# iamrudhh/python-login-signup architecture

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

- Interactive diagram: https://gitdiagram.com/iamrudhh/python-login-signup
- Repository: https://github.com/iamrudhh/python-login-signup

## Overview

This is a small terminal-based authentication program. A user selects an action from the menu; signup validates a username, password, and mobile number before hashing the password and adding the account to memory, while login looks up an account and checks its password. The program can read an existing users.json file at startup, but the sampled source never writes account changes to disk. Also, signup stores a SHA-256 hash while login compares it directly with the entered password, so that check will not succeed for newly registered accounts. The README’s persistence claim is not supported by the source shown.

Main entry points: [`main.py`](https://github.com/iamrudhh/python-login-signup/blob/main/main.py) (Main menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terminal["Terminal interaction"]
  node_menu["Main menu<br/>[main.py]"]
end

subgraph group_accounts["Account operations"]
  node_signup["Signup<br/>[main.py]"]
  node_validation["Input validation<br/>[main.py]"]
  node_login["Login<br/>[main.py]"]
  node_display["Show database<br/>[main.py]"]
end

subgraph group_data["Credential data"]
  node_hashing["SHA-256 hashing<br/>[main.py]"]
  node_database[("In-memory database<br/>[main.py]")]
  node_jsonfile["users.json"]
end

node_user(("Terminal user"))

node_user -->|"chooses action"| node_menu
node_menu -->|"dispatches"| node_signup
node_menu -->|"dispatches"| node_login
node_menu -->|"dispatches"| node_display
node_signup -->|"checks inputs"| node_validation
node_signup -->|"hashes password"| node_hashing
node_signup -->|"adds account"| node_database
node_login -->|"looks up account"| node_database
node_login -->|"prompts and reports"| node_user
node_display -->|"prints contents"| node_database
node_jsonfile -->|"loads at startup"| node_database

click node_menu "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_signup "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_validation "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_login "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_display "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_hashing "https://github.com/iamrudhh/python-login-signup/blob/main/main.py"
click node_database "https://github.com/iamrudhh/python-login-signup/blob/main/main.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_menu,node_user toneBlue
class node_signup,node_validation,node_login,node_display toneAmber
class node_hashing,node_database,node_jsonfile toneMint
```

## Components

### Terminal interaction

- [Main menu](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`

### Account operations

- [Signup](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`
- [Input validation](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`
- [Login](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`
- [Show database](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`

### Credential data

- [SHA-256 hashing](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`
- [In-memory database](https://github.com/iamrudhh/python-login-signup/blob/main/main.py): `main.py`
- **users.json**

### Other components

- **Terminal user**

## Connections

- Terminal user → Main menu: chooses action
- Main menu → Signup: dispatches
- Main menu → Login: dispatches
- Main menu → Show database: dispatches
- Signup → Input validation: checks inputs
- Signup → SHA-256 hashing: hashes password
- Signup → In-memory database: adds account
- Login → In-memory database: looks up account
- Login → Terminal user: prompts and reports
- Show database → In-memory database: prints contents
- users.json → In-memory database: loads at startup
