[FEAT] First functional version.

This commit is contained in:
NADAL Jean-Baptiste
2026-02-18 10:08:48 +01:00
parent 5c93000873
commit bc6e603af4
32 changed files with 5618 additions and 30 deletions

154
PLAN.md
View File

@@ -45,29 +45,45 @@
### 1.1 ScoreScanner.php ✓ (FAIT)
- [x] Classe pour scanner les partitions
- [x] Lecture des fichiers score.ini
- [x] Lecture des fichiers score.ini (supporte sections [info], [pieces])
- [x] Scan récursif instruments → parties → fichiers PDF
- [x] Mapping codes instruments vers noms
- [x] Retourne `piece` pour chaque instrument
- [x] Parse les noms de fichiers : `part`, `key`, `clef`, `variant`
- [x] Retourne `ressource` si présent dans score.ini
- [x] Supporte les partitions multi-morceaux (ex: score 390)
### 1.2 Auth.php
- [ ] Classe JWT pour authentification
- [ ] Génération token JWT
- [ ] Vérification token JWT
- [ ] Lecture users.json
- [ ] Vérification password hashé (bcrypt)
- [x] Classe JWT pour authentification
- [x] Génération token JWT
- [x] Vérification token JWT
- [x] Lecture users.json
- [x] Vérification password hashé (bcrypt)
- [ ] Tests unitaires Auth.php (PHP non installé)
### 1.3 users.json
- [ ] Fichier JSON avec structure users
- [ ] Passwords hashés avec bcrypt
- [x] Fichier JSON avec structure users
- [ ] Passwords hashés avec bcrypt (password: password)
- [ ] Script pour ajouter/modifier users
### 1.4 index.php (Router API)
- [ ] CORS headers
- [ ] Routing : POST /login
- [ ] Routing : GET /scores (protégé JWT)
- [ ] Routing : GET /scores/:id (protégé JWT)
- [ ] Routing : GET /download/:path (protégé JWT, stream PDF)
- [x] CORS headers
- [x] POST /login
- [x] GET /scores (protégé JWT)
- [x] GET /scores/:id (protégé JWT)
- [x] GET /pieces/:scoreId (protégé JWT)
- [x] GET /download/:path (protégé JWT, stream PDF)
- [x] POST /admin/scores (protégé JWT, créer partition)
- [x] PUT /admin/scores/:id (protégé JWT, modifier partition)
- [x] DELETE /admin/scores/:id (protégé JWT, supprimer partition)
- [x] POST /admin/scores/:id/upload (protégé JWT, upload PDF)
- [ ] Gestion erreurs JSON
- [ ] Tests toutes les routes (PHP non installé)
### 1.5 Tests API
- [ ] Tests unitaires Auth.php (PHP non installé)
- [ ] Tests intégration toutes les routes (PHP non installé)
- [ ] Tests authentification JWT (PHP non installé)
## Phase 2 : Frontend SvelteKit (partitions/)
@@ -370,3 +386,115 @@ count = 5
- ✅ Mots composés: `sax_alto`, `clarinette_basse`
- ✅ Pas de `-et-` (0 occurrences)
- ✅ Pas de `--` (0 occurrences)
---
## Phase future : Liens externes
### Objectif
Ajouter des liens externes dans les partitions (YouTube, site éditeur, etc.)
### Implementation
1. **Modification score.ini** (FAIT)
```ini
[info]
name = Le morceau
compositor = Compositeur
ressource = https://youtube.com/watch?v=xxx
# ou
ressource = https://www.musicdiffusion.com/...
```
2. **API** (FAIT)
- GET /scores → retourner `ressource` si présent
- GET /scores/:id → retourner `ressource` aussi
3. **Frontend**
- Page liste partitions : afficher icône lien externe si présent
- Page détail partition : afficher les liens sous le titre
### Ordre de priorité
- Implémenté, en attente frontend
---
## TODO: Icônes instruments
- Installer lucide-svelte (fait)
- Personnaliser chaque instrument avec la bonne icône
### Code IconeDesired
- pic flute traversiere
- flu flute traversiere
- cla clarinette
- clb clarinette basse
- sax OK
- sat OK
- sab OK
- coa cor anglais
- cba OK
- cor cor
- trp OK
- trb OK
- tub OK
- htb hautbois
- bas basson
- per OK
- crn OK
- eup OK
- har OK
- pia OK
---
## TODO: Déploiement
### Solution idéale: Docker
**Services à conteneriser:**
1. **PHP-FPM** - API backend
2. **Nginx** - Servir static + proxy PHP
3. **Node.js** - Frontend SvelteKit (ou build static)
**docker-compose.yml:**
```yaml
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./frontend/build:/usr/share/nginx/html
- ./api:/var/www/html
- ./legacy/Scores:/var/www/html/Scores
depends_on:
- php
php:
image: php:8.2-fpm
volumes:
- ./api:/var/www/html
node:
build: ./partitions
command: npm run dev
```
### Solution alternative: Serveur classique
**Si hébergement mutualisé:**
- Build SvelteKit → dossier `build/`
- PHP-FPM pour API
- Dossiers:
- `/` → frontend static
- `/api` → PHP
- `/legacy/Scores` → fichiers PDF
### Tâches pour déploiement
- [ ] Créer Dockerfile
- [ ] Créer docker-compose.yml
- [ ] Tester en local
- [ ] Configurer CI/CD (GitHub Actions)
- [ ] Déployer sur serveur prod