尚未检测到更新。GitHub 发布版本后会显示在这里。
Skill development app for coaches and members
翻译准备中
正在加载完整 README。
查看完整 README ↗A mobile-first PWA for a martial arts club (BJJ, wrestling, MMA, ~300 members). The UI is in Swedish; code and docs are in English.
Conventions, scope and domain rules live in CLAUDE.md; the visual design in DESIGN.md. Read both before changing things.
Next.js (App Router, TypeScript strict) · Supabase (Postgres, Auth, Row Level Security) · Tailwind CSS · Vitest · hosted on Vercel.
anon role in RLS). The site is noindex.has_role(...). Server
Actions check the role as well, but RLS is what actually protects the data.localStorage). It's lost if they clear site data or switch phone, and they
simply pick the date again. No member data is stored on the server.Requires Node.js 22+.
npm install
cp .env.example .env.local
Never commit .env.local. No secret/service-role key is needed.npx supabase login
npx supabase link --project-ref <your-project-ref>
npm run db:push
With Docker installed you can instead run a local database with
npm run db:start and npm run db:reset (re-creates it from the migrations).npm run dev
pending is
created automatically.update profiles set role = 'admin', status = 'active'
where email = '[email protected]';
This is allowed because the protect_profile_role_status trigger only blocks
logged-in non-admins, and in the SQL editor there is no logged-in user
(auth.uid() is null).After that, new coaches are added the same way (step 1), then activated and given a role in the app under /admin/konton.
| Script | What it does |
|---|---|
npm run dev | Dev server |
npm run build / start | Production build / run it |
npm test | Vitest, once (test:watch to keep running) |
npm run typecheck | TypeScript check, no output files |
npm run lint | ESLint |
npm run db:push | Apply new migrations to the linked Supabase project |
npm run db:types | Regenerate src/lib/supabase/types.ts from the linked project |
npm run db:start / db:stop / db:reset | Local Supabase (needs Docker) |
All schema changes go in a new file in supabase/migrations/, never in the
dashboard and never by editing an old migration. Then:
npm run db:push # apply it
npm run db:types # regenerate the TypeScript types
db:types reads the linked (hosted) project, so push the migration first.
Because production builds from main, push a migration before merging code that
depends on it. Keep migrations additive so the live code keeps working meanwhile.
Vercel builds production from main and a preview for every other branch.
The Vercel project needs two environment variables, the same as .env.local:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY (the publishable key)Test a branch on its preview URL (on a phone) before merging it.