feat: init repo
deploy / deploy (push) Canceled after 0s

This commit is contained in:
2026-11-10 19:56:03 +01:00
commit 858d862fed
166 changed files with 13336 additions and 0 deletions
+107
View File
@@ -0,0 +1,107 @@
# @cohaise/web
Vitrine institutionnelle de `cohaise.dev`. Première application du monorepo CoHaiSe et premier consommateur réel du design system partagé.
## Rôle
| Responsabilité | Localisation |
| -------------------------------------------- | ----------------- |
| Design system, jetons, composants | `frontend/shared` |
| vitrine institutionnelle | `frontend/web` |
| Point d'entrée local, publication des builds | `docker/nginx` |
```mermaid
flowchart LR
subgraph navigateur
app["frontend/web<br/>React + Vite"]
end
subgraph monorepo
ui["frontend/shared<br/>@cohaise/ui"]
end
subgraph infrastructure
web["nginx<br/>cohaise.dev"]
end
app -->|import| ui
app -->|build statique| web
```
## Prérequis
- Node.js `>=22.23.1`
- npm `>=10`
## Commandes
| Commande | Effet |
| ----------------------------------- | ----------------------------------------------------------- |
| `npm run dev -w @cohaise/web` | serveur Vite sur `http://localhost:5173` |
| `npm run build -w @cohaise/web` | vérification de types puis build de production dans `dist/` |
| `npm run preview -w @cohaise/web` | sert le build de production localement |
| `npm run typecheck -w @cohaise/web` | vérification de types seule |
| `make web` | construit l'image et republie le build dans le volume Nginx |
## Publication dans l'infrastructure
Le `Dockerfile` est un build multi-étapes. Le contexte de construction est la racine du
monorepo, car le build a besoin des workspaces, du lockfile et des références
TypeScript partagées.
```text
node:22-alpine deps installation déterministe via npm ci
node:22-alpine builder tsc --build puis vite build
alpine:3.21 export /app/dist, copié dans le volume web_data
```
Le service `cohaise-web-build` copie le résultat dans le volume `web_data`, que Nginx
monte déjà sur `/usr/share/nginx/html/web`. Aucune modification de la configuration
Nginx n'est nécessaire, et la publication reste découplée des autres applications.
## Consommation du design system
L'application importe la feuille de style publique du package partagé une seule fois, dans `src/styles/index.css` :
```css
@import "tailwindcss";
@import "@cohaise/ui/styles";
@source "../../../../frontend/shared/src";
```
La directive `@source` est indispensable. Sans elle, Tailwind ignore `node_modules` et les classes utilisées par les composants de `frontend/shared` ne sont jamais générées : les composants s'afficheraient sans style.
## Thème
Le thème est appliqué par la classe `dark` sur `<html>`. Le script inline de `index.html` applique la préférence enregistrée ou celle du système avant le premier rendu, ce qui évite le flash de thème clair. `src/hooks/useTheme.ts` pilote le changement et persiste le choix dans `localStorage` sous la clé `cohaise-theme`.
## Structure
```text
frontend/web
├── index.html amorce de thème et point de montage
├── public/favicon.webp
├── src
│ ├── App.tsx composition de la page
│ ├── main.tsx point d'entrée React
│ ├── components
│ │ ├── DemoCard.tsx états repos, chargement, chargé
│ │ └── ThemeToggle.tsx
│ ├── hooks
│ │ └── useTheme.ts
│ └── styles/index.css import du design system
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
```
## Limites actuelles
- Aucun appel réseau : toutes les données de démonstration sont locales.
- Aucun routage : la page est un point d'entrée unique.
- Les URL d'API devront passer par un wrapper dédié, jamais codées en dur dans les composants.
## Variables d'environnement
L'application ne déclare aucune variable pour l'instant. Le gabarit `frontend/web/.env.example`
prendra une entrée `VITE_API_BASE_URL` au moment où le premier appel réseau existera, afin
que l'URL reste définie à un seul endroit. Seules les variables préfixées par `VITE_` sont
exposées au bundle ; aucun secret ne doit jamais être lu par le navigateur.
+30
View File
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<meta
name="description"
content="CoHaiSe conçoit des sites vitrines, applications mobiles et logiciels sur mesure : modernes, rapides et agréables à utiliser."
/>
<link rel="icon" type="image/svg+xml" href="/favicon.webp" />
<title>
CoHaiSe — Développement web, applications et design sur mesure
</title>
<script>
(() => {
const stored = localStorage.getItem("cohaise-theme");
const prefersDark = window.matchMedia(
"(prefers-color-scheme: dark)",
).matches;
const theme = stored ?? (prefersDark ? "dark" : "light");
if (theme === "dark") document.documentElement.classList.add("dark");
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+30
View File
@@ -0,0 +1,30 @@
{
"name": "@cohaise/web",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@cohaise/ui": "*",
"gsap": "^3.15.1",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-icons": "^5.7.0",
"three": "^0.187.0"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@types/three": "^0.187.0",
"@vitejs/plugin-react": "^6.1.1",
"tailwindcss": "^4.3.3",
"typescript": "^7.0.2",
"vite": "^8.3.1"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

+50
View File
@@ -0,0 +1,50 @@
import { lazy, Suspense } from "react";
import { LanguageProvider } from "./lib/i18n.js";
import { useScrollReveal } from "./hooks/useScrollReveal.js";
import { Header } from "./components/Header.js";
import { Hero } from "./components/Hero.js";
import { Services } from "./components/Services.js";
import { Demos } from "./components/Demos.js";
import { Stack } from "./components/Stack.js";
import { About } from "./components/About.js";
import { Contact } from "./components/Contact.js";
import { Footer } from "./components/Footer.js";
import { BackToTop } from "./components/BackToTop.js";
import { services } from "./data/services.js";
import { demos } from "./data/demos.js";
import { stack } from "./data/stack.js";
// Le fond WebGL (topographie) est lourd : chargé à la demande. Il vit en
// `position: fixed` (z-0) : le défilement n'a aucune incidence sur lui, seul
// le contenu (z-10) défile au-dessus.
const Topography = lazy(() => import("./components/background/Topography.js"));
export const App = () => {
useScrollReveal();
return (
<LanguageProvider>
<div id="top" className="relative flex min-h-screen flex-col bg-background text-foreground">
<div className="pointer-events-none fixed inset-0 z-0" aria-hidden="true">
<Suspense fallback={null}>
<Topography color="#ff5252" opacity={0.5} speed={0.22} clickEffect="none" />
</Suspense>
</div>
<div className="relative z-10 flex flex-1 flex-col">
<Header />
<main className="flex flex-1 flex-col">
<Hero />
<Services services={services} />
<Demos demos={demos} />
<Stack items={stack} />
<About />
<Contact />
</main>
<Footer />
<BackToTop />
</div>
</div>
</LanguageProvider>
);
};
+18
View File
@@ -0,0 +1,18 @@
import { useLanguage } from "../lib/i18n.js";
import { Section, SectionHeading } from "./Section.js";
export const About = () => {
const { t } = useLanguage();
return (
<Section id="about">
<SectionHeading title={t("about.title")} />
<p
data-reveal
className="max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg"
>
{t("about.body")}
</p>
</Section>
);
};
+41
View File
@@ -0,0 +1,41 @@
import { useEffect, useState } from "react";
import { cn } from "@cohaise/ui";
import { scrollToSection } from "../lib/gsap.js";
export const BackToTop = () => {
const [visible, setVisible] = useState(false);
useEffect(() => {
const onScroll = () => setVisible(window.scrollY > 400);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
return (
<button
type="button"
onClick={() => scrollToSection("#top")}
aria-label="Retour en haut"
title="Retour en haut"
className={cn(
"glass fixed bottom-6 right-6 z-50 flex size-11 items-center justify-center rounded-full border border-border/60 text-foreground shadow-md transition-all duration-base hover:border-border-strong",
visible ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-3 opacity-0",
)}
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M12 19V5M5 12l7-7 7 7" />
</svg>
</button>
);
};
+123
View File
@@ -0,0 +1,123 @@
import { useState, type FormEvent } from "react";
import { Input } from "@cohaise/ui";
import { useLanguage } from "../lib/i18n.js";
import { LEADS_ENDPOINT } from "../lib/api.js";
import { Section, SectionHeading } from "./Section.js";
type Status = "idle" | "sending" | "success" | "error";
const text = (value: FormDataEntryValue | null): string => String(value ?? "").trim();
export const Contact = () => {
const { t } = useLanguage();
const [status, setStatus] = useState<Status>("idle");
const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
const form = event.currentTarget;
const data = new FormData(form);
const payload = {
firstName: text(data.get("firstName")),
lastName: text(data.get("lastName")),
email: text(data.get("email")),
organization: text(data.get("organization")) || null,
phone: text(data.get("phone")) || null,
message: text(data.get("message")),
website: text(data.get("website")),
};
if (!payload.firstName || !payload.lastName || !payload.email) {
setStatus("error");
return;
}
setStatus("sending");
try {
const response = await fetch(LEADS_ENDPOINT, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
if (!response.ok) throw new Error("request failed");
setStatus("success");
form.reset();
} catch {
setStatus("error");
}
};
return (
<Section id="contact">
<SectionHeading title={t("contact.title")} subtitle={t("contact.subtitle")} />
<form
onSubmit={(event) => void handleSubmit(event)}
className="glass max-w-2xl rounded-lg border border-border/60 p-6 sm:p-8"
data-reveal
noValidate
>
<input
type="text"
name="website"
tabIndex={-1}
autoComplete="off"
aria-hidden="true"
className="absolute -left-[9999px] h-px w-px opacity-0"
/>
<div className="grid gap-4 sm:grid-cols-2">
<Input name="firstName" label={t("contact.firstName")} required autoComplete="given-name" />
<Input name="lastName" label={t("contact.lastName")} required autoComplete="family-name" />
</div>
<div className="mt-4 grid gap-4 sm:grid-cols-2">
<Input name="organization" label={t("contact.company")} autoComplete="organization" />
<Input name="phone" label={t("contact.phone")} type="tel" autoComplete="tel" />
</div>
<div className="mt-4">
<Input name="email" label={t("contact.email")} type="email" required autoComplete="email" />
</div>
<div className="mt-4 flex flex-col gap-1.5">
<label
htmlFor="message"
className="font-display text-[0.6875rem] font-semibold uppercase tracking-label text-foreground"
>
{t("contact.message")}
</label>
<textarea
id="message"
name="message"
rows={5}
required
className="w-full rounded-sm border border-border-control bg-surface px-3 py-2.5 text-sm text-foreground placeholder:text-subtle-foreground transition-[border-color,box-shadow] duration-fast focus-visible:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
/>
</div>
<div className="mt-6 flex flex-wrap items-center gap-4">
<button
type="submit"
disabled={status === "sending"}
className="inline-flex h-12 items-center gap-2.5 rounded-lg bg-primary px-6 font-display text-sm font-semibold uppercase tracking-label text-primary-foreground transition-colors hover:bg-primary-hover disabled:pointer-events-none disabled:opacity-50"
>
{status === "sending" ? t("contact.sending") : t("contact.submit")}
</button>
{status === "success" ? (
<p className="text-sm text-success" role="status">
{t("contact.success")}
</p>
) : null}
{status === "error" ? (
<p className="text-sm text-destructive" role="alert">
{t("contact.error")}
</p>
) : null}
</div>
</form>
</Section>
);
};
+110
View File
@@ -0,0 +1,110 @@
import { cn } from "@cohaise/ui";
import type { DemoVariant } from "../data/demos.js";
const Bar = ({ className }: { className?: string }) => (
<span className={cn("block rounded-full bg-surface-hover", className)} aria-hidden="true" />
);
const Dot = ({ className }: { className?: string }) => (
<span className={cn("block rounded-full bg-surface-hover", className)} aria-hidden="true" />
);
/** Mini-interface neutre, dessinée en CSS : aucune capture, aucun logo, aucune marque. */
export const DemoMockup = ({ variant }: { variant: DemoVariant }) => (
<div className="relative aspect-[16/9] w-full overflow-hidden border-b border-border/60 bg-surface-sunken p-3 sm:p-4">
<div className="flex h-full flex-col">
<div className="mb-3 flex items-center gap-1.5" aria-hidden="true">
<Dot className="size-2 bg-border-control" />
<Dot className="size-2 bg-border-control" />
<Dot className="size-2 bg-accent-graphic" />
<span className="ml-auto h-2 w-24 rounded-full bg-surface-hover" />
</div>
{variant === "crm" ? <CrmMock /> : variant === "inventory" ? <InventoryMock /> : <LeaderboardMock />}
</div>
</div>
);
const CrmMock = () => (
<div className="flex min-h-0 flex-1 gap-3">
<div className="flex w-14 shrink-0 flex-col gap-2 rounded-md border border-border/50 bg-surface/50 p-2" aria-hidden="true">
<span className="h-1.5 w-6 rounded-full bg-accent-graphic" />
<Bar className="h-1.5 w-9" />
<Bar className="h-1.5 w-9" />
<Bar className="h-1.5 w-7" />
<div className="mt-auto" />
<Bar className="h-1.5 w-6" />
</div>
<div className="flex min-w-0 flex-1 flex-col gap-3">
<div className="grid shrink-0 grid-cols-3 gap-2" aria-hidden="true">
{[0, 1, 2].map((index) => (
<div key={index} className="flex flex-col gap-1.5 rounded-md border border-border/50 bg-surface/50 p-2">
<Bar className="h-1.5 w-8" />
<span className="h-3 w-7 rounded-sm bg-accent-graphic/70" />
</div>
))}
</div>
<div className="flex min-h-0 flex-1 flex-col gap-2.5 rounded-md border border-border/50 bg-surface/50 p-2.5" aria-hidden="true">
{[0, 1, 2, 3].map((index) => (
<div key={index} className="flex items-center gap-2">
<Dot className="size-3.5 shrink-0" />
<Bar className="h-2 w-1/2" />
<Bar className={cn("ml-auto h-1.5 w-9 rounded-full", index % 2 === 0 ? "bg-accent-graphic/50" : "bg-surface-hover")} />
</div>
))}
</div>
</div>
</div>
);
const InventoryMock = () => (
<div className="flex min-h-0 flex-1 flex-col gap-3">
<div className="flex shrink-0 items-center gap-2" aria-hidden="true">
<span className="h-5 w-28 rounded-sm border border-border/50 bg-surface/50" />
<span className="ml-auto h-5 w-16 rounded-sm bg-accent-graphic/70" />
</div>
<div className="flex min-h-0 flex-1 gap-3">
<div className="flex min-w-0 flex-1 flex-col gap-2.5 rounded-md border border-border/50 bg-surface/50 p-2.5" aria-hidden="true">
{[0, 1, 2, 3, 4].map((index) => (
<div key={index} className="flex items-center gap-2">
<span className="size-3.5 shrink-0 rounded-sm bg-surface-hover" />
<Bar className="h-2 w-2/5" />
<Bar className="ml-auto h-2 w-14" />
<Bar className="h-1.5 w-8 rounded-full bg-accent-graphic/50" />
</div>
))}
</div>
<div className="flex w-16 shrink-0 flex-col justify-end gap-1.5 rounded-md border border-border/50 bg-surface/50 p-2" aria-hidden="true">
{["h-1/3", "h-2/3", "h-1/2", "h-4/5"].map((height, index) => (
<span key={index} className={cn("w-full rounded-sm", height, index === 3 ? "bg-accent-graphic/70" : "bg-surface-hover")} />
))}
</div>
</div>
</div>
);
const LeaderboardMock = () => (
<div className="flex min-h-0 flex-1 gap-3">
<div className="flex w-2/5 shrink-0 flex-col justify-end gap-2" aria-hidden="true">
{[
{ label: "h-1/2", accent: true },
{ label: "h-4/5", accent: false },
{ label: "h-2/3", accent: false },
].map((item, index) => (
<div key={index} className="flex items-end justify-center gap-1">
<span className={cn("w-full rounded-md", item.label, item.accent ? "bg-accent-graphic" : "bg-surface-hover")} />
</div>
))}
</div>
<div className="flex min-w-0 flex-1 flex-col gap-2.5 rounded-md border border-border/50 bg-surface/50 p-2.5" aria-hidden="true">
{[0, 1, 2, 3].map((index) => (
<div key={index} className="flex items-center gap-2">
<Dot className="size-3.5 shrink-0 rounded-full bg-accent-graphic/70" />
<Bar className="h-2 w-1/3" />
<div className="ml-auto h-1.5 w-24 overflow-hidden rounded-full bg-surface-hover">
<span className={cn("block h-full rounded-full bg-accent-graphic/60", index === 0 ? "w-4/5" : index === 1 ? "w-3/5" : index === 2 ? "w-2/5" : "w-1/4")} />
</div>
</div>
))}
</div>
</div>
);
+59
View File
@@ -0,0 +1,59 @@
import { useLanguage } from "../lib/i18n.js";
import type { Demo } from "../data/demos.js";
import { DemoMockup } from "./DemoMockup.js";
import { Section, SectionHeading } from "./Section.js";
export const Demos = ({ demos }: { demos: Demo[] }) => {
const { t, pick } = useLanguage();
return (
<Section id="demos">
<SectionHeading title={t("demos.title")} subtitle={t("demos.subtitle")} />
<div className="grid gap-6 md:grid-cols-3">
{demos.map((demo, index) => (
<article
key={demo.slug}
data-reveal
data-reveal-delay={String(index * 0.08)}
className="glass flex flex-col overflow-hidden rounded-lg border border-border/60 shadow-sm"
>
<DemoMockup variant={demo.mockup} />
<div className="flex flex-1 flex-col gap-3 p-5">
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
{pick(demo.category)}
</span>
<h3 className="font-display text-lg font-bold uppercase tracking-display">
{demo.title}
</h3>
<p className="text-sm leading-relaxed text-muted-foreground">
{pick(demo.description)}
</p>
<ul className="flex flex-wrap gap-2">
{demo.tech.map((name) => (
<li
key={name}
className="rounded-full border border-border/60 px-2.5 py-1 text-[0.625rem] uppercase tracking-label text-subtle-foreground"
>
{name}
</li>
))}
</ul>
<a
href={demo.href}
target="_blank"
rel="noreferrer noopener"
className="mt-auto inline-flex items-center gap-1.5 pt-1 font-display text-xs font-semibold uppercase tracking-label text-foreground transition-colors hover:text-accent"
>
{t("demos.source")} <span aria-hidden="true">↗</span>
</a>
</div>
</article>
))}
</div>
</Section>
);
};
+45
View File
@@ -0,0 +1,45 @@
import { useLanguage } from "../lib/i18n.js";
const year = new Date().getFullYear();
export const Footer = () => {
const { t } = useLanguage();
return (
<footer className="border-t border-border/60">
<div className="mx-auto flex w-full max-w-6xl flex-col gap-6 px-4 py-10 sm:flex-row sm:items-center sm:justify-between sm:px-6">
<div className="flex flex-col gap-1">
<span className="font-logo text-sm font-bold tracking-logo text-foreground">
{t("brand.name")}
</span>
<span className="text-xs text-subtle-foreground">
{t("footer.built")}
</span>
</div>
<nav className="flex flex-wrap gap-x-6 gap-y-2" aria-label="Liens">
<a
href="https://git.cohaise.dev/Esiah"
target="_blank"
rel="noreferrer noopener"
className="text-xs uppercase tracking-label text-muted-foreground transition-colors hover:text-foreground"
>
Gitea (self-hosted)
</a>
<a
href="https://github.com/xEsiah"
target="_blank"
rel="noreferrer noopener"
className="text-xs uppercase tracking-label text-muted-foreground transition-colors hover:text-foreground"
>
GitHub
</a>
</nav>
<span className="text-xs text-subtle-foreground">
© {year} {t("brand.name")} — {t("footer.rights")}
</span>
</div>
</footer>
);
};
+101
View File
@@ -0,0 +1,101 @@
import { useEffect, useState } from "react";
import { cn } from "@cohaise/ui";
import { useLanguage } from "../lib/i18n.js";
import { useTheme } from "../hooks/useTheme.js";
import { scrollToSection } from "../lib/gsap.js";
const links = [
{ href: "#services", key: "nav.services" },
{ href: "#demos", key: "nav.demos" },
{ href: "#stack", key: "nav.stack" },
{ href: "#about", key: "nav.about" },
{ href: "#contact", key: "nav.contact" },
] as const;
export const Header = () => {
const { t, lang, setLang } = useLanguage();
const { theme, toggleTheme } = useTheme();
const [active, setActive] = useState<string>("");
useEffect(() => {
const sections = links
.map((link) => document.getElementById(link.href.slice(1)))
.filter((element): element is HTMLElement => element !== null);
const observer = new IntersectionObserver(
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting) setActive(entry.target.id);
}
},
{ rootMargin: "-45% 0px -50% 0px" },
);
sections.forEach((section) => observer.observe(section));
return () => observer.disconnect();
}, []);
return (
<header className="sticky top-0 z-40 border-b border-border/60 bg-background/70 backdrop-blur-xl">
<div className="mx-auto flex h-16 max-w-6xl items-center gap-4 px-4 sm:px-6">
<a
href="#top"
onClick={(event) => {
event.preventDefault();
scrollToSection("#top");
}}
className="flex items-center gap-2.5"
>
<img src="/images/cohaise.webp" alt="" className="size-7 object-contain" aria-hidden="true" />
<span className="font-logo text-sm font-bold tracking-logo text-foreground">
{t("brand.name")}
</span>
</a>
<nav className="ml-auto hidden items-center gap-1 md:flex" aria-label="Navigation">
{links.map((link) => {
const id = link.href.slice(1);
return (
<a
key={link.href}
href={link.href}
onClick={(event) => {
event.preventDefault();
scrollToSection(link.href);
}}
aria-current={active === id ? "true" : undefined}
className={cn(
"rounded-md px-3 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label transition-colors",
active === id
? "bg-surface-hover text-foreground"
: "text-muted-foreground hover:bg-surface-hover hover:text-foreground",
)}
>
{t(link.key)}
</a>
);
})}
</nav>
<div className="flex items-center gap-2 md:ml-6">
<button
type="button"
onClick={() => setLang(lang === "fr" ? "en" : "fr")}
className="rounded-md border border-border px-2.5 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label text-muted-foreground transition-colors hover:border-border-strong hover:text-foreground"
aria-label={lang === "fr" ? "Switch to English" : "Passer en français"}
>
{lang === "fr" ? "EN" : "FR"}
</button>
<button
type="button"
onClick={toggleTheme}
className="rounded-md border border-border px-2.5 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label text-muted-foreground transition-colors hover:border-border-strong hover:text-foreground"
aria-label={t(theme === "dark" ? "theme.light" : "theme.dark")}
>
{t(theme === "dark" ? "theme.light" : "theme.dark")}
</button>
</div>
</div>
</header>
);
};
+61
View File
@@ -0,0 +1,61 @@
import { useLanguage } from "../lib/i18n.js";
import { scrollToSection } from "../lib/gsap.js";
export const Hero = () => {
const { t } = useLanguage();
return (
<section className="mx-auto flex w-full max-w-6xl flex-col items-start gap-6 px-4 pb-28 pt-24 sm:px-6 sm:pt-32">
<h1
data-reveal
data-reveal-delay="0.08"
className="font-display text-5xl font-black uppercase leading-none tracking-display sm:text-7xl md:text-8xl"
>
{t("brand.name")}
</h1>
<p
data-reveal
data-reveal-delay="0.16"
className="max-w-2xl text-xl font-medium leading-relaxed text-foreground sm:text-2xl"
>
{t("hero.tagline")}
</p>
<p
data-reveal
data-reveal-delay="0.24"
className="max-w-xl text-base leading-relaxed text-muted-foreground"
>
{t("hero.subtitle")}
</p>
<div
data-reveal
data-reveal-delay="0.32"
className="mt-6 flex flex-wrap gap-3"
>
<a
href="#services"
onClick={(event) => {
event.preventDefault();
scrollToSection("#services");
}}
className="inline-flex h-12 items-center gap-2.5 rounded-lg bg-primary px-6 font-display text-sm font-semibold uppercase tracking-label text-primary-foreground transition-colors hover:bg-primary-hover"
>
{t("hero.primary")}
</a>
<a
href="#contact"
onClick={(event) => {
event.preventDefault();
scrollToSection("#contact");
}}
className="inline-flex h-12 items-center gap-2.5 rounded-lg border border-border-strong bg-surface px-6 font-display text-sm font-semibold uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
>
{t("hero.secondary")}
</a>
</div>
</section>
);
};
+29
View File
@@ -0,0 +1,29 @@
import type { ReactNode } from "react";
export const Section = ({ id, children }: { id: string; children: ReactNode }) => (
<section id={id} className="mx-auto w-full max-w-6xl scroll-mt-24 px-4 py-24 sm:px-6">
{children}
</section>
);
export const SectionHeading = ({
eyebrow,
title,
subtitle,
}: {
eyebrow?: string;
title: string;
subtitle?: string;
}) => (
<div className="mb-12 flex flex-col gap-3" data-reveal>
{eyebrow ? (
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
{eyebrow}
</span>
) : null}
<h2 className="font-display text-3xl font-bold uppercase tracking-display sm:text-4xl">{title}</h2>
{subtitle ? (
<p className="max-w-2xl text-sm leading-relaxed text-muted-foreground sm:text-base">{subtitle}</p>
) : null}
</div>
);
+79
View File
@@ -0,0 +1,79 @@
import { useState } from "react";
import { cn } from "@cohaise/ui";
import { useLanguage } from "../lib/i18n.js";
import type { Service } from "../data/services.js";
import { Section, SectionHeading } from "./Section.js";
export const Services = ({ services }: { services: Service[] }) => {
const { t, pick } = useLanguage();
const [open, setOpen] = useState<string | null>(services[0]?.slug ?? null);
return (
<Section id="services">
<SectionHeading title={t("services.title")} subtitle={t("services.subtitle")} />
<div className="flex flex-col" data-reveal>
{services.map((service) => {
const isOpen = open === service.slug;
return (
<article key={service.slug} className="border-b border-border/60 first:border-t">
<button
type="button"
onClick={() => setOpen(isOpen ? null : service.slug)}
aria-expanded={isOpen}
className="group flex w-full items-center gap-4 py-6 text-left sm:gap-8 sm:py-8"
>
<span className="font-display text-2xl font-bold uppercase tracking-display text-foreground transition-colors group-hover:text-accent sm:text-3xl md:text-4xl">
{pick(service.title)}
</span>
<span
className={cn(
"ml-auto font-display text-3xl font-light text-accent-graphic transition-transform duration-base",
isOpen ? "rotate-45" : "rotate-0",
)}
aria-hidden="true"
>
+
</span>
</button>
<div
className={cn(
"grid transition-[grid-template-rows] duration-slow ease-in-out-soft",
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
)}
>
<div className="overflow-hidden">
<div className="flex flex-col gap-6 pb-8 md:flex-row md:items-start md:gap-10">
<img
src={service.image}
alt=""
loading="lazy"
decoding="async"
className="aspect-[3/2] w-full rounded-lg border border-border/60 object-cover md:w-64"
/>
<div className="flex flex-col gap-4">
<p className="max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg">
{pick(service.description)}
</p>
<ul className="flex flex-wrap gap-2.5">
{service.tags.map((tag) => (
<li
key={pick(tag)}
className="rounded-full border border-border/60 px-4 py-1.5 text-[0.6875rem] uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
>
{pick(tag)}
</li>
))}
</ul>
</div>
</div>
</div>
</div>
</article>
);
})}
</div>
</Section>
);
};
+65
View File
@@ -0,0 +1,65 @@
import { useEffect, useRef } from "react";
import { gsap, prefersReducedMotion } from "../lib/gsap.js";
import { useLanguage } from "../lib/i18n.js";
import type { StackItem } from "../data/stack.js";
import { Section, SectionHeading } from "./Section.js";
export const Stack = ({ items }: { items: StackItem[] }) => {
const { t } = useLanguage();
const trackRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const track = trackRef.current;
if (!track || prefersReducedMotion()) return;
// Deux copies rendues dans le JSX : -50 % = exactement une copie, boucle sans couture.
const tween = gsap.to(track, {
xPercent: -50,
duration: 36,
ease: "none",
repeat: -1,
});
const slow = () => gsap.to(tween, { timeScale: 0.25, duration: 0.6, overwrite: true });
const resume = () => gsap.to(tween, { timeScale: 1, duration: 0.6, overwrite: true });
track.addEventListener("mouseenter", slow);
track.addEventListener("mouseleave", resume);
return () => {
track.removeEventListener("mouseenter", slow);
track.removeEventListener("mouseleave", resume);
tween.kill();
};
}, []);
const doubled = [...items, ...items];
return (
<Section id="stack">
<SectionHeading title={t("stack.title")} subtitle={t("stack.subtitle")} />
<div className="overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]">
<div ref={trackRef} className="flex w-max items-center gap-12">
{doubled.map((item, index) => {
const Icon = item.Icon;
return (
<span
key={`${item.name}-${index}`}
className="group/item flex shrink-0 items-center gap-3 whitespace-nowrap"
>
<Icon
className="size-7 text-subtle-foreground transition-transform duration-300 ease-out group-hover/item:scale-125"
aria-hidden="true"
/>
<span className="font-display text-lg uppercase tracking-label text-subtle-foreground">
{item.name}
</span>
</span>
);
})}
</div>
</div>
</Section>
);
};
File diff suppressed because it is too large Load Diff
+52
View File
@@ -0,0 +1,52 @@
import type { Localized } from "../lib/i18n.js";
export type DemoVariant = "crm" | "inventory" | "leaderboard";
export interface Demo {
slug: string;
title: string;
category: Localized;
description: Localized;
tech: string[];
mockup: DemoVariant;
href: string;
}
export const demos: Demo[] = [
{
slug: "crm",
title: "CRM",
category: { fr: "Candidatures", en: "Applications" },
description: {
fr: "Suivi des prospects, organisations et pipelines de candidatures, avec workflows d'e-mails automatisés. Des connexions externes (WordPress, L'Express Éducation, d'autres sites) peuvent être mises en place.",
en: "Track prospects, organizations and application pipelines, with automated email workflows. External connections (WordPress, L'Express Éducation, other sites) can be set up as needed.",
},
tech: ["Next.js", "Express", "MariaDB", "Docker"],
mockup: "crm",
href: "https://github.com/Ensemble-Scolaire-Jean-XXIII/jeanxxiii-crm",
},
{
slug: "inventory",
title: "Inventaire IT",
category: { fr: "Inventaire", en: "Inventory" },
description: {
fr: "Inventaire du parc informatique : équipements par gabarit, champs personnalisés, validation MAC/IP et graphiques.",
en: "IT asset inventory: equipment by template, custom fields, MAC/IP validation and charts.",
},
tech: ["Next.js", "Express", "MariaDB", "Docker"],
mockup: "inventory",
href: "https://github.com/Ensemble-Scolaire-Jean-XXIII/Inventory-IT",
},
{
slug: "vie-de-classe",
title: "Vie de classe",
category: { fr: "Gamification scolaire", en: "Classroom gamification" },
description: {
fr: "Points, niveaux et médailles : un classement qui motive les classes et accompagne l'intégration des élèves.",
en: "Points, levels and medals: a leaderboard that motivates classes and supports student onboarding.",
},
tech: ["Next.js", "Express", "MariaDB", "Docker"],
mockup: "leaderboard",
href: "https://github.com/Ensemble-Scolaire-Jean-XXIII/DEFI-Vie-de-classe",
},
];
+69
View File
@@ -0,0 +1,69 @@
import type { Localized } from "../lib/i18n.js";
export interface Service {
slug: string;
title: Localized;
description: Localized;
tags: Localized[];
image: string;
}
export const services: Service[] = [
{
slug: "web",
title: { fr: "Développement web", en: "Web development" },
description: {
fr: "Des sites propres, rapides et responsives avec React et Next.js. Je vise la vitesse, la visibilité et la conversion de vos visiteurs en clients.",
en: "Clean, fast, responsive sites with React and Next.js. I focus on speed, visibility and turning your visitors into clients.",
},
tags: [
{ fr: "Sites vitrines", en: "Showcase sites" },
{ fr: "SEO & performance", en: "SEO & performance" },
{ fr: "Intégration CMS", en: "CMS integration" },
],
image: "/images/webDevelopment.webp",
},
{
slug: "mobile",
title: { fr: "Applications mobiles", en: "Mobile apps" },
description: {
fr: "Vos idées en vraies applications. React Native pour des expériences fluides, parfaites sur tous les téléphones.",
en: "Your ideas as real apps. React Native for smooth experiences that work perfectly on every phone.",
},
tags: [
{ fr: "Cross-platform", en: "Cross-platform" },
{ fr: "Publication sur les stores", en: "App store submission" },
{ fr: "Interfaces soignées", en: "Polished interfaces" },
],
image: "/images/mobileApps.webp",
},
{
slug: "design",
title: { fr: "UI/UX Design", en: "UI/UX Design" },
description: {
fr: "Des designs simples et efficaces. Des interfaces belles, qui aident vos utilisateurs à trouver ce qu'ils cherchent sans effort.",
en: "Simple, effective design. Interfaces that look great and help users find what they need, effortlessly.",
},
tags: [
{ fr: "Wireframes & prototypes", en: "Wireframing & prototyping" },
{ fr: "Mobile-first", en: "Mobile-first" },
{ fr: "Identité visuelle", en: "Visual identity" },
],
image: "/images/uxUI.webp",
},
{
slug: "custom",
title: { fr: "Logiciels sur mesure", en: "Custom software" },
description: {
fr: "Un besoin précis ? Je construis des outils et tableaux de bord sur mesure pour automatiser vos tâches et gagner du temps.",
en: "Something specific in mind? I build custom tools and dashboards to automate your daily tasks and save you time.",
},
tags: [
{ fr: "Outils web", en: "Web tools" },
{ fr: "Applications desktop", en: "Desktop apps" },
{ fr: "Tableaux de bord", en: "Dashboards" },
{ fr: "Connexions API", en: "API connections" },
],
image: "/images/customSoftware.webp",
},
];
+43
View File
@@ -0,0 +1,43 @@
import type { IconType } from "react-icons";
import {
SiReact,
SiNextdotjs,
SiTypescript,
SiNodedotjs,
SiExpress,
SiMariadb,
SiPostgresql,
SiDocker,
SiTailwindcss,
SiFigma,
SiGit,
SiLinux,
SiCloudflare,
SiVercel,
SiElectron,
SiDotnet,
} from "react-icons/si";
export interface StackItem {
name: string;
Icon: IconType;
}
export const stack: StackItem[] = [
{ name: "React", Icon: SiReact },
{ name: "Next.js", Icon: SiNextdotjs },
{ name: "TypeScript", Icon: SiTypescript },
{ name: "Node.js", Icon: SiNodedotjs },
{ name: "Express", Icon: SiExpress },
{ name: "MariaDB", Icon: SiMariadb },
{ name: "PostgreSQL", Icon: SiPostgresql },
{ name: "Docker", Icon: SiDocker },
{ name: "Tailwind CSS", Icon: SiTailwindcss },
{ name: "Figma", Icon: SiFigma },
{ name: "Git", Icon: SiGit },
{ name: "Linux", Icon: SiLinux },
{ name: "Cloudflare", Icon: SiCloudflare },
{ name: "Vercel", Icon: SiVercel },
{ name: "Electron", Icon: SiElectron },
{ name: ".NET", Icon: SiDotnet },
];
+30
View File
@@ -0,0 +1,30 @@
import { useLayoutEffect } from "react";
import { gsap, prefersReducedMotion } from "../lib/gsap.js";
/**
* Anime à l'entrée tout élément portant `data-reveal` (fade-up au scroll).
* Un `data-reveal-delay` optionnel (secondes) retarde l'élément pour créer
* un décalage entre des éléments voisins.
*/
export const useScrollReveal = (): void => {
useLayoutEffect(() => {
if (prefersReducedMotion()) return;
const context = gsap.context(() => {
const elements = gsap.utils.toArray<HTMLElement>("[data-reveal]");
elements.forEach((element) => {
const delay = Number.parseFloat(element.dataset.revealDelay ?? "0") || 0;
gsap.from(element, {
y: 32,
opacity: 0,
duration: 0.9,
delay,
ease: "power3.out",
scrollTrigger: { trigger: element, start: "top 88%" },
});
});
});
return () => context.revert();
}, []);
};
+23
View File
@@ -0,0 +1,23 @@
import { useCallback, useEffect, useState } from "react";
export type Theme = "light" | "dark";
const storageKey = "cohaise-theme";
const readInitialTheme = (): Theme =>
document.documentElement.classList.contains("dark") ? "dark" : "light";
export const useTheme = () => {
const [theme, setTheme] = useState<Theme>(readInitialTheme);
useEffect(() => {
document.documentElement.classList.toggle("dark", theme === "dark");
localStorage.setItem(storageKey, theme);
}, [theme]);
const toggleTheme = useCallback(() => {
setTheme((current) => (current === "dark" ? "light" : "dark"));
}, []);
return { theme, toggleTheme };
};
+12
View File
@@ -0,0 +1,12 @@
/** Point d'entrée de l'API CRM. Surchargeable via VITE_CRM_API_URL au build. */
const host = typeof window !== "undefined" ? window.location.hostname : "";
const isLocal = host === "localhost" || host === "127.0.0.1" || host === "0.0.0.0";
const base =
(import.meta.env.VITE_CRM_API_URL as string | undefined) ??
(isLocal ? "http://localhost:8082" : "https://crm.cohaise.dev");
const trimmed = base.replace(/\/+$/, "");
/** Endpoint public qui crée un prospect depuis le formulaire de contact. */
export const LEADS_ENDPOINT = `${trimmed}/api/crm/leads`;
+28
View File
@@ -0,0 +1,28 @@
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
export { gsap, ScrollTrigger };
export const prefersReducedMotion = (): boolean =>
typeof window !== "undefined" &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
/** Défilement fluide vers une section, sans toucher à l'URL. */
export const scrollToSection = (hash: string): void => {
const target = document.querySelector<HTMLElement>(hash);
if (!target) return;
if (prefersReducedMotion()) {
target.scrollIntoView({ behavior: "auto" });
return;
}
gsap.to(window, {
duration: 1,
scrollTo: { y: target, offsetY: 96 },
ease: "power3.inOut",
});
};
+155
View File
@@ -0,0 +1,155 @@
import {
createContext,
useCallback,
useContext,
useEffect,
useMemo,
useState,
type ReactNode,
} from "react";
export type Lang = "fr" | "en";
/** Champ traduit : la vitrine est bilingue, chaque libellé porte ses deux versions. */
export interface Localized {
fr: string;
en: string;
}
const fr = {
"brand.name": "COHAISE",
"nav.services": "Services",
"nav.demos": "Démos",
"nav.stack": "Stack",
"nav.about": "À propos",
"nav.contact": "Contact",
"hero.tagline":
"Votre projet commence par une idée. Il prend vie avec CoHaiSe.",
"hero.subtitle":
"Développement web, applications mobiles et design UI/UX. Des outils modernes, rapides et pensés pour durer.",
"hero.primary": "Découvrir les services",
"hero.secondary": "Me contacter",
"services.title": "Services",
"services.subtitle": "Quatre façons de donner vie à votre idée.",
"demos.title": "Démos",
"demos.subtitle": "Des versions adaptées de réalisations concrètes.",
"demos.source": "Voir le code",
"stack.title": "Stack",
"stack.subtitle": "Les technologies qui font tourner mes projets.",
"about.title": "À propos",
"about.body":
"CoHaiSe développe des outils sur mesure : sites vitrines, applications mobiles et logiciels internes. Je conçois chaque projet pour qu'il soit rapide, maintenable et agréable à utiliser — de la première idée jusqu'à la mise en ligne, et après.",
"contact.title": "Contact",
"contact.subtitle": "Un projet en tête ? Parlons-en.",
"contact.firstName": "Prénom",
"contact.lastName": "Nom",
"contact.company": "Entreprise / organisme",
"contact.phone": "Téléphone (facultatif)",
"contact.email": "E-mail",
"contact.message": "Message",
"contact.submit": "Envoyer",
"contact.sending": "Envoi…",
"contact.success": "Merci ! Votre message a bien été envoyé.",
"contact.error": "Impossible d'envoyer le message. Réessayez plus tard.",
"footer.rights": "Tous droits réservés.",
"footer.built": "Conçu et développé par Esiah.",
"theme.light": "Mode clair",
"theme.dark": "Mode sombre",
} as const;
type MessageKey = keyof typeof fr;
const en: Record<MessageKey, string> = {
"brand.name": "COHAISE",
"nav.services": "Services",
"nav.demos": "Demos",
"nav.stack": "Stack",
"nav.about": "About",
"nav.contact": "Contact",
"hero.tagline":
"Your project starts with an idea. It comes to life with CoHaiSe.",
"hero.subtitle":
"Web development, mobile apps and UI/UX design. Modern, fast tools built to last.",
"hero.primary": "Discover the services",
"hero.secondary": "Contact me",
"services.title": "Services",
"services.subtitle": "Four ways to bring your idea to life.",
"demos.title": "Demos",
"demos.subtitle": "Adapted versions of real work.",
"demos.source": "View source",
"stack.title": "Stack",
"stack.subtitle": "The technologies behind my projects.",
"about.title": "About",
"about.body":
"CoHaiSe builds tailor-made tools: showcase sites, mobile apps and internal software. Every project is designed to be fast, maintainable and pleasant to use — from the first idea to launch, and beyond.",
"contact.title": "Contact",
"contact.subtitle": "Have a project in mind? Let's talk.",
"contact.firstName": "First name",
"contact.lastName": "Last name",
"contact.company": "Company / organization",
"contact.phone": "Phone (optional)",
"contact.email": "Email",
"contact.message": "Message",
"contact.submit": "Send",
"contact.sending": "Sending…",
"contact.success": "Thanks! Your message has been sent.",
"contact.error": "Could not send the message. Please try again later.",
"footer.rights": "All rights reserved.",
"footer.built": "Designed and built by Esiah.",
"theme.light": "Light mode",
"theme.dark": "Dark mode",
};
const dictionaries: Record<Lang, Record<MessageKey, string>> = { fr, en };
const STORAGE_KEY = "cohaise-lang";
const readInitialLang = (): Lang => {
const stored = window.localStorage.getItem(STORAGE_KEY);
if (stored === "fr" || stored === "en") return stored;
if (navigator.language?.toLowerCase().startsWith("en")) return "en";
return "fr";
};
interface LanguageContextValue {
lang: Lang;
setLang: (lang: Lang) => void;
t: (key: MessageKey) => string;
pick: (value: Localized) => string;
}
const LanguageContext = createContext<LanguageContextValue | null>(null);
export const LanguageProvider = ({ children }: { children: ReactNode }) => {
const [lang, setLangState] = useState<Lang>(readInitialLang);
useEffect(() => {
document.documentElement.lang = lang;
window.localStorage.setItem(STORAGE_KEY, lang);
}, [lang]);
const setLang = useCallback((next: Lang) => setLangState(next), []);
const value = useMemo<LanguageContextValue>(() => {
const dictionary = dictionaries[lang];
return {
lang,
setLang,
t: (key) => dictionary[key],
pick: (item) => item[lang],
};
}, [lang, setLang]);
return (
<LanguageContext.Provider value={value}>
{children}
</LanguageContext.Provider>
);
};
export const useLanguage = (): LanguageContextValue => {
const context = useContext(LanguageContext);
if (!context)
throw new Error("useLanguage doit être utilisé sous LanguageProvider.");
return context;
};
+16
View File
@@ -0,0 +1,16 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./App.js";
import "./styles/index.css";
const container = document.getElementById("root");
if (!container) {
throw new Error("Element racine introuvable");
}
createRoot(container).render(
<StrictMode>
<App />
</StrictMode>,
);
+17
View File
@@ -0,0 +1,17 @@
@import "tailwindcss";
@import "@cohaise/ui/styles";
@source "../../../../frontend/shared/src";
@layer base {
body {
min-height: 100dvh;
}
}
/* Verre « liquide » : panneau translucide flouté, posé sur le fond sombre. */
.glass {
background: color-mix(in oklab, var(--cohaise-surface) 58%, transparent);
backdrop-filter: blur(16px) saturate(1.5);
-webkit-backdrop-filter: blur(16px) saturate(1.5);
}
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"types": ["vite/client"],
"noEmit": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
}
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["ES2022"],
"module": "ESNext",
"moduleResolution": "bundler",
"noEmit": true
},
"include": ["vite.config.ts"]
}
+11
View File
@@ -0,0 +1,11 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
host: true,
port: 5173,
},
});