Skip to content

ddahan/fast-batteries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔋 Fast Batteries 🔋

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.

🧰 General Features

  • 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.)

🧑‍💻 Developer Experience

  • 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

🔧 Configuration

  • 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 & Database

🚀 Deployment & Monitoring

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

🧪 Tests

🎨 Front-end

  • 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

Demo

You can try it here. E-mails will be sent for real, unless my free daily quota is reached.

Documentation

Check the /doc folder for various information.

Contributions

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)

Public Roadmap

View it here

FAQ / Philosophy

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.

Screenshots

List Badges New Badge Create Account

About me

I'm David, 36, living in Paris. Learn more about me on my website

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published