Overview
AWS Boilerplate is a comprehensive and integrated boilerplate solution for building web applications or startups. It offers a complete stack, including a React front end, Lambda backend, infrastructure, and CI/CD pipeline. The motivation behind AWS Boilerplate is to allow users to focus on their ideas rather than spending time on setup and configuration.
Features
- Complete stack: Includes a React front end, Lambda backend, infrastructure, and CI/CD pipeline.
- React/Redux stack: Leverages the react-boilerplate project for the front end development.
- Lambda backend: Provides exemplars for common Lambda patterns, such as hello world, background jobs, and data pipelines.
- Infrastructure: Offers domain registration via Route53, DNS, naked domain redirect, CloudFront, and API Gateways.
- Monitoring: Uses CloudWatch for monitoring purposes.
- Infrastructure as Code: All elements, including applications, infrastructure, and the pipeline, are defined in code using Cloud Development Kit (CDK).
- CI/CD pipeline: A self-mutating pipeline that deploys all elements of the stack.
- Local development workflow: Supports local development using AWS SAM.
- Integration: All components are wired together, including build, config, and infrastructure.
Installation
Run Locally
- Fork and checkout the AWS Boilerplate project.
- Navigate to the lambda_hello_world directory (
cd awsboilerplate/app/lambda_hello_world) and runsam local start-apito start the Lambda locally. - Navigate to the www directory (
cd awsboilerplate/www) and runnpm startto start the React front end locally. - Open http://localhost:3000/ in your browser to view the application.
Run on AWS
- Fork and clone the AWS Boilerplate project.
- Create a Python virtual environment.
- Install AWS CDK and run
cdk synthto test the installation. - Run
cdk bootstrap --trust <AWS ACCOUNT ID> --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccessto set up CDK on your AWS account. - Log into GitHub and create an access token to allow CodePipeline to pull from your repository.
- Add the access token to AWS Secrets Manager using the appropriate command.
- Register a domain via Route53, which will create a hosted zone. Run
aws route53 list-hosted-zonesand enter the hosted zone ID and domain name in the awsboilerplate_config.py file. - Update the server URL in awsboilerplate/www/internals/webpack/webpack.prod.babel.js
- Commit and push the changes to your GitHub fork.
- Run
cdk deployto create the pipeline and infrastructure defined in awsboilerplate/pipeline/cdk_pipeline_stack.py. - Once the pipeline runs, you can access the application by using the domain name (note that CloudFront cache may be enabled).
Summary
AWS Boilerplate is a ready-to-use solution for building web applications or startups using a React front end and Lambda backend. It provides a complete stack, including infrastructure and a CI/CD pipeline, allowing users to focus on their ideas rather than spending time on setup and configuration. The installation guide provides step-by-step instructions for running the application locally and deploying it on AWS.