Skip to content

A web-based ATM system built using Java Servlets and MySQL. Supports secure user authentication, real-time transactions (withdraw, deposit, balance check), and account management. Designed to simulate realistic banking operations with session handling and backend efficiency for up to 50+ concurrent users.

Notifications You must be signed in to change notification settings

DaivikGirish/Java_Servlet_ATM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Union ATM System

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.

🖼️ Application Screenshots

Login Page

Login Page Professional login interface with secure User ID authentication

Account Dashboard

Account Dashboard 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 and account-dashboard.png in the screenshots/ directory. See screenshots/README.md for detailed instructions.


Features

  • 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

Tech Stack

  • Frontend: HTML5, CSS3, JavaScript (vanilla, fetch API)
  • Backend: Java Servlet (ATMServlet.java), Gson for JSON
  • Database: MySQL (accountInfo table)
  • Build: Maven (pom.xml included)

Database Setup

  1. 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);
  2. Update DB credentials in src/servlet/ATMServlet.java:
    • DB_URL, DB_USER, DB_PASS
  3. Start your MySQL server and ensure the table is seeded.

Backend Setup

  • 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.

Frontend Setup

  • 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.

Building and Running

  1. Build the project with Maven:
    mvn clean package
  2. Deploy the WAR file (target/Java_servlet_ATM.war) to your servlet container (e.g., Tomcat's webapps/ directory).
  3. Access the app:
    • Open your browser to http://localhost:8080/Java_servlet_ATM/

Git Setup

  1. Initialize Git repository:
    git init
    git add .
    git commit -m "Initial commit: Credit Union ATM System"
  2. 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

Project Structure

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

Example Users

  • UserID: 101, Name: Alice Smith, Balance: $1200.00
  • UserID: 102, Name: Bob Johnson, Balance: $800.00

Contribution & License

  • Contributions are welcome! Please fork and submit a pull request.
  • This project is for educational/demo purposes.

.gitignore

A .gitignore is included to exclude build output, IDE files, and OS-specific files.

About

A web-based ATM system built using Java Servlets and MySQL. Supports secure user authentication, real-time transactions (withdraw, deposit, balance check), and account management. Designed to simulate realistic banking operations with session handling and backend efficiency for up to 50+ concurrent users.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published