A complete full-stack application demonstrating modern cloud-native deployment patterns using Spring Boot, React, and AWS services with enterprise-grade security.
- Frontend: React 18 + TypeScript + Vite (deployed on AWS Amplify)
- Backend: Spring Boot 3.3.0 + Java 17 (deployed on AWS Elastic Beanstalk)
- Database: PostgreSQL (Local development + AWS RDS)
- CI/CD: GitHub Actions with automated testing and deployment
- Security: SQL injection protection, input validation, CORS configuration
customer-management-aws-demo/
βββ client/ # React TypeScript Frontend
β βββ src/
β β βββ components/ # React components (CustomerList, CustomerForm)
β β βββ services/ # API service layer
β β βββ types/ # TypeScript interfaces
β β βββ styles/ # CSS styling
β βββ .env.development # Local environment variables
β βββ .env.production # Production environment variables
β βββ package.json # Node.js dependencies
βββ server/ # Spring Boot API
β βββ deploy/ # AWS deployment package
β β βββ .ebextensions/ # AWS Elastic Beanstalk configuration
β β βββ Procfile # Process configuration for deployment
β β βββ *.jar # Compiled application
β βββ src/main/java/ # Java source code
β β βββ com/example/relationaldataaccess/
β β βββ Customer.java # Data model
β β βββ RelationalDataAccessApplication.java # Main application
β β βββ controller/
β β βββ CustomerController.java # REST API endpoints
β βββ src/main/resources/ # Application configuration
β β βββ application.properties # Local configuration
β β βββ application-production.properties # Production configuration
β βββ src/test/java/ # Security and unit tests
β βββ Dockerfile # Container configuration
β βββ pom.xml # Maven dependencies (build tool)
β βββ mvnw # Maven wrapper
βββ .github/workflows/ # CI/CD pipelines
βββ amplify.yml # AWS Amplify build configuration
βββ BUILD_AND_DEPLOY.md # Detailed build and deployment guide
βββ DEPLOYMENT.md # Comprehensive deployment guide
βββ SECURITY.md # Security documentation
βββ INSTRUCTOR_GUIDE.md # Educational materials
βββ setup.sh # Local development setup script
βββ README.md # This file
- β REST API: Complete CRUD operations for customer management
- β Database Integration: PostgreSQL with JDBC Template
- β Security: SQL injection protection with parameterized queries
- β Input Validation: Comprehensive input sanitization and validation
- β CORS: Configured for local development and production
- β Health Checks: API monitoring endpoint
- β Environment Configuration: Development and production profiles
- β Modern UI: Responsive customer management interface
- β TypeScript: Type-safe development with interfaces
- β Component Architecture: Reusable React components
- β API Integration: Axios-based service layer
- β Real-time Updates: Live data synchronization
- β Error Handling: User-friendly error messages
- β Containerization: Docker support with security best practices
- β CI/CD Pipeline: GitHub Actions for automated deployment
- β AWS Ready: Configured for Amplify, Elastic Beanstalk, and RDS
- β Environment Management: Separate configs for dev/prod
- β Security Testing: Automated security validation
- β Educational Materials: Swedish guides and instructor resources
- Java 17+ (for backend development)
- Node.js 18+ (for frontend development)
- PostgreSQL 14+ (for local database)
- Git (for version control)
Run the setup script to configure everything automatically:
# Clone and setup
git clone https://github.com/JohanCodeForFun/customer-management-aws-demo.git
cd customer-management-aws-demo
chmod +x setup.sh
./setup.sh-
Clone the repository:
git clone https://github.com/JohanCodeForFun/customer-management-aws-demo.git cd customer-management-aws-demo -
Setup PostgreSQL database:
# macOS with Homebrew brew install postgresql brew services start postgresql # Create database and user psql postgres -c "CREATE DATABASE customerdb;" psql postgres -c "CREATE USER customeruser WITH PASSWORD 'customerpass';" psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE customerdb TO customeruser;"
-
Start the backend:
cd server ./mvnw spring-boot:run -
Start the frontend (in a new terminal):
cd client npm install npm run dev
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080/api/customers
- Health Check: http://localhost:8080/api/health
GET /api/customers- List all customersGET /api/customers/{id}- Get customer by IDPOST /api/customers- Create new customerDELETE /api/customers/{id}- Delete customerGET /api/customers/search?name={name}- Search customers by name
GET /api/health- API health check
# Get all customers
curl http://localhost:8080/api/customers
# Create a new customer
curl -X POST http://localhost:8080/api/customers \
-H "Content-Type: application/json" \
-d '{"firstName": "John", "lastName": "Doe"}'
# Search customers
curl "http://localhost:8080/api/customers/search?name=John"
# Delete customer
curl -X DELETE http://localhost:8080/api/customers/1- SQL Injection Protection: Parameterized queries with input validation
- Input Sanitization: Character filtering and length limits
- CORS Configuration: Secure cross-origin resource sharing
- Environment-based Security: Production-ready configurations
- Docker Security: Non-root user containers
For detailed security information, see SECURITY.md.
This application is configured for deployment to AWS using:
- AWS Amplify: Frontend hosting with CDN
- AWS Elastic Beanstalk: Backend auto-scaling and load balancing
- AWS RDS: Managed PostgreSQL database
- GitHub Actions: Automated CI/CD pipeline
For step-by-step deployment instructions, see DEPLOYMENT.md.
- Set up AWS infrastructure (RDS, Elastic Beanstalk, Amplify)
- Configure GitHub repository secrets
- Push to main branch to trigger deployment
git push origin main # Triggers automatic deployment- Spring Boot 3.3.0 - Application framework
- Spring Web - REST API development
- Spring JDBC - Database access layer
- PostgreSQL - Primary database
- JUnit 5 - Testing framework
- Maven - Build and dependency management (single build tool)
- React 18 - UI library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and development server
- Axios - HTTP client for API calls
- CSS3 - Styling and responsive design
- Docker - Containerization
- AWS Amplify - Frontend hosting and CI/CD
- AWS Elastic Beanstalk - Backend deployment and scaling
- AWS RDS - Managed PostgreSQL database
- GitHub Actions - Continuous integration and deployment
# Backend tests (includes security tests)
cd server
./mvnw test
# Frontend tests
cd client
npm test- Feature Development: Create feature branch from
main - Local Testing: Test both frontend and backend locally
- Pull Request: Submit PR for code review
- Automated Testing: GitHub Actions runs tests
- Deployment: Merge to
maintriggers deployment
# View backend logs
cd server
./mvnw spring-boot:run --debug
# View frontend development server
cd client
npm run dev -- --debugThis project demonstrates modern full-stack development with AWS cloud deployment. Contributions are welcome!
- 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 existing code style and patterns
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
- π Bug Reports: Use GitHub Issues with bug template
- π‘ Feature Requests: Describe use case and expected behavior
- β Questions: Use Discussions for general questions
- π Security Issues: Report privately via email
- BUILD_AND_DEPLOY.md - Step-by-step build and deployment guide
- DEPLOYMENT.md - Complete AWS deployment guide
- SECURITY.md - Security features and best practices
- INSTRUCTOR_GUIDE.md - Educational materials and teaching guide
- Spring Boot Docs - Framework documentation
- React Docs - Frontend library documentation
- AWS Documentation - Cloud platform guides
This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details.
- Spring Guides: Based on Accessing Relational Data tutorial
- Spring Boot Team: For the excellent framework and documentation
- React Team: For the powerful UI library
- AWS: For comprehensive cloud platform and documentation
- Open Source Community: For the tools and libraries that make this possible