diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8484718 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - run: npm run lint + - run: npm run format:check + - run: npm run typecheck + - run: npm run test + - run: npm audit --audit-level=high diff --git a/README.md b/README.md index 7dbf7eb..3249003 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,63 @@ -# React + TypeScript + Vite +# Expria Frontend -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +Frontend SaaS pour la préparation au TCF Canada. SPA React + Vite, déploiement Cloudflare Pages. -Currently, two official plugins are available: +## Stack -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) +React 19 · Vite 8 · TypeScript 6 · Tailwind 4 · React Router 7 · TanStack Query 5 · Supabase Auth · Vitest. -## React Compiler +Détails et versions : [`docs/adr/006-stack-versions-2026.md`](docs/adr/006-stack-versions-2026.md). -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). +## Prérequis -## Expanding the ESLint configuration +- Node.js 22 LTS +- npm 10+ -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: +## Installation -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +```bash +npm install +cp .env.example .env +# Remplir .env avec tes valeurs Supabase + URL backend ``` -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: +## Commandes -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' +| Commande | Rôle | +|---|---| +| `npm run dev` | Lance le serveur de dev Vite (HMR) | +| `npm run build` | Build de production | +| `npm run typecheck` | `tsc --noEmit` | +| `npm run lint` | ESLint | +| `npm run test` | Vitest (run unique) | +| `npm run test:watch` | Vitest (watch mode) | +| `npm run format` | Formate tout via Prettier | +| `npm run format:check` | Vérifie le formatage sans écrire | -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` +## Variables d'environnement + +Voir [`.env.example`](.env.example). Le démarrage échoue avec un message clair si une variable requise manque (validation Zod dans `src/shared/config/env.ts`). + +## Structure du code + +Voir [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) §3. + +Architecture FSD : `app/` (entry) · `entities/` (métier) · `features/` (UI) · `shared/` (code réutilisable). + +## Documentation + +| Document | Contenu | +|---|---| +| [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) | Architecture complète, flux, codes d'erreur | +| [`docs/DEVELOPMENT_PRINCIPLES.md`](docs/DEVELOPMENT_PRINCIPLES.md) | Règles de dev, conventions, workflow | +| [`docs/ONBOARDING.md`](docs/ONBOARDING.md) | Guide dev (démarrage, outils) | +| [`docs/SECURITY.md`](docs/SECURITY.md) | Patterns sécurité + trous identifiés | +| [`docs/adr/`](docs/adr/) | Architecture Decision Records | + +## CI + +GitHub Actions : `lint`, `format:check`, `typecheck`, `test`, `npm audit --audit-level=high`. Voir [`.github/workflows/ci.yml`](.github/workflows/ci.yml). + +## Licence + +Propriétaire — Expria.