A comprehensive JavaFX desktop application for electricity bill management, power monitoring, and energy analytics. Built with modern Java technologies and featuring advanced UI/UX design with glassmorphism effects.
- Dual Login System: Separate interfaces for Admin and Customer users
- Secure Authentication: bcrypt password hashing for enhanced security
- Session Management: Automatic session handling with proper logout functionality
- User Role Management: Admin can manage customer accounts and permissions
- Modern Glassmorphism UI: Beautiful, responsive design with gradient backgrounds
- Customer Management: Add, edit, and manage customer accounts
- Usage Data Entry: Admin can input electricity consumption data
- System Settings: Configure application parameters and preferences
- Reports & Analytics: Comprehensive reporting system with visual charts
- Voltage Monitoring: Real-time voltage spike detection and alerts
- Personalized Dashboard: Welcome message with actual customer name
- Voltage Spike Alerts: Real-time monitoring with color-coded status indicators
- Energy Forecast: AI-powered consumption predictions and cost estimates
- Carbon Footprint Analysis: Environmental impact tracking and sustainability goals
- QR Code Payment System: Modern UPI payment integration with QR code generation
- Billing System: View bills, payment history, and account status
- Real-time Charts: Interactive LineCharts for voltage trends and consumption patterns
- Weather Impact Analysis: Correlation between weather conditions and energy usage
- Cost Breakdown: Detailed analysis of electricity costs, taxes, and fees
- Smart Recommendations: AI-driven energy-saving tips and optimization suggestions
- QR Code Generation: Automatic UPI payment link creation with QR codes
- Multiple Payment Methods: Support for various UPI apps and payment gateways
- Payment Timer: Time-limited payment sessions for security
- Transaction Tracking: Complete payment history and status monitoring
- Java 17: Latest LTS version with modern language features
- JavaFX 17: Rich desktop UI framework with FXML support
- MySQL 8.x: Robust relational database with advanced features
- HikariCP: High-performance connection pooling
- Maven 3.8+: Dependency management and build automation
- bcrypt: Industry-standard password hashing
- Session Management: Secure user session handling
- Input Validation: Comprehensive data validation and sanitization
- FXML: Declarative UI design with controller separation
- CSS3: Advanced styling with glassmorphism effects
- JavaFX Charts: Interactive data visualization
- Responsive Design: Adaptive layouts for different screen sizes
- PDF Generation: PDFBox for bill generation and reports
- QR Code Generation: Custom QR code creation for payments
- Data Analytics: Advanced forecasting and anomaly detection
- Real-time Updates: Live data monitoring and alerts
src/
βββ main/
β βββ java/com/ebg/
β β βββ MainApp.java # Application entry point
β β βββ model/ # Domain models
β β β βββ User.java # User authentication model
β β β βββ Customer.java # Customer information model
β β β βββ Bill.java # Billing data model
β β β βββ ...
β β βββ dao/ # Data Access Layer
β β β βββ UserDAO.java # User data operations
β β β βββ CustomerDAO.java # Customer data operations
β β β βββ BillDAO.java # Billing data operations
β β β βββ impl/ # DAO implementations
β β βββ service/ # Business Logic Layer
β β β βββ AuthService.java # Authentication services
β β β βββ BillingService.java # Billing calculations
β β β βββ ReportService.java # Report generation
β β β βββ ...
β β βββ ui/ # User Interface Controllers
β β β βββ LoginController.java # Login screen controller
β β β βββ UnifiedAdminPanelController.java # Admin dashboard
β β β βββ CustomerDashboardController.java # Customer portal
β β β βββ QRPaymentController.java # Payment system
β β β βββ ...
β β βββ util/ # Utility Classes
β β βββ Session.java # Session management
β β βββ QRCodeGenerator.java # QR code creation
β β βββ ...
β βββ resources/
β βββ fxml/ # FXML UI definitions
β β βββ Login.fxml # Login screen
β β βββ UnifiedAdminPanel.fxml # Admin dashboard
β β βββ CustomerDashboard.fxml # Customer portal
β β βββ QRPaymentWindow.fxml # Payment interface
β β βββ ...
β βββ styles/ # CSS styling
β β βββ enhanced-ui.css # Modern glassmorphism styles
β β βββ login.css # Login screen styles
β βββ application.properties # Configuration
βββ test/ # Test files
βββ db/ # Database scripts
βββ schema.sql # Database schema
βββ seed_demo.sql # Sample data
βββ sample_users.sql # User accounts
- Java 17 (JDK) - Download from Oracle or OpenJDK
- Maven 3.8+ - Download from Apache Maven
- MySQL 8.x - Download from MySQL
-
Create Database and User:
CREATE DATABASE voltorio; CREATE USER 'voltorio_user'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON voltorio.* TO 'voltorio_user'@'localhost'; FLUSH PRIVILEGES;
-
Initialize Database Schema:
mysql -u root -p voltorio < db/schema.sql -
Load Sample Data:
mysql -u voltorio_user -p voltorio < db/seed_demo.sql
Edit src/main/resources/application.properties:
# Database Configuration
db.url=jdbc:mysql://localhost:3306/voltorio
db.user=voltorio_user
db.password=your_password
# Application Settings
co2_factor=0.82
app.name=Voltoria
app.version=1.0.0-
Build the Project:
mvn clean compile
-
Run the Application:
mvn javafx:run- Alternative - Package and Run:
mvn clean package java --module-path "path/to/javafx/lib" --add-modules javafx.controls,javafx.fxml -cp target/classes com.ebg.MainApp
- Username:
admin - Password:
password - Access: Full system administration
-
Username:
alice -
Password:
password -
Role: Consumer
-
Username:
bob -
Password:
password -
Role: Consumer
- Modern Login Interface: Clean, responsive design with glassmorphism effects
- Role-based Redirection: Automatic routing to appropriate dashboard
- Session Management: Secure login with automatic session handling
- Customer Management: Add, edit, and manage customer accounts
- Usage Data Entry: Input electricity consumption data for customers
- System Settings: Configure application parameters
- Reports & Analytics: Generate comprehensive reports with charts
- Voltage Monitoring: Real-time voltage spike detection
- Personalized Welcome: Dynamic welcome message with customer name
- Voltage Monitoring: Real-time voltage status with color-coded indicators
- Energy Forecast: AI-powered consumption predictions
- Carbon Footprint: Environmental impact analysis
- QR Payment: Modern UPI payment with QR code generation
- QR Code Generation: Automatic UPI payment link creation
- Multiple Payment Methods: Support for various UPI apps
- Payment Timer: Time-limited payment sessions
- Transaction History: Complete payment tracking
- Voltage Spike Detection: Automatic detection of voltage anomalies
- Live Charts: Interactive LineCharts for data visualization
- Status Indicators: Color-coded status indicators (Green/Yellow/Red)
- Alert System: Custom-styled popup notifications
- Consumption Forecasting: AI-powered energy usage predictions
- Weather Correlation: Analysis of weather impact on consumption
- Cost Analysis: Detailed breakdown of electricity costs
- Carbon Footprint: Environmental impact tracking
- Glassmorphism Design: Modern glass-like effects with transparency
- Gradient Backgrounds: Beautiful color gradients throughout the app
- Hover Effects: Interactive button animations
- Responsive Layout: Adaptive design for different screen sizes
- Consistent Typography: Professional font styling
- Password Hashing: bcrypt encryption for secure password storage
- Session Management: Secure user session handling
- Input Validation: Comprehensive data validation
- SQL Injection Prevention: Parameterized queries
- Access Control: Role-based permissions
- users: User authentication and roles
- customers: Customer information and accounts
- bills: Billing data and payment history
- consumption_readings: Electricity usage data
- voltage_data: Voltage monitoring data
- settings: Application configuration
- Users are linked to customers via
customer_id - Bills are associated with customers
- Consumption readings track usage over time
- Voltage data provides real-time monitoring
-
Database Connection Error:
- Verify MySQL is running
- Check database credentials in
application.properties - Ensure database
ebgexists
-
JavaFX Runtime Error:
- Ensure Java 17 is installed
- Check JavaFX modules are available
- Use
mvn javafx:runinstead of direct execution
-
FXML Loading Error:
- Verify FXML files are in
src/main/resources/fxml/ - Check controller class names match FXML references
- Ensure all imports are correct
- Verify FXML files are in
-
CSS Parsing Warnings:
- These are non-critical warnings about gradient syntax
- Application will still function correctly
- Can be ignored for development
-
Database Optimization:
- Use connection pooling (HikariCP)
- Index frequently queried columns
- Regular database maintenance
-
Memory Management:
- Monitor heap usage
- Close resources properly
- Use appropriate data structures
- Create Model: Add domain model in
com.ebg.model - Create DAO: Implement data access in
com.ebg.dao - Create Service: Add business logic in
com.ebg.service - Create UI: Design FXML and controller in
com.ebg.ui - Add Styling: Update CSS in
src/main/resources/styles
- Unit Tests: Test individual components
- Integration Tests: Test component interactions
- UI Tests: Test user interface functionality
- Database Tests: Test data operations
- Mobile App: React Native or Flutter mobile application
- Web Interface: Spring Boot web application
- API Integration: RESTful API for third-party integrations
- Advanced Analytics: Machine learning for better predictions
- IoT Integration: Real-time sensor data integration
- Multi-language Support: Internationalization
- Cloud Deployment: AWS/Azure cloud deployment options
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the troubleshooting section
- Review the demo documentation
- JavaFX Team: For the excellent UI framework
- MySQL Team: For the robust database system
- Maven Community: For the build automation tools
- Open Source Contributors: For the various libraries used
Built with β€οΈ using Java 17, JavaFX, and MySQL
Last updated: October 2025