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
Multi-tenant fitness analytics platform with PostgreSQL row-level security, Supabase auth, Recharts dashboards, and an AI insights layer. Next.js, TypeScript, Tailwind, GitHub Actions CI.
DataTypeScript · PLpgSQLGitHub @bibeshpyakurelOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
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.Read the full 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.