Production-style backend for a Spotify-like music app.
- Google Sign-In verification via Firebase Auth (
/auth/google) - Backend JWT session tokens
- YouTube search + audio stream URL extraction via
yt-dlp - Firebase Realtime DB user/library/history/playlists
- Recommendations based on preferences + history + likes
- Railway-ready Docker deployment
POST /auth/googleGET /search?q=...GET /stream?videoId=...GET /recommendations?uid=...POST /user/update-preferencesPOST /user/like-songPOST /user/historyPOST /playlist/createPOST /playlist/addPOST /playlist/removeGET /playlist/get
Compatibility aliases:
POST /user/preferencesPOST /user/likeGET /playlist/list
- Install dependencies:
pip install -r requirements.txt- Configure environment:
copy .env.example .env- Start server:
uvicorn app.main:app --reload --port 8000Open docs at http://localhost:8000/docs.
- Create a Railway project and connect this repo.
- Add environment variables from
.env.example. - Deploy; Railway will build from
Dockerfile.
Expected root collections:
/users/{uid}/songsCache/{songId}