feat: initialiser le projet CVP (Next.js 14 + FastAPI + PostgreSQL)
- Frontend : Next.js 14 App Router, TypeScript strict, Tailwind 3, shadcn/ui, next-intl (fr/en) - Backend : FastAPI, SQLAlchemy 2 async, Alembic, Pydantic 2, Python 3.11 - Infrastructure : Docker Compose (PostgreSQL 16 + Ollama) - Tooling : ESLint + Prettier (frontend), Ruff (backend), pytest - Structure complète des dossiers avec pages et routers placeholder
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
# CVP — CV Personnalisé
|
||||
|
||||
Application web locale de recherche d'emploi intelligente. Agrège des offres (France Travail, Adzuna), analyse la compatibilité profil/offre via un LLM local (Ollama), et génère des CV adaptés.
|
||||
|
||||
## Stack
|
||||
|
||||
- **Frontend** : Next.js 14 (App Router), React 18, TypeScript strict, Tailwind CSS 3, shadcn/ui (new-york), next-intl (fr/en)
|
||||
- **Backend** : Python 3.11, FastAPI, SQLAlchemy 2 (async), Alembic, Pydantic 2
|
||||
- **Base de données** : PostgreSQL 16 (via Docker Compose)
|
||||
- **LLM local** : Ollama + Phi-3 mini (optionnel — l'app fonctionne sans)
|
||||
|
||||
## Commandes
|
||||
|
||||
### Frontend (`cd frontend`)
|
||||
|
||||
```bash
|
||||
npm run dev # Serveur de développement (port 3000)
|
||||
npm run build # Build production
|
||||
npm run lint # ESLint
|
||||
npm run lint:fix # ESLint avec auto-fix
|
||||
npm run format # Prettier — formater les fichiers
|
||||
npm run format:check # Prettier — vérifier le formatage
|
||||
npm run type-check # TypeScript — vérification des types
|
||||
```
|
||||
|
||||
### Backend (`cd backend`)
|
||||
|
||||
```bash
|
||||
source .venv/bin/activate # Activer le virtualenv
|
||||
uvicorn app.main:app --reload # Serveur de développement (port 8000)
|
||||
pytest tests/ -v # Lancer les tests
|
||||
ruff check app/ tests/ # Linter
|
||||
ruff format app/ tests/ # Formater le code
|
||||
ruff check --fix app/ tests/ # Linter avec auto-fix
|
||||
alembic upgrade head # Appliquer les migrations
|
||||
alembic revision --autogenerate -m "description" # Créer une migration
|
||||
```
|
||||
|
||||
### Infrastructure
|
||||
|
||||
```bash
|
||||
docker compose up -d # PostgreSQL + Ollama
|
||||
docker compose down # Arrêter les services
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
### TypeScript / Frontend
|
||||
|
||||
- TypeScript strict (`strict: true`), jamais de `any`
|
||||
- Composants : PascalCase (`OffreCard.tsx`), fonctionnels uniquement
|
||||
- Hooks : camelCase préfixé `use` (`useOffres.ts`)
|
||||
- Types/Interfaces : PascalCase, pas de préfixe `I`
|
||||
- Constantes : UPPER_SNAKE_CASE
|
||||
- Imports : alias `@/` pour `src/`
|
||||
- Un composant par fichier
|
||||
|
||||
### Python / Backend
|
||||
|
||||
- Python 3.11+, annotations de type sur toutes les fonctions publiques
|
||||
- Modules et variables : snake_case, classes : PascalCase
|
||||
- `async def` pour tous les endpoints et accès DB
|
||||
- Imports absolus : `from app.services.matching import ...`
|
||||
- Pas de `print()` — utiliser `logging`
|
||||
- Pas de `# type: ignore`
|
||||
|
||||
### Git
|
||||
|
||||
- Conventional Commits en français : `feat:`, `fix:`, `chore:`
|
||||
- Ne JAMAIS ajouter `Co-Authored-By` dans les messages de commit
|
||||
- Branches : `feature/nom-court`, `fix/description`, `chore/description`
|
||||
|
||||
## Règles impératives
|
||||
|
||||
1. Ne jamais hardcoder de clés API — variables d'environnement via `.env`
|
||||
2. Ne jamais commit `.env` — uniquement `.env.example`
|
||||
3. Toujours vérifier via Context7 avant d'implémenter une intégration API externe
|
||||
4. Le LLM local est optionnel — mode dégradé si Ollama indisponible
|
||||
5. Mono-utilisateur pour l'instant, mais architecture extensible
|
||||
6. Français par défaut pour toute l'interface
|
||||
7. Responsive — optimisé desktop, utilisable mobile
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
cvp/
|
||||
├── frontend/ # Next.js 14 App Router
|
||||
│ ├── src/
|
||||
│ │ ├── app/[locale]/ # Pages i18n (dashboard, offres, profil, cv, candidatures, parametres)
|
||||
│ │ ├── components/ # ui/ (shadcn), layout/, offres/, cv/, profil/
|
||||
│ │ ├── lib/ # Utilitaires (utils.ts)
|
||||
│ │ ├── hooks/ # Custom React hooks
|
||||
│ │ ├── types/ # Types TypeScript partagés
|
||||
│ │ ├── messages/ # Traductions (fr.json, en.json)
|
||||
│ │ └── i18n/ # Config next-intl (routing.ts, request.ts)
|
||||
│ └── package.json
|
||||
├── backend/ # FastAPI
|
||||
│ ├── app/
|
||||
│ │ ├── main.py # Point d'entrée + routers
|
||||
│ │ ├── config.py # Settings (Pydantic)
|
||||
│ │ ├── api/routes/ # offres, profil, cv, candidatures, parametres
|
||||
│ │ ├── api/deps.py # Dépendances (DbSession)
|
||||
│ │ ├── models/ # SQLAlchemy
|
||||
│ │ ├── schemas/ # Pydantic
|
||||
│ │ ├── services/ # Logique métier
|
||||
│ │ ├── templates/ # Templates CV (HTML)
|
||||
│ │ └── db/ # database.py + migrations/ (Alembic)
|
||||
│ ├── tests/
|
||||
│ ├── requirements.txt
|
||||
│ └── pyproject.toml
|
||||
├── docker-compose.yml # PostgreSQL 16 + Ollama
|
||||
├── .env.example
|
||||
└── PROMPT.md # Spécification complète du projet
|
||||
```
|
||||
Reference in New Issue
Block a user