Imported from AdityaBorkar/recruit-staff (
AGENTS.md). Install upstream withnpx skills add AdityaBorkar/recruit-staff. Copyright stays with the author.
AGENTS.md
Multi-tenant hospital/clinic app ("Healthcare Clinic") built on Bun + TanStack Start (file routes, SSR) + Vite 8 + Nitro (preset bun) + Tailwind v4 + oRPC, with domain logic supplied by the linked Aspen OS platform packages.
Commands
bun run dev— dev server on port 4020 (vite dev --port 4020)bun run check:types—tsc --noEmitbun run check:lint—biome check --fix .(auto-fixes; mutates files). Biome is the only formatter/linter — there is no eslint/prettier config.bun run build—vite build(Nitro outputs to.output)bun run test—vitest run(no test files exist yet; vitest config comes from vite.config.ts)bun run gen:routes—tsr generate; regeneratessrc/routeTree.gen.ts(*.gen.tsis gitignored; vite dev regenerates it automatically)bun run db:studio— Drizzle Studio viaaspen db-studio --config=./src/aspen/server.tsbun run update:deps—taze -w --maturity-period 3 && bun installbun run infra:up/preview/destroy -- <stack>— Pulumi;infra/index.tsboots Postgres (port 9050) and MinIO (ports 9000/9001) as Docker containers.
Architecture
- Aspen OS is a sibling repo (
/home/aditya/projects/aspen-os);@aspen-os/platform|management|organizationarelink:symlinks intonode_modules. Changes there take effect without reinstall, but theaspenCLI lives in platform's build output — after editing aspen packages, runbun run buildinpackages/platformor the CLI/bin may be stale. - Platform is configured in
src/aspen/server.ts(exportsp, anIsolatedTenantPlatformwired to auth/Postgres/S3) andsrc/aspen/client.ts(browser side). DB schema, auth, and storage live in Aspen OS, not this app. - oRPC is the RPC layer: server router in
src/rpc/router.ts, procedures insrc/rpc/procedures/, called viaorpcclient fromsrc/lib/orpc.ts. HTTP entry issrc/routes/api/rpc.$.ts(/api/rpc); auth entry issrc/routes/api/auth.$.ts. - Route tree:
/landing,/account/*(auth-free),/(tenant)/*guarded by abeforeLoadsession check + subdomain-based organization lookup insrc/routes/(tenant)/route.tsx. src/schemas/*hold zod/valibot schemas shared by procedures and forms.
Conventions & gotchas
- Env is validated at import by
src/env.ts(@t3-oss/env-core):DB_*,AUTH_SECRET,GOOGLE_*,STORAGE_*are required server-side. Missing vars crash on startup. All vars (including secrets) live in the gitignored.env.local; add any new var to bothsrc/env.tsand.env.local. src/components/ui/**are shadcn-generated and exempt from Biome lint (biome.jsonoverride) — don't hand-edit them; regenerate viashadcn.- Design tokens (stone palette + single cyan accent, fonts, radii) are defined in
src/styles.cssperDESIGN.md— keep new UI on those tokens, not ad-hoc colors. - Imports are auto-sorted by Biome (URL → node/bun → package → alias) — run
check:lintbefore finishing. biome.jsonenforces sorted Tailwind classes (useSortedClasses), double quotes, 2-space indent, 80-col width.- Commits must follow conventional-commit types (incl.
wip) via commitlint/husky;lint-stagedrunsbiome format --fixon commit. - The
aspenCLI binary resolves to@aspen-os/platform/.output/cli/index.js, sodb:studiorequires that package to be built. - Dockerfile runs every
gen:*script beforebun run buildand then copies/app/distand runsdist/server/index.mjs— note this conflicts withvite.config.tsoutDir: ".output"; verify before trusting the container image.