How tiangolo/full-stack-fastapi-template works
This is a full-stack FastAPI dashboard template: users sign in or register, then manage their profile, users, and items through a React application backed by a PostgreSQL API. Backend routes validate requests, enforce JWT-based identity and permissions, and use CRUD/model layers for persistence; account flows also support email. The README documents password recovery, dark mode, and email templates. Some frontend route-to-client and recovery wiring is not shown in the sampled source, so those links are documented or marked unverified rather than inferred from imports.
Main entry points: crud.py Data operations · client.gen.ts Generated API client · main.py API router · deps.py Auth and sessions
Components 23
React dashboard
- React application
frontend/src/main.tsx - Sign-in and signup
frontend/src/routes - Dashboard views
frontend/src/routes/_layout - Admin user tools
frontend/src/components/Admin - Item tools
frontend/src/components/Items - Account settings
frontend/src/components/UserSettings - Generated API client
frontend/src/client/client/client.gen.ts
FastAPI API
- API application
backend/app/main.py - API router
backend/app/api/main.py - Login and recovery
backend/app/api/routes/login.py - User endpoints
backend/app/api/routes/users.py - Item endpoints
backend/app/api/routes/items.py - Private utilities
backend/app/api/routes/private.py
Identity and data
- Auth and sessions
backend/app/api/deps.py - Data operations
backend/app/crud.py - User and item models
backend/app/models.py - JWT and passwords
backend/app/core/security.py - Runtime configuration
backend/app/core/config.py
Email capabilities
- Email and tokens
backend/app/utils.py - New-account template
packages/react-email/emails/new_account.tsx
Other components
- Dashboard user
- PostgreSQL
- SMTP mail service
Connections 35
- Dashboard user → React application: uses
README.md - React application → Generated API client: configures
frontend/src/main.tsx - React application → Sign-in and signup: routes
- React application → Dashboard views: routes
- Sign-in and signup → Generated API client: requests
- Dashboard views → Admin user tools: renders
- Dashboard views → Item tools: renders
- Dashboard views → Account settings: renders
- Admin user tools → Generated API client: requests
- Item tools → Generated API client: requests
- Account settings → Generated API client: requests
- Generated API client → API application: calls API
README.md - API application → API router: mounts
backend/app/main.py - API router → Login and recovery: registers
backend/app/api/main.py - API router → User endpoints: registers
backend/app/api/main.py - API router → Item endpoints: registers
backend/app/api/main.py - API router → Private utilities: registers
backend/app/api/main.py - Login and recovery → Data operations: authenticates
backend/app/api/routes/login.py - User endpoints → Data operations: uses
backend/app/api/routes/users.py - Item endpoints → Data operations: uses
backend/app/api/routes/items.py - Login and recovery → Auth and sessions: requires
backend/app/api/routes/login.py - User endpoints → Auth and sessions: requires
backend/app/api/routes/users.py - Item endpoints → Auth and sessions: requires
backend/app/api/routes/items.py - Auth and sessions → JWT and passwords: validates JWT
backend/app/api/deps.py - Data operations → JWT and passwords: hashes passwords
backend/app/crud.py - Data operations → User and item models: uses models
backend/app/crud.py - Auth and sessions → PostgreSQL: opens sessions
backend/app/api/deps.py - Data operations → PostgreSQL: reads and writes
- API application → Runtime configuration: loads settings
backend/app/main.py - Email and tokens → Runtime configuration: reads settings
backend/app/utils.py - Login and recovery → Email and tokens: sends recovery email
backend/app/api/routes/login.py - User endpoints → Email and tokens: sends account email
backend/app/api/routes/users.py - Email and tokens → SMTP mail service: sends email
backend/app/utils.py - New-account template → SMTP mail service: formats email
README.md - Dashboard user → SMTP mail service: receives recovery
README.md