Imported from billalben/teamora (
AGENTS.md). Install upstream withnpx skills add billalben/teamora. Copyright stays with the author.
AGENTS.md
Quick commands
pnpm dev # start dev server
pnpm build # production build (also typechecks)
pnpm lint # eslint
pnpm format # prettier on all files
pnpm knip # dead-code / unused-dependency check
pnpm knip:md # knip output to markdown
- No
pnpm typecheckscript. TypeScript is validated at build time by Next.js (pnpm build). If you need standalone typechecking, runnpx tsc --noEmit. - No test suite. There are no test files, no Jest/Vitest config, and no
testscript in this repo.
Package manager
Always use pnpm. The lockfile is pnpm-lock.yaml.
Architecture
oRPC API layer (not REST or tRPC)
All backend procedures live under app/router/. The router tree is composed in app/router/index.ts and served via the catch-all handler at app/rpc/[[...rest]]/route.ts.
- Server-side client: initialized in
lib/orpc.server.ts(imported byinstrumentation.tsandapp/layout.tsxfor pre-rendering). Provides a global$clientfor SSR fetching. - Client-side client:
lib/orpc.tscreates an oRPC link to/rpc(browser only) and exportsorpc(TanStack Query utils) for use in components. - Middlewares: defined in
app/middlewares/usingosfrom@orpc/server. Thebasemiddleware defines standard error types. Auth (auth.ts) validates Kinde sessions; workspace (workspace.ts) validates Kinde org membership.
Auth (Kinde)
Kinde manages authentication and organizations. Kinde organizations are used as workspaces — workspace IDs are Kinde org IDs.
proxy.ts(Next.js 16 proxy-based middleware) wraps all non-static routes through Arcjet bot detection and Kinde auth./and/api/uploadthingare marked as public paths.- The route group
(dashboard)is behind auth;(marketing)is public.
Generated code
- Prisma client outputs to
lib/generated/prisma/(notnode_modules/.prisma/client). Imported as@/lib/generated/prisma/clientinlib/prisma.ts. - Run
npx prisma generateto regenerate after schema changes, thennpx prisma migrate devfor migrations.
Database
PostgreSQL via @prisma/adapter-pg with DATABASE_URL from env. No connection pooling library — uses the pg driver directly through Prisma's adapter.
File uploads
UploadThing handles file uploads. The router is defined in app/api/uploadthing/core.ts. The utapi instance (lib/uploadthing-server.ts) is used for server-side operations like deletion. /api/uploadthing is excluded from Arcjet/Kinde middleware.
TanStack Query
Custom query client (lib/query/client.ts) uses oRPC's StandardRPCJsonSerializer for proper serialization of BigInt, Map, Set, etc. Server-side hydration uses the cached getQueryClient from lib/query/hydration.tsx.
Git conventions
- Commit messages: conventional commits enforced via
commitlint(huskycommit-msghook). - Pre-commit:
lint-stagedrunseslinton.ts/.tsx/.js/.jsxfiles andprettier --writeon a broader set of file types. - Prettier: double quotes (
singleQuote: false), semicolons,printWidth: 120,trailingComma: "es5".
UI
shadcn/ui (New York style) with components.json. Components live in components/ui/. The @/* alias maps to the project root.