# uvsax/px4x architecture

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

- Interactive diagram: https://gitdiagram.com/uvsax/px4x
- Repository: https://github.com/uvsax/px4x

## Overview

PX4X is an Arabic, multi-user presentation and document manager. A user signs in, uploads and manages private files, previews them through an online viewer, or creates public share links. The backend also supports optional Google OAuth. The excerpts show FastAPI routes, SQLite access, file handling, and static UI mounting; the frontend implementation and some route bodies were not sampled, so UI-to-API interactions are marked unverified.

Main entry points: [`app.py`](https://github.com/uvsax/px4x/blob/main/app.py) (FastAPI application), [`static/index.html`](https://github.com/uvsax/px4x/blob/main/static/index.html) (Arabic web UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_ui["Arabic web UI<br/>[index.html]"]
  node_api["FastAPI application<br/>[app.py]"]
  node_privacy["Privacy page<br/>[app.py]"]
end

subgraph group_identity["Identity and accounts"]
  node_auth["Account sessions<br/>[app.py]"]
  node_google["Google OAuth<br/>[app.py]"]
  node_db[("SQLite records<br/>[app.py]")]
end

subgraph group_documents["File management"]
  node_upload["File upload<br/>[app.py]"]
  node_library["Private file library<br/>[app.py]"]
  node_storage[("Uploaded files<br/>[app.py]")]
end

subgraph group_sharing["Preview and sharing"]
  node_preview["Viewer access tokens<br/>[app.py]"]
  node_public_share["Public share links<br/>[app.py]"]
end

node_user(("User"))
node_google_service["Google identity"]
node_office["Microsoft viewer"]

node_user -->|"uses"| node_ui
node_api -->|"serves"| node_ui
node_ui -.->|"calls API"| node_api
node_api -->|"routes auth"| node_auth
node_auth -->|"reads/writes"| node_db
node_api -->|"routes OAuth"| node_google
node_google -->|"requests identity"| node_google_service
node_google -->|"finds/creates user"| node_db
node_api -->|"routes upload"| node_upload
node_upload -->|"stores files"| node_storage
node_api -->|"routes file actions"| node_library
node_library -->|"lists/reads/deletes"| node_storage
node_api -->|"issues tokens"| node_preview
node_preview -->|"authorizes file fetch"| node_storage
node_preview -->|"provides viewer URL"| node_office
node_api -->|"routes sharing"| node_public_share
node_public_share -->|"reads share records"| node_db
node_public_share -->|"serves shared file"| node_storage
node_api -->|"serves page"| node_privacy

click node_ui "https://github.com/uvsax/px4x/blob/main/static/index.html"
click node_api "https://github.com/uvsax/px4x/blob/main/app.py"
click node_auth "https://github.com/uvsax/px4x/blob/main/app.py"
click node_google "https://github.com/uvsax/px4x/blob/main/app.py"
click node_db "https://github.com/uvsax/px4x/blob/main/app.py"
click node_upload "https://github.com/uvsax/px4x/blob/main/app.py"
click node_library "https://github.com/uvsax/px4x/blob/main/app.py"
click node_storage "https://github.com/uvsax/px4x/blob/main/app.py"
click node_preview "https://github.com/uvsax/px4x/blob/main/app.py"
click node_public_share "https://github.com/uvsax/px4x/blob/main/app.py"
click node_privacy "https://github.com/uvsax/px4x/blob/main/app.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_ui,node_api,node_privacy,node_user,node_office toneBlue
class node_auth,node_google,node_db toneAmber
class node_upload,node_library,node_storage toneMint
class node_preview,node_public_share toneRose
class node_google_service toneIndigo
```

## Components

### Web interface

- [Arabic web UI](https://github.com/uvsax/px4x/blob/main/static/index.html): `static/index.html`
- [FastAPI application](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [Privacy page](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`

### Identity and accounts

- [Account sessions](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [Google OAuth](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [SQLite records](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`

### File management

- [File upload](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [Private file library](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [Uploaded files](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`

### Preview and sharing

- [Viewer access tokens](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`
- [Public share links](https://github.com/uvsax/px4x/blob/main/app.py): `app.py`

### Other components

- **User**
- **Google identity**
- **Microsoft viewer**

## Connections

- User → Arabic web UI: uses (evidence: `README.md`)
- FastAPI application → Arabic web UI: serves (evidence: `app.py`)
- Arabic web UI → FastAPI application: calls API
- FastAPI application → Account sessions: routes auth (evidence: `app.py`)
- Account sessions → SQLite records: reads/writes (evidence: `app.py`)
- FastAPI application → Google OAuth: routes OAuth (evidence: `app.py`)
- Google OAuth → Google identity: requests identity (evidence: `app.py`)
- Google OAuth → SQLite records: finds/creates user (evidence: `app.py`)
- FastAPI application → File upload: routes upload (evidence: `app.py`)
- File upload → Uploaded files: stores files (evidence: `README.md`)
- FastAPI application → Private file library: routes file actions (evidence: `app.py`)
- Private file library → Uploaded files: lists/reads/deletes (evidence: `app.py`)
- FastAPI application → Viewer access tokens: issues tokens (evidence: `app.py`)
- Viewer access tokens → Uploaded files: authorizes file fetch (evidence: `app.py`)
- Viewer access tokens → Microsoft viewer: provides viewer URL (evidence: `README.md`)
- FastAPI application → Public share links: routes sharing (evidence: `app.py`)
- Public share links → SQLite records: reads share records (evidence: `app.py`)
- Public share links → Uploaded files: serves shared file (evidence: `app.py`)
- FastAPI application → Privacy page: serves page (evidence: `app.py`)
