Mobile-first web app to view guitar chord sheets with local auto-scroll, Ultimate Guitar import, and Turso (SQLite) storage.
- Copy
.env.templateto.env.localand fill in Turso credentials. - Apply the database schema to your Turso database:
npm run db:pushAlternatively, use generated SQL under drizzle/ with your preferred migration workflow.
- Install dependencies and run the dev server:
npm install
npm run devOpen http://localhost:3000.
| Script | Description |
|---|---|
npm run dev |
Start Next.js (Turbopack) |
npm run build |
Production build |
npm run db:push |
Push Drizzle schema to DB |
npm run db:generate |
Generate SQL migrations |
npm run db:studio |
Drizzle Studio |
Set the same environment variables in the Vercel project. API routes that scrape Ultimate Guitar use the Node.js runtime (export const runtime = "nodejs").
Required env vars in production:
TURSO_DATABASE_URLTURSO_AUTH_TOKENEXTENSION_IMPORT_TOKEN(required if you use the Chrome extension importer)
Work through this in order:
- Diagnostics URL (no database required)
Open
https://YOUR_PROJECT.vercel.app/api/health(use your real deployment domain).- If this is also 404: the deployment is not running Next.js correctly. Fix project settings (below) and redeploy — the app code is not being served.
- If you get JSON with
"ok": true: routing works; continue with env vars / Turso if/shows an error banner.
- Project → Settings → General → Framework Preset must be Next.js, not “Other” or a static preset.
- Project → Settings → Build & Development → Output Directory must be empty for Next.js. Do not set it to
.nextoroutunless you really know you need it; wrong values often produce a global 404. - Root Directory should be empty (repo root) unless the app lives in a subfolder.
- Open the URL from the latest successful deployment on the Deployments tab (avoid old preview URLs with a long hash if that deployment was removed).
- After changing framework or output settings, trigger a Redeploy (optionally “Clear cache and redeploy”).
- If it still fails, create a new Vercel project from the same Git repo (Framework: Next.js, root empty, output empty) so no stale overrides remain.
Add TURSO_DATABASE_URL and TURSO_AUTH_TOKEN (if your Turso database requires it) under Environment Variables for Production, then redeploy. From your machine, run npm run db:push with the same URL/token so the songs / song_contents tables exist.
The GET /api/health response includes safe booleans (hasTursoUrl, hasExtensionImportToken, etc.) so you can confirm variables are visible to the deployment without pasting secrets.
This repository includes a Chrome MV3 extension under extension/ that exports the currently open Ultimate Guitar song to your app.
- Set
EXTENSION_IMPORT_TOKENin your app env vars. - Use endpoint:
POST /api/songs/import-extension - Send header:
x-extension-token: <EXTENSION_IMPORT_TOKEN>
- Open
chrome://extensions. - Enable Developer mode.
- Click Load unpacked.
- Select the
extension/folder from this repo.
Open the extension options page and set:
API Base URL(example:https://your-app.vercel.app)Extension Import Token(must match backend env var)
- Open any Ultimate Guitar tab page (
/tab/...URL). - Click the extension icon.
- Click Export current song.
- The popup reports whether the song was imported or already exists.
New songs imported through the Chrome extension now keep chord positions aligned to lyric words (Ultimate Guitar style).
If a song was imported before this feature, reimport it from the extension to get exact alignment data. Older records continue to render with the legacy chord-line fallback.
- Next.js 15 (App Router), TypeScript, Tailwind CSS, shadcn/ui
- Drizzle ORM + Turso (
@libsql/client) - Cheerio for server-side parsing