A comprehensive, production-ready banking system built with Spring Boot, following modern software engineering principles and designed for AWS cloud deployment.
- Customer Management: Complete customer onboarding and profile management
- Account Management: Multiple account types (Savings, Checking, Business, Investment)
- Transaction Processing: Deposits, withdrawals, and transfers with full audit trail
- Balance Management: Real-time balance tracking with concurrent access protection
- Transaction History: Comprehensive transaction reporting and filtering
- SOLID Principles: Clean, maintainable, and extensible code architecture
- Design Patterns: Factory, Strategy, Observer, Facade, and Repository patterns
- Concurrency: Thread-safe operations with pessimistic locking and deadlock prevention
- Security: Spring Security with JWT authentication and authorization
- Validation: Comprehensive input validation and error handling
- Testing: Unit, integration, and concurrent testing with 90%+ coverage
- Domain-Driven Design: Clear domain boundaries and business logic separation
- CQRS Ready: Separate read/write operations for scalability
- Event Sourcing: Complete transaction audit trail
- Microservices Ready: Modular design for easy service extraction
- API-First: RESTful APIs with OpenAPI documentation
- Java 17: Latest LTS version with modern language features
- Spring Boot 3.2.1: Latest Spring Boot with native compilation support
- Spring Data JPA: Database abstraction with Hibernate
- Spring Security: Authentication and authorization
- PostgreSQL: Production database with ACID compliance
- H2: In-memory database for testing
- Maven: Dependency management and build automation
- JUnit 5: Modern testing framework
- Mockito: Mocking framework for unit tests
- TestContainers: Integration testing with real databases
- AssertJ: Fluent assertions for better test readability
- OpenAPI 3.0: API documentation with Swagger UI
- MapStruct: Type-safe bean mapping
- Lombok: Boilerplate code reduction
- Docker: Containerization with multi-stage builds
- AWS ECS: Container orchestration with Fargate
- AWS RDS: Managed PostgreSQL database
- AWS ALB: Load balancing and SSL termination
- CloudFormation: Infrastructure as Code
- GitHub Actions: CI/CD pipeline
- Java 17 or higher
- Maven 3.6+
- Docker (for containerization)
- AWS CLI (for deployment)
- PostgreSQL (for production)
-
Clone the repository
git clone https://github.com/your-org/banking-system.git cd banking-system -
Run with Docker Compose
docker-compose up -d
-
Or run locally
mvn spring-boot:run
-
Access the application
- Application: http://localhost:8080
- API Documentation: http://localhost:8080/swagger-ui.html
- Health Check: http://localhost:8080/actuator/health
- H2 Console: http://localhost:8080/h2-console
# Run all tests
mvn test
# Run specific test categories
mvn test -Dtest="*ServiceTest"
mvn test -Dtest="*RepositoryTest"
mvn test -Dtest="*ControllerTest"
# Run with coverage
mvn test jacoco:reportPerson ββ AccountHolder ββ Account ββ Transaction
β β β
ββββββββ Bank ββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
β REST Controllers β
βββββββββββββββββββββββββββββββββββββββ€
β Services β
βββββββββββββββββββββββββββββββββββββββ€
β Repositories β
βββββββββββββββββββββββββββββββββββββββ€
β Database β
βββββββββββββββββββββββββββββββββββββββ
- PersonService: Customer information management
- AccountService: Account operations with thread safety
- TransactionService: Transaction processing and audit
- BankingFacadeService: High-level business operations
- Security: JWT-based authentication and authorization
- Authentication: JWT-based stateless authentication
- Authorization: Role-based access control
- Input Validation: Comprehensive request validation
- SQL Injection Prevention: Parameterized queries
- XSS Protection: Safe data handling
- HTTPS: SSL/TLS encryption in production
- Audit Trail: Complete transaction logging
The API is fully documented using OpenAPI 3.0 specification:
- Interactive Documentation:
/swagger-ui.html - OpenAPI Spec:
/v3/api-docs
POST /api/v1/banking/onboard-customer # Customer onboarding
GET /api/v1/accounts/{accountNumber} # Get account details
POST /api/v1/accounts/{accountNumber}/deposit # Deposit money
POST /api/v1/accounts/{accountNumber}/withdraw # Withdraw money
POST /api/v1/transfers # Transfer money
GET /api/v1/accounts/{accountNumber}/transactions # Transaction history
- AWS CLI configured
- Docker installed
- Appropriate AWS permissions
-
Deploy Infrastructure
chmod +x scripts/deploy.sh ./scripts/deploy.sh dev us-east-1
-
Access Application
- The script will output the Application Load Balancer URL
- API Documentation:
http://{ALB-URL}/swagger-ui.html
- VPC: Isolated network with public/private subnets
- ECS Fargate: Serverless container hosting
- RDS PostgreSQL: Managed database with encryption
- Application Load Balancer: High availability and SSL termination
- Auto Scaling: Automatic scaling based on CPU/Memory
- CloudWatch: Monitoring and alerting
- S3: Document storage
- SQS/SNS: Async processing and notifications
- Unit Tests: Service and component testing with mocking
- Integration Tests: End-to-end business flow testing
- Repository Tests: Data access layer testing
- Controller Tests: REST API testing with MockMvc
- Concurrent Tests: Thread safety and deadlock prevention
- Services: 95%+ coverage
- Controllers: 90%+ coverage
- Repositories: 85%+ coverage
- Overall: 90%+ coverage
- Thread-Safe Operations: Pessimistic locking for balance updates
- Deadlock Prevention: Consistent lock ordering in transfers
- Connection Pooling: Optimized database connections
- Async Processing: Non-blocking operations where possible
- Horizontal Scaling: Stateless design for easy scaling
- Database Optimization: Indexed queries and batch processing
- Caching Ready: Service layer prepared for Redis integration
- Load Balancing: Multiple instance support
- default: Local development with H2
- docker: Docker Compose with PostgreSQL
- aws: Production deployment on AWS
spring:
profiles:
active: ${SPRING_PROFILES_ACTIVE:default}
datasource:
url: ${DATABASE_URL}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow SOLID principles
- Write comprehensive tests
- Use conventional commits
- Update documentation
- Ensure security best practices
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
/docsfolder for detailed guides - Issues: Report bugs and feature requests via GitHub Issues
- Discussions: Join community discussions in GitHub Discussions