Classic Enterprise Web App

Electricity Billing System

A robust, Java-based billing portal engineered using classic JSP, Servlets, and MySQL. Features algorithmic meter reading checks, comprehensive customer billing histories, payment updates, and dynamic invoice generation.

View Source Code

The system provides a seamless administrative dashboard and customer portal. Users can track billing consumption cycles, inspect unpaid invoices, and process balance logs. Built focusing on raw transactional performance and strict database consistency.

Core Architecture & Capabilities

Designed to manage customer operations, calculations, and transactional logs efficiently.

JSP & Servlet Core

Employs clean MVC design. Controller Servlets intercept incoming HTTP actions, invoke model components, and forward response states to dynamically compiled JSPs.

🧮 Consumption Calculator

Calculates dynamic charges based on previous and current meter readings, factoring in structural tariff slabs and basic service overheads.

📁 MySQL Database Layer

Normalized database tables housing customer records, meter values, billing cycles, transactions, and admin authentication schemas.

👤 Customer Self-Service

Secure login interface enabling customers to check current outstanding dues, browse consumption history, and download billing invoices.

🎟️ Payment Verification

Administrative log tracker allowing staff to verify bill updates, record payments, and balance ledger accounts dynamically.

🖨️ PDF Invoicing

Compiles and formats invoice receipts, permitting users to print or save digital transaction summaries directly from the browser window.

Relational Schema Design & Data Management

📊 Meter Reading History Schema

Structured with constraints ensuring chronological entry sequence. Prevents double-logging of billing entries for the same service connection in a single billing period.

💡 Multi-Slab Tariff Matrix

Separates tariff rule rates from the execution code. Enables admins to update charge brackets (e.g., domestic vs. commercial slabs) without redeploying Java Servlet code.

🔐 Transaction Audit Trail

Maintains ledger updates tracking payment updates, minimizing inconsistencies between physical cash receipts and database record values.

Key Engineering Breakthroughs

Typos and Abnormal Meter Readings (Input Validation)

The Problem: Manual meter reading entries are prone to typos (e.g. extra zeros), resulting in astronomical billing amounts that trigger customer disputes.

The Solution: Implemented a dynamic validation filter at the Controller layer. It automatically validates new reading entries against the customer's 3-month running average. Entries showing more than a 300% deviation are flagged for admin verification before final bill generation.

Session Hijacking in Classic Servlet Environments

The Problem: Classic Servlet containers are susceptible to session hijacking if session identifier cookies are transmitted over insecure channels or exposed to scripting.

The Solution: Enforced secure session configurations. Modified web.xml to configure <http-only> and <secure> flags on cookies, preventing JavaScript access and restricting cookie transmissions to HTTPS.

Get Started

Interested in the code?

Explore the complete codebase on GitHub. Review Java Servlet controller mappings, JSP page compilations, and MySQL schema definitions.

Explore GitHub Repository