Now playing: Loading...
Last watched: Being John Malkovich (1999)
Currently reading: The Anxious Generation - Jonathan Haidt
Back
Created

Full-Stack FastAPI Template

As part of the FastAPI team, I've been contributing to the template since late 2023. I built the current React frontend from scratch, replacing the old Vue one, led its migrations to Chakra UI v3 and then shadcn/ui with Tailwind, set up the end-to-end tests with Playwright, and moved package management to Bun and uv workspaces.

Here’s a walkthrough of the parts I’ve worked on! But first, this is what the template looks like today, in light and dark mode:

Admin users table in the template, light mode The same admin users table in dark mode

Building the new frontend

The template used to ship a Vue frontend. I set up the new one from scratch with Vite, TypeScript and React, along with its Docker config, and then built it out piece by piece.

From there came private/public routing, form validation, a Not Found page, dark mode, password reset, the ability to delete your own account, and the migration to TanStack Query and TanStack Router. Once it was ready, I moved new-frontend into frontend and the old one was retired.

Migrations

I’ve led several migrations of the frontend, including:

The items screen, one of the views rebuilt with shadcn/ui:

Items table in the template, showing item IDs, titles and descriptions

End-to-end testing

I added the initial Playwright setup and then wrote the suites for several features, wired the config, and documented all of it.

Backend and API

I’ve also refactored the Users API and dependencies, added delete_user and delete_user_me, moved models to cascade delete relationships, added a created_at field to users and items, restricted the admin route to superusers, refactored the email templates and added an endpoint to preview password recovery emails, and fixed a handful of bugs along the way.

Keeping things running

The less exciting but still important work includes: Dependabot configuration and grouping, dependency upgrades (React, TanStack, Biome, Playwright, uv), GitHub issue and discussion templates, the security policy, the labeler and issue-manager workflows, the Mailcatcher setup for local email testing, CI tweaks for client generation and coverage, and several docs updates.