# bhanu0077/bitforge architecture

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

- Interactive diagram: https://gitdiagram.com/bhanu0077/bitforge
- Repository: https://github.com/bhanu0077/bitforge

## Overview

BitForge is a browser-based blockchain wallet dashboard backed by Java servlet APIs and MySQL. Users sign up or log in, inspect their wallet and ecosystem data, toggle balance privacy, transfer funds, and mine blocks; separate pages expose transactions, blockchain, and network status. Administrators have a session-protected console for inspecting and editing users and transaction records while blocks remain read-only. The sampled source shows direct API-to-database operations; page-level links for unsampled views are documented but not inferred as calls.

Main entry points: [`src/com/bitforge/DatabaseManager.java`](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/DatabaseManager.java) (Database access and schema), [`script.js`](https://github.com/bhanu0077/bitforge/blob/main/script.js) (Dashboard interactions), [`html`](https://github.com/bhanu0077/bitforge/tree/main/html) (Dashboard pages), [`src/com/bitforge/AuthServlet.java`](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AuthServlet.java) (Authentication and recovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_pages["Dashboard pages"]
  node_browser["Dashboard interactions<br/>[script.js]"]
  node_serviceworker["Push notifications<br/>[sw.js]"]
end

subgraph group_account["Accounts and Wallet"]
  node_auth["Authentication and recovery<br/>[AuthServlet.java]"]
  node_wallet["Wallet profile<br/>[UserServlet.java]"]
end

subgraph group_ledger["Ledger and Mining"]
  node_transactions["Transfers and history"]
  node_mining["Block mining<br/>[MiningServlet.java]"]
  node_blockchain["Blockchain view"]
  node_network["Network status"]
end

subgraph group_admin["Administration"]
  node_adminui["Admin console<br/>[admin.html]"]
  node_adminapi["Admin operations<br/>[AdminServlet.java]"]
end

subgraph group_persistence["Persistence"]
  node_listener["Schema startup"]
  node_dbmanager["Database access and schema"]
  node_mysql[("MySQL database")]
end

node_visitor(("Dashboard user"))

node_visitor -->|"opens"| node_pages
node_pages -.->|"loads interactions"| node_browser
node_browser -->|"posts credentials"| node_auth
node_browser -->|"fetches profile"| node_wallet
node_browser -->|"fetches and submits"| node_transactions
node_browser -->|"fetches ecosystem"| node_blockchain
node_visitor -.->|"mines blocks"| node_mining
node_visitor -.->|"views network"| node_network
node_browser -->|"registers"| node_serviceworker
node_visitor -->|"opens admin console"| node_adminui
node_adminui -.->|"admin requests"| node_adminapi
node_auth -->|"gets connection"| node_dbmanager
node_wallet -->|"gets connection"| node_dbmanager
node_transactions -->|"gets connection"| node_dbmanager
node_mining -->|"gets connection"| node_dbmanager
node_blockchain -->|"gets connection"| node_dbmanager
node_network -->|"gets connection"| node_dbmanager
node_adminapi -->|"gets connection"| node_dbmanager
node_listener -->|"initializes schema"| node_dbmanager
node_dbmanager -->|"connects and initializes"| node_mysql

click node_pages "https://github.com/bhanu0077/bitforge/tree/main/html"
click node_browser "https://github.com/bhanu0077/bitforge/blob/main/script.js"
click node_serviceworker "https://github.com/bhanu0077/bitforge/blob/main/sw.js"
click node_auth "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AuthServlet.java"
click node_wallet "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/UserServlet.java"
click node_transactions "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/TransactionServlet.java"
click node_mining "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/MiningServlet.java"
click node_blockchain "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/BlockchainServlet.java"
click node_network "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/NetworkServlet.java"
click node_adminui "https://github.com/bhanu0077/bitforge/blob/main/html/admin.html"
click node_adminapi "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AdminServlet.java"
click node_listener "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AppContextListener.java"
click node_dbmanager "https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/DatabaseManager.java"

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_pages,node_browser,node_serviceworker,node_visitor toneBlue
class node_auth,node_wallet toneAmber
class node_transactions,node_mining,node_blockchain,node_network toneMint
class node_adminui,node_adminapi toneRose
class node_listener,node_dbmanager,node_mysql toneIndigo
```

## Components

### Dashboard UI

- [Dashboard pages](https://github.com/bhanu0077/bitforge/tree/main/html): `html`
- [Dashboard interactions](https://github.com/bhanu0077/bitforge/blob/main/script.js): `script.js`
- [Push notifications](https://github.com/bhanu0077/bitforge/blob/main/sw.js): `sw.js`

### Accounts and Wallet

- [Authentication and recovery](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AuthServlet.java): `src/com/bitforge/AuthServlet.java`
- [Wallet profile](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/UserServlet.java): `src/com/bitforge/UserServlet.java`

### Ledger and Mining

- [Transfers and history](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/TransactionServlet.java): `src/com/bitforge/TransactionServlet.java`
- [Block mining](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/MiningServlet.java): `src/com/bitforge/MiningServlet.java`
- [Blockchain view](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/BlockchainServlet.java): `src/com/bitforge/BlockchainServlet.java`
- [Network status](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/NetworkServlet.java): `src/com/bitforge/NetworkServlet.java`

### Administration

- [Admin console](https://github.com/bhanu0077/bitforge/blob/main/html/admin.html): `html/admin.html`
- [Admin operations](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AdminServlet.java): `src/com/bitforge/AdminServlet.java`

### Persistence

- [Schema startup](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/AppContextListener.java): `src/com/bitforge/AppContextListener.java`
- [Database access and schema](https://github.com/bhanu0077/bitforge/blob/main/src/com/bitforge/DatabaseManager.java): `src/com/bitforge/DatabaseManager.java`
- **MySQL database**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Dashboard pages: opens (evidence: `README.md`)
- Dashboard pages → Dashboard interactions: loads interactions
- Dashboard interactions → Authentication and recovery: posts credentials (evidence: `script.js`)
- Dashboard interactions → Wallet profile: fetches profile (evidence: `script.js`)
- Dashboard interactions → Transfers and history: fetches and submits (evidence: `script.js`)
- Dashboard interactions → Blockchain view: fetches ecosystem (evidence: `script.js`)
- Dashboard user → Block mining: mines blocks
- Dashboard user → Network status: views network
- Dashboard interactions → Push notifications: registers (evidence: `script.js`)
- Dashboard user → Admin console: opens admin console (evidence: `README.md`)
- Admin console → Admin operations: admin requests
- Authentication and recovery → Database access and schema: gets connection (evidence: `src/com/bitforge/AuthServlet.java`)
- Wallet profile → Database access and schema: gets connection (evidence: `src/com/bitforge/UserServlet.java`)
- Transfers and history → Database access and schema: gets connection (evidence: `src/com/bitforge/TransactionServlet.java`)
- Block mining → Database access and schema: gets connection (evidence: `src/com/bitforge/MiningServlet.java`)
- Blockchain view → Database access and schema: gets connection (evidence: `src/com/bitforge/BlockchainServlet.java`)
- Network status → Database access and schema: gets connection (evidence: `src/com/bitforge/NetworkServlet.java`)
- Admin operations → Database access and schema: gets connection (evidence: `src/com/bitforge/AdminServlet.java`)
- Schema startup → Database access and schema: initializes schema (evidence: `src/com/bitforge/AppContextListener.java`)
- Database access and schema → MySQL database: connects and initializes (evidence: `src/com/bitforge/DatabaseManager.java`)
