# arjaythedev/twelve-dollar-server-challenge architecture

> Architecture diagram of the GitHub repository arjaythedev/twelve-dollar-server-challenge, 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/arjaythedev/twelve-dollar-server-challenge
- Repository: https://github.com/arjaythedev/twelve-dollar-server-challenge

## Overview

This repository is a server-performance challenge: submissions implement a fixed social-feed API over SQLite, and are evaluated for correctness and load capacity. The principal workflow is an HTTP request routed by the server into an API handler, which authenticates writes when required, accesses SQLite, and returns JSON. Seed generation supplies benchmark data; a load-test client measures the running API. The graph uses the sampled FastAPI implementation as the concrete runtime; other submissions are not represented. The load-test relationship is documented in the README, not verified from its source here.

Main entry points: [`submissions/python-fastapi-cknutson12/app.py`](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py) (FastAPI handlers), [`schema.sql`](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/schema.sql) (SQLite database), [`submissions/python-fastapi-cknutson12/server.py`](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/server.py) (Uvicorn server), [`seed/generate.mjs`](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/seed/generate.mjs) (Seed generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_server["Uvicorn server<br/>[server.py]"]
  node_api["FastAPI handlers<br/>[app.py]"]
  node_auth["JWT authentication<br/>[app.py]"]
  node_health["Health endpoint<br/>[app.py]"]
  node_feed["Feed endpoint<br/>[app.py]"]
  node_post["Post lookup<br/>[app.py]"]
  node_create["Post creation<br/>[app.py]"]
  node_like["Like endpoint<br/>[app.py]"]
  node_responses["JSON responses<br/>[app.py]"]
end

subgraph group_data["SQLite data"]
  node_sqlite[("SQLite database<br/>[schema.sql]")]
end

subgraph group_challenge["Challenge tooling"]
  node_seed["Seed generator<br/>[generate.mjs]"]
  node_load["Load-test client<br/>[load.js]"]
end

node_client(("HTTP client"))

node_client -->|"sends requests"| node_server
node_server -->|"loads app"| node_api
node_api -->|"routes health"| node_health
node_api -->|"routes feed"| node_feed
node_api -->|"routes lookup"| node_post
node_api -->|"routes creation"| node_create
node_api -->|"routes likes"| node_like
node_create -->|"authenticates"| node_auth
node_like -->|"authenticates"| node_auth
node_health -->|"checks connection"| node_sqlite
node_feed -->|"reads feed"| node_sqlite
node_post -->|"reads post"| node_sqlite
node_create -->|"inserts post"| node_sqlite
node_like -->|"inserts like"| node_sqlite
node_health -->|"returns JSON"| node_responses
node_feed -->|"returns JSON"| node_responses
node_post -->|"returns JSON"| node_responses
node_create -->|"returns JSON"| node_responses
node_like -->|"returns JSON"| node_responses
node_seed -.->|"populates seed data"| node_sqlite
node_load -->|"benchmarks API"| node_server

click node_server "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/server.py"
click node_api "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_auth "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_health "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_feed "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_post "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_create "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_like "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_responses "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py"
click node_sqlite "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/schema.sql"
click node_seed "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/seed/generate.mjs"
click node_load "https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/bench/load.js"

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_server,node_api,node_auth,node_health,node_feed,node_post,node_create,node_like,node_responses,node_client toneBlue
class node_sqlite toneAmber
class node_seed,node_load toneMint
```

## Components

### API runtime

- [Uvicorn server](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/server.py): `submissions/python-fastapi-cknutson12/server.py`
- [FastAPI handlers](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [JWT authentication](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [Health endpoint](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [Feed endpoint](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [Post lookup](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [Post creation](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [Like endpoint](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`
- [JSON responses](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/submissions/python-fastapi-cknutson12/app.py): `submissions/python-fastapi-cknutson12/app.py`

### SQLite data

- [SQLite database](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/schema.sql): `schema.sql`

### Challenge tooling

- [Seed generator](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/seed/generate.mjs): `seed/generate.mjs`
- [Load-test client](https://github.com/arjaythedev/twelve-dollar-server-challenge/blob/main/bench/load.js): `bench/load.js`

### Other components

- **HTTP client**

## Connections

- HTTP client → Uvicorn server: sends requests (evidence: `README.md`)
- Uvicorn server → FastAPI handlers: loads app (evidence: `submissions/python-fastapi-cknutson12/server.py`)
- FastAPI handlers → Health endpoint: routes health (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- FastAPI handlers → Feed endpoint: routes feed (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- FastAPI handlers → Post lookup: routes lookup (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- FastAPI handlers → Post creation: routes creation (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- FastAPI handlers → Like endpoint: routes likes (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Post creation → JWT authentication: authenticates (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Like endpoint → JWT authentication: authenticates (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Health endpoint → SQLite database: checks connection (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Feed endpoint → SQLite database: reads feed (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Post lookup → SQLite database: reads post (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Post creation → SQLite database: inserts post (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Like endpoint → SQLite database: inserts like (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Health endpoint → JSON responses: returns JSON (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Feed endpoint → JSON responses: returns JSON (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Post lookup → JSON responses: returns JSON (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Post creation → JSON responses: returns JSON (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Like endpoint → JSON responses: returns JSON (evidence: `submissions/python-fastapi-cknutson12/app.py`)
- Seed generator → SQLite database: populates seed data (evidence: `README.md`)
- Load-test client → Uvicorn server: benchmarks API (evidence: `README.md`)
