How coreymschafer/fastapi-14-password-reset-background-tasks works
This is a FastAPI blog with server-rendered pages and a JSON API. A visitor browses paginated posts or user-post listings; registered users authenticate, publish and manage posts, update profiles, and recover passwords. The API handlers own database operations, while shared authentication, validation schemas, image processing, and email delivery support those domain stages. The source excerpts show the primary request paths; the README is empty, and some user-router wiring is only partially sampled, so uncertain links are omitted.
Main entry points: users.py Account workflows · main.py Page and API routing · posts.py Post workflows · database.py SQLite persistence
Components 16
Web experience
- Page and API routing
main.py - Rendered pages
templates - Browser auth behavior
static/js/auth.js
Blog and accounts
- Account workflows
routers/users.py - Post workflows
routers/posts.py
Shared services
- Identity and tokens
auth.py - Request and response schemas
schemas.py - User, post, reset models
models.py - SQLite persistence
database.py - Application settings
config.py - Profile image processing
image_utils.py - Profile image files
media/profile_pics - Reset email delivery
email_utils.py
Data setup
- Sample data population
populate_db.py
Other components
- Visitor or user
- SMTP service
Connections 29
- Visitor or user → Page and API routing: requests pages
main.py - Page and API routing → Rendered pages: renders pages
main.py - Page and API routing → Account workflows: mounts routes
main.py - Page and API routing → Post workflows: mounts routes
main.py - Visitor or user → Browser auth behavior: uses browser auth
- Account workflows → Identity and tokens: checks identity
routers/users.py - Post workflows → Identity and tokens: checks identity
routers/posts.py - Account workflows → Request and response schemas: validates data
routers/users.py - Post workflows → Request and response schemas: validates data
routers/posts.py - Account workflows → User, post, reset models: reads and writes
routers/users.py - Post workflows → User, post, reset models: reads and writes
routers/posts.py - Page and API routing → User, post, reset models: queries posts
main.py - Page and API routing → SQLite persistence: opens schema
main.py - Account workflows → SQLite persistence: uses sessions
routers/users.py - Post workflows → SQLite persistence: uses sessions
routers/posts.py - Identity and tokens → SQLite persistence: loads user
auth.py - Identity and tokens → User, post, reset models: loads user
auth.py - Identity and tokens → Application settings: reads token settings
auth.py - Page and API routing → Application settings: reads page settings
main.py - Account workflows → Profile image processing: processes uploads
routers/users.py - Profile image processing → Profile image files: writes image files
image_utils.py - Account workflows → Profile image files: deletes old images
routers/users.py - Account workflows → Reset email delivery: sends reset mail
routers/users.py - Reset email delivery → SMTP service: sends message
email_utils.py - Reset email delivery → Application settings: reads mail settings
email_utils.py - Sample data population → Account workflows: creates sample accounts
populate_db.py - Sample data population → Post workflows: creates sample posts
populate_db.py - Sample data population → SQLite persistence: clears and dates data
populate_db.py - User, post, reset models → SQLite persistence: extends base
models.py