# ray20060511-maker/113213011_midterm architecture

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

- Interactive diagram: https://gitdiagram.com/ray20060511-maker/113213011_midterm
- Repository: https://github.com/ray20060511-maker/113213011_midterm

## Overview

This is a small FastAPI submission-and-review application. Users access the served homepage and use API routes to register or log in, draft and manage articles, submit them for review, and approve or return them. The routes use SQLAlchemy models and database sessions backed by PostgreSQL. Workflow stages share main.py; the index.html contents were not sampled, so its client-side behavior is unknown.

Main entry points: [`main.py`](https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py) (FastAPI routes), [`database.py`](https://github.com/ray20060511-maker/113213011_midterm/blob/main/database.py) (Database sessions), [`models.py`](https://github.com/ray20060511-maker/113213011_midterm/blob/main/models.py) (User and article models), [`index.html`](https://github.com/ray20060511-maker/113213011_midterm/blob/main/index.html) (Homepage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_homepage["Homepage<br/>[index.html]"]
end

subgraph group_workflow["Submission workflow"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_account["Account access<br/>[main.py]"]
  node_author["Author submissions<br/>[main.py]"]
  node_editor["Editorial review<br/>[main.py]"]
end

subgraph group_persistence["Data persistence"]
  node_models["User and article models<br/>[models.py]"]
  node_database["Database sessions<br/>[database.py]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]

node_user -->|"uses routes"| node_api
node_api -->|"serves"| node_homepage
node_api -->|"routes login"| node_account
node_api -->|"routes submissions"| node_author
node_api -->|"routes review"| node_editor
node_account -->|"queries users"| node_models
node_author -->|"queries articles"| node_models
node_editor -->|"queries articles"| node_models
node_account -->|"uses sessions"| node_database
node_author -->|"uses sessions"| node_database
node_editor -->|"uses sessions"| node_database
node_models -->|"uses base"| node_database
node_database -->|"connects to"| node_postgres

click node_api "https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py"
click node_homepage "https://github.com/ray20060511-maker/113213011_midterm/blob/main/index.html"
click node_account "https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py"
click node_author "https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py"
click node_editor "https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py"
click node_models "https://github.com/ray20060511-maker/113213011_midterm/blob/main/models.py"
click node_database "https://github.com/ray20060511-maker/113213011_midterm/blob/main/database.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_homepage,node_user toneBlue
class node_api,node_account,node_author,node_editor,node_postgres toneAmber
class node_models,node_database toneMint
```

## Components

### Web interface

- [Homepage](https://github.com/ray20060511-maker/113213011_midterm/blob/main/index.html): `index.html`

### Submission workflow

- [FastAPI routes](https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py): `main.py`
- [Account access](https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py): `main.py`
- [Author submissions](https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py): `main.py`
- [Editorial review](https://github.com/ray20060511-maker/113213011_midterm/blob/main/main.py): `main.py`

### Data persistence

- [User and article models](https://github.com/ray20060511-maker/113213011_midterm/blob/main/models.py): `models.py`
- [Database sessions](https://github.com/ray20060511-maker/113213011_midterm/blob/main/database.py): `database.py`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → FastAPI routes: uses routes (evidence: `main.py`)
- FastAPI routes → Homepage: serves (evidence: `main.py`)
- FastAPI routes → Account access: routes login (evidence: `main.py`)
- FastAPI routes → Author submissions: routes submissions (evidence: `main.py`)
- FastAPI routes → Editorial review: routes review (evidence: `main.py`)
- Account access → User and article models: queries users (evidence: `main.py`)
- Author submissions → User and article models: queries articles (evidence: `main.py`)
- Editorial review → User and article models: queries articles (evidence: `main.py`)
- Account access → Database sessions: uses sessions (evidence: `main.py`)
- Author submissions → Database sessions: uses sessions (evidence: `main.py`)
- Editorial review → Database sessions: uses sessions (evidence: `main.py`)
- User and article models → Database sessions: uses base (evidence: `models.py`)
- Database sessions → PostgreSQL: connects to (evidence: `database.py`)
