# gaurab-arl/securebank architecture

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

- Interactive diagram: https://gitdiagram.com/gaurab-arl/securebank
- Repository: https://github.com/gaurab-arl/securebank

## Overview

This is a PHP/MySQL bank-management web app. Customers enter through the home page, create an account or log in, then use the dashboard to view account summaries and transaction history or initiate transfers; logout clears the session. The README also describes deposits, withdrawals, and admin management, but the sampled implementation chiefly exposes transfer and dashboard behavior, and the tree has no distinct admin module. Dashboard source excerpts are partial, so the graph omits uncertain internal wiring. Database setup and authentication are shown separately as implemented.

Main entry points: [`php/dashboard.php`](https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php) (Account dashboard), [`pages/login.html`](https://github.com/gaurab-arl/securebank/blob/main/pages/login.html) (Login page), [`php/auth.php`](https://github.com/gaurab-arl/securebank/blob/main/php/auth.php) (Authentication), [`pages/signup.html`](https://github.com/gaurab-arl/securebank/blob/main/pages/signup.html) (Signup page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_home["Home page<br/>[index.html]"]
  node_mainjs["Home interactions<br/>[main.js]"]
  node_signup["Signup page<br/>[signup.html]"]
  node_login["Login page<br/>[login.html]"]
  node_signupjs["Signup validation<br/>[signup.js]"]
  node_loginjs["Password visibility<br/>[login.js]"]
end

subgraph group_identity["Identity and setup"]
  node_setup["Database setup<br/>[setup.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_logout["Session logout<br/>[logout.php]"]
end

subgraph group_banking["Banking operations"]
  node_dashboard["Account dashboard<br/>[dashboard.php]"]
  node_dashboardjs["Dashboard interactions<br/>[dashboard.js]"]
  node_transfers["Transfers<br/>[dashboard.php]"]
  node_accountview["Accounts and balances<br/>[dashboard.php]"]
  node_history["Transaction history<br/>[dashboard.php]"]
  node_admin["Admin capabilities"]
end

subgraph group_state["Persistent state"]
  node_mysql[("MySQL database")]
end

node_customer(("Customer"))

node_customer -->|"opens"| node_home
node_home -->|"loads"| node_mainjs
node_mainjs -.->|"requests setup"| node_setup
node_customer -->|"registers"| node_signup
node_customer -->|"signs in"| node_login
node_signup -->|"loads validation"| node_signupjs
node_login -->|"loads controls"| node_loginjs
node_signup -->|"submits signup"| node_auth
node_login -->|"submits login"| node_auth
node_auth -->|"reads and writes users"| node_mysql
node_setup -->|"creates database and users table"| node_mysql
node_auth -->|"redirects after login"| node_dashboard
node_customer -->|"uses"| node_dashboard
node_dashboard -->|"loads interactions"| node_dashboardjs
node_dashboard -->|"renders"| node_accountview
node_dashboard -->|"renders"| node_history
node_dashboard -->|"handles transfer requests"| node_transfers
node_dashboard -->|"reads and updates banking data"| node_mysql
node_customer -->|"logs out"| node_logout
node_logout -->|"redirects"| node_login

click node_home "https://github.com/gaurab-arl/securebank/blob/main/index.html"
click node_mainjs "https://github.com/gaurab-arl/securebank/blob/main/js/main.js"
click node_signup "https://github.com/gaurab-arl/securebank/blob/main/pages/signup.html"
click node_login "https://github.com/gaurab-arl/securebank/blob/main/pages/login.html"
click node_signupjs "https://github.com/gaurab-arl/securebank/blob/main/js/signup.js"
click node_loginjs "https://github.com/gaurab-arl/securebank/blob/main/js/login.js"
click node_setup "https://github.com/gaurab-arl/securebank/blob/main/php/setup.php"
click node_auth "https://github.com/gaurab-arl/securebank/blob/main/php/auth.php"
click node_dashboard "https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php"
click node_dashboardjs "https://github.com/gaurab-arl/securebank/blob/main/js/dashboard.js"
click node_transfers "https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php"
click node_accountview "https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php"
click node_history "https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php"
click node_admin "https://github.com/gaurab-arl/securebank/tree/main/php"
click node_logout "https://github.com/gaurab-arl/securebank/blob/main/php/logout.php"

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_home,node_mainjs,node_signup,node_login,node_signupjs,node_loginjs toneBlue
class node_setup,node_auth,node_logout toneAmber
class node_dashboard,node_dashboardjs,node_transfers,node_accountview,node_history,node_admin toneMint
class node_mysql toneRose
class node_customer toneIndigo
```

## Components

### Web entry

- [Home page](https://github.com/gaurab-arl/securebank/blob/main/index.html): `index.html`
- [Home interactions](https://github.com/gaurab-arl/securebank/blob/main/js/main.js): `js/main.js`
- [Signup page](https://github.com/gaurab-arl/securebank/blob/main/pages/signup.html): `pages/signup.html`
- [Login page](https://github.com/gaurab-arl/securebank/blob/main/pages/login.html): `pages/login.html`
- [Signup validation](https://github.com/gaurab-arl/securebank/blob/main/js/signup.js): `js/signup.js`
- [Password visibility](https://github.com/gaurab-arl/securebank/blob/main/js/login.js): `js/login.js`

### Identity and setup

- [Database setup](https://github.com/gaurab-arl/securebank/blob/main/php/setup.php): `php/setup.php`
- [Authentication](https://github.com/gaurab-arl/securebank/blob/main/php/auth.php): `php/auth.php`
- [Session logout](https://github.com/gaurab-arl/securebank/blob/main/php/logout.php): `php/logout.php`

### Banking operations

- [Account dashboard](https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php): `php/dashboard.php`
- [Dashboard interactions](https://github.com/gaurab-arl/securebank/blob/main/js/dashboard.js): `js/dashboard.js`
- [Transfers](https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php): `php/dashboard.php`
- [Accounts and balances](https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php): `php/dashboard.php`
- [Transaction history](https://github.com/gaurab-arl/securebank/blob/main/php/dashboard.php): `php/dashboard.php`
- [Admin capabilities](https://github.com/gaurab-arl/securebank/tree/main/php): `php`

### Persistent state

- **MySQL database**

### Other components

- **Customer**

## Connections

- Customer → Home page: opens
- Home page → Home interactions: loads
- Home interactions → Database setup: requests setup
- Customer → Signup page: registers
- Customer → Login page: signs in
- Signup page → Signup validation: loads validation
- Login page → Password visibility: loads controls
- Signup page → Authentication: submits signup
- Login page → Authentication: submits login
- Authentication → MySQL database: reads and writes users
- Database setup → MySQL database: creates database and users table
- Authentication → Account dashboard: redirects after login
- Customer → Account dashboard: uses
- Account dashboard → Dashboard interactions: loads interactions
- Account dashboard → Accounts and balances: renders
- Account dashboard → Transaction history: renders
- Account dashboard → Transfers: handles transfer requests
- Account dashboard → MySQL database: reads and updates banking data
- Customer → Session logout: logs out
- Session logout → Login page: redirects
