🔌Backend ArchitectureComing Soon
tRPC API Layer
End-to-end type-safe API with procedures, middleware, and automatic type inference.
Video coming soon
Add a YouTube video ID to the topics config
Documentation
Overview
The API layer uses tRPC for end-to-end type safety between the Next.js frontend and the server. No REST endpoints, no manual type definitions — everything is inferred.
Procedure Types
| Type | Auth | Use Case |
|---|---|---|
publicProcedure | None | Public data (player list, explore lineups) |
protectedProcedure | Logged in | User actions (create lineup, rate, comment) |
adminProcedure | Admin role | Admin actions (manage players, view stats) |
Middleware Stack
- Timing middleware — logs procedure execution time
- Auth middleware — validates session and injects typed context
- Admin middleware — checks
session.user.adminflag
Router Organization
Each domain has its own router file registered in the root router:
player, lineup, profile, follow, feedback, requestedPlayer, admin, video
Technical Details
<!-- Add details about error handling patterns, input validation with Zod, etc. -->Content coming soon — add your video and detailed writeup here.