# hmidani-abdelilah/secureauth---python-login-system-with-argon2 architecture

> Architecture diagram of the GitHub repository hmidani-abdelilah/secureauth---python-login-system-with-argon2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2
- Repository: https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2

## Overview

SecureAuth is a desktop login application. The user enters credentials in the CustomTkinter sign-in screen; the UI calls authentication logic, which checks the SQLite user record and verifies its Argon2 hash, tracks failed attempts, and records successful login time. On success, the UI displays a dashboard with account information and password-change and logout actions. The README also describes these capabilities. Evidence is limited to the README and the two excerpted Python files.

Main entry points: [`security.py`](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py) (Authentication and attempts), [`main.py`](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/main.py) (Sign-in and dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_login_ui["Sign-in and dashboard<br/>[main.py]"]
  node_password_ui["Password change<br/>[main.py]"]
end

subgraph group_auth["Authentication"]
  node_auth_logic["Authentication and attempts<br/>[security.py]"]
  node_password_hash["Argon2 hashing<br/>[security.py]"]
end

subgraph group_persistence["Account persistence"]
  node_account_db[("User records<br/>[security.py]")]
end

node_user(("User"))

node_user -->|"enters credentials"| node_login_ui
node_login_ui -->|"verifies login"| node_auth_logic
node_auth_logic -->|"verifies hash"| node_password_hash
node_auth_logic -->|"reads and updates"| node_account_db
node_auth_logic -->|"returns result"| node_login_ui
node_login_ui -->|"loads account info"| node_auth_logic
node_user -->|"requests password change"| node_password_ui
node_password_ui -->|"changes password"| node_auth_logic
node_auth_logic -->|"hashes new password"| node_password_hash
node_auth_logic -->|"stores password hash"| node_account_db
node_login_ui -->|"shows dashboard or logout"| node_login_ui

click node_login_ui "https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/main.py"
click node_password_ui "https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/main.py"
click node_auth_logic "https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py"
click node_password_hash "https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py"
click node_account_db "https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.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_login_ui,node_password_ui,node_user toneBlue
class node_auth_logic,node_password_hash toneAmber
class node_account_db toneMint
```

## Components

### Desktop interface

- [Sign-in and dashboard](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/main.py): `main.py`
- [Password change](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/main.py): `main.py`

### Authentication

- [Authentication and attempts](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py): `security.py`
- [Argon2 hashing](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py): `security.py`

### Account persistence

- [User records](https://github.com/hmidani-abdelilah/secureauth---python-login-system-with-argon2/blob/main/security.py): `security.py`

### Other components

- **User**

## Connections

- User → Sign-in and dashboard: enters credentials (evidence: `main.py`)
- Sign-in and dashboard → Authentication and attempts: verifies login (evidence: `main.py`)
- Authentication and attempts → Argon2 hashing: verifies hash (evidence: `security.py`)
- Authentication and attempts → User records: reads and updates (evidence: `security.py`)
- Authentication and attempts → Sign-in and dashboard: returns result (evidence: `main.py`)
- Sign-in and dashboard → Authentication and attempts: loads account info (evidence: `main.py`)
- User → Password change: requests password change (evidence: `main.py`)
- Password change → Authentication and attempts: changes password (evidence: `main.py`)
- Authentication and attempts → Argon2 hashing: hashes new password (evidence: `security.py`)
- Authentication and attempts → User records: stores password hash (evidence: `security.py`)
- Sign-in and dashboard → Sign-in and dashboard: shows dashboard or logout (evidence: `main.py`)
