small build note: @shipitdev
COOKED is a small full-stack app that pulls a user's Spotify top artists and tracks, sends that taste profile to Gemini, and returns one short roast in a brutalist dashboard UI.
The app also has a demo fallback, so it can still run locally without live Spotify or Gemini credentials.
- Backend: Python, FastAPI, Spotipy, Google GenAI
- Frontend: React, Vite, Tailwind CSS, Framer Motion
- APIs: Spotify Web API, Gemini
.
├── server.py
├── requirements.txt
├── frontend/
│ ├── src/
│ ├── package.json
│ └── vite.config.js
└── README.md
Create a .env file in the project root:
SPOTIPY_CLIENT_ID=your_spotify_client_id
SPOTIPY_CLIENT_SECRET=your_spotify_client_secret
SPOTIPY_REDIRECT_URI=http://127.0.0.1:8080/callback
GEMINI_API_KEY=your_gemini_api_key
# optional
DEMO_MODE=false
GEMINI_MODEL=gemini-2.5-flash
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173For the frontend, create frontend/.env if the backend is not running on the default local URL:
VITE_API_URL=http://127.0.0.1:8000Install backend dependencies:
pip install -r requirements.txtStart the backend:
uvicorn server:app --host 127.0.0.1 --port 8000 --reloadInstall frontend dependencies:
cd frontend
npm installStart the frontend:
npm run devOpen the Vite URL shown in the terminal.
Health check:
GET /healthGenerate a roast:
GET /roast-me?time_range=long_term&style=elitistSupported time_range values:
short_termmedium_termlong_term
Supported style values:
elitistcondescendingboomer
The backend falls back to mock artists, tracks, and roasts when credentials are missing or DEMO_MODE=true.
That makes the UI testable without connecting a real Spotify account.
- Set
VITE_API_URLto the deployed backend URL. - Set
CORS_ORIGINSto the deployed frontend URL instead of*. - Run the backend without
--reload. - Keep
.envout of git. - Make sure the Spotify redirect URI matches the environment you are using.
Example backend command for a host that provides $PORT:
uvicorn server:app --host 0.0.0.0 --port $PORTBuild the frontend:
cd frontend
npm run buildFrontend:
cd frontend
npm run lint
npm run buildBackend smoke check:
DEMO_MODE=true python3 -c 'from fastapi.testclient import TestClient; from server import app; c=TestClient(app); print(c.get("/health").json())'