# adarsh9616/electricity_billing_system architecture

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

- Interactive diagram: https://gitdiagram.com/adarsh9616/electricity_billing_system
- Repository: https://github.com/adarsh9616/electricity_billing_system

## Overview

This Java Swing application supports an operator workflow: show the splash screen, authenticate, then use the main menu to manage customers, calculate bills, view bill history, generate a bill, or open an external payment page. Screen handlers access MySQL through a shared JDBC connection helper. The README documents the database tables and personal-login creation, but the sampled login screen verifies credentials; no login-creation screen is present in the tree. The graph uses the supplied source excerpts and README; unsampled implementation details are not inferred.

Main entry points: [`src/Project.java`](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/Project.java) (Main menu), [`src/conn.java`](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/conn.java) (JDBC connection), [`src/login.java`](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/login.java) (Login screen), [`src/splash.java`](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/splash.java) (Splash screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_splash["Splash screen<br/>[splash.java]"]
  node_login["Login screen<br/>[login.java]"]
  node_main["Main menu<br/>[Project.java]"]
end

subgraph group_customer["Customer records"]
  node_new_customer["Add customer<br/>[new_customer.java]"]
  node_customer_details["Customer details"]
end

subgraph group_billing["Billing operations"]
  node_calculate_bill["Calculate bill"]
  node_last_bill["Bill history<br/>[LastBill.java]"]
  node_generate_bill["Generate bill<br/>[generate_bill.java]"]
  node_pay_bill["Payment page<br/>[pay_bill.java]"]
end

subgraph group_integration["Database and payment"]
  node_connection["JDBC connection<br/>[conn.java]"]
  node_mysql[("MySQL database")]
end

node_operator(("Operator"))
node_payment_service["Paytm payment site"]

node_operator -->|"starts app"| node_splash
node_splash -->|"opens after delay"| node_login
node_login -->|"checks credentials"| node_connection
node_login -->|"opens on success"| node_main
node_main -->|"opens"| node_new_customer
node_main -->|"opens"| node_customer_details
node_main -->|"opens"| node_calculate_bill
node_main -->|"opens"| node_last_bill
node_main -->|"opens"| node_generate_bill
node_main -->|"opens"| node_pay_bill
node_new_customer -->|"inserts customer"| node_connection
node_customer_details -->|"reads customers"| node_connection
node_calculate_bill -->|"stores bill"| node_connection
node_last_bill -->|"reads customer and bills"| node_connection
node_generate_bill -->|"reads bill data"| node_connection
node_connection -->|"connects JDBC"| node_mysql
node_pay_bill -->|"loads payment page"| node_payment_service

click node_splash "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/splash.java"
click node_login "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/login.java"
click node_main "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/Project.java"
click node_new_customer "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/new_customer.java"
click node_customer_details "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/customer_details.java"
click node_calculate_bill "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/calculate_bill.java"
click node_last_bill "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/LastBill.java"
click node_generate_bill "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/generate_bill.java"
click node_pay_bill "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/pay_bill.java"
click node_connection "https://github.com/adarsh9616/electricity_billing_system/blob/master/src/conn.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_splash,node_login,node_main toneBlue
class node_new_customer,node_customer_details toneAmber
class node_calculate_bill,node_last_bill,node_generate_bill,node_pay_bill toneMint
class node_connection,node_mysql toneRose
class node_operator,node_payment_service toneIndigo
```

## Components

### Entry and navigation

- [Splash screen](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/splash.java): `src/splash.java`
- [Login screen](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/login.java): `src/login.java`
- [Main menu](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/Project.java): `src/Project.java`

### Customer records

- [Add customer](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/new_customer.java): `src/new_customer.java`
- [Customer details](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/customer_details.java): `src/customer_details.java`

### Billing operations

- [Calculate bill](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/calculate_bill.java): `src/calculate_bill.java`
- [Bill history](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/LastBill.java): `src/LastBill.java`
- [Generate bill](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/generate_bill.java): `src/generate_bill.java`
- [Payment page](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/pay_bill.java): `src/pay_bill.java`

### Database and payment

- [JDBC connection](https://github.com/adarsh9616/electricity_billing_system/blob/master/src/conn.java): `src/conn.java`
- **MySQL database**

### Other components

- **Operator**
- **Paytm payment site**

## Connections

- Operator → Splash screen: starts app (evidence: `src/splash.java`)
- Splash screen → Login screen: opens after delay (evidence: `src/splash.java`)
- Login screen → JDBC connection: checks credentials (evidence: `src/login.java`)
- Login screen → Main menu: opens on success (evidence: `src/login.java`)
- Main menu → Add customer: opens (evidence: `src/Project.java`)
- Main menu → Customer details: opens (evidence: `src/Project.java`)
- Main menu → Calculate bill: opens (evidence: `src/Project.java`)
- Main menu → Bill history: opens (evidence: `src/Project.java`)
- Main menu → Generate bill: opens (evidence: `src/Project.java`)
- Main menu → Payment page: opens (evidence: `src/Project.java`)
- Add customer → JDBC connection: inserts customer (evidence: `src/new_customer.java`)
- Customer details → JDBC connection: reads customers (evidence: `src/customer_details.java`)
- Calculate bill → JDBC connection: stores bill (evidence: `src/calculate_bill.java`)
- Bill history → JDBC connection: reads customer and bills (evidence: `src/LastBill.java`)
- Generate bill → JDBC connection: reads bill data (evidence: `src/generate_bill.java`)
- JDBC connection → MySQL database: connects JDBC (evidence: `src/conn.java`)
- Payment page → Paytm payment site: loads payment page (evidence: `src/pay_bill.java`)
