# yutsen1072/semid architecture

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

## Overview

This is a Chinese-language authoring and editorial-review web application. Authors register or sign in, create and edit draft submissions, attach PDFs, then submit them for review; editors retrieve submissions and approve or reject them. The browser UI in script.js calls the FastAPI service in main.py, which handles authentication, submission workflows, and attachment access using SQLModel persistence. The excerpts show these routes and browser calls, but not all review-route behavior or database configuration; models.py is included as a separate submission-model file because its use by main.py is not evidenced.

Main entry points: [`main.py`](https://github.com/yutsen1072/semid/blob/main/main.py) (FastAPI routes), [`index.html`](https://github.com/yutsen1072/semid/blob/main/index.html) (Web page), [`script.js`](https://github.com/yutsen1072/semid/blob/main/script.js) (Browser workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_page["Web page<br/>[index.html]"]
  node_browser["Browser workflows<br/>[script.js]"]
end

subgraph group_service["API service"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_auth["Authentication<br/>[main.py]"]
end

subgraph group_domain["Submission workflow"]
  node_submissions["Submission lifecycle<br/>[main.py]"]
  node_pdf["PDF attachments<br/>[main.py]"]
  node_review["Editorial review<br/>[main.py]"]
end

subgraph group_persistence["Data layer"]
  node_db[("SQLModel database<br/>[main.py]")]
  node_submission_model["Submission model<br/>[models.py]"]
end

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

node_author -->|"uses"| node_page
node_editor -->|"uses"| node_page
node_page -.->|"hosts"| node_browser
node_browser -->|"calls API"| node_api
node_api -->|"routes auth"| node_auth
node_api -->|"routes submissions"| node_submissions
node_api -->|"routes attachments"| node_pdf
node_api -->|"routes reviews"| node_review
node_auth -->|"reads and writes"| node_db
node_submissions -->|"reads and writes"| node_db
node_pdf -->|"checks metadata"| node_db
node_review -->|"updates status"| node_db

click node_page "https://github.com/yutsen1072/semid/blob/main/index.html"
click node_browser "https://github.com/yutsen1072/semid/blob/main/script.js"
click node_api "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_auth "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_submissions "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_pdf "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_review "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_db "https://github.com/yutsen1072/semid/blob/main/main.py"
click node_submission_model "https://github.com/yutsen1072/semid/blob/main/models.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_page,node_browser toneBlue
class node_api,node_auth toneAmber
class node_submissions,node_pdf,node_review toneMint
class node_db,node_submission_model toneRose
class node_author,node_editor toneIndigo
```

## Components

### Browser client

- [Web page](https://github.com/yutsen1072/semid/blob/main/index.html): `index.html`
- [Browser workflows](https://github.com/yutsen1072/semid/blob/main/script.js): `script.js`

### API service

- [FastAPI routes](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`
- [Authentication](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`

### Submission workflow

- [Submission lifecycle](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`
- [PDF attachments](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`
- [Editorial review](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`

### Data layer

- [SQLModel database](https://github.com/yutsen1072/semid/blob/main/main.py): `main.py`
- [Submission model](https://github.com/yutsen1072/semid/blob/main/models.py): `models.py`

### Other components

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

## Connections

- Author → Web page: uses
- Editor → Web page: uses
- Web page → Browser workflows: hosts
- Browser workflows → FastAPI routes: calls API (evidence: `script.js`)
- FastAPI routes → Authentication: routes auth (evidence: `main.py`)
- FastAPI routes → Submission lifecycle: routes submissions (evidence: `main.py`)
- FastAPI routes → PDF attachments: routes attachments (evidence: `main.py`)
- FastAPI routes → Editorial review: routes reviews (evidence: `main.py`)
- Authentication → SQLModel database: reads and writes (evidence: `main.py`)
- Submission lifecycle → SQLModel database: reads and writes (evidence: `main.py`)
- PDF attachments → SQLModel database: checks metadata (evidence: `main.py`)
- Editorial review → SQLModel database: updates status (evidence: `main.py`)
