A personal Spotify dashboard that shows your last 50 recently played tracks and your top tracks/artists. Built with Next.js, Neon Postgres, Better Auth (Spotify OAuth), and Shadcn UI.
- Dashboard — Stats overview and recent tracks
- Leaderboard — Top tracks and artists (4 weeks, 6 months, all time)
- Recent History — Last 50 played tracks with search and CSV export
- Settings — Account info and sign out
- Next.js 15 (App Router)
- Better Auth (Spotify OAuth)
- Neon (serverless Postgres)
- Drizzle ORM
- Shadcn UI + Tailwind CSS
- Mintlify (user docs)
cd spotify-dashboard
npm install- Go to Spotify Developer Dashboard
- Create a new app
- Add redirect URI:
http://localhost:3000/api/auth/callback/spotify(and your production URL when deploying) - Copy Client ID and Client Secret
- Go to Neon Console
- Create a new project
- Copy the connection string
Copy .env.example to .env.local and fill in:
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=require
BETTER_AUTH_SECRET=your-32-character-or-longer-secret
BETTER_AUTH_URL=http://localhost:3000npm run db:migrateOr with Drizzle Studio for development:
npx drizzle-kit pushnpm run devOpen http://localhost:3000 and sign in with Spotify.
User-facing docs are in the docs/ folder (Mintlify format). To deploy them:
- Go to mintlify.com/start
- Connect your repo and point to the
docs/folder - Or run
mint devfrom the docs directory
- Push to GitHub and import to Vercel
- Add environment variables
- Set redirect URI in Spotify Dashboard:
https://your-domain.com/api/auth/callback/spotify - Run migrations against your Neon database (or use
drizzle-kit push)