# 0jj123/demo1117 architecture

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

## Overview

This is a FastAPI paper-submission and review application. Authors log in, create and edit papers, then submit them for editorial review; editors can inspect submissions and approve or reject them, changing their status. The application also provides role-specific lists and session-based login/logout. `main.py` owns the routes, authorization checks, SQL operations, and template rendering; `db.py` supplies the pooled PostgreSQL connection lifecycle. The excerpts show route-to-database and route-to-template relationships, but do not include the contents of `schema.sql`, so its schema details are not mapped.

Main entry points: [`main.py`](https://github.com/0jj123/demo1117/blob/main/main.py) (Application routes), [`db.py`](https://github.com/0jj123/demo1117/blob/main/db.py) (Database access), [`templates`](https://github.com/0jj123/demo1117/tree/main/templates) (HTML templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Application routes<br/>[main.py]"]
  node_sessions["Session authentication<br/>[main.py]"]
  node_templates["HTML templates"]
end

subgraph group_author["Author workflow"]
  node_author_papers["Paper authoring<br/>[main.py]"]
end

subgraph group_editor["Editorial workflow"]
  node_editor_review["Editorial review<br/>[main.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_access["Database access<br/>[db.py]"]
  node_papers_store[("Papers database")]
end

node_author_actor(("Author"))
node_editor_actor(("Editor"))

node_author_actor -->|"uses routes"| node_routes
node_editor_actor -->|"uses routes"| node_routes
node_routes -->|"checks sessions"| node_sessions
node_routes -->|"renders pages"| node_templates
node_routes -->|"routes author"| node_author_papers
node_routes -->|"routes editor"| node_editor_review
node_routes -->|"gets connection"| node_db_access
node_author_papers -->|"queries and updates"| node_db_access
node_editor_review -->|"queries and updates"| node_db_access
node_db_access -->|"opens pool"| node_papers_store

click node_routes "https://github.com/0jj123/demo1117/blob/main/main.py"
click node_sessions "https://github.com/0jj123/demo1117/blob/main/main.py"
click node_templates "https://github.com/0jj123/demo1117/tree/main/templates"
click node_author_papers "https://github.com/0jj123/demo1117/blob/main/main.py"
click node_editor_review "https://github.com/0jj123/demo1117/blob/main/main.py"
click node_db_access "https://github.com/0jj123/demo1117/blob/main/db.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_routes,node_sessions,node_templates toneBlue
class node_author_papers toneAmber
class node_editor_review toneMint
class node_db_access,node_papers_store toneRose
class node_author_actor,node_editor_actor toneIndigo
```

## Components

### Web application

- [Application routes](https://github.com/0jj123/demo1117/blob/main/main.py): `main.py`
- [Session authentication](https://github.com/0jj123/demo1117/blob/main/main.py): `main.py`
- [HTML templates](https://github.com/0jj123/demo1117/tree/main/templates): `templates`

### Author workflow

- [Paper authoring](https://github.com/0jj123/demo1117/blob/main/main.py): `main.py`

### Editorial workflow

- [Editorial review](https://github.com/0jj123/demo1117/blob/main/main.py): `main.py`

### Persistence

- [Database access](https://github.com/0jj123/demo1117/blob/main/db.py): `db.py`
- **Papers database**

### Other components

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

## Connections

- Author → Application routes: uses routes (evidence: `main.py`)
- Editor → Application routes: uses routes (evidence: `main.py`)
- Application routes → Session authentication: checks sessions (evidence: `main.py`)
- Application routes → HTML templates: renders pages (evidence: `main.py`)
- Application routes → Paper authoring: routes author (evidence: `main.py`)
- Application routes → Editorial review: routes editor (evidence: `main.py`)
- Application routes → Database access: gets connection (evidence: `main.py`)
- Paper authoring → Database access: queries and updates (evidence: `main.py`)
- Editorial review → Database access: queries and updates (evidence: `main.py`)
- Database access → Papers database: opens pool (evidence: `db.py`)
