# AudiOhm đŸŽ” Alternative Ă  Spotify avec streaming YouTube, interface nĂ©on cyberpunk et backend auto-hĂ©bergĂ©. ![Python](https://img.shields.io/badge/Python-3.11+-blue.svg) ![Flutter](https://img.shields.io/badge/Flutter-3.2+-cyan.svg) ![FastAPI](https://img.shields.io/badge/FastAPI-0.109+-green.svg) ![License](https://img.shields.io/badge/License-MIT-purple.svg) ## 🎯 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 ### 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 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 ### 4. Setup Frontend ```bash cd frontend # Installer dĂ©pendances flutter pub get # Lancer app flutter run -d windows # Desktop flutter run -d android # Android ``` ### 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**