ryn.cx

Full Stack FastAPI Template

Overview

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more following FastAPI Best Practices.

Why

There is an official Full Stack FastAPI Template that works really well, but it does not follow some of the commonly accepted FastAPI Best Practices. This fork makes the project more closely follow these best practices as well as other minor quality of life improvements.

Projects Using This Template

Backend Changes in this Fork

  • ๐Ÿ“ Restructure the project to more closely follow zhanymkanov/fastapi-best-practices and Netflix/dispatch.
  • ๐Ÿ“ง Support case-insensitive email addresses.
  • โšก (Optional) Automatically load models and routers based on the project folder structure.
  • ๐Ÿงช Run automated tests against a separate test database.
    • The original template ran backend tests against the local database, and would delete all entries when the tests completed. A dedicated test database leaves the local data intact so it can act as consistent reference data during development.
  • ๐Ÿ  Default to the root domain instead of the dashboard subdomain.
  • ๐Ÿ“™ Use timestamp-based file names for Alembic migrations.

Frontend Changes in this Fork

  • ๐Ÿคž Optimistic updates when modifying items and users.
  • ๐Ÿ“„ Client-side pagination, filtering, and sorting.
    • In the original template, the backend paginated results but the frontend had no way to load data past the first page. TanStack Table handles 100,000 rows comfortably, and most projects using this template will stay well under that, so client-side pagination is the default. The backend pagination code is retained, so server-side pagination can be reinstated with minimal frontend changes if needed.
  • ๐Ÿงช Run automated frontend tests against a dedicated test database in test-specific Docker containers.
    • This also fixes a local-only issue where a prior backend test run would delete the first superuser the frontend tests depend on, causing those tests to fail.

Other Changes

  • ๐Ÿ—๏ธ Derive all port assignments from a configurable PROJECT_NUMBER so multiple projects using this template can run side by side without port conflicts.