Wallet Funds Transfer Service is a high-performance, Payment API that implements banking-grade transaction management with ACID compliance. Built with Spring Boot 3 and Java 17, it demonstrates modern backend development practices including distributed transactions, optimistic locking, and Spring security.
- Atomic Money Transfers - ACID-compliant fund transfers with rollback support
- Optimistic Locking - Prevents double-spending in high-concurrency scenarios
- JWT Authentication - Stateless, secure user authentication
- Comprehensive API Docs - Interactive documentation with Swagger UI
- Docker Support - Containerized deployment with Docker Compose
- Test Coverage - Unit, integration, and concurrency tests
- Performance Optimized - Connection pooling, batch processing, and caching
┌─────────────────────────────────────────────────────────────┐
│ Client Applications │
└───────────────────────────────┬─────────────────────────────┘
│
┌───────────────────────────────▼─────────────────────────────┐
│ API Gateway (Spring Cloud Gateway) │
└───────────────────────────────┬─────────────────────────────┘
│
┌───────────────────────────────▼─────────────────────────────┐
│ Wallet Funds Transfer Service │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ REST Controllers │ │
│ └───────────────┬───────────────────────┬───────────────┘ │
│ │ │ │
│ ┌───────────────▼───────┐ ┌────────────▼───────────────┐ │
│ │ Account Service │ │ Transaction Service │ │
│ └───────────────┬───────┘ └────────────┬───────────────┘ │
│ │ │ │
│ ┌───────────────▼───────────────────────▼───────────────┐ │
│ │ Repository Layer │ │
│ └───────────────────────────┬───────────────────────────┘ │
│ │ │
└──────────────────────────────┼──────────────────────────────┘
│
┌─────────────┴───────────────┐
│ │
┌────────────▼───────┐ ┌────────────▼───────┐
│ PostgreSQL DB │ │ H2 (for dev) │
└────────────────────┘ └────────────────────┘
- Core: Java 17, Spring Boot 3.1.0
- Security: Spring Security 6.1.0, JWT, BCrypt
- Database: PostgreSQL 15, H2 (development)
- Data Access: Spring Data JPA, Hibernate 6.2.0
- API Docs: SpringDoc OpenAPI 3.0
- Build: Maven 3.8.6+
- Containerization: Docker 20.10+, Docker Compose
- Testing: JUnit 5, TestContainers, MockMVC
# Clone the repository
git clone https://github.com/yourusername/rupeexfer.git
cd rupeexfer
# Run with Maven
mvn spring-boot:run -Dspring-boot.run.profiles=devAccess the application at http://localhost:8080
docker-compose up --build| Variable | Default (Dev) | Description |
|---|---|---|
SPRING_PROFILES_ACTIVE |
dev |
Active Spring profile |
DB_URL |
jdbc:h2:mem:rupeexfer |
Database connection URL |
DB_USERNAME |
sa |
Database username |
DB_PASSWORD |
(empty) | Database password |
JWT_SECRET |
your-256-bit-secret |
JWT signing key |
JWT_EXPIRATION_MS |
86400000 (24h) |
JWT expiration time in ms |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/auth/signin |
User authentication | No |
POST |
/api/accounts |
Create new account | Yes |
GET |
/api/accounts/{accountNumber}/balance |
Get balance | Yes |
POST |
/api/transactions/transfer |
Transfer funds | Yes |
GET |
/api/accounts/{accountNumber}/transactions |
Transaction history | Yes |
curl -X POST 'http://localhost:8080/api/accounts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-d '{
"accountType": "SAVINGS",
"initialBalance": 1000.00
}'curl -X POST 'http://localhost:8080/api/transactions/transfer' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-d '{
"sourceAccountNumber": "ACC123456",
"destinationAccountNumber": "ACC789012",
"amount": 100.00,
"description": "Dinner bill"
}'curl 'http://localhost:8080/api/accounts/ACC123456/transactions?page=0&size=10' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'Run the complete test suite:
mvn testTest categories:
- Unit tests (
*Test.java) - Integration tests (
*IT.java)
- Prevents lost updates in concurrent transfer scenarios
- Uses
@Versionfor automatic conflict detection - Throws
OptimisticLockingFailureExceptionon conflicts
- All money transfers are wrapped in
@Transactional - Automatic rollback on any failure
- Consistent state guaranteed at all times
- All transactions are append-only
- No updates/deletes on transaction records
- Complete audit trail for compliance
- Support for idempotency keys in transfer requests
- Prevents duplicate processing of the same request
- Essential for reliable retries
mvn clean packagejava -jar target/rupeexfer-0.0.1-SNAPSHOT.jarFor production deployment, it's recommended to:
- Use HTTPS
- Set strong database credentials
- Configure proper JWT secret
- Enable proper logging and monitoring
- Set up proper backup strategy
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Copyright © 2025 Sanket Desai. All rights reserved. This project is licensed under the MIT License - see the LICENSE file for details.