mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 11:46:07 +00:00
feat: migrate to PostgreSQL and enhance playlist curation
- Migrate database from SQLite to PostgreSQL (100.91.248.114:5433) - Fix playlist curation to use actual top tracks instead of AI name matching - Add /playlists/history endpoint for historical playlist viewing - Add Playlist Archives section to frontend with expandable history - Add playlist-modify-* scopes to Spotify OAuth for playlist creation - Rewrite Genius client to use official API (fixes 403 scraping blocks) - Ensure playlists are created on Spotify before curation attempts - Add DATABASE.md documentation for PostgreSQL schema - Add migrations for PlaylistConfig and composition storage
This commit is contained in:
19
README.md
19
README.md
@@ -79,25 +79,26 @@ Open your browser to: **http://localhost:8991**
|
||||
┌────────┴────────┐
|
||||
▼ ▼
|
||||
┌──────────┐ ┌──────────────┐
|
||||
│ SQLite │ │ Spotify API │
|
||||
│ music.db │ │ Gemini AI │
|
||||
│PostgreSQL│ │ Spotify API │
|
||||
│ music_db │ │ Gemini AI │
|
||||
└──────────┘ └──────────────┘
|
||||
```
|
||||
|
||||
- **Backend Container**: Runs both the FastAPI server AND the background Spotify polling worker
|
||||
- **Frontend Container**: Nginx serving the React build, proxies `/api/` to backend
|
||||
- **Database**: SQLite stored in a Docker named volume (`music_data`) for persistence
|
||||
- **Database**: PostgreSQL hosted on internal server (100.91.248.114:5433)
|
||||
|
||||
## Data Persistence
|
||||
|
||||
Your listening history is stored in a Docker named volume:
|
||||
- Volume name: `music_data`
|
||||
- Database file: `/app/music.db`
|
||||
- Migrations run automatically on container startup
|
||||
Your listening history is stored in PostgreSQL:
|
||||
- Host: `100.91.248.114:5433`
|
||||
- Database: `music_db`
|
||||
- Data Location (on server): `/opt/DB/MusicDB/pgdata`
|
||||
- Migrations run automatically on container startup via Alembic
|
||||
|
||||
To backup your data:
|
||||
```bash
|
||||
docker cp $(docker-compose ps -q backend):/app/music.db ./backup.db
|
||||
pg_dump -h 100.91.248.114 -p 5433 -U bnair music_db > backup.sql
|
||||
```
|
||||
|
||||
## Local Development
|
||||
@@ -136,4 +137,4 @@ Access at http://localhost:5173 (Vite proxies `/api` to backend automatically)
|
||||
| `SPOTIFY_REFRESH_TOKEN` | Yes | Long-lived refresh token from OAuth |
|
||||
| `GEMINI_API_KEY` | Yes | Google Gemini API key |
|
||||
| `GENIUS_ACCESS_TOKEN` | No | Genius API token for lyrics |
|
||||
| `DATABASE_URL` | No | SQLite path (default: `sqlite:///./music.db`) |
|
||||
| `DATABASE_URL` | No | PostgreSQL URL (default: `postgresql://bnair:Bharath2002@100.91.248.114:5433/music_db`) |
|
||||
|
||||
Reference in New Issue
Block a user