GitHunt
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.

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 sync in backend to init backend dependencies.
  • Run pnpm install in web to init frontend dependencies.
  • Run sh scripts/generate-client.sh to generate API types and client code.

Languages

TypeScript81.5%Python14.0%HTML2.8%CSS0.8%Shell0.4%Dockerfile0.3%Mako0.1%JavaScript0.1%Jinja0.0%
MIT License
Created July 13, 2025
Updated July 14, 2025