Skip to content

GeorgeCaoJ/fastapi-nextjs-template

 
 

Repository files navigation

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.

About

Full stack, modern web application template. Using FastAPI, Next.js, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 81.5%
  • Python 14.0%
  • HTML 2.8%
  • CSS 0.8%
  • Shell 0.4%
  • Dockerfile 0.3%
  • Other 0.2%