Auto Fuel X is a comprehensive web-based fuel station and vehicle service management system built with Jakarta EE (Servlet + JSP). This application streamlines operations for fuel stations by providing integrated tools for managing customers, vehicles, service bookings, fuel inventory, complaints, and employee roles.
- Customer registration and profile management
- Vehicle registration and tracking
- Service booking system
- Complaint submission and tracking
- Fuel stock monitoring and dispensing records
- Service center workflow management
- Role-based access control for employees
- Admin: Manage service bookings, fuel suppliers, employees, and fuel levels
- Fuel Cashier: Process vehicle refueling transactions
- Service Center: Check and manage assigned service jobs
- Customer Care Officer: Handle and respond to customer complaints
- Backend: Jakarta EE 10 (Servlets, JSP)
- Database: Microsoft SQL Server
- Build Tool: Maven
- Server: Tomcat 11+ or any Jakarta EE 10 compatible server
- Frontend: JSP, HTML, CSS, JavaScript
- Java 17 or higher
- Maven 3.8 or higher
- Microsoft SQL Server
- Tomcat 11+ or Jakarta EE 10 compatible server
-
Clone the repository
git clone https://github.com/thisal-d/auto-fuel-x.git cd auto-fuel-x -
Database Setup
The project includes SQL scripts in the
database_config/directory:01_create_tables.sql- Creates all necessary tables02_create_triggers.sql- Defines database triggers03_insert_defaults.sql- Inserts required default data04_insert_sample_data.sql- Inserts sample/test data05_select_data.sql- Example select queriesfull_database_setup.sql- Convenience script to run all scripts in order
Execute these scripts on your SQL Server instance using SQL Server Management Studio or sqlcmd. The default database name referenced in the application is
AutoFuelX. -
Configure Database Connection
Edit
src/main/java/com/example/autofuelx/util/DatabaseConnection.javaand update the connection constants with your database credentials:static String URL = "jdbc:sqlserver://localhost:1433;databaseName=AutoFuelX;encrypt=false;"; static String USER = "your_username"; static String PASSWORD = "your_password";
-
Build the Application
mvn clean package # To skip tests: mvn clean package -DskipTestsThe built WAR file will be located at
target/auto-fuel-x-1.0-SNAPSHOT.war. -
Deploy the Application
Deploy the WAR file to a servlet container (Tomcat 11+ or any Jakarta EE 10 compatible server). If you prefer using a server-managed datasource, configure the server's datasource/credentials accordingly.
For development, you can create an exploded artifact in your IDE (IntelliJ/Eclipse) and run the server directly from the IDE.
-
Access the Application
Once deployed, access the application at the appropriate URL (e.g.,
http://localhost:8080/auto-fuel-x/if deployed to the/auto-fuel-xcontext).The main page provides links to:
- Customer login/registration:
views/customer/login.jspandviews/customer/register.jsp - Employee login:
views/employee/login.jsp
- Customer login/registration:
auto-fuel-x/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/autofuelx/
│ │ │ ├── controller/ # Servlets/controllers
│ │ │ ├── dao/ # Database access code
│ │ │ ├── dto/ # Data transfer objects
│ │ │ ├── model/ # Domain models
│ │ │ ├── service/ # Business logic
│ │ │ └── util/ # Utility classes
│ │ └── webapp/
│ │ ├── assets/ # CSS, JS, images
│ │ ├── views/ # JSP pages organized by role
│ │ └── index.jsp # Entry point
├── database_config/ # SQL scripts for database setup
├── pom.xml # Maven configuration
└── README.md # This file
The primary configuration file for database connection is:
src/main/java/com/example/autofuelx/util/DatabaseConnection.java
All database setup scripts are located in the database_config/ directory. For a fresh installation, run the full_database_setup.sql script to create all tables, triggers, and insert default and sample data.
The system comes with pre-configured user accounts for different roles:
| Role | Password | Permissions | |
|---|---|---|---|
| Admin | admin@station.com | admin123 | Manage service bookings, fuel suppliers, employees, update fuel levels, add new fuel types |
| Fuel Cashier | r.cashier@station.com | rcashier123 | Process vehicle refueling |
| Service Center | s.center@station.com | scenter123 | Check and manage assigned service jobs |
| Customer Care Officer | c.care@station.com | ccare123 | Handle and respond to customer complaints |
This project is licensed under the MIT License - see the LICENSE file for details.