A public full stack FastAPI starter with app-owned auth, RBAC, React, Vite,
SQLModel, Alembic, optional Redis, password recovery, and frontend serving through
FastAPI's app.frontend().
- FastAPI for the backend API.
- SQLModel and Alembic for database models and migrations.
- Cookie JWT sessions, CSRF protection, password hashing, and token revocation.
- Role and permission based authorization for users, admins, and items.
- Optional SMTP password recovery.
- Optional Redis login rate limiting through
fastapi-redis-sdkthat never blocks core app flows.
- React for the frontend.
- TypeScript, Vite, TanStack Router, TanStack Query, and Tailwind CSS.
- shadcn-style owned components and FastAPI template inspired UI.
- Generated OpenAPI TypeScript client.
- Playwright end-to-end tests.
- Dark mode support.
- PostgreSQL for application data.
- Docker Compose for local dependency services only.
- Committed
dist/output served byapp.frontend().
Use this project as a starting point for a new FastAPI full stack app.
On GitHub, select Use this template and create a new repository from it. Then clone your new repository locally.
With the GitHub CLI:
gh repo create my-fastapi-app --template mantle-bearer/fullstack-fastapi-template --clone
cd my-fastapi-appReplace mantle-bearer/fullstack-fastapi-template with the published repository path.
Use degit when you want a clean project directory without Git history:
npx degit mantle-bearer/fullstack-fastapi-template my-fastapi-app
cd my-fastapi-appUse a tagged version for reproducible starts:
npx degit mantle-bearer/fullstack-fastapi-template#v0.1.0 my-fastapi-app
cd my-fastapi-appUse Copier when you want prompted project settings:
uvx copier copy gh:mantle-bearer/fullstack-fastapi-template my-fastapi-app
cd my-fastapi-appFor a tagged version:
uvx copier copy gh:mantle-bearer/fullstack-fastapi-template --vcs-ref v0.1.0 my-fastapi-app
cd my-fastapi-appClone directly if you want this repository's Git history:
git clone https://github.com/mantle-bearer/fullstack-fastapi-template.git my-fastapi-app
cd my-fastapi-appmacOS:
brew install python node pnpm just
curl -LsSf https://astral.sh/uv/install.sh | shLinux:
curl -LsSf https://astral.sh/uv/install.sh | sh
corepack enable
corepack prepare pnpm@latest --activateInstall Python, Node.js, Docker, and just with your distribution's package manager.
Windows PowerShell:
winget install Python.Python.3.12
winget install OpenJS.NodeJS.LTS
winget install Docker.DockerDesktop
winget install Casey.Just
irm https://astral.sh/uv/install.ps1 | iex
corepack enable
corepack prepare pnpm@latest --activateIf uv is installed but not available as uv on Windows, use python -m uv
for the Python commands below.
Copy the example environment file and update it for your project:
cp .env.example .envOn Windows PowerShell:
Copy-Item .env.example .envBefore production, change at least:
DATABASE_URLJWT_SECRETENVIRONMENTCOOKIE_SECUREPUBLIC_BASE_URLCORS_ORIGINS
Generate a secret key with:
python -c "import secrets; print(secrets.token_urlsafe(32))"Start local dependency services:
docker compose up -dInstall dependencies and seed demo users:
uv sync --all-groups
pnpm --dir frontend install
uv run app seed-localRun the FastAPI app:
uv run fastapi devThen open http://127.0.0.1:8000.
Demo users:
admin@example.com/ChangeMe123!user@example.com/ChangeMe123!
For frontend-only development with Vite live reload:
pnpm --dir frontend devCommon commands:
just test
just check
just build
pnpm --dir frontend test:e2eRegenerate the OpenAPI client after backend API changes:
just client-generateBackend docs: backend/README.md.
Frontend docs: frontend/README.md.
Auth and RBAC docs: docs/auth-rbac.md.
Integrations docs: docs/integrations.md.
Publishing checklist: docs/publishing.md.
This app can deploy to FastAPI Cloud from the repository root:
uv run fastapi deployThe committed dist/ directory is intentional so the frontend can be served by
FastAPI through app.frontend() without a separate frontend build service.
PostgreSQL is required in production. SQLite is local-only and will be rejected
when ENVIRONMENT=production.
It is still a normal FastAPI app, so you can adapt it for other platforms that can run Python and connect to PostgreSQL.
FastAPI Cloud checklist: docs/fastapi-cloud.md.
Before publishing your own template:
- Replace
mantle-bearer/fullstack-fastapi-templateplaceholders. - Confirm
.envand.fastapicloud/are not tracked. - Rebuild
dist/withjust build. - Run
just check,just test, andjust dist-check. - Confirm screenshots in
img/match your app. - Tag the first release, for example
v0.1.0.
Install current library skills:
uv tool run library-skills --all --yesRun advisory skill checks:
just skills-checkCommit messages in this project must be at most 10 words.
This template is licensed under the terms of the MIT license.






