This file provides guidance for Claude Code when working with this repository.
Run once after cloning:
make setupThis copies .claude/settings.template.json → .claude/settings.local.json. Then run /mcp inside Claude Code to authenticate with Supabase via browser (one-time OAuth).
This project has Supabase MCP configured (.mcp.json). Use it for database-related tasks:
- Exploring schema, tables, and data
- Running SQL queries against the production database
- Inspecting Edge Function logs and configurations
- Reviewing migrations and RLS policies
Prefer MCP tools over raw SQL commands when querying or inspecting the database.
For local Supabase (when running deno task start), the MCP endpoint is http://localhost:54321/mcp.
Local Supabase is NOT required for most frontend work. The web app can connect directly to the production Supabase API in read-only mode, which is sufficient for the majority of frontend development and testing.
When to run local Supabase:
- Modifying database schema (migrations)
- Working on Edge Functions
- Testing CRON jobs
- Making write operations to the database
For frontend-only work: Just run deno task dev from src/web/ - it will use the production API configured in .env.
A personal music tracking application that syncs listening history from Last.fm to a PostgreSQL database via Supabase. It includes a React web frontend to visualize the data.
Deno monorepo with three workspaces:
src/shared/- Shared TypeScript types and database clientsrc/web/- React + Vite frontend with i18n (Lingui)supabase/functions/- Edge Functions for Last.fm API sync
Backend: Supabase (PostgreSQL, Edge Functions, CRON jobs) Frontend: React 19, Vite 7, TanStack Query, Tailwind-style CSS
# Start local Supabase (requires Docker)
deno task start
# Stop local Supabase
deno task down
# Run Edge Functions locally
deno task serve
# Run tests
deno task tests
# Format code
deno task format
# Lint code
deno task lint
# Generate TypeScript types from database
deno task update-types-local # from local DB
deno task update-types-linked # from linked project
# Create new migration
deno task migration <name>
# Apply migrations
deno task migrate# Development server
deno task dev
# Production build
deno task build
# Extract i18n strings
deno task extract
# Compile i18n translations
deno task compile├── src/
│ ├── shared/ # Shared types (db.types.ts) and DB client
│ └── web/ # React frontend
│ └── src/
│ ├── data/ # API queries and hooks
│ ├── i18n/ # Lingui translations
│ ├── lib/ # Utilities (supabase client, dates)
│ ├── ui/ # UI components
│ └── view/ # Page views
├── supabase/
│ ├── functions/ # Edge Functions
│ │ ├── _shared/ # Shared utilities, DB helpers, Last.fm client
│ │ ├── lastfm-library-artists/
│ │ └── lastfm-user-recent-tracks/
│ └── migrations/ # SQL migrations
└── .docs/ # Project documentation
deno.json- Root workspace config with all taskssrc/web/deno.json- Web app dependencies and taskssrc/shared/db.types.ts- Auto-generated database typessupabase/functions/_shared/- Shared Edge Function codecron_jobs.sql- CRON job definitions for scheduled syncs
Two main functions that sync data from Last.fm:
lastfm-user-recent-tracks- Syncs recently played tracks (runs every 5 min via CRON)lastfm-library-artists- Syncs artist library data
Required in .env or Supabase secrets:
SUPABASE_URL/SUPABASE_ANON_KEY- Supabase connectionLASTFM_API_KEY- Last.fm API keySENTRY_DSN- Sentry error tracking (optional)
- Deno formatting: 2-space indent, double quotes, semicolons
- Run
deno task formatbefore committing - Run
deno task lintto check for issues
When creating new files, always stage them with git add <file> after creating them.