A full-stack digital wallet application built with Java Spring Boot backend and vanilla HTML/CSS/JavaScript frontend. Users can register, log in, check their balance, and send money to other users.
- User Registration β Sign up with email & password, receive βΉ1000 starting balance
- User Login β Authenticate with email and password
- Balance Dashboard β View current wallet balance in real-time
- Money Transfer β Send money to any registered user
- Error Handling β Prevents self-transfers, insufficient balance, duplicate accounts, and invalid credentials
- Transactional Safety β Money transfers use
@Transactionalfor atomicity
| Layer | Technology |
|---|---|
| Backend | Java 17+, Spring Boot 3.2.5 |
| Database | H2 (in-memory relational DB) |
| ORM | Spring Data JPA / Hibernate |
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| API Format | RESTful JSON |
| Build Tool | Maven 3.9.6 (wrapper included) |
Wallet/
βββ README.md
βββ backend/
β βββ pom.xml
β βββ mvnw.cmd
β βββ .mvn/wrapper/
β βββ src/main/
β βββ java/com/wallet/
β β βββ WalletApplication.java # Spring Boot entry point
β β βββ model/
β β β βββ User.java # JPA Entity (id, email, password, balance)
β β βββ repository/
β β β βββ UserRepository.java # Spring Data JPA Repository
β β βββ service/
β β β βββ WalletService.java # Business logic with @Transactional
β β βββ controller/
β β β βββ WalletController.java # REST API endpoints
β β βββ config/
β β βββ WebConfig.java # CORS configuration
β βββ resources/
β βββ application.properties # H2 & JPA configuration
β βββ static/ # Frontend served by Spring Boot
β βββ login.html
β βββ dashboard.html
β βββ send.html
β βββ style.css
βββ frontend/ # Standalone frontend files
βββ login.html
βββ dashboard.html
βββ send.html
βββ style.css
- Java 17 or higher installed (Download)
- No Maven installation needed β Maven wrapper is included
# Clone the repository
git clone https://github.com/atharv01h/Wallet-App.git
cd wallet-app/backend
# Start the Spring Boot server (Windows)
.\mvnw.cmd spring-boot:run
# Start the Spring Boot server (Linux/Mac)
./mvnw spring-boot:runNote: First run downloads all dependencies and may take a few minutes. Subsequent runs are much faster.
Navigate to: http://localhost:8080/login.html
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
POST |
/api/register |
Register a new user | { "email": "...", "password": "..." } |
POST |
/api/login |
Login with credentials | { "email": "...", "password": "..." } |
GET |
/api/balance?email=... |
Get wallet balance | β |
POST |
/api/send |
Transfer money | { "fromEmail": "...", "toEmail": "...", "amount": 100 } |
# Register
curl -X POST http://localhost:8080/api/register \
-H "Content-Type: application/json" \
-d '{"email":"alice@wallet.com","password":"pass123"}'
# Login
curl -X POST http://localhost:8080/api/login \
-H "Content-Type: application/json" \
-d '{"email":"alice@wallet.com","password":"pass123"}'
# Check Balance
curl http://localhost:8080/api/balance?email=alice@wallet.com
# Send Money
curl -X POST http://localhost:8080/api/send \
-H "Content-Type: application/json" \
-d '{"fromEmail":"alice@wallet.com","toEmail":"bob@wallet.com","amount":250}'- Enter email and password
- Click "Create Account" to register (βΉ1000 default balance)
- Click "Sign In" to log in
- View your current wallet balance
- Navigate to send money or logout
- Refresh balance button for real-time updates
- Enter recipient's email and amount
- Submit to transfer funds instantly
- Error messages shown for invalid operations
| Rule | Description |
|---|---|
| Default Balance | New users receive βΉ1000 on registration |
| Self-Transfer | Cannot send money to yourself |
| Insufficient Funds | Cannot send more than your available balance |
| Duplicate Email | Cannot register with an already-used email |
| Positive Amount | Transfer amount must be greater than zero |
The app uses H2 in-memory database β all data resets on server restart.
- H2 Console: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:walletdb - Username:
sa - Password: (leave empty)
- JDBC URL:
βββββββββββββββ HTTP/JSON ββββββββββββββββββββββββββββββββββββββββ
β Frontend β ββββββββββββββββΊ β Spring Boot Backend β
β (HTML/JS) β β β
β β β Controller β Service β Repository β
β login.html β β β β β β
β dashboard β β REST API Business JPA/H2 DB β
β send.html β β Logic β
βββββββββββββββ ββββββββββββββββββββββββββββββββββββββββ
This project is open source and available for educational purposes.
Atharv Hatwar