# alicekuo1016/113213004-submission architecture

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

- Interactive diagram: https://gitdiagram.com/alicekuo1016/113213004-submission
- Repository: https://github.com/alicekuo1016/113213004-submission

## Overview

This is a FastAPI submission-review application: authors create and manage drafts, submit them for editorial review, and editors approve or return them with revision notes. Editors can also inspect their review history, including saved review snapshots. The main routes and browser client are excerpted; templates and SQL files are documented but not sampled, so their detailed wiring is represented only where the README supports it.

Main entry points: [`www/app.js`](https://github.com/alicekuo1016/113213004-submission/blob/master/www/app.js) (Browser client), [`db.py`](https://github.com/alicekuo1016/113213004-submission/blob/master/db.py) (DB connection pool), [`templates/base.html`](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/base.html) (Shared layout), [`main.py`](https://github.com/alicekuo1016/113213004-submission/blob/master/main.py) (Editor review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser client<br/>[app.js]"]
  node_login_view["Login view<br/>[login.html]"]
  node_author_views["Author views"]
  node_submission_form["Submission form"]
  node_editor_queue_view["Editor queue<br/>[editor_queue.html]"]
  node_review_view["Review detail<br/>[review_detail.html]"]
  node_page_shell["Shared layout<br/>[base.html]"]
end

subgraph group_api["Application API"]
  node_auth["Authentication<br/>[main.py]"]
  node_author_api["Author submissions<br/>[main.py]"]
  node_editor_api["Editor review<br/>[main.py]"]
  node_review_history["Review history<br/>[main.py]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL")]
  node_db_access["DB connection pool<br/>[db.py]"]
  node_schema["Database schema<br/>[schema.sql]"]
  node_review_upgrade["Review migration"]
  node_seed["Demo accounts<br/>[seed.sql]"]
end

node_author(("Author"))
node_editor(("Editor"))

node_author -->|"uses"| node_browser
node_editor -->|"uses"| node_browser
node_browser -->|"logs in"| node_auth
node_browser -->|"manages drafts"| node_author_api
node_browser -->|"reviews submissions"| node_editor_api
node_browser -->|"loads history"| node_review_history
node_browser -.->|"renders"| node_login_view
node_browser -.->|"renders"| node_author_views
node_browser -.->|"renders"| node_submission_form
node_browser -.->|"renders"| node_editor_queue_view
node_browser -.->|"renders"| node_review_view
node_login_view -.->|"extends"| node_page_shell
node_author_views -.->|"extends"| node_page_shell
node_submission_form -.->|"extends"| node_page_shell
node_editor_queue_view -.->|"extends"| node_page_shell
node_review_view -.->|"extends"| node_page_shell
node_auth -->|"queries users"| node_db_access
node_author_api -->|"queries submissions"| node_db_access
node_editor_api -->|"queries submissions"| node_db_access
node_review_history -->|"queries history"| node_db_access
node_db_access -->|"opens pool"| node_postgres
node_schema -.->|"defines tables"| node_postgres
node_review_upgrade -.->|"upgrades schema"| node_postgres
node_seed -.->|"seeds users"| node_postgres
node_editor_api -.->|"records decisions"| node_review_history

