GE
GeorgeCaoJ/fastapi-nextjs-template
Full stack, modern web application template. Using FastAPI, Next.js, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
Full Stack FastAPI + Next.js Template
This project offers a well-structured template for developing full stack applications using FastAPI and Next.js, with directory-based cursor rules for clear organization.
- Backend: See the official template repository for backend implementation details.
- Web: The web interface is generated using V0.
Technology Stack and Features
- โก FastAPI for the Python backend API.
- ๐งฐ SQLModel for the Python SQL database interactions (ORM).
- ๐ Pydantic, used by FastAPI, for the data validation and settings management.
- ๐พ PostgreSQL as the SQL database.
- ๐ Next.js for the web frontend.
- ๐จ Shadcn UI for the UI component library, providing accessible, customizable, and modern React components styled with Tailwind CSS.
- ๐ Orval for generating a fully-typed API client from OpenAPI specs, enabling seamless and type-safe communication between the frontend and backend.
- ๐๏ธ Zustand for simple, scalable, and fast state management in React, used to manage authentication and other global app state.
- ๐ Docker Compose for development and production.
- ๐ Secure password hashing by default.
- ๐ JWT (JSON Web Token) authentication.
- ๐ซ Email based password recovery.
- โ Tests with Pytest.
- ๐ Traefik as a reverse proxy / load balancer.
- ๐ข Deployment instructions using Docker Compose, including how to set up a frontend Traefik proxy to handle automatic HTTPS certificates.
- ๐ญ CI (continuous integration) and CD (continuous deployment) based on GitHub Actions.
How to use
Local development
- Clone the repository
- Run
uv syncin backend to init backend dependencies. - Run
pnpm installin web to init frontend dependencies. - Run
sh scripts/generate-client.shto generate API types and client code.