e67de45a3e
Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.3 KiB
Markdown
51 lines
1.3 KiB
Markdown
# MyLibrary — backend Java
|
||
|
||
Backend métier du projet librairie (Maxime Lebreton / Marvin Aubert / Patrick Felix-Vimalaratnam).
|
||
Pendant visuel : dépôt **`2026-DEV-BUT3`** (React).
|
||
|
||
## Stack
|
||
|
||
- Java 21, Maven
|
||
- Couche domaine : livres, clients, points de fidélité
|
||
- **API REST** (branche `fusion`) : Spring Boot sur le port **8080**
|
||
|
||
## Lancer l’API
|
||
|
||
```bash
|
||
mvn spring-boot:run
|
||
```
|
||
|
||
Vérifier : [http://localhost:8080/api/health](http://localhost:8080/api/health)
|
||
|
||
## Endpoints exposés au front
|
||
|
||
| Méthode | Route | Rôle |
|
||
|---------|-------|------|
|
||
| GET | `/api/health` | Ping |
|
||
| GET | `/api/books` | Liste des livres (format UI) |
|
||
| POST | `/api/books` | Créer un livre |
|
||
| GET | `/api/books/{isbn}` | Détail |
|
||
| DELETE | `/api/books/{isbn}` | Supprimer |
|
||
| POST | `/api/books/{isbn}/read` | Basculer lu / non lu |
|
||
| GET | `/api/users/{uuid}/loyalty-points` | Points fidélité client |
|
||
|
||
Au démarrage, deux livres démo + un client Marie Dupont (100 pts) sont chargés si le catalogue est vide.
|
||
|
||
## Brancher le front React
|
||
|
||
Dans `2026-DEV-BUT3` (branche `fusion`) :
|
||
|
||
```bash
|
||
cp .env.example .env
|
||
npm install
|
||
npm run dev
|
||
```
|
||
|
||
Le proxy Vite envoie `/api` vers `localhost:8080`. Commandes, promos, réservations, avis, abo, prêts et groupes restent côté front (local) tant que ces use cases ne sont pas exposés ici.
|
||
|
||
## Tests unitaires
|
||
|
||
```bash
|
||
mvn test
|
||
```
|