85dad89d5b
Phase 1 - Corrections Critiques: - Fixed memory leaks dans music_provider.dart (stream subscriptions) - Fixed race conditions dans search_provider.dart (stale results) - Fixed token refresh errors dans api_service.dart - Improved error handling avec messages utilisateur - Changed API URL to HTTPS by default Phase 2 - Améliorations UX Desktop: - Ajouté cursor pointers sur tous les éléments cliquables - Implémenté hover states avec effets néon glow (200ms transitions) - Créé skeleton loading states avec shimmer animation - Ajouté widgets: ClickableWrapper, ErrorDisplay, SkeletonLoading - Enhanced visual feedback pour desktop users Phase 3 - Configuration Flutter: - Configuré Android (Gradle 8.1.0, Kotlin 1.9.0, minSdk 21, targetSdk 34) - Créé launcher icons cyberpunk néon (5 densités) - Configuré Windows desktop (structure complète) - Activé Linux desktop support - Ajouté package équatable pour entités de domaine - Corrigé imports (colors.dart, auth_provider.dart) - Fixed Dio API compatibility (RequestOptions) Documentation: - STYLE_GUIDE.md: Guide complet (100+ pages) - DESIGN_IMPLEMENTATION_GUIDE.md: Implémentation Flutter - BUILD_STATUS.md: Status builds + troubleshooting - QUICKSTART_BUILDS.md: Guide rapide - BUILD_INDEX.md: Index documentation - PHASE_1_CORRECTIONS.md: Corrections Phase 1 - PHASE_2_UX_IMPROVEMENTS.md: Améliorations Phase 2 - PR_REVIEW_SUMMARY.md: Revue code complète - CODE_ANALYSIS_AND_PRIORITIES.md: Analyse code Scripts & Builds: - BUILD_ALL.sh: Script automatisé builds multi-plateforme - builds/: Structure avec README par plateforme - design-system/: Système de design complet Backend: - Ajouté streaming HTTP Range pour audio progressif - Enhanced YouTube service avec métadonnées complètes - Improved error handling et validation Generated with [Claude Code](https://claude.com/claude-code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
327 lines
7.7 KiB
Markdown
327 lines
7.7 KiB
Markdown
|
|
# AudiOhm 🎵
|
|
|
|
Alternative à Spotify avec streaming YouTube, interface néon cyberpunk et backend auto-hébergé.
|
|
|
|

|
|

|
|

|
|

|
|
|
|
## 🎯 Fonctionnalités
|
|
|
|
### ✅ Implémenté
|
|
|
|
**Backend FastAPI :**
|
|
- ✅ Authentification JWT complète (register, login, refresh, logout)
|
|
- ✅ Recherche multi-source (database + YouTube via yt-dlp)
|
|
- ✅ Streaming audio avec support HTTP Range
|
|
- ✅ CRUD Playlists complet (create, read, update, delete)
|
|
- ✅ Gestion des tracks dans playlists (add, remove, reorder)
|
|
- ✅ Recommandations basées sur YouTube related videos
|
|
|
|
**Frontend Flutter :**
|
|
- ✅ Thème néon cyberpunk complet avec effets glow
|
|
- ✅ Layout adaptatif (Desktop sidebar + Mobile bottom nav)
|
|
- ✅ Mini player avec contrôles réactifs
|
|
- ✅ Navigation instantanée (< 100ms)
|
|
- ✅ Image caching progressif
|
|
- ✅ State management avec Riverpod
|
|
|
|
**Base de données :**
|
|
- ✅ 6 modèles SQLAlchemy (User, Artist, Album, Track, Playlist, PlaylistTrack)
|
|
- ✅ Relations et indexes optimisés
|
|
- ✅ Support async complet
|
|
|
|
### 🚧 À venir
|
|
|
|
- Import de playlists Spotify
|
|
- Mode offline avec cache local
|
|
- Recommandations avancées (Last.fm)
|
|
- Système de likes (bibliothèque)
|
|
- Mode collaboratif playlists
|
|
- Historique d'écoute
|
|
- UI pages (Search, Library, Settings)
|
|
|
|
## 📁 Structure du Projet
|
|
|
|
```
|
|
spotify-le-2/
|
|
├── backend/ # FastAPI backend
|
|
│ ├── app/
|
|
│ │ ├── api/v1/ # Routes (auth, music, playlists)
|
|
│ │ ├── core/ # Config, security, database
|
|
│ │ ├── models/ # SQLAlchemy models
|
|
│ │ ├── schemas/ # Pydantic schemas
|
|
│ │ └── services/ # Business logic
|
|
│ ├── requirements.txt
|
|
│ └── .env.example
|
|
│
|
|
├── frontend/ # Flutter app
|
|
│ ├── lib/
|
|
│ │ ├── core/theme/ # Neon cyberpunk theme
|
|
│ │ ├── domain/ # Entities
|
|
│ │ ├── infrastructure/ # API client
|
|
│ │ └── presentation/ # UI, providers
|
|
│ └── pubspec.yaml
|
|
│
|
|
├── docker/
|
|
│ └── docker-compose.yml # PostgreSQL + Redis
|
|
│
|
|
├── docs/
|
|
│ ├── design-preview.html # Preview du thème
|
|
│ └── plans/ # Design document
|
|
│
|
|
└── README.md
|
|
```
|
|
|
|
## 🚀 Installation
|
|
|
|
📖 **Pour un démarrage rapide en mode Web, voir [QUICKSTART_WEB.md](QUICKSTART_WEB.md)**
|
|
|
|
### Prérequis
|
|
|
|
**Backend :**
|
|
- Python 3.11+
|
|
- PostgreSQL 15+
|
|
- Redis 7+
|
|
- FFmpeg
|
|
- yt-dlp
|
|
|
|
**Frontend :**
|
|
- Flutter 3.2+
|
|
- Dart 3.2+
|
|
- Android Studio / VS Code
|
|
|
|
### 1. Cloner le projet
|
|
|
|
```bash
|
|
git clone <repo-url>
|
|
cd Spotify_le_2
|
|
```
|
|
|
|
### 2. Lancer l'infrastructure (Docker)
|
|
|
|
```bash
|
|
cd docker
|
|
docker-compose up -d
|
|
```
|
|
|
|
### 3. Setup Backend
|
|
|
|
```bash
|
|
cd backend
|
|
|
|
# Créer venv
|
|
python -m venv venv
|
|
venv\Scripts\activate # Windows
|
|
source venv/bin/activate # Linux/Mac
|
|
|
|
# Installer dépendances
|
|
pip install -r requirements.txt
|
|
|
|
# Configurer environnement
|
|
cp .env.example .env
|
|
# Éditer .env (changer SECRET_KEY!)
|
|
|
|
# Initialiser DB
|
|
python -c "from app.core.database import init_db; import asyncio; asyncio.run(init_db())"
|
|
|
|
# Lancer serveur
|
|
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
API disponible sur http://localhost:8000
|
|
|
|
### 5. Builder l'Application (Android/Windows)
|
|
|
|
**IMPORTANT:** Lire le guide de build complet:
|
|
- 📖 **[BUILD_STATUS.md](BUILD_STATUS.md)** - Status détaillé et solutions aux problèmes
|
|
- 🚀 **[QUICKSTART_BUILDS.md](QUICKSTART_BUILDS.md)** - Guide de build rapide
|
|
|
|
**Résumé rapide:**
|
|
|
|
| Plateforme | Status | Instructions |
|
|
|-----------|--------|--------------|
|
|
| **Android APK** | ⚠️ Nécessite Android SDK | Voir [BUILD_STATUS.md](BUILD_STATUS.md) |
|
|
| **Windows EXE** | ⚠️ Requiert Windows host | Builder sur Windows avec `flutter build windows --release` |
|
|
| **Web** | ⚠️ Problème audio | `flutter run -d chrome` pour dev uniquement |
|
|
|
|
Pour tester l'application **sans build**, utiliser:
|
|
```bash
|
|
cd frontend
|
|
flutter run -d chrome
|
|
```
|
|
|
|
### 4. Setup Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
|
|
# Installer dépendances
|
|
flutter pub get
|
|
|
|
# Activer le support Web (recommandé pour le debug)
|
|
flutter config --enable-web
|
|
flutter create --platforms=web .
|
|
|
|
# Lancer app
|
|
flutter run -d chrome # Web (recommandé pour debug)
|
|
flutter run -d windows # Desktop Windows
|
|
flutter run -d android # Android
|
|
```
|
|
|
|
**🌐 Mode Web (recommandé pour le développement/debug)**
|
|
|
|
L'application web s'ouvrira automatiquement à : `http://localhost:8080`
|
|
|
|
Avantages du mode Web :
|
|
- ✅ Pas besoin de Visual Studio
|
|
- ✅ Débugage dans le navigateur (Chrome DevTools)
|
|
- ✅ Hot reload instantané
|
|
- ✅ Fonctionne sur toutes les plateformes
|
|
|
|
### 5. Créer un exécutable (.exe)
|
|
|
|
**Windows :**
|
|
```cmd
|
|
# Double-cliquez sur:
|
|
BUILD_CLIENT_WINDOWS.bat
|
|
|
|
# Ou manuellement:
|
|
cd frontend
|
|
flutter build windows --release
|
|
# Exécutable dans: build\windows\x64\runner\Release\
|
|
```
|
|
|
|
**Linux :**
|
|
```bash
|
|
./BUILD_CLIENT_LINUX.sh
|
|
```
|
|
|
|
📖 **Voir `BUILD_CLIENT_README.md` pour les instructions détaillées**
|
|
|
|
## 🎨 Design
|
|
|
|
Le thème **Néon Cyberpunk** est visible dans `docs/design-preview.html`.
|
|
|
|
**Couleurs principales :**
|
|
- Background: `#0A0E27` (bleu nuit très foncé)
|
|
- Primary: `#00F0FF` (cyan électrique néon)
|
|
- Secondary: `#BF00FF` (violet néon)
|
|
- Accent: `#FF006E` (rose néon)
|
|
|
|
## 📡 API Endpoints
|
|
|
|
### Authentification
|
|
|
|
```
|
|
POST /api/v1/auth/register - Créer compte
|
|
POST /api/v1/auth/login - Se connecter
|
|
POST /api/v1/auth/refresh - Rafraîchir token
|
|
GET /api/v1/auth/me - Profil utilisateur
|
|
PUT /api/v1/auth/me - Modifier profil
|
|
POST /api/v1/auth/logout - Se déconnecter
|
|
```
|
|
|
|
### Musique
|
|
|
|
```
|
|
GET /api/v1/music/search - Rechercher (DB + YouTube)
|
|
GET /api/v1/music/tracks/{id} - Détails track
|
|
GET /api/v1/music/tracks/{id}/stream - Stream audio
|
|
POST /api/v1/music/tracks/from-youtube - Créer track YouTube
|
|
GET /api/v1/music/tracks/{id}/recommendations - Recommandations
|
|
GET /api/v1/music/trending - Trending tracks
|
|
```
|
|
|
|
### Playlists
|
|
|
|
```
|
|
GET /api/v1/playlists - Lister playlists
|
|
POST /api/v1/playlists - Créer playlist
|
|
GET /api/v1/playlists/{id} - Détails playlist
|
|
PUT /api/v1/playlists/{id} - Modifier playlist
|
|
DELETE /api/v1/playlists/{id} - Supprimer playlist
|
|
POST /api/v1/playlists/{id}/tracks - Ajouter tracks
|
|
DELETE /api/v1/playlists/{id}/tracks/{track_id} - Retirer track
|
|
PUT /api/v1/playlists/{id}/tracks/reorder - Réordonner
|
|
```
|
|
|
|
## 🔧 Configuration
|
|
|
|
### Backend (.env)
|
|
|
|
```env
|
|
# Application
|
|
DEBUG=true
|
|
SECRET_KEY=change-this-to-a-strong-random-key
|
|
|
|
# Database
|
|
POSTGRES_HOST=localhost
|
|
POSTGRES_PORT=5432
|
|
POSTGRES_USER=spotify
|
|
POSTGRES_PASSWORD=your_password
|
|
POSTGRES_DB=spotify_le_2
|
|
|
|
# Redis
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6379
|
|
```
|
|
|
|
### Frontend
|
|
|
|
```dart
|
|
// lib/core/constants/api_constants.dart
|
|
const String baseUrl = 'http://localhost:8000/api/v1';
|
|
```
|
|
|
|
## 📊 Stack Technique
|
|
|
|
| Composant | Technologie |
|
|
|-----------|------------|
|
|
| **Backend** | Python + FastAPI |
|
|
| **Base de données** | PostgreSQL 15+ |
|
|
| **Cache** | Redis 7+ |
|
|
| **Streaming** | yt-dlp + FFmpeg |
|
|
| **Frontend** | Flutter 3.2+ |
|
|
| **State Management** | Riverpod |
|
|
| **Audio** | just_audio |
|
|
| **ORM** | SQLAlchemy 2.0 (async) |
|
|
|
|
## 🛠️ Développement
|
|
|
|
### Backend
|
|
|
|
```bash
|
|
# Linter
|
|
ruff check app/
|
|
|
|
# Formatter
|
|
black app/
|
|
|
|
# Tests
|
|
pytest
|
|
```
|
|
|
|
### Frontend
|
|
|
|
```bash
|
|
# Formatter
|
|
flutter format .
|
|
|
|
# Linter
|
|
flutter analyze
|
|
|
|
# Tests
|
|
flutter test
|
|
```
|
|
|
|
## 📝 License
|
|
|
|
MIT
|
|
|
|
---
|
|
|
|
**Projet développé avec 💜 pour remplacer Spotify**
|