# alankurian1015-sudo/secure_app architecture

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

- Interactive diagram: https://gitdiagram.com/alankurian1015-sudo/secure_app
- Repository: https://github.com/alankurian1015-sudo/secure_app

## Overview

SecureAuth is a Flask authentication web app. The main user journey is account registration, password login, optional TOTP verification, then access to a protected dashboard; users can also enroll or disable 2FA and log out. Routes own the workflow, while forms validate input, models define persisted user and audit data, and templates render responses. The route excerpt is partial, so the graph omits uncertain details beyond the shown registration, login, 2FA, dashboard, and logout flows.

Main entry points: [`routes.py`](https://github.com/alankurian1015-sudo/secure_app/blob/main/routes.py) (Route handlers), [`main.py`](https://github.com/alankurian1015-sudo/secure_app/blob/main/main.py) (App startup), [`app.py`](https://github.com/alankurian1015-sudo/secure_app/blob/main/app.py) (Flask app configuration), [`forms.py`](https://github.com/alankurian1015-sudo/secure_app/blob/main/forms.py) (Input forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app configuration<br/>[app.py]"]
  node_entry["App startup<br/>[main.py]"]
end

subgraph group_auth["Authentication"]
  node_routes["Route handlers<br/>[routes.py]"]
  node_forms["Input forms<br/>[forms.py]"]
end

subgraph group_data["Persistence"]
  node_users["User and audit models<br/>[models.py]"]
  node_sqlite[("SQLite database<br/>[app.py]")]
end

subgraph group_ui["User interface"]
  node_templates["Page templates"]
end

node_visitor(("Visitor"))
node_bcrypt["Password hashing"]
node_totp["TOTP verification"]
node_qr["QR generation"]

node_visitor -->|"submits requests"| node_routes
node_entry -->|"initializes"| node_app
node_entry -->|"loads routes"| node_routes
node_routes -->|"validates input"| node_forms
node_routes -->|"queries and updates"| node_users
node_routes -->|"reads and writes"| node_sqlite
node_app -->|"configures database"| node_sqlite
node_routes -->|"renders pages"| node_templates
node_routes -->|"hashes and checks"| node_bcrypt
node_routes -->|"verifies codes"| node_totp
node_routes -->|"creates setup QR"| node_qr

click node_app "https://github.com/alankurian1015-sudo/secure_app/blob/main/app.py"
click node_entry "https://github.com/alankurian1015-sudo/secure_app/blob/main/main.py"
click node_routes "https://github.com/alankurian1015-sudo/secure_app/blob/main/routes.py"
click node_forms "https://github.com/alankurian1015-sudo/secure_app/blob/main/forms.py"
click node_users "https://github.com/alankurian1015-sudo/secure_app/blob/main/models.py"
click node_sqlite "https://github.com/alankurian1015-sudo/secure_app/blob/main/app.py"
click node_templates "https://github.com/alankurian1015-sudo/secure_app/tree/main/templates"

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_entry toneBlue
class node_routes,node_forms toneAmber
class node_users,node_sqlite toneMint
class node_templates toneRose
class node_visitor,node_bcrypt,node_totp,node_qr toneIndigo
```

## Components

### Web application

- [Flask app configuration](https://github.com/alankurian1015-sudo/secure_app/blob/main/app.py): `app.py`
- [App startup](https://github.com/alankurian1015-sudo/secure_app/blob/main/main.py): `main.py`

### Authentication

- [Route handlers](https://github.com/alankurian1015-sudo/secure_app/blob/main/routes.py): `routes.py`
- [Input forms](https://github.com/alankurian1015-sudo/secure_app/blob/main/forms.py): `forms.py`

### Persistence

- [User and audit models](https://github.com/alankurian1015-sudo/secure_app/blob/main/models.py): `models.py`
- [SQLite database](https://github.com/alankurian1015-sudo/secure_app/blob/main/app.py): `app.py`

### User interface

- [Page templates](https://github.com/alankurian1015-sudo/secure_app/tree/main/templates): `templates`

### Other components

- **Visitor**
- **Password hashing**
- **TOTP verification**
- **QR generation**

## Connections

- Visitor → Route handlers: submits requests
- App startup → Flask app configuration: initializes
- App startup → Route handlers: loads routes
- Route handlers → Input forms: validates input
- Route handlers → User and audit models: queries and updates
- Route handlers → SQLite database: reads and writes
- Flask app configuration → SQLite database: configures database
- Route handlers → Page templates: renders pages
- Route handlers → Password hashing: hashes and checks
- Route handlers → TOTP verification: verifies codes
- Route handlers → QR generation: creates setup QR