click node_browser "https://github.com/alicekuo1016/113213004-submission/blob/master/www/app.js"
click node_login_view "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/login.html"
click node_author_views "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/author_submissions.html"
click node_submission_form "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/submission_form.html"
click node_editor_queue_view "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/editor_queue.html"
click node_review_view "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/review_detail.html"
click node_page_shell "https://github.com/alicekuo1016/113213004-submission/blob/master/templates/base.html"
click node_auth "https://github.com/alicekuo1016/113213004-submission/blob/master/main.py"
click node_author_api "https://github.com/alicekuo1016/113213004-submission/blob/master/main.py"
click node_editor_api "https://github.com/alicekuo1016/113213004-submission/blob/master/main.py"
click node_review_history "https://github.com/alicekuo1016/113213004-submission/blob/master/main.py"
click node_db_access "https://github.com/alicekuo1016/113213004-submission/blob/master/db.py"
click node_schema "https://github.com/alicekuo1016/113213004-submission/blob/master/schema.sql"
click node_review_upgrade "https://github.com/alicekuo1016/113213004-submission/blob/master/upgrade_reviews.sql"
click node_seed "https://github.com/alicekuo1016/113213004-submission/blob/master/seed.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_browser,node_login_view,node_author_views,node_submission_form,node_editor_queue_view,node_review_view,node_page_shell toneBlue
class node_auth,node_author_api,node_editor_api,node_review_history toneAmber
class node_postgres,node_db_access,node_schema,node_review_upgrade,node_seed toneMint
class node_author,node_editor toneIndigo
```

## Components

### Web experience

- [Browser client](https://github.com/alicekuo1016/113213004-submission/blob/master/www/app.js): `www/app.js`
- [Login view](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/login.html): `templates/login.html`
- [Author views](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/author_submissions.html): `templates/author_submissions.html`
- [Submission form](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/submission_form.html): `templates/submission_form.html`
- [Editor queue](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/editor_queue.html): `templates/editor_queue.html`
- [Review detail](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/review_detail.html): `templates/review_detail.html`
- [Shared layout](https://github.com/alicekuo1016/113213004-submission/blob/master/templates/base.html): `templates/base.html`

### Application API

- [Authentication](https://github.com/alicekuo1016/113213004-submission/blob/master/main.py): `main.py`
- [Author submissions](https://github.com/alicekuo1016/113213004-submission/blob/master/main.py): `main.py`
- [Editor review](https://github.com/alicekuo1016/113213004-submission/blob/master/main.py): `main.py`
- [Review history](https://github.com/alicekuo1016/113213004-submission/blob/master/main.py): `main.py`

### Persistence

- **PostgreSQL**
- [DB connection pool](https://github.com/alicekuo1016/113213004-submission/blob/master/db.py): `db.py`
- [Database schema](https://github.com/alicekuo1016/113213004-submission/blob/master/schema.sql): `schema.sql`
- [Review migration](https://github.com/alicekuo1016/113213004-submission/blob/master/upgrade_reviews.sql): `upgrade_reviews.sql`
- [Demo accounts](https://github.com/alicekuo1016/113213004-submission/blob/master/seed.sql): `seed.sql`

### Other components

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

## Connections

- Author → Browser client: uses (evidence: `README.md`)
- Editor → Browser client: uses (evidence: `README.md`)
- Browser client → Authentication: logs in (evidence: `www/app.js`)
- Browser client → Author submissions: manages drafts (evidence: `www/app.js`)
- Browser client → Editor review: reviews submissions (evidence: `www/app.js`)
- Browser client → Review history: loads history (evidence: `www/app.js`)
- Browser client → Login view: renders
- Browser client → Author views: renders
- Browser client → Submission form: renders
- Browser client → Editor queue: renders
- Browser client → Review detail: renders
- Login view → Shared layout: extends
- Author views → Shared layout: extends
- Submission form → Shared layout: extends
- Editor queue → Shared layout: extends
- Review detail → Shared layout: extends
- Authentication → DB connection pool: queries users (evidence: `main.py`)
- Author submissions → DB connection pool: queries submissions (evidence: `main.py`)
- Editor review → DB connection pool: queries submissions (evidence: `main.py`)
- Review history → DB connection pool: queries history (evidence: `main.py`)
- DB connection pool → PostgreSQL: opens pool (evidence: `db.py`)
- Database schema → PostgreSQL: defines tables
- Review migration → PostgreSQL: upgrades schema
- Demo accounts → PostgreSQL: seeds users
- Editor review → Review history: records decisions (evidence: `main.py`)
