# coreymschafer/fastapi-14-password-reset-background-tasks architecture

> Architecture diagram of the GitHub repository coreymschafer/fastapi-14-password-reset-background-tasks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coreymschafer/fastapi-14-password-reset-background-tasks
- Repository: https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks

## Overview

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: [`routers/users.py`](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/users.py) (Account workflows), [`main.py`](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/main.py) (Page and API routing), [`routers/posts.py`](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/posts.py) (Post workflows), [`database.py`](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/database.py) (SQLite persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Page and API routing<br/>[main.py]"]
  node_templates["Rendered pages"]
  node_browser_auth["Browser auth behavior<br/>[auth.js]"]
end

subgraph group_domain["Blog and accounts"]
  node_users["Account workflows<br/>[users.py]"]
  node_posts["Post workflows<br/>[posts.py]"]
end

subgraph group_platform["Shared services"]
  node_auth["Identity and tokens<br/>[auth.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_models["User, post, reset models<br/>[models.py]"]
  node_database[("SQLite persistence<br/>[database.py]")]
  node_settings["Application settings<br/>[config.py]"]
  node_images["Profile image processing<br/>[image_utils.py]"]
  node_media[("Profile image files")]
  node_mail["Reset email delivery<br/>[email_utils.py]"]
end

subgraph group_operations["Data setup"]
  node_seed["Sample data population<br/>[populate_db.py]"]
end

node_visitor(("Visitor or user"))
node_smtp["SMTP service"]

node_visitor -->|"requests pages"| node_webapp
node_webapp -->|"renders pages"| node_templates
node_webapp -->|"mounts routes"| node_users
node_webapp -->|"mounts routes"| node_posts
node_visitor -.->|"uses browser auth"| node_browser_auth
node_users -->|"checks identity"| node_auth
node_posts -->|"checks identity"| node_auth
node_users -->|"validates data"| node_schemas
node_posts -->|"validates data"| node_schemas
node_users -->|"reads and writes"| node_models
node_posts -->|"reads and writes"| node_models
node_webapp -->|"queries posts"| node_models
node_webapp -->|"opens schema"| node_database
node_users -->|"uses sessions"| node_database
node_posts -->|"uses sessions"| node_database
node_auth -->|"loads user"| node_database
node_auth -->|"loads user"| node_models
node_auth -->|"reads token settings"| node_settings
node_webapp -->|"reads page settings"| node_settings
node_users -->|"processes uploads"| node_images
node_images -->|"writes image files"| node_media
node_users -->|"deletes old images"| node_media
node_users -->|"sends reset mail"| node_mail
node_mail -->|"sends message"| node_smtp
node_mail -->|"reads mail settings"| node_settings
node_seed -->|"creates sample accounts"| node_users
node_seed -->|"creates sample posts"| node_posts
node_seed -->|"clears and dates data"| node_database
node_models -->|"extends base"| node_database

click node_webapp "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/main.py"
click node_templates "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/tree/main/templates"
click node_browser_auth "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/static/js/auth.js"
click node_users "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/users.py"
click node_posts "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/posts.py"
click node_auth "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/auth.py"
click node_schemas "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/schemas.py"
click node_models "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/models.py"
click node_database "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/database.py"
click node_settings "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/config.py"
click node_images "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/image_utils.py"
click node_media "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/tree/main/media/profile_pics"
click node_mail "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/email_utils.py"
click node_seed "https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/populate_db.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_templates,node_browser_auth,node_visitor toneBlue
class node_users,node_posts toneAmber
class node_auth,node_schemas,node_models,node_database,node_settings,node_images,node_media,node_mail toneMint
class node_seed toneRose
class node_smtp toneIndigo
```

## Components

### Web experience

- [Page and API routing](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/main.py): `main.py`
- [Rendered pages](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/tree/main/templates): `templates`
- [Browser auth behavior](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/static/js/auth.js): `static/js/auth.js`

### Blog and accounts

- [Account workflows](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/users.py): `routers/users.py`
- [Post workflows](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/routers/posts.py): `routers/posts.py`

### Shared services

- [Identity and tokens](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/auth.py): `auth.py`
- [Request and response schemas](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/schemas.py): `schemas.py`
- [User, post, reset models](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/models.py): `models.py`
- [SQLite persistence](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/database.py): `database.py`
- [Application settings](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/config.py): `config.py`
- [Profile image processing](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/image_utils.py): `image_utils.py`
- [Profile image files](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/tree/main/media/profile_pics): `media/profile_pics`
- [Reset email delivery](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/email_utils.py): `email_utils.py`

### Data setup

- [Sample data population](https://github.com/coreymschafer/fastapi-14-password-reset-background-tasks/blob/main/populate_db.py): `populate_db.py`

### Other components

- **Visitor or user**
- **SMTP service**

## Connections

- Visitor or user → Page and API routing: requests pages (evidence: `main.py`)
- Page and API routing → Rendered pages: renders pages (evidence: `main.py`)
- Page and API routing → Account workflows: mounts routes (evidence: `main.py`)
- Page and API routing → Post workflows: mounts routes (evidence: `main.py`)
- Visitor or user → Browser auth behavior: uses browser auth
- Account workflows → Identity and tokens: checks identity (evidence: `routers/users.py`)
- Post workflows → Identity and tokens: checks identity (evidence: `routers/posts.py`)
- Account workflows → Request and response schemas: validates data (evidence: `routers/users.py`)
- Post workflows → Request and response schemas: validates data (evidence: `routers/posts.py`)
- Account workflows → User, post, reset models: reads and writes (evidence: `routers/users.py`)
- Post workflows → User, post, reset models: reads and writes (evidence: `routers/posts.py`)
- Page and API routing → User, post, reset models: queries posts (evidence: `main.py`)
- Page and API routing → SQLite persistence: opens schema (evidence: `main.py`)
- Account workflows → SQLite persistence: uses sessions (evidence: `routers/users.py`)
- Post workflows → SQLite persistence: uses sessions (evidence: `routers/posts.py`)
- Identity and tokens → SQLite persistence: loads user (evidence: `auth.py`)
- Identity and tokens → User, post, reset models: loads user (evidence: `auth.py`)
- Identity and tokens → Application settings: reads token settings (evidence: `auth.py`)
- Page and API routing → Application settings: reads page settings (evidence: `main.py`)
- Account workflows → Profile image processing: processes uploads (evidence: `routers/users.py`)
- Profile image processing → Profile image files: writes image files (evidence: `image_utils.py`)
- Account workflows → Profile image files: deletes old images (evidence: `routers/users.py`)
- Account workflows → Reset email delivery: sends reset mail (evidence: `routers/users.py`)
- Reset email delivery → SMTP service: sends message (evidence: `email_utils.py`)
- Reset email delivery → Application settings: reads mail settings (evidence: `email_utils.py`)
- Sample data population → Account workflows: creates sample accounts (evidence: `populate_db.py`)
- Sample data population → Post workflows: creates sample posts (evidence: `populate_db.py`)
- Sample data population → SQLite persistence: clears and dates data (evidence: `populate_db.py`)
- User, post, reset models → SQLite persistence: extends base (evidence: `models.py`)
