# anguscow0508/submission_system architecture

> Architecture diagram of the GitHub repository anguscow0508/submission_system, 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/anguscow0508/submission_system
- Repository: https://github.com/anguscow0508/submission_system

## Overview

This is a small FastAPI article-submission and editorial-review application. Authors create and edit drafts, submit them for review, and editors inspect the queue before approving or returning submissions; the article status records these stages. The main routes also serve page templates and static assets, while a connection helper opens PostgreSQL sessions. Route behavior and database access are visible in main.py and db.py; the README is empty, and schema.sql and templates were not sampled, so their internals are not inferred.

Main entry points: [`main.py`](https://github.com/anguscow0508/submission_system/blob/main/main.py) (FastAPI routes), [`database/schema.sql`](https://github.com/anguscow0508/submission_system/blob/main/database/schema.sql) (Article store), [`db.py`](https://github.com/anguscow0508/submission_system/blob/main/db.py) (DB connection), [`templates`](https://github.com/anguscow0508/submission_system/tree/main/templates) (Page templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["FastAPI routes<br/>[main.py]"]
  node_page_views["Page templates"]
  node_static_assets["Static assets"]
end

subgraph group_workflow["Submission workflow"]
  node_author_drafts["Author drafts<br/>[main.py]"]
  node_submission["Submission status<br/>[main.py]"]
  node_editorial_queue["Editorial queue<br/>[main.py]"]
  node_review_decision["Review decision<br/>[main.py]"]
end

subgraph group_persistence["Persistence"]
  node_connection["DB connection<br/>[db.py]"]
  node_article_store[("Article store<br/>[schema.sql]")]
end

node_author(("Author"))
node_editor(("Editor"))
node_postgres[("PostgreSQL")]

node_author -->|"uses"| node_routes
node_editor -->|"uses"| node_routes
node_routes -->|"renders"| node_page_views
node_routes -->|"mounts"| node_static_assets
node_routes -->|"routes"| node_author_drafts
node_routes -->|"routes"| node_submission
node_routes -->|"routes"| node_editorial_queue
node_routes -->|"routes"| node_review_decision
node_routes -->|"opens sessions"| node_connection
node_author_drafts -->|"reads and writes"| node_article_store
node_submission -->|"updates status"| node_article_store
node_editorial_queue -->|"queries"| node_article_store
node_review_decision -->|"updates status"| node_article_store
node_connection -->|"connects"| node_postgres

click node_routes "https://github.com/anguscow0508/submission_system/blob/main/main.py"
click node_page_views "https://github.com/anguscow0508/submission_system/tree/main/templates"
click node_static_assets "https://github.com/anguscow0508/submission_system/tree/main/static"
click node_author_drafts "https://github.com/anguscow0508/submission_system/blob/main/main.py"
click node_submission "https://github.com/anguscow0508/submission_system/blob/main/main.py"
click node_editorial_queue "https://github.com/anguscow0508/submission_system/blob/main/main.py"
click node_review_decision "https://github.com/anguscow0508/submission_system/blob/main/main.py"
click node_connection "https://github.com/anguscow0508/submission_system/blob/main/db.py"
click node_article_store "https://github.com/anguscow0508/submission_system/blob/main/database/schema.sql"

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_routes,node_page_views,node_static_assets toneBlue
class node_author_drafts,node_submission,node_editorial_queue,node_review_decision,node_postgres toneAmber
class node_connection,node_article_store toneMint
class node_author,node_editor toneIndigo
```

## Components

### Web application

- [FastAPI routes](https://github.com/anguscow0508/submission_system/blob/main/main.py): `main.py`
- [Page templates](https://github.com/anguscow0508/submission_system/tree/main/templates): `templates`
- [Static assets](https://github.com/anguscow0508/submission_system/tree/main/static): `static`

### Submission workflow

- [Author drafts](https://github.com/anguscow0508/submission_system/blob/main/main.py): `main.py`
- [Submission status](https://github.com/anguscow0508/submission_system/blob/main/main.py): `main.py`
- [Editorial queue](https://github.com/anguscow0508/submission_system/blob/main/main.py): `main.py`
- [Review decision](https://github.com/anguscow0508/submission_system/blob/main/main.py): `main.py`

### Persistence

- [DB connection](https://github.com/anguscow0508/submission_system/blob/main/db.py): `db.py`
- [Article store](https://github.com/anguscow0508/submission_system/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Author**
- **Editor**
- **PostgreSQL**

## Connections

- Author → FastAPI routes: uses (evidence: `main.py`)
- Editor → FastAPI routes: uses (evidence: `main.py`)
- FastAPI routes → Page templates: renders (evidence: `main.py`)
- FastAPI routes → Static assets: mounts (evidence: `main.py`)
- FastAPI routes → Author drafts: routes (evidence: `main.py`)
- FastAPI routes → Submission status: routes (evidence: `main.py`)
- FastAPI routes → Editorial queue: routes (evidence: `main.py`)
- FastAPI routes → Review decision: routes (evidence: `main.py`)
- FastAPI routes → DB connection: opens sessions (evidence: `main.py`)
- Author drafts → Article store: reads and writes (evidence: `main.py`)
- Submission status → Article store: updates status (evidence: `main.py`)
- Editorial queue → Article store: queries (evidence: `main.py`)
- Review decision → Article store: updates status (evidence: `main.py`)
- DB connection → PostgreSQL: connects (evidence: `db.py`)
