Getting started with a base project

Accelerate your next web development project with this FastAPI/Nuxt.js base project generator.

This project is a fork of Sebastián Ramírez's Full Stack FastAPI and PostgreSQL Base Project Generator. FastAPI is updated to version 0.109 (April 2024), SQLAlchemy to version 2.0.29 (March 2024), and the frontend to Nuxt 3.11 (April 2024).



What is it?

This FastAPI, PostgreSQL & Nuxt repo will generate a complete web application stack as a foundation for your project development.

  • Docker Compose integration and optimization for local development.
  • Authentication user management schemas, models, crud and apis already built, with OAuth2 JWT token support & default hashing using argon2. Offers magic link authentication, with password fallback, with cookie management, including access and refresh tokens.
  • FastAPI version 0.115 backend with Inboard one-repo Docker images, using Python 3.12:
    • SQLAlchemy version 2.0 support for models.
    • Pydantic version 2.9 for schemas.
    • Metadata Schema based on Dublin Core for inheritance.
    • Common CRUD support via generic inheritance.
    • Standards-based: Based on (and fully compatible with) the open standards for APIs: OpenAPI and JSON Schema.
    • MJML templates for common email transactions.
    • Many other features: including automatic validation, serialization, interactive documentation, etc.
  • Nuxt/Vue 3 frontend using TypeScript:
  • PostgreSQL database.
  • Adminer for PostgreSQL database management.
  • Celery worker that can import and use models and code from the rest of the backend selectively.
  • Flower for Celery jobs monitoring.
  • Redis for caching.
  • Load balancing between frontend and backend with Traefik version 3.3, so you can have both under the same domain, separated by path, but served by different containers.
  • Traefik integration, including Let's Encrypt HTTPS certificates automatic generation.

Who is it for?

This project is a rock-solid foundation on which to build complex web applications which need parallel processing, scheduled event management, and a range of relational and graph database support. The base deployment takes up about 12Gb drive space, and requires about 4Gb of memory to build.

This is not a light-weight system to deploy a blog or simple content-management-system. There are easier ways to run a blog.

It is for developers looking to build and maintain full feature progressive web applications that can run online, or offline, want the complex-but-routine aspects of auth 'n auth, and component and deployment configuration taken care of.

How to use it

You can fork or clone this repository and use it as is.

Installing for local development

You can customise the deployment by generating a new project using Copier, and then building with Docker compose, takes about 20 minutes.

Deploying for production

This stack can be adjusted and used with several deployment options that are compatible with Docker Compose, but it is designed to be used with a Traefik main load balancer proxy handling automatic HTTPS certificates.

Authentication with magic and TOTP

Time-based One-Time Password (TOTP) authentication extends the login process to include a challenge-response component where the user needs to enter a time-based token after their preferred login method.

Fork differences

The original objective of this fork was to maintain parity with the Full Stack FastAPI and PostgreSQL Base Project Generator but update it to bring it up to current stack versions, fixes, and with a complete auth 'n auth system.

With the most recent updates to the base stack (as of 2024), Sebastián has made some fairly dramatic changes and these two stacks are no longer compatible. This table presents a summary of the major differences:

This base stackTiangolo base stack
SQLAlchemy & PydanticSqlModel
Postgresql 17 & AdminerPostgresql 12 & Adminer
Celery & RabbitMQ task queue-
Redis caching-
NuxtJS frontendReact frontend
Tailwind CSSBootstrap CSS

This stack also has a much more sophisticated and feature-complete auth 'n auth system which is a requirement for any web app. A basic implementation of i18n support is available in both frontend and backend.

Licence

This project is licensed under the terms of the MIT license.