You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
213 lines
6.1 KiB
Markdown
213 lines
6.1 KiB
Markdown
|
2 months ago
|
# BricoLoc - Application Moderne 🛠️
|
||
|
|
|
||
|
|
Application de location d'outils démontrant une architecture microservices moderne avec Clean Architecture.
|
||
|
|
|
||
|
|
## 📚 Table des matières
|
||
|
|
|
||
|
|
- [Stack Technique](#stack-technique)
|
||
|
|
- [Architecture](#architecture)
|
||
|
|
- [Installation](#installation)
|
||
|
|
- [Scripts Disponibles](#scripts-disponibles)
|
||
|
|
- [Structure du Projet](#structure-du-projet)
|
||
|
|
- [Documentation](#documentation)
|
||
|
|
- [Tests](#tests)
|
||
|
|
- [CI/CD](#cicd)
|
||
|
|
|
||
|
|
## 🚀 Stack Technique
|
||
|
|
|
||
|
|
- **Frontend** : Next.js 14 (App Router), React 18, TypeScript
|
||
|
|
- **UI** : Tailwind CSS, shadcn/ui
|
||
|
|
- **Backend** : Supabase (PostgreSQL, Auth, Realtime, Storage)
|
||
|
|
- **State Management** : Zustand, React Query
|
||
|
|
- **Validation** : Zod, React Hook Form
|
||
|
|
- **Tests** : Jest, React Testing Library, Playwright
|
||
|
|
- **CI/CD** : GitHub Actions, Vercel
|
||
|
|
|
||
|
|
## 🏗️ Architecture
|
||
|
|
|
||
|
|
Cette application suit une **architecture microservices hybride** avec 6 services :
|
||
|
|
|
||
|
|
- **Auth Service** : Authentification et gestion des utilisateurs
|
||
|
|
- **Catalogue Service** : Gestion des outils, catégories et recherche
|
||
|
|
- **Reservation Service** : Création et gestion des réservations
|
||
|
|
- **Inventory Service** : Gestion des stocks et disponibilités
|
||
|
|
- **Payment Service** : Traitement des paiements (Stripe)
|
||
|
|
- **Notification Service** : Envoi d'emails et notifications
|
||
|
|
|
||
|
|
Chaque service implémente **Clean Architecture** avec 3 couches :
|
||
|
|
- **Domain Layer** : Entités métier, règles business, interfaces
|
||
|
|
- **Application Layer** : Use Cases, services applicatifs
|
||
|
|
- **Infrastructure Layer** : Repositories, APIs externes, Supabase
|
||
|
|
|
||
|
|
```
|
||
|
|
src/
|
||
|
|
├── services/
|
||
|
|
│ ├── auth/
|
||
|
|
│ │ ├── domain/ # Entités User, règles métier
|
||
|
|
│ │ ├── application/ # Use cases (login, register)
|
||
|
|
│ │ └── infrastructure/ # Supabase Auth
|
||
|
|
│ ├── catalogue/
|
||
|
|
│ ├── reservation/
|
||
|
|
│ └── ...
|
||
|
|
├── shared/ # Code partagé entre services
|
||
|
|
│ ├── domain/
|
||
|
|
│ ├── infrastructure/
|
||
|
|
│ └── utils/
|
||
|
|
└── components/ # Composants UI React
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📦 Installation
|
||
|
|
|
||
|
|
### Prérequis
|
||
|
|
|
||
|
|
- Node.js 20+
|
||
|
|
- pnpm 8+
|
||
|
|
- Un compte Supabase
|
||
|
|
|
||
|
|
### Installation locale
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# 1. Cloner le repository
|
||
|
|
git clone https://github.com/votre-username/bricoloc.git
|
||
|
|
cd bricoloc/apps/modern-app
|
||
|
|
|
||
|
|
# 2. Installer les dépendances
|
||
|
|
pnpm install
|
||
|
|
|
||
|
|
# 3. Configurer les variables d'environnement
|
||
|
|
cp .env.example .env.local
|
||
|
|
# Éditer .env.local avec vos credentials Supabase
|
||
|
|
|
||
|
|
# 4. Lancer le serveur de développement
|
||
|
|
pnpm dev
|
||
|
|
```
|
||
|
|
|
||
|
|
L'application sera accessible sur [http://localhost:3000](http://localhost:3000)
|
||
|
|
|
||
|
|
## 🛠️ Scripts Disponibles
|
||
|
|
|
||
|
|
### Développement
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pnpm dev # Lancer le serveur de développement
|
||
|
|
pnpm build # Build de production
|
||
|
|
pnpm start # Lancer le build de production
|
||
|
|
```
|
||
|
|
|
||
|
|
### Qualité du code
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pnpm lint # Linter le code (ESLint)
|
||
|
|
pnpm lint:fix # Corriger automatiquement les erreurs de lint
|
||
|
|
pnpm format # Formatter le code (Prettier)
|
||
|
|
pnpm type-check # Vérifier les types TypeScript
|
||
|
|
```
|
||
|
|
|
||
|
|
### Tests
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pnpm test # Tests unitaires (Jest)
|
||
|
|
pnpm test:watch # Tests en mode watch
|
||
|
|
pnpm test:coverage # Tests avec coverage
|
||
|
|
pnpm e2e # Tests E2E (Playwright)
|
||
|
|
pnpm e2e:ui # Tests E2E avec interface UI
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📂 Structure du Projet
|
||
|
|
|
||
|
|
```
|
||
|
|
apps/modern-app/
|
||
|
|
├── src/
|
||
|
|
│ ├── app/ # Pages Next.js (App Router)
|
||
|
|
│ ├── components/
|
||
|
|
│ │ ├── ui/ # Composants shadcn/ui
|
||
|
|
│ │ ├── features/ # Composants métier
|
||
|
|
│ │ └── layouts/ # Layouts (Header, Footer)
|
||
|
|
│ ├── services/ # Microservices (Clean Architecture)
|
||
|
|
│ │ ├── auth/
|
||
|
|
│ │ ├── catalogue/
|
||
|
|
│ │ ├── reservation/
|
||
|
|
│ │ ├── inventory/
|
||
|
|
│ │ ├── payment/
|
||
|
|
│ │ └── notification/
|
||
|
|
│ ├── shared/ # Code partagé
|
||
|
|
│ │ ├── domain/
|
||
|
|
│ │ ├── infrastructure/
|
||
|
|
│ │ └── utils/
|
||
|
|
│ ├── hooks/ # Hooks React personnalisés
|
||
|
|
│ └── lib/ # Utilitaires
|
||
|
|
├── tests/
|
||
|
|
│ ├── unit/ # Tests unitaires
|
||
|
|
│ ├── integration/ # Tests d'intégration
|
||
|
|
│ └── e2e/ # Tests E2E Playwright
|
||
|
|
├── docs/ # Documentation
|
||
|
|
└── public/ # Assets statiques
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📖 Documentation
|
||
|
|
|
||
|
|
- [Roadmap](./docs/ROADMAP_MODERN.md) - Planning du développement
|
||
|
|
- [Setup Semaine 5](./docs/WEEK_5_SETUP.md) - Configuration initiale
|
||
|
|
- [Auth Semaine 6](./docs/WEEK_6_AUTH.md) - Implémentation Auth Service
|
||
|
|
- [Exigences Non Fonctionnelles](./docs/NON_FUNCTIONAL_REQUIREMENTS.md)
|
||
|
|
- [Architecture Logique](./docs/LOGICAL_ARCHITECTURE.md)
|
||
|
|
- [Comparaison Styles Architecturaux](./docs/ARCHITECTURE_STYLES_COMPARISON.md)
|
||
|
|
- [Matrice de Choix Technologique](./docs/TECHNOLOGY_DECISION_MATRIX.md)
|
||
|
|
- [Setup Supabase](./docs/SUPABASE_SETUP.md)
|
||
|
|
|
||
|
|
## 🧪 Tests
|
||
|
|
|
||
|
|
### Tests Unitaires (Jest)
|
||
|
|
|
||
|
|
Les tests unitaires couvrent :
|
||
|
|
- Entités du domaine
|
||
|
|
- Validateurs (Zod)
|
||
|
|
- Utilitaires (Result Pattern, Email validation)
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pnpm test
|
||
|
|
```
|
||
|
|
|
||
|
|
**Coverage actuel** : 95%+ sur le domaine et les utilitaires
|
||
|
|
|
||
|
|
### Tests E2E (Playwright)
|
||
|
|
|
||
|
|
Les tests E2E valident :
|
||
|
|
- Navigation sur la page d'accueil
|
||
|
|
- Parcours utilisateur complets
|
||
|
|
- Interactions avec l'UI
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pnpm e2e
|
||
|
|
```
|
||
|
|
|
||
|
|
## 🚀 CI/CD
|
||
|
|
|
||
|
|
### GitHub Actions
|
||
|
|
|
||
|
|
Le pipeline CI s'exécute sur chaque push/PR et effectue :
|
||
|
|
- ✅ Lint (ESLint)
|
||
|
|
- ✅ Type check (TypeScript)
|
||
|
|
- ✅ Tests unitaires avec coverage
|
||
|
|
- ✅ Build de production
|
||
|
|
- ✅ Vérification de la taille du bundle
|
||
|
|
|
||
|
|
### Déploiement Vercel
|
||
|
|
|
||
|
|
- **Production** : Déploiement automatique sur push vers `main`
|
||
|
|
- **Preview** : Déploiement automatique pour chaque PR
|
||
|
|
- **URL Production** : [bricoloc-moderne.vercel.app](https://bricoloc-moderne.vercel.app) (à configurer)
|
||
|
|
|
||
|
|
## 🤝 Contribution
|
||
|
|
|
||
|
|
Voir [CONTRIBUTING.md](../../CONTRIBUTING.md) pour les guidelines de contribution.
|
||
|
|
|
||
|
|
## 📝 License
|
||
|
|
|
||
|
|
MIT
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Développé avec ❤️ par l'équipe BricoLoc**
|
||
|
|
**Dernière mise à jour** : 31 Octobre 2025
|