A modern and opinionated Full-Stack FastAPI template to kickstart a mid-sized project with built-in additional features (batteries).
The philosophy slightly differs from other templates, as it avoids relying on small external packages. This approach gives users full control over their code and reduces potential maintenance issues, especially with single-author, small-scale packages.
A small portion of these features are demonstrated in a front-end demo (built with Nuxt 3) showcasing CRUD management and a signup/login workflow.
- OAuth2 / JWT Authentication
- Social login (with LinkedIn's complete workflow)
- Query features: pagination, ordering, and filtering
- Email templates using MJML, and VS Code extension for HTML generation
- Background tasks with Celery/Beat, inclusding in-database scheduled tasks
- S3-compatible file uploads with MinIO
- Miscellaneous utilities, fields, schemas, functions, model mixins (timezone, timestamp, price, percentage, phone numbers, etc.)
- VS Code support for testing, debugging, tasks, and extensions
- VS Code devcontainers for a fully isolated and reproducible development environment
- Ruff for linting and formatting
- Additional management scripts (interactive shell, database reset, superuser creation, ...)
- Package management with Poetry
- Extensive comments and documentation to help with code modifications
- Strictly typed (Python 3.13 syntax) using Pyright
- 12-factors compliant, with strict separation of config and code
- 3 levels of settings configuration: code-level, environment-level, and database-level
- Custom exception classes and exception handler (errors are categorized to ease display in front-end)
- Sync-first design, prioritizing ease of use over performance
- ORM: SQLAlchemy 2.0 (without SQLModel)
- Migrations: Alembic
- DBMS: PostgreSQL
- A multi-purpose Redis store is available too (currently used as a Celery Broker)
- Production-ready hosting with Docker compose (the demo is deployed with Dokploy)
- All-in-one Observability with Pydantic Logfire: logs, errors, metrics, alerts, SQL introspection, and background task results. Can be used as well in local environment to debug.
- pgAdmin for database management.
- Loguru for simple and clean logs.
- CI with Github actions.
- Batteries are tested with Pytest (150+ tests)
- Factories with factory_boy for test data generation
- E2E test example with Playwright
- Demos: CRUD (including pagination/ordering/filtering) + login/signup workflow
- Made with Nuxt (Vue.js) and NuxtUI (uses Tailwind CSS)
- Dark mode support
- Typescript interfaces and schemas auto-generation with OpenAPI TypeScript
You can try it here. E-mails will be sent for real, unless my free daily quota is reached.
Check the /doc
folder for various information.
I need help improving this template over time. Issues and PRs are very welcome. Here’s how you can contribute:
- Make the current features more robust (fix mistakes, improve functionality, add use cases and tests, etc.)
- Help develop new features (see the roadmap)
View it here
For battery 'X', why not use an external package?
My goal is to rely only on well-maintained, widely-used, and well-documented libraries such as SQLAlchemy or Pydantic. For smaller or more specialized functionalities, I prefer a 'DIY' approach, building and extending code myself. This ensures full ownership and flexibility over the implementation. In the long term, I aim to avoid the risk of creating a patchwork of numerous small packages with poor external maintenance, which can compromise the project's sustainability as it grows.
Battery 'X' is incomplete
I chose basic solutions over fully-featured implementations to make the template easier to understand. However, the code is yours, and you can extend it as needed. If you believe a missing feature is critical, feel free to open a PR or an issue.
Why is this template so opinionated / does not support 'X' ?
I don’t have the time or skills to support every IDE, database, ORM, or older Python version. Offering too many options would also introduce unnecessary complexity. If you don’t use VS Code, you should probably avoid using this template directly.
There is a coupling between some batteries
Batteries are often interconnected because it makes sense when not building an external packages.
Why choose Nuxt instead of Vue.js?
Nuxt is not used here for its SSR abilities. However, Nuxt helps a lot to make the front-end stack all-batteries-included, especially thanks to Nuxt UI package. As the purpose of this template is not a front-end showcase, this should make sense here.
I'm David, 36, living in Paris. Learn more about me on my website