This is a simple ATM backend application built using Spring Boot.
It provides basic REST APIs for ATM operations like deposit, withdrawal, and balance check.
- Go to Spring Initializr.
- Fill in the details:
- Project: Maven
- Language: Java
- Spring Boot Version: (latest stable, e.g., 3.x.x)
- Group: com.example
- Artifact: atm-backend
- Name: atm-backend
- Packaging: Jar
- Java: 17 (or your installed version)
- Add dependencies:
- Spring Web
- Click Generate, and extract the downloaded project.
- Open IntelliJ IDEA.
- Import the project by selecting the extracted folder.
- Wait until Maven builds the project and dependencies are downloaded.
- Locate the main class:
src/main/java/com/example/atmbackend/AtmBackendApplication.java
- Right-click and select Run 'AtmBackendApplication'.
- The application will start on http://localhost:8080 by default.
You can use Postman or curl to test the APIs.
For example:
- Check balance:
GET http://localhost:8080/api/atm/balance
- Deposit:
POST http://localhost:8080/api/atm/deposit
- Withdraw:
POST http://localhost:8080/api/atm/withdraw
- Java 17+
- Spring Boot
- Maven
- REST API
This project simulates an ATM machine workflow where a user can:
- Insert a card
- Enter a PIN
- Perform banking operations (Check Balance, Withdraw, Deposit)
POST http://localhost:8080/atm/insert-card?cardNumber=1234-5678-9012-3456
POST http://localhost:8080/atm/enter-pin?pin=1234
- Used after inserting a card.
- Validates the PIN for the given card.

POST http://localhost:8080/atm/operation?operation=CHECK_BALANCE
- Returns the current balance of the account linked to the inserted card.

POST http://localhost:8080/atm/operation?operation=WITHDRAW_CASH&amount=570
POST http://localhost:8080/atm/operation?operation=DEPOSIT_CASH&amount=200
- Adds the given amount to the account balance.
