This project demonstrates a modern React application built with TypeScript and Vite, featuring end-to-end testing capabilities using Playwright. The application is fully containerized using Docker, making it easy to deploy and test in any environment.
- Modern React development setup with TypeScript
- Production-ready Docker configuration
- Automated E2E testing infrastructure
- Continuous Integration ready with AWS Elastic Beanstalk deployment pipeline
- ESLint configuration for code quality
- Multi-stage Docker builds for optimized production images
- Automated deployment to AWS Elastic Beanstalk infrastructure
- Frontend: React 18 with TypeScript
- Build Tool: Vite
- Testing: Playwright for E2E testing
- Containerization: Docker & Docker Compose
- Web Server: Nginx for production deployment
The project is structured into two main components:
-
React Application (
/react-app
)- Built with React and TypeScript
- Uses Vite for fast development and optimized builds
- Containerized with Nginx for production deployment
-
E2E Testing Suite (
/e2e
)- Playwright-based end-to-end testing
- Configured for CI/CD environments
- Generates comprehensive HTML and JUnit test reports
# Install dependencies
npm install
# Start development server
npm run dev
# Run E2E tests
cd e2e
npm install
npx playwright test
# Build and run the application
docker-compose up --build
The application will be available at http://localhost:80
- End-to-end testing with Playwright
- Automated test reporting
- CI/CD integration support
- Parallel test execution
- Cross-browser testing capabilities
The application uses GitHub Actions for continuous integration and deployment to AWS Elastic Beanstalk. The pipeline ensures code quality and runs all tests before deploying to production.
-
Build & Test
- Builds the React application
- Runs ESLint checks
- Executes E2E tests with Playwright
- Generates test reports
-
Docker Build
- Builds production Docker image
- Runs container security scanning
- Pushes image to Amazon ECR
-
Deploy to AWS Elastic Beanstalk
- Deploys to staging environment first
- Runs smoke tests
- Promotes to production if all checks pass
- Elastic Beanstalk Environment
- Platform: Docker running on 64bit Amazon Linux 2
- Instance type: t3.small (adjustable based on load)
- Auto-scaling enabled: 2-4 instances
- Load balancer: Application Load Balancer
# Example Elastic Beanstalk configuration
option_settings:
aws:elasticbeanstalk:application:environment:
NODE_ENV: production
aws:autoscaling:asg:
MinSize: 2
MaxSize: 4
aws:elasticbeanstalk:container:docker:
Memory: 512
- Tests pass on main branch
- Docker image is built and pushed to ECR
- Elastic Beanstalk environment is updated
- Health checks confirm deployment success
- Traffic is gradually shifted to new version
- Automatic rollback on deployment failure
- Health check failures trigger previous version restoration
- Maximum 5-minute downtime SLA
├── react-app/ # React application
│ ├── src/ # Source code
│ ├── Dockerfile # Production Docker configuration
│ └── vite.config.ts # Vite configuration
├── e2e/ # End-to-end tests
│ ├── tests/ # Test specifications
│ └── Dockerfile # Testing environment configuration
└── docker-compose.yaml # Docker composition configuration
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is open-source and available under the MIT License.