# sriharsha93/zkp-auth-framework architecture

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

- Interactive diagram: https://gitdiagram.com/sriharsha93/zkp-auth-framework
- Repository: https://github.com/sriharsha93/zkp-auth-framework

## Overview

zkp-auth-framework is a FastAPI authentication application with browser-facing pages and a ZKP-style proof mechanism. Users request registration, login, dashboard, password-reset, and security-log pages through the application; the app also registers an API router, initializes its database and CSV files at startup, and renders templates. The sampled security module implements password hashing, JWTs, HMAC proofs, and OTP utilities. The routes implementation was not excerpted, so its detailed workflow and connections to security or persistence are not asserted.

Main entry points: [`app/main.py`](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/main.py) (FastAPI app), [`app/database.py`](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/database.py) (Database setup), [`app/routes.py`](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/routes.py) (API routes), [`app/models.py`](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/models.py) (User and security models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["FastAPI app<br/>[main.py]"]
  node_api["API routes<br/>[routes.py]"]
  node_pages["Page templates"]
  node_assets["Static assets"]
end

subgraph group_auth["Authentication security"]
  node_security["Auth security utilities<br/>[security.py]"]
end

subgraph group_data["Data persistence"]
  node_models["User and security models<br/>[models.py]"]
  node_database["Database setup<br/>[database.py]"]
  node_sqlite[("SQLite database")]
end

node_user(("Browser user"))

node_user -->|"requests pages"| node_app
node_app -->|"registers router"| node_api
node_app -->|"initializes CSV files"| node_api
node_app -->|"renders pages"| node_pages
node_app -->|"mounts assets"| node_assets
node_app -->|"initializes database"| node_database
node_models -->|"uses ORM base"| node_database
node_database -->|"configures connection"| node_sqlite

click node_app "https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/main.py"
click node_api "https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/routes.py"
click node_pages "https://github.com/sriharsha93/zkp-auth-framework/tree/main/app/templates"
click node_assets "https://github.com/sriharsha93/zkp-auth-framework/tree/main/app/static"
click node_security "https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/security.py"
click node_models "https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/models.py"
click node_database "https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/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_app,node_api,node_pages,node_assets,node_user toneBlue
class node_security toneAmber
class node_models,node_database,node_sqlite toneMint
```

## Components

### Web application

- [FastAPI app](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/main.py): `app/main.py`
- [API routes](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/routes.py): `app/routes.py`
- [Page templates](https://github.com/sriharsha93/zkp-auth-framework/tree/main/app/templates): `app/templates`
- [Static assets](https://github.com/sriharsha93/zkp-auth-framework/tree/main/app/static): `app/static`

### Authentication security

- [Auth security utilities](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/security.py): `app/security.py`

### Data persistence

- [User and security models](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/models.py): `app/models.py`
- [Database setup](https://github.com/sriharsha93/zkp-auth-framework/blob/main/app/database.py): `app/database.py`
- **SQLite database**

### Other components

- **Browser user**

## Connections

- Browser user → FastAPI app: requests pages (evidence: `app/main.py`)
- FastAPI app → API routes: registers router (evidence: `app/main.py`)
- FastAPI app → API routes: initializes CSV files (evidence: `app/main.py`)
- FastAPI app → Page templates: renders pages (evidence: `app/main.py`)
- FastAPI app → Static assets: mounts assets (evidence: `app/main.py`)
- FastAPI app → Database setup: initializes database (evidence: `app/main.py`)
- User and security models → Database setup: uses ORM base (evidence: `app/models.py`)
- Database setup → SQLite database: configures connection (evidence: `app/database.py`)
