# mithra-c/secure-login architecture

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

- Interactive diagram: https://gitdiagram.com/mithra-c/secure-login
- Repository: https://github.com/mithra-c/secure-login

## Overview

This is a small Flask account-authentication web app: users register, log in, encounter failed-attempt account locking, view a session-protected dashboard, and log out. The app handles requests and authentication decisions; SQLite stores user credentials and failed-attempt counts. A separate script creates the users table. The README documents the screens and lockout behavior, but provides no implementation details for the templates or stylesheet; their wiring is therefore not inferred.

Main entry points: [`app.py`](https://github.com/mithra-c/secure-login/blob/main/app.py) (Flask routes), [`database.py`](https://github.com/mithra-c/secure-login/blob/main/database.py) (Schema initializer), [`templates/register.html`](https://github.com/mithra-c/secure-login/blob/main/templates/register.html) (Registration page), [`templates/login.html`](https://github.com/mithra-c/secure-login/blob/main/templates/login.html) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflow"]
  node_flask["Flask routes<br/>[app.py]"]
  node_register["Registration page<br/>[register.html]"]
  node_login["Login page<br/>[login.html]"]
  node_dashboard["Dashboard page<br/>[dashboard.html]"]
end

subgraph group_auth["Account logic"]
  node_credentials["Credential checks<br/>[app.py]"]
  node_sessions["Session access<br/>[app.py]"]
end

subgraph group_storage["SQLite storage"]
  node_db_init["Schema initializer<br/>[database.py]"]
  node_users_db[("Users database")]
end

node_browser(("Browser user"))

node_browser -->|"submits requests"| node_flask
node_flask -->|"renders"| node_register
node_flask -->|"renders"| node_login
node_flask -->|"renders"| node_dashboard
node_flask -->|"checks credentials"| node_credentials
node_flask -->|"manages session"| node_sessions
node_flask -->|"reads and updates"| node_users_db
node_db_init -->|"creates schema"| node_users_db

click node_flask "https://github.com/mithra-c/secure-login/blob/main/app.py"
click node_register "https://github.com/mithra-c/secure-login/blob/main/templates/register.html"
click node_login "https://github.com/mithra-c/secure-login/blob/main/templates/login.html"
click node_dashboard "https://github.com/mithra-c/secure-login/blob/main/templates/dashboard.html"
click node_credentials "https://github.com/mithra-c/secure-login/blob/main/app.py"
click node_sessions "https://github.com/mithra-c/secure-login/blob/main/app.py"
click node_db_init "https://github.com/mithra-c/secure-login/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_flask,node_register,node_login,node_dashboard,node_browser toneBlue
class node_credentials,node_sessions toneAmber
class node_db_init,node_users_db toneMint
```

## Components

### Web workflow

- [Flask routes](https://github.com/mithra-c/secure-login/blob/main/app.py): `app.py`
- [Registration page](https://github.com/mithra-c/secure-login/blob/main/templates/register.html): `templates/register.html`
- [Login page](https://github.com/mithra-c/secure-login/blob/main/templates/login.html): `templates/login.html`
- [Dashboard page](https://github.com/mithra-c/secure-login/blob/main/templates/dashboard.html): `templates/dashboard.html`

### Account logic

- [Credential checks](https://github.com/mithra-c/secure-login/blob/main/app.py): `app.py`
- [Session access](https://github.com/mithra-c/secure-login/blob/main/app.py): `app.py`

### SQLite storage

- [Schema initializer](https://github.com/mithra-c/secure-login/blob/main/database.py): `database.py`
- **Users database**

### Other components

- **Browser user**

## Connections

- Browser user → Flask routes: submits requests (evidence: `app.py`)
- Flask routes → Registration page: renders (evidence: `app.py`)
- Flask routes → Login page: renders (evidence: `app.py`)
- Flask routes → Dashboard page: renders (evidence: `app.py`)
- Flask routes → Credential checks: checks credentials (evidence: `app.py`)
- Flask routes → Session access: manages session (evidence: `app.py`)
- Flask routes → Users database: reads and updates (evidence: `app.py`)
- Schema initializer → Users database: creates schema (evidence: `database.py`)
