Spotify statistics, no bs
A modern web application that connects to your Spotify account and displays comprehensive listening statistics and insights.
- 🔐 Secure Spotify OAuth authentication
- 📊 Top tracks and artists analysis
- 🎨 Genre distribution insights
- 📈 Listening habits over time
- 🎵 Recently played tracks
- 📱 Responsive design for all devices
- FastAPI - Modern Python web framework
- Python 3.9+ - Core backend language
- Spotify Web API - Music data source
- Pydantic - Data validation and serialization
- React 18 - UI framework
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Chart.js - Data visualization
- Python 3.9+
- Node.js 16+
- Spotify Developer Account
git clone https://github.com/fromagge/statify.git
cd statify- Go to Spotify Developer Dashboard
- Create a new app
- Add redirect URI:
http://localhost:8000/auth/callback - Note your Client ID and Client Secret
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Copy environment template and fill in your Spotify credentials
cp .env.example .env
# Edit .env with your Spotify Client ID and Secret
# Run the backend
uvicorn main:app --reload --port 8000cd frontend
npm install
npm startThe app will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downstatify/
├── backend/ # FastAPI backend
│ ├── main.py # Application entry point
│ ├── auth.py # Spotify OAuth handling
│ ├── spotify_service.py # Spotify API integration
│ ├── models.py # Data models
│ └── routes/ # API endpoints
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts
│ │ └── services/ # API clients
│ └── public/
├── docs/ # Documentation
└── scripts/ # Development scripts
GET /auth/login- Initiate Spotify OAuthGET /auth/callback- Handle OAuth callbackPOST /auth/refresh- Refresh access token
GET /user/profile- Get user profileGET /user/top-tracks- Get top tracksGET /user/top-artists- Get top artistsGET /user/recently-played- Get recently played tracks
GET /stats/overview- Get overview statisticsGET /stats/genres- Get genre distributionGET /stats/listening-habits- Get listening patterns
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Spotify Web API for providing music data
- FastAPI for the excellent Python framework
- React for the powerful UI library