# simiremichael/crude-fastapi architecture

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

- Interactive diagram: https://gitdiagram.com/simiremichael/crude-fastapi
- Repository: https://github.com/simiremichael/crude-fastapi

## Overview

This is a small FastAPI backend for user authentication and a media-post feed. The main workflow is an authenticated upload: the API stages a file, sends it to ImageKit, and records post metadata in SQLite; authenticated users can also list and delete posts. Authentication and user-management routes are provided through FastAPI Users. The README is empty, so the graph relies on the sampled source; it does not show the full behavior of framework-generated routes.

Main entry points: [`app/app.py`](https://github.com/simiremichael/crude-fastapi/blob/master/app/app.py) (API routes), [`app/db.py`](https://github.com/simiremichael/crude-fastapi/blob/master/app/db.py) (User and post models), [`app/users.py`](https://github.com/simiremichael/crude-fastapi/blob/master/app/users.py) (Auth services), [`app/images.py`](https://github.com/simiremichael/crude-fastapi/blob/master/app/images.py) (ImageKit client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_entry["Server entry<br/>[main.py]"]
  node_routes["API routes<br/>[app.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

subgraph group_identity["Identity"]
  node_auth["Auth services<br/>[users.py]"]
end

subgraph group_posts["Posts and media"]
  node_models["User and post models<br/>[db.py]"]
  node_database[("SQLite database<br/>[test.db]")]
  node_imagekit["ImageKit"]
  node_image_config["ImageKit client<br/>[images.py]"]
end

node_client(("API client"))

node_client -->|"calls endpoints"| node_routes
node_entry -->|"runs app"| node_routes
node_routes -->|"registers auth routes"| node_auth
node_routes -->|"requires active user"| node_auth
node_routes -->|"uses schemas"| node_schemas
node_auth -->|"loads user database"| node_models
node_routes -->|"creates tables"| node_models
node_routes -->|"reads and writes posts"| node_models
node_models -->|"stores records"| node_database
node_routes -->|"uses client"| node_image_config
node_image_config -->|"uploads media"| node_imagekit

click node_entry "https://github.com/simiremichael/crude-fastapi/blob/master/main.py"
click node_routes "https://github.com/simiremichael/crude-fastapi/blob/master/app/app.py"
click node_schemas "https://github.com/simiremichael/crude-fastapi/blob/master/app/schemas.py"
click node_auth "https://github.com/simiremichael/crude-fastapi/blob/master/app/users.py"
click node_models "https://github.com/simiremichael/crude-fastapi/blob/master/app/db.py"
click node_database "https://github.com/simiremichael/crude-fastapi/blob/master/test.db"
click node_image_config "https://github.com/simiremichael/crude-fastapi/blob/master/app/images.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_entry,node_routes,node_schemas,node_client toneBlue
class node_auth toneAmber
class node_models,node_database,node_imagekit,node_image_config toneMint
```

## Components

### API

- [Server entry](https://github.com/simiremichael/crude-fastapi/blob/master/main.py): `main.py`
- [API routes](https://github.com/simiremichael/crude-fastapi/blob/master/app/app.py): `app/app.py`
- [API schemas](https://github.com/simiremichael/crude-fastapi/blob/master/app/schemas.py): `app/schemas.py`

### Identity

- [Auth services](https://github.com/simiremichael/crude-fastapi/blob/master/app/users.py): `app/users.py`

### Posts and media

- [User and post models](https://github.com/simiremichael/crude-fastapi/blob/master/app/db.py): `app/db.py`
- [SQLite database](https://github.com/simiremichael/crude-fastapi/blob/master/test.db): `test.db`
- **ImageKit**
- [ImageKit client](https://github.com/simiremichael/crude-fastapi/blob/master/app/images.py): `app/images.py`

### Other components

- **API client**

## Connections

- API client → API routes: calls endpoints (evidence: `app/app.py`)
- Server entry → API routes: runs app (evidence: `main.py`)
- API routes → Auth services: registers auth routes (evidence: `app/app.py`)
- API routes → Auth services: requires active user (evidence: `app/app.py`)
- API routes → API schemas: uses schemas (evidence: `app/app.py`)
- Auth services → User and post models: loads user database (evidence: `app/users.py`)
- API routes → User and post models: creates tables (evidence: `app/app.py`)
- API routes → User and post models: reads and writes posts (evidence: `app/app.py`)
- User and post models → SQLite database: stores records (evidence: `app/db.py`)
- API routes → ImageKit client: uses client (evidence: `app/app.py`)
- ImageKit client → ImageKit: uploads media (evidence: `app/images.py`)
