Busabase
Busabase is an open-source (MIT) database and workspace for AI agents — data, docs, skills, and apps in one place. Run it locally, self-host it inside your network, or use Busabase Cloud, and turn age
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
A multi-tenant fitness analytics platform where every user's training data is isolated
at the database layer — workout logging, bodyweight and calorie tracking, dashboard
trends, and an AI insights chat, for lifters who want low-friction tracking they can
trust with their data.
Not yet captured. These are the shots that would explain Trainlytics fastest.
Drop each file at the path shown and uncomment the matching line.檢視完整 README ↗A multi-tenant fitness analytics platform where every user's training data is isolated at the database layer — workout logging, bodyweight and calorie tracking, dashboard trends, and an AI insights chat, for lifters who want low-friction tracking they can trust with their data.
Live demo → trainlytics-two.vercel.app
Not yet captured. These are the shots that would explain Trainlytics fastest. Drop each file at the path shown and uncomment the matching line.
| Screenshot | Path | Why it matters |
|---|---|---|
| The dashboard with strength, muscle-group, and energy-balance charts | docs/screenshots/dashboard.png | The analytics surface — the reason the project exists |
| The workout logger mid-session, with a split selected and sets entered | docs/screenshots/workout-logger.png | Shows the core logging loop and per-user exercise management |
| The AI insights chat answering a question about recent training | docs/screenshots/insights-ai.png | Shows the LLM layer grounded in the user's own workout history |
exercises, workout_sessions, workout_sets, bodyweight_logs, calories_logs,
profiles) has RLS enabled with separate owner policies for select, insert, update,
and delete. db/audit/rls_policy_audit.sql re-verifies that coverage against the live
database, so isolation is auditable rather than assumed.proxy.ts classifies every request as public or
protected, checks the Supabase session, and enforces session timeout before a page
renders — so a new page cannot accidentally ship unguarded./api/insights-ai caps request bodies at 24 KB,
truncates chat history to the last six messages, and aborts the provider call on a
bounded, configurable timeout, so a slow or hostile request cannot hang the route.db/plan.json plus
npm run db:check-plan runs on every build, which catches schema drift before deploy.Trainlytics is built for lifters who want low-friction tracking and trustworthy data isolation.
push, pull, legs, core)xlsx, jspdf, jspdf-autotable for workout exportsnpm install
npm run dev
App URL: http://localhost:3000
Create .env.local:
# Required
NEXT_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY=YOUR_SUPABASE_SERVICE_ROLE_KEY
# Optional (Insights AI chat only)
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
OPENAI_MODEL=gpt-4o-mini
OPENAI_BASE_URL=https://api.openai.com/v1
SUPABASE_SERVICE_ROLE_KEY in browser/client code.NEXT_PUBLIC_SUPABASE_ANON_KEY must be your anon key, not service role.Core directories:
app/ routes and API endpointsfeatures/ feature modules (UI + domain logic)lib/ shared services/utilities (auth, routes, monitoring, helpers)db/ schema, migrations, audits, migration planscripts/db/ DB plan runner + validatore2e/ Playwright suiteflowchart LR
U[User Browser] --> N[Next.js App Router]
N --> P[proxy.ts Route Guard]
P -->|Public| A[Auth Pages<br/>/login /signup /forgot-password]
P -->|Protected| F[Feature Pages<br/>dashboard/log/bodyweight/calories/profile/insights]
A --> SC[lib/supabaseClient]
F --> SC
SC --> SA[(Supabase Auth)]
SC --> SD[(Supabase Postgres + RLS)]
SC --> SS[(Supabase Storage)]
F --> API2["/api/insights-ai"]
API2 --> OAI[(OpenAI API)]
N --> MON["/api/monitoring/error"]
A --> MON
F --> MON
proxy.ts, enforcing public/protected route access.lib/supabaseClient for auth/session and scoped data./api/monitoring/error.Every command below is a script in package.json.
npm run lint # ESLint
npm run typecheck # tsc --noEmit
npm run test # Vitest unit tests
npm run test:coverage # Vitest with coverage
npm run check # lint + typecheck + coverage, in one pass
npm run db:check-plan # validate the migration plan (also runs in CI)
npm run db:migrate # apply the migration plan
npm run e2e:install # one-time: install the Chromium build Playwright uses
npm run e2e # Playwright suite over the auth-critical flows
CI runs lint, typecheck, unit tests with coverage, a production build, the DB plan check, and the Playwright auth suite on every pull request.
Deployed and actively maintained. Running in production on Vercel with Supabase as the auth and data layer; a scheduled workflow polls the deployment for uptime. Built as a portfolio project rather than a commercial product.
MIT — see LICENSE.