High-Level Architecture
Ticku is a single Next.js application serving both the Teams tab and the standalone web app, backed by a typed tRPC API and PostgreSQL via Prisma. It is a shared multi-tenant platform — one deployment serves many tenants, isolated by a tenant-scoped data layer (see Multi-Tenancy).
Key Design Points
- One codebase, two front doors. The same UI serves Teams (tab) and web; only the auth entry differs.
- Three auth paths, one resolver. Every request resolves to the same user context — Teams JWT, Azure SSO JWT, or a session cookie — and then to an active tenant from the user's memberships. Details in Authentication.
- Structural tenant isolation. Tenant-model queries go through a tenant-scoped Prisma client that injects
tenantId; a CI guard fails the build if any query bypasses it. See Multi-Tenancy and Security & RBAC. - Feature-based server layout. Each feature (
tickets,tasks,worklog,analytics,master-calendar, …) is a self-contained tRPC router + repository undersrc/server/features/; routers stay thin. - Typed end-to-end. tRPC gives the client compile-time knowledge of every API procedure.
- Mock mode. A development flag swaps repositories for in-memory mock data, bypassing auth and the database entirely — useful for demos.