web-app Template
A fullstack template combining Next.js frontend with FastAPI backend for building interactive applications, dashboards, and SaaS products.Quick Start
http://localhost:3000 for the frontend and http://localhost:8080/docs for the API docs.
Specifications
Project Structure
Frontend
API Client
React Components
Backend
The backend follows the same structure asbackend-service:
Database
Enable SQLite persistence:Shared Types
Keep frontend and backend types in sync:Authentication
Enable Better Auth integration:Generate Secret
Protected Routes
Auth Hooks
Local Development
- Frontend at
http://localhost:3000 - Backend at
http://localhost:8080
/api/* requests to the backend.
Deployment
Use Cases
Dashboard
Analytics dashboards with real-time data
SaaS App
Multi-tenant applications with auth
Admin Panel
Internal tools and admin interfaces
Portal
Customer portals with account management
Best Practices
Keep types in sync
Keep types in sync
When you change a backend model, update the frontend types too.
Use Server Components
Use Server Components
Fetch data in Server Components when possible for better performance.
Separate concerns
Separate concerns
Frontend handles UI, backend handles data and business logic.
Test both layers
Test both layers
Write tests for both frontend components and backend APIs.