VercelLogotypeVercelLogotype
LoginSign Up
Back to Templates

Full stack FastAPI template with Next.js

Build full-stack apps with Next.js and FastAPI.

DeployView Demo
Contentful thumbnail for Full stack FastAPI template Next.js

Full stack FastAPI template Next.js

Next.js v16 fork of the official fastapi/full-stack-fastapi-template template. Server components, server actions, HttpOnly cookie auth, ShadcnUI with TailwindCSS v4, simplified local development environment and Docker production.

Demo

Docker: https://full-stack-fastapi-template-nextjs.arm1.nemanjamitic.com

Vercel: https://full-stack-fastapi-template-nextjs.vercel.app

Screenshot

Credits

  • The original repository: fastapi/full-stack-fastapi-template
  • Next.js client side rendered PR: https://github.com/fastapi/full-stack-fastapi-template/pull/1733
  • HttpOnly cookie PR: https://github.com/fastapi/full-stack-fastapi-template/pull/1606

Features

  • Next.js v16, server components
  • React Hook Form and server actions for forms
  • HttpOnly cookie auth, enables SSR
  • Hey Api with client-next
  • Suspense, error boundaries
  • Turborepo monorepo, TailwindCSS v4, ShadcnUI
  • Validated env vars with Zod
  • Simple local dev environment, simplified Docker production

Todo

  • Register page, Github login
  • Migrate Playwright tests
  • Unit tests with Vitest, Testing Library
  • Tag Docker images
  • API sort params
  • Support emails, Sentry from the original repo
  • no-monorepo branch
  • Runtime only env vars, reusable build
  • Env vars with alizeait/next-public-env
  • Versioning with changesets/changesets or semantic-release/semantic-release
  • API internationalization
  • Update Python
  • Open graph, SEO, analytics
  • Tailscale Github Actions
  • Integration tests frontend and backend
  • Deploy with Vercel

Installation and running

Docs: docs/running.md

Deploy to Vercel

If you want to deploy with Docker, use the main branch. If you want to deploy with Vercel, use the vercel-deploy branch.

# Docker
git checkout main
# Vercel
git checkout vercel-deploy

Similarly to how you need two separate containers to deploy the app with Docker, you also need two separate deployments in Vercel to deploy the frontend and backend. You will configure them to be aware of each other using SITE_URL and API_URL, which they use to communicate with each other.

You can deploy to Vercel either using "Vercel button" or Vercel CLI method.

Vercel button

Clicking the "Deploy" button above will take you to the Vercel deployment wizard. It will create a single GitHub repository and two separate Vercel projects, pointing to the /backend and /frontend/apps/web directories for the backend and frontend, respectively.

No environment variables will be set automatically, you will need to configure them manually after the wizard completes. During setup, you will be prompted to add the Neon integration for a Postgres database. Make sure to select the backend project as the integration target. Finally, you will need to run the database migrations and seed the newly provisioned database.

Vercel CLI

You can also deploy to Vercel from you local development environment using Vercel CLI.

Documentation

You can find more details about deploying using both "Vercel button" and Vercel CLI methods in the documentation linked bellow.

Frontend docs: docs/vercel-deployment-frontend.md

Backend docs: docs/vercel-deployment-backend.md

Routes

# Frontend
http://localhost:3000
https://full-stack-fastapi-template-nextjs.arm1.nemanjamitic.com
# Backend
http://localhost:8000/docs
https://api-full-stack-fastapi-template-nextjs.arm1.nemanjamitic.com/docs
# openapi.json
http://localhost:8000/api/v1/openapi.json
https://api-full-stack-fastapi-template-nextjs.arm1.nemanjamitic.com/api/v1/openapi.json

License

MIT license: License

GitHub Reponemanjam/full-stack-fastapi-template-nextjs
Use Cases
Starter
Stack
OtherNext.jsTailwind
Database
PostgresNeon

Get Started

  • Templates
  • Supported frameworks
  • Marketplace
  • Domains

Build

  • Next.js on Vercel
  • Turborepo
  • v0

Scale

  • Content delivery network
  • Fluid compute
  • CI/CD
  • Observability
  • AI GatewayNew
  • Vercel AgentNew

Secure

  • Platform security
  • Web Application Firewall
  • Bot management
  • BotID
  • SandboxNew

Resources

  • Pricing
  • Customers
  • Enterprise
  • Articles
  • Startups
  • Solution partners

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Community

Frameworks

  • Next.js
  • Nuxt
  • Svelte
  • Nitro
  • Turbo

SDKs

  • AI SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDK
  • Streamdown AINew

Use Cases

  • Composable commerce
  • Multi-tenant platforms
  • Web apps
  • Marketing sites
  • Platform engineers
  • Design engineers

Company

  • About
  • Careers
  • Help
  • Press
  • Legal
  • Privacy Policy

Community

  • Open source program
  • Events
  • Shipped on Vercel
  • GitHub
  • LinkedIn
  • X
  • YouTube

Loading status…

Select a display theme:
    • AI Cloud
      • v0

        Build applications with AI

      • AI SDK

        The AI Toolkit for TypeScript

      • AI Gateway

        One endpoint, all your models

      • Vercel Agent

        An agent that knows your stack

      • Sandbox

        AI workflows in live environments

    • Core Platform
      • CI/CD

        Helping teams ship 6× faster

      • Content Delivery

        Fast, scalable, and reliable

      • Fluid Compute

        Servers, in serverless form

      • Observability

        Trace every step

    • Security
      • Bot Management

        Scalable bot protection

      • BotID

        Invisible CAPTCHA

      • Platform Security

        DDoS Protection, Firewall

      • Web Application Firewall

        Granular, custom protection

    • Company
      • Customers

        Trusted by the best teams

      • Blog

        The latest posts and changes

      • Changelog

        See what shipped

      • Press

        Read the latest news

      • Events

        Join us at an event

    • Learn
      • Docs

        Vercel documentation

      • Academy

        Linear courses to level up

      • Knowledge Base

        Find help quickly

      • Community

        Join the conversation

    • Open Source
      • Next.js

        The native Next.js platform

      • Nuxt

        The progressive web framework

      • Svelte

        The web’s efficient UI framework

      • Turborepo

        Speed with Enterprise scale

    • Use Cases
      • AI Apps

        Deploy at the speed of AI

      • Composable Commerce

        Power storefronts that convert

      • Marketing Sites

        Launch campaigns fast

      • Multi-tenant Platforms

        Scale apps with one codebase

      • Web Apps

        Ship features, not infrastructure

    • Tools
      • Marketplace

        Extend and automate workflows

      • Templates

        Jumpstart app development

      • Partner Finder

        Get help from solution partners

    • Users
      • Platform Engineers

        Automate away repetition

      • Design Engineers

        Deploy for every idea

  • Enterprise
  • Pricing
Log InContact
Sign Up
Sign Up
Back to Templates
DeployView Demo
v0

Build applications with AI

AI SDK

The AI Toolkit for TypeScript

AI Gateway

One endpoint, all your models

Vercel Agent

An agent that knows your stack

Sandbox

AI workflows in live environments

CI/CD

Helping teams ship 6× faster

Content Delivery

Fast, scalable, and reliable

Fluid Compute

Servers, in serverless form

Observability

Trace every step

Bot Management

Scalable bot protection

BotID

Invisible CAPTCHA

Platform Security

DDoS Protection, Firewall

Web Application Firewall

Granular, custom protection

Customers

Trusted by the best teams

Blog

The latest posts and changes

Changelog

See what shipped

Press

Read the latest news

Events

Join us at an event

Docs

Vercel documentation

Academy

Linear courses to level up

Knowledge Base

Find help quickly

Community

Join the conversation

Next.js

The native Next.js platform

Nuxt

The progressive web framework

Svelte

The web’s efficient UI framework

Turborepo

Speed with Enterprise scale

AI Apps

Deploy at the speed of AI

Composable Commerce

Power storefronts that convert

Marketing Sites

Launch campaigns fast

Multi-tenant Platforms

Scale apps with one codebase

Web Apps

Ship features, not infrastructure

Marketplace

Extend and automate workflows

Templates

Jumpstart app development

Partner Finder

Get help from solution partners

Platform Engineers

Automate away repetition

Design Engineers

Deploy for every idea