# rrrrrjunn/midprj architecture

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

- Interactive diagram: https://gitdiagram.com/rrrrrjunn/midprj
- Repository: https://github.com/rrrrrjunn/midprj

## Overview

This is a FastAPI article-submission and editorial-review application. Users log in, authors create and submit articles for review, and editors approve them or return them to editing; the homepage directs authenticated users into the app. SQLite persists users and article status, while Jinja templates render the screens. The graph follows route registration and calls visible in the excerpts; the README is empty, and no external services are documented.

Main entry points: [`main.py`](https://github.com/rrrrrjunn/midprj/blob/main/main.py) (FastAPI app), [`routes/auth.py`](https://github.com/rrrrrjunn/midprj/blob/main/routes/auth.py) (Login and session), [`db.py`](https://github.com/rrrrrjunn/midprj/blob/main/db.py) (SQLite access), [`routes/author.py`](https://github.com/rrrrrjunn/midprj/blob/main/routes/author.py) (Author submissions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web runtime"]
  node_app["FastAPI app<br/>[main.py]"]
  node_pages["Home page<br/>[pages.py]"]
end

subgraph group_identity["Identity"]
  node_auth["Login and session<br/>[auth.py]"]
end

subgraph group_authoring["Author workflow"]
  node_author["Author submissions<br/>[author.py]"]
end

subgraph group_review["Editorial review"]
  node_editor["Editorial review<br/>[editor.py]"]
end

subgraph group_persistence["Persistence and UI"]
  node_db["SQLite access<br/>[db.py]"]
  node_schema["Database schema<br/>[schema.sql]"]
  node_store[("Application database<br/>[app.db]")]
  node_templates["HTML templates"]
  node_styles["Static styles<br/>[style.css]"]
end

node_user(("Browser user"))

node_user -->|"sends requests"| node_app
node_app -->|"initializes database"| node_db
node_app -->|"registers routes"| node_auth
node_app -->|"registers routes"| node_author
node_app -->|"registers routes"| node_editor
node_app -->|"registers routes"| node_pages
node_app -->|"serves static files"| node_styles
node_pages -->|"checks session"| node_auth
node_auth -->|"queries users"| node_db
node_author -->|"checks session"| node_auth
node_author -->|"reads and writes articles"| node_db
node_author -->|"renders forms and list"| node_templates
node_editor -->|"checks session"| node_auth
node_editor -->|"reads and updates articles"| node_db
node_editor -->|"renders review screens"| node_templates
node_auth -->|"renders login page"| node_templates
node_pages -->|"renders homepage"| node_templates
node_db -->|"loads schema"| node_schema
node_db -->|"connects to"| node_store

click node_app "https://github.com/rrrrrjunn/midprj/blob/main/main.py"
click node_pages "https://github.com/rrrrrjunn/midprj/blob/main/routes/pages.py"
click node_auth "https://github.com/rrrrrjunn/midprj/blob/main/routes/auth.py"
click node_author "https://github.com/rrrrrjunn/midprj/blob/main/routes/author.py"
click node_editor "https://github.com/rrrrrjunn/midprj/blob/main/routes/editor.py"
click node_db "https://github.com/rrrrrjunn/midprj/blob/main/db.py"
click node_schema "https://github.com/rrrrrjunn/midprj/blob/main/sql/schema.sql"
click node_store "https://github.com/rrrrrjunn/midprj/blob/main/app.db"
click node_templates "https://github.com/rrrrrjunn/midprj/tree/main/templates"
click node_styles "https://github.com/rrrrrjunn/midprj/blob/main/www/style.css"

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_app,node_pages,node_user toneBlue
class node_auth toneAmber
class node_author toneMint
class node_editor toneRose
class node_db,node_schema,node_store,node_templates,node_styles toneIndigo
```

## Components

### Web runtime

- [FastAPI app](https://github.com/rrrrrjunn/midprj/blob/main/main.py): `main.py`
- [Home page](https://github.com/rrrrrjunn/midprj/blob/main/routes/pages.py): `routes/pages.py`

### Identity

- [Login and session](https://github.com/rrrrrjunn/midprj/blob/main/routes/auth.py): `routes/auth.py`

### Author workflow

- [Author submissions](https://github.com/rrrrrjunn/midprj/blob/main/routes/author.py): `routes/author.py`

### Editorial review

- [Editorial review](https://github.com/rrrrrjunn/midprj/blob/main/routes/editor.py): `routes/editor.py`

### Persistence and UI

- [SQLite access](https://github.com/rrrrrjunn/midprj/blob/main/db.py): `db.py`
- [Database schema](https://github.com/rrrrrjunn/midprj/blob/main/sql/schema.sql): `sql/schema.sql`
- [Application database](https://github.com/rrrrrjunn/midprj/blob/main/app.db): `app.db`
- [HTML templates](https://github.com/rrrrrjunn/midprj/tree/main/templates): `templates`
- [Static styles](https://github.com/rrrrrjunn/midprj/blob/main/www/style.css): `www/style.css`

### Other components

- **Browser user**

## Connections

- Browser user → FastAPI app: sends requests (evidence: `main.py`)
- FastAPI app → SQLite access: initializes database (evidence: `main.py`)
- FastAPI app → Login and session: registers routes (evidence: `main.py`)
- FastAPI app → Author submissions: registers routes (evidence: `main.py`)
- FastAPI app → Editorial review: registers routes (evidence: `main.py`)
- FastAPI app → Home page: registers routes (evidence: `main.py`)
- FastAPI app → Static styles: serves static files (evidence: `main.py`)
- Home page → Login and session: checks session (evidence: `routes/pages.py`)
- Login and session → SQLite access: queries users (evidence: `routes/auth.py`)
- Author submissions → Login and session: checks session (evidence: `routes/author.py`)
- Author submissions → SQLite access: reads and writes articles (evidence: `routes/author.py`)
- Author submissions → HTML templates: renders forms and list (evidence: `routes/author.py`)
- Editorial review → Login and session: checks session (evidence: `routes/editor.py`)
- Editorial review → SQLite access: reads and updates articles (evidence: `routes/editor.py`)
- Editorial review → HTML templates: renders review screens (evidence: `routes/editor.py`)
- Login and session → HTML templates: renders login page (evidence: `routes/auth.py`)
- Home page → HTML templates: renders homepage (evidence: `routes/pages.py`)
- SQLite access → Database schema: loads schema (evidence: `db.py`)
- SQLite access → Application database: connects to (evidence: `db.py`)
