A modern, full-stack pseudo ATM web application for a Credit Union, built with Java Servlets, MySQL, and a clean HTML/CSS/JavaScript frontend. This project demonstrates secure authentication, deposit, and withdrawal operations with real-time feedback and a user-friendly interface.
Professional login interface with secure User ID authentication
Modern account dashboard showing current balance, transaction form, and transaction history
Note: To add the actual screenshots, take photos of your running application and save them as
login-page.png
andaccount-dashboard.png
in thescreenshots/
directory. Seescreenshots/README.md
for detailed instructions.
- Modern UI: Responsive, clean design with HTML, CSS, and JavaScript
- User Authentication: Login with numeric UserID
- Personalized Dashboard: Displays user's name and current balance
- Transactions: Deposit or withdraw funds with instant feedback
- Secure Backend: Java Servlet (single file) with JDBC and MySQL
- JSON API: All frontend-backend communication via JSON (using Gson)
- Error Handling: Clear error/success messages for all actions
- Frontend: HTML5, CSS3, JavaScript (vanilla, fetch API)
- Backend: Java Servlet (ATMServlet.java), Gson for JSON
- Database: MySQL (accountInfo table)
- Build: Maven (pom.xml included)
- Create the database and table:
CREATE DATABASE ATM; USE ATM; CREATE TABLE accountInfo ( userId INT PRIMARY KEY, Name VARCHAR(100) NOT NULL, Balance DOUBLE NOT NULL ); INSERT INTO accountInfo (userId, Name, Balance) VALUES (101, 'Alice Smith', 1200.00), (102, 'Bob Johnson', 800.00);
- Update DB credentials in
src/servlet/ATMServlet.java
:DB_URL
,DB_USER
,DB_PASS
- Start your MySQL server and ensure the table is seeded.
- The backend logic is in
src/servlet/ATMServlet.java
. - Uses JDBC for MySQL and Gson for JSON serialization.
- Maven dependencies for MySQL and Gson are included in
pom.xml
.
- The main UI is in
web/index.html
. - All actions (login, deposit, withdraw) use
fetch()
to communicate with the backend servlet (ATMServlet
). - On login, the user's name and balance are shown. Transactions update the balance and show messages.
- Build the project with Maven:
mvn clean package
- Deploy the WAR file (
target/Java_servlet_ATM.war
) to your servlet container (e.g., Tomcat'swebapps/
directory). - Access the app:
- Open your browser to
http://localhost:8080/Java_servlet_ATM/
- Open your browser to
- Initialize Git repository:
git init git add . git commit -m "Initial commit: Credit Union ATM System"
- Create a remote repository (GitHub, GitLab, etc.) and push:
git remote add origin <your-repository-url> git branch -M main git push -u origin main
Java_servlet_ATM/
├── src/main/java/servlet/
│ └── ATMServlet.java # Main servlet handling all operations
├── web/
│ ├── index.html # Main entry point with redirect logic
│ ├── login.html # Login page
│ └── account.html # Account dashboard with transactions
├── screenshots/
│ ├── README.md # Screenshot instructions
│ ├── login-page.png # Login page screenshot (add manually)
│ └── account-dashboard.png # Dashboard screenshot (add manually)
├── pom.xml # Maven configuration
├── README.md # This file
└── .gitignore # Git ignore rules
- UserID: 101, Name: Alice Smith, Balance: $1200.00
- UserID: 102, Name: Bob Johnson, Balance: $800.00
- Contributions are welcome! Please fork and submit a pull request.
- This project is for educational/demo purposes.
A .gitignore
is included to exclude build output, IDE files, and OS-specific files.