# drjag-id/mvc-uco architecture

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

- Interactive diagram: https://gitdiagram.com/drjag-id/mvc-uco
- Repository: https://github.com/drjag-id/mvc-uco

## Overview

UCO Presence is a presence-registration and attendance system with user/admin views, Indonesian spoken-number liveness verification, photo capture, and Flask/SQLite capabilities documented in the README. The principal flow is login, then either initialize a user for admin approval or complete verified attendance; admins manage initialization and attendance records. Sampled frontend code calls a browser-local store, while the README describes a Flask/SQLite API. The backend implementation was read but not excerpted, so API-to-database detail follows the README; several backend/UI wiring details remain unverified.

Main entry points: [`src/App.tsx`](https://github.com/drjag-id/mvc-uco/blob/main/src/App.tsx) (Route controller), [`app.py`](https://github.com/drjag-id/mvc-uco/blob/main/app.py) (Flask API), [`src/components/AbsencePage.tsx`](https://github.com/drjag-id/mvc-uco/blob/main/src/components/AbsencePage.tsx) (Attendance capture), [`src/models/store.ts`](https://github.com/drjag-id/mvc-uco/blob/main/src/models/store.ts) (Browser data store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["Route controller<br/>[App.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_navigation["Navigation<br/>[Navbar.tsx]"]
  node_admin_layout["Admin layout<br/>[AdminLayout.tsx]"]
  node_tooltip["Help tooltips<br/>[InfoTooltip.tsx]"]
end

subgraph group_workflow["Presence workflows"]
  node_initialization["User initialization"]
  node_id_generator["ID and timestamp<br/>[idGenerator.ts]"]
  node_attendance["Attendance capture<br/>[AbsencePage.tsx]"]
  node_liveness["Speech liveness"]
  node_camera["Browser camera and speech"]
end

subgraph group_admin["Administration"]
  node_approval["Initialization approval"]
  node_attendance_admin["Attendance management"]
  node_console["API and Docker console"]
end

subgraph group_data["Data and API"]
  node_store[("Browser data store<br/>[store.ts]")]
  node_flask["Flask API<br/>[app.py]"]
  node_sqlite[("SQLite database<br/>[dataabsen.sql]")]
end

node_visitor(("User or admin"))

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_login
node_app -->|"renders"| node_navigation
node_app -->|"routes to"| node_initialization
node_app -->|"routes to"| node_attendance
node_app -->|"renders"| node_admin_layout
node_app -->|"routes to"| node_approval
node_app -->|"routes to"| node_attendance_admin
node_app -->|"routes to"| node_console
node_login -->|"authenticates with"| node_store
node_initialization -->|"generates ID with"| node_id_generator
node_initialization -->|"submits registration to"| node_store
node_attendance -->|"checks speech with"| node_liveness
node_attendance -->|"captures photo and speech via"| node_camera
node_attendance -->|"records attendance in"| node_store
node_approval -->|"manages registrations in"| node_store
node_attendance_admin -->|"manages records in"| node_store
node_admin_layout -->|"hosts"| node_approval
node_admin_layout -->|"hosts"| node_attendance_admin
node_initialization -.->|"submits registration to"| node_flask
node_attendance -.->|"posts attendance to"| node_flask
node_approval -.->|"manages via"| node_flask
node_attendance_admin -.->|"retrieves records via"| node_flask
node_flask -->|"reads and writes"| node_sqlite
node_console -.->|"tests API"| node_flask

click node_app "https://github.com/drjag-id/mvc-uco/blob/main/src/App.tsx"
click node_login "https://github.com/drjag-id/mvc-uco/blob/main/src/components/LoginPage.tsx"
click node_navigation "https://github.com/drjag-id/mvc-uco/blob/main/src/components/Navbar.tsx"
click node_admin_layout "https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminLayout.tsx"
click node_tooltip "https://github.com/drjag-id/mvc-uco/blob/main/src/components/InfoTooltip.tsx"
click node_initialization "https://github.com/drjag-id/mvc-uco/blob/main/src/components/InitializationPage.tsx"
click node_id_generator "https://github.com/drjag-id/mvc-uco/blob/main/src/controllers/idGenerator.ts"
click node_attendance "https://github.com/drjag-id/mvc-uco/blob/main/src/components/AbsencePage.tsx"
click node_liveness "https://github.com/drjag-id/mvc-uco/blob/main/src/controllers/livenessController.ts"
click node_approval "https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminApprovalPage.tsx"
click node_attendance_admin "https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminAbsencePage.tsx"
click node_console "https://github.com/drjag-id/mvc-uco/blob/main/src/components/FlaskDockerConsole.tsx"
click node_store "https://github.com/drjag-id/mvc-uco/blob/main/src/models/store.ts"
click node_flask "https://github.com/drjag-id/mvc-uco/blob/main/app.py"
click node_sqlite "https://github.com/drjag-id/mvc-uco/blob/main/dataabsen.sql"

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_app,node_login,node_navigation,node_admin_layout,node_tooltip,node_visitor toneBlue
class node_initialization,node_id_generator,node_attendance,node_liveness,node_camera toneAmber
class node_approval,node_attendance_admin,node_console toneMint
class node_store,node_flask,node_sqlite toneRose
```

## Components

### User interface

- [Route controller](https://github.com/drjag-id/mvc-uco/blob/main/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/drjag-id/mvc-uco/blob/main/src/components/LoginPage.tsx): `src/components/LoginPage.tsx`
- [Navigation](https://github.com/drjag-id/mvc-uco/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Admin layout](https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminLayout.tsx): `src/components/AdminLayout.tsx`
- [Help tooltips](https://github.com/drjag-id/mvc-uco/blob/main/src/components/InfoTooltip.tsx): `src/components/InfoTooltip.tsx`

### Presence workflows

- [User initialization](https://github.com/drjag-id/mvc-uco/blob/main/src/components/InitializationPage.tsx): `src/components/InitializationPage.tsx`
- [ID and timestamp](https://github.com/drjag-id/mvc-uco/blob/main/src/controllers/idGenerator.ts): `src/controllers/idGenerator.ts`
- [Attendance capture](https://github.com/drjag-id/mvc-uco/blob/main/src/components/AbsencePage.tsx): `src/components/AbsencePage.tsx`
- [Speech liveness](https://github.com/drjag-id/mvc-uco/blob/main/src/controllers/livenessController.ts): `src/controllers/livenessController.ts`
- **Browser camera and speech**

### Administration

- [Initialization approval](https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminApprovalPage.tsx): `src/components/AdminApprovalPage.tsx`
- [Attendance management](https://github.com/drjag-id/mvc-uco/blob/main/src/components/AdminAbsencePage.tsx): `src/components/AdminAbsencePage.tsx`
- [API and Docker console](https://github.com/drjag-id/mvc-uco/blob/main/src/components/FlaskDockerConsole.tsx): `src/components/FlaskDockerConsole.tsx`

### Data and API

- [Browser data store](https://github.com/drjag-id/mvc-uco/blob/main/src/models/store.ts): `src/models/store.ts`
- [Flask API](https://github.com/drjag-id/mvc-uco/blob/main/app.py): `app.py`
- [SQLite database](https://github.com/drjag-id/mvc-uco/blob/main/dataabsen.sql): `dataabsen.sql`

### Other components

- **User or admin**

## Connections

- User or admin → Route controller: opens app (evidence: `README.md`)
- Route controller → Login: routes to (evidence: `src/App.tsx`)
- Route controller → Navigation: renders (evidence: `src/App.tsx`)
- Route controller → User initialization: routes to (evidence: `src/App.tsx`)
- Route controller → Attendance capture: routes to (evidence: `src/App.tsx`)
- Route controller → Admin layout: renders (evidence: `src/App.tsx`)
- Route controller → Initialization approval: routes to (evidence: `src/App.tsx`)
- Route controller → Attendance management: routes to (evidence: `src/App.tsx`)
- Route controller → API and Docker console: routes to (evidence: `src/App.tsx`)
- Login → Browser data store: authenticates with (evidence: `src/components/LoginPage.tsx`)
- User initialization → ID and timestamp: generates ID with (evidence: `src/components/InitializationPage.tsx`)
- User initialization → Browser data store: submits registration to (evidence: `src/components/InitializationPage.tsx`)
- Attendance capture → Speech liveness: checks speech with (evidence: `src/components/AbsencePage.tsx`)
- Attendance capture → Browser camera and speech: captures photo and speech via (evidence: `README.md`)
- Attendance capture → Browser data store: records attendance in (evidence: `src/components/AbsencePage.tsx`)
- Initialization approval → Browser data store: manages registrations in (evidence: `src/components/AdminApprovalPage.tsx`)
- Attendance management → Browser data store: manages records in (evidence: `src/components/AdminAbsencePage.tsx`)
- Admin layout → Initialization approval: hosts (evidence: `src/App.tsx`)
- Admin layout → Attendance management: hosts (evidence: `src/App.tsx`)
- User initialization → Flask API: submits registration to (evidence: `README.md`)
- Attendance capture → Flask API: posts attendance to (evidence: `README.md`)
- Initialization approval → Flask API: manages via (evidence: `README.md`)
- Attendance management → Flask API: retrieves records via (evidence: `README.md`)
- Flask API → SQLite database: reads and writes (evidence: `README.md`)
- API and Docker console → Flask API: tests API (evidence: `README.md`)
