# nicy95319/submission architecture

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

## Overview

This is a FastAPI manuscript-submission app for authors and editors. Authors log in, create and edit drafts, and submit them for review; editors can list submissions and mark them approved or return them to editing. FastAPI routes render role-specific pages, validate API inputs, and use SQLAlchemy models and sessions to persist users and submissions in PostgreSQL. The template contents were not excerpted, so their internal behavior is not shown.

Main entry points: [`main.py`](https://github.com/nicy95319/submission/blob/main/main.py) (FastAPI routes), [`database.py`](https://github.com/nicy95319/submission/blob/main/database.py) (Database sessions), [`models.py`](https://github.com/nicy95319/submission/blob/main/models.py) (User and submissions), [`templates`](https://github.com/nicy95319/submission/tree/main/templates) (Role pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_pages["Role pages"]
end

subgraph group_api["Application API"]
  node_routes["FastAPI routes<br/>[main.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
end

subgraph group_persistence["Persistence"]
  node_models["User and submissions<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

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

node_author -->|"uses routes"| node_routes
node_editor -->|"uses routes"| node_routes
node_routes -->|"renders"| node_pages
node_routes -->|"validates inputs"| node_schemas
node_routes -->|"queries and updates"| node_models
node_routes -->|"opens sessions"| node_db_session
node_models -->|"uses base"| node_db_session
node_db_session -->|"connects to"| node_postgres

click node_pages "https://github.com/nicy95319/submission/tree/main/templates"
click node_routes "https://github.com/nicy95319/submission/blob/main/main.py"
click node_schemas "https://github.com/nicy95319/submission/blob/main/schemas.py"
click node_models "https://github.com/nicy95319/submission/blob/main/models.py"
click node_db_session "https://github.com/nicy95319/submission/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_pages toneBlue
class node_routes,node_schemas toneAmber
class node_models,node_db_session,node_postgres toneMint
class node_author,node_editor toneIndigo
```

## Components

### Web interface

- [Role pages](https://github.com/nicy95319/submission/tree/main/templates): `templates`

### Application API

- [FastAPI routes](https://github.com/nicy95319/submission/blob/main/main.py): `main.py`
- [Request schemas](https://github.com/nicy95319/submission/blob/main/schemas.py): `schemas.py`

### Persistence

- [User and submissions](https://github.com/nicy95319/submission/blob/main/models.py): `models.py`
- [Database sessions](https://github.com/nicy95319/submission/blob/main/database.py): `database.py`
- **PostgreSQL**

### Other components

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

## Connections

- Author → FastAPI routes: uses routes (evidence: `main.py`)
- Editor → FastAPI routes: uses routes (evidence: `main.py`)
- FastAPI routes → Role pages: renders (evidence: `main.py`)
- FastAPI routes → Request schemas: validates inputs (evidence: `main.py`)
- FastAPI routes → User and submissions: queries and updates (evidence: `main.py`)
- FastAPI routes → Database sessions: opens sessions (evidence: `main.py`)
- User and submissions → Database sessions: uses base (evidence: `models.py`)
- Database sessions → PostgreSQL: connects to (evidence: `database.py`)
