A Spring Boot 3.3 application with Java 25, demonstrating enterprise-grade development practices, scalable architecture, and infrastructure as code using Terraform.
This project showcases knowledge across:
- Java 25 - Modern Java features and best practices
- Spring Boot 3.3 - Layered architecture and dependency injection
- PostgreSQL 16 - Database design and optimization
- Terraform - Infrastructure as Code for AWS
- Docker - Containerization and orchestration
- AWS Services - ECS, RDS, ALB, ECR, CloudWatch
- Design Patterns - SOLID principles, Domain-Driven Design
- Testing - Unit and integration tests
- Security - Secrets management, security groups, IAM roles
- Project Structure
- Architecture
- Getting Started
- Development
- Testing
- Docker Deployment
- Terraform Infrastructure
- API Documentation
- Database Migrations
- Best Practices Demonstrated
product-service/
βββ src/
β βββ main/
β β βββ java/com/senior/project/
β β β βββ ProductServiceApplication.java # Main entry point
β β β βββ application/
β β β β βββ dto/ # Data Transfer Objects
β β β β βββ mapper/ # MapStruct mappers
β β β β βββ service/ # Business logic
β β β βββ domain/
β β β β βββ entity/ # JPA entities
β β β β βββ exception/ # Domain exceptions
β β β βββ infrastructure/
β β β β βββ config/ # Spring configurations
β β β β βββ repository/ # Data access layer
β β β βββ presentation/
β β β βββ controller/ # REST endpoints
β β β βββ exception/ # Global exception handler
β β βββ resources/
β β βββ application.properties # Base configuration
β β βββ application-dev.properties # Dev environment
β β βββ application-prod.properties # Prod environment
β β βββ db/migration/ # Flyway migrations
β βββ test/
β βββ java/com/senior/project/
β βββ application/service/ # Service tests
βββ terraform/
β βββ main.tf # Provider configuration
β βββ variables.tf # Input variables
β βββ vpc.tf # Network configuration
β βββ rds.tf # Database setup
β βββ ecs.tf # Container orchestration
β βββ alb.tf # Load balancer
β βββ outputs.tf # Output values
β βββ dev.tfvars # Dev environment vars
β βββ prod.tfvars # Prod environment vars
βββ pom.xml # Maven configuration
βββ Dockerfile # Docker image
βββ docker-compose.yml # Local development
βββ README.md # This file
βββββββββββββββββββββββββββββββββββββββ
β Presentation Layer (REST API) β ProductController
βββββββββββββββββββββββββββββββββββββββ€
β Application Layer (Business Logic) β ProductService
βββββββββββββββββββββββββββββββββββββββ€
β Domain Layer (Entities & Rules) β Product, ProductStatus
βββββββββββββββββββββββββββββββββββββββ€
β Infrastructure Layer (Persistence) β ProductRepository
βββββββββββββββββββββββββββββββββββββββ
- Repository Pattern - Data access abstraction
- Service Pattern - Business logic encapsulation
- DTO Pattern - API contract separation from domain
- Mapper Pattern - Object transformation using MapStruct
- Global Exception Handler - Centralized error management
- Dependency Injection - Spring IoC container
- Transaction Management - @Transactional for ACID compliance
- Java 25+
- Maven 3.8+
- Docker & Docker Compose
- PostgreSQL 16 (or use Docker)
- Terraform 1.5+
- AWS CLI (for cloud deployment)
- Clone the repository
git clone <repository-url>
cd product-service- Start PostgreSQL using Docker Compose
docker-compose up -dThis will:
- Start PostgreSQL 16 on port 5432
- Create the
product_service_devdatabase - Run Flyway migrations automatically
- Insert sample data
- Build the application
mvn clean install- Run the application
mvn spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=dev"The application will start on http://localhost:8080
- Verify the application is running
curl http://localhost:8080/actuator/healthUnit Tests
mvn testIntegration Tests (requires running PostgreSQL)
mvn verifymvn clean package
docker build -t product-service:1.0.0 .docker-compose up -dDevelopment Environment
cd terraform
terraform init
terraform plan -var-file="dev.tfvars"
terraform apply -var-file="dev.tfvars"Production Environment
terraform plan -var-file="prod.tfvars"
terraform apply -var-file="prod.tfvars"POST /api/v1/products- Create productGET /api/v1/products- List all products (paginated)GET /api/v1/products/{id}- Get product by IDGET /api/v1/products/sku/{sku}- Get product by SKUGET /api/v1/products/search?q={term}- Search productsGET /api/v1/products/category/{category}- Get by categoryGET /api/v1/products/low-stock- Get low stock productsPUT /api/v1/products/{id}- Update productDELETE /api/v1/products/{id}- Delete product
β
Clean, layered architecture
β
SOLID principles and DDD
β
Dependency injection
β
Repository pattern
β
Service layer with business logic
β
DTOs for API contracts
β
Input validation
β
Global exception handling
β
Logging and monitoring
β
Transaction management
β
Database migrations (Flyway)
β
Unit and integration tests
β
Docker containerization
β
Infrastructure as Code (Terraform)
β
AWS best practices (VPC, Security Groups, IAM, RDS, ECS, ALB)
β
Auto-scaling policies
β
Secrets management
β
Health checks and monitoring
Version: 1.0.0
Java: 25
Spring Boot: 3.3.0
PostgreSQL: 16