https://github.com/geod/awsboilerplate Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} geod / awsboilerplate Template * Notifications * Star 7 * Fork 0 A complete starter kit to get your project live on AWS in minutes and a CICD pipeline to allow you to move quickly awsboilerplate.io/ Apache-2.0 License 7 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 5 branches 1 tag Code * Clone HTTPS GitHub CLI [https://github.com/g] Use Git or checkout with SVN using the web URL. [gh repo clone geod/a] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit geod Documentation tweaks ... aee7d58 Aug 23, 2021 Documentation tweaks aee7d58 Git stats * 119 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time awsboilerplate Documentation cleanup Aug 23, 2021 bin Adding debugging to react Aug 19, 2021 documentation Roadmap cleanup Aug 23, 2021 .gitignore Initial commit Apr 3, 2021 CONTRIBUTING.md Initial commit Apr 3, 2021 Documentation.md Pulling out design conversation from landing page Apr 3, 2021 LICENSE Documentation clean up Apr 3, 2021 README.md Documentation tweaks Aug 23, 2021 app.py changing app name to avoid CDK KMS collision Aug 5, 2021 awsboilerplate_config.py Documentation cleanup Aug 22, 2021 buildspec.yml Removing one .. due to removing react folder Aug 22, 2021 cdk.context.json Initial commit Apr 3, 2021 cdk.json Initial commit Apr 3, 2021 requirements.txt Adding IAM from CodeBuild to WWW bucket Aug 3, 2021 setup.py Initial commit Apr 3, 2021 template.yaml Config cleanup Aug 4, 2021 View code [ ] What is it? Motivation Prerequisites Quickstart Run Locally Run on AWS Development Cycle / Making Changes Architecture Overview 'Everything is Code' Documentation Acknowledgements Contributing License README.md awsboilerplate What is it? Get live in minutes with a complete stack: react front end, lambdas, infrastructure and CICD pipeline. Motivation Everyone wants to focus on the idea and not setup / config fiddling. A react front end with lambda backend is a common pattern for building web applications / startups. However, there is hours/days of setup to create a complete and robust setup. Awsboilerplate attempts to provide a complete and integrated boilerplate solution: 1. Front end react/redux stack: leveraging the react-boilerplate project built via codebuild 2. Lambda back end: including exemplars for common lambda patterns - hello world, background jobs, data pipelines 3. Infrastructure: Domain registration (via route53), DNS, Naked domain redirect, Cloudfront, API Gateways 4. Monitoring: via Cloudwatch 5. Everything is Code: All elements are defined in code/CDK (application, infrastructure and pipeline) 6. CICD pipeline: self-mutating pipeline which deploys everything 7. Supports local development workflow (SAM is configured) 8. Integration: All the components are wired together (build, config (dev, prod), infrastructure) Live Demo shows the react front end calling a 'hello world' lambda. This application is deployed via the CICD pipeline. Prerequisites 1. Existing AWS Account 2. AWS CLI 3. Python / Pip / Virtualenv Quickstart Run Locally AWSBoilerplate can be run locally. 1. Fork and checkout the project 2. cd awsboilerplate/app/lambda_hello_world; sam local start-api 3. cd awsboilerplate/www; npm start 4. Open http://localhost:3000/ Run on AWS 1. Fork THEN clone this project (you need to fork as AWS will pull the code from your github project) 2. Create a python venv virtualenv -p python3.8 .venv pip install -r requirements.txt 3. Install AWS CDK. Run cdk synth to test the tools are installed correctly 4. Run cdk bootstrap --trust --cloudformation-execution-policies arn:aws:iam::aws:policy/ AdministratorAccess (this command sets up cdk on your account) 5. Log into github and create an access token to allow codepipeline to pull from the repository 6. Add this access token to AWS secrets manager using the following command aws secretsmanager create-secret --name awsboilerplate-github-oath-token \ --description "awsboilerplate Git Auth Token" \ --region us-east-1 --secret-string 7. Register a domain via Route53 which will create a hosted zone. Run aws route53 list-hosted-zones. Take the hosted zone ID and domain name and enter them in awsboilerplate_config.py hosted_zone_name = "" website_domain_name = "" 8. Update the server URL in awsboilerplate/www/internals/webpack/ webpack.prod.babel.js new webpack.EnvironmentPlugin({ SERVER_URL: 'https://api.' // <-- Keep https://api prefix. An API Gateway will be created for this URL }), 9. Commit and push (to your github fork) 10. Run cdk deploy. CDK will create the pipeline defined in awsboilerplate/pipeline/cdk_pipeline_stack.py. When this pipeline runs it will create all of the infrastructure defined in awsboilerplate/infra and app. Development Cycle / Making Changes You can develop the react front end or lambdas locally then deploy. When ready to push simply run -- usual git add, git commit -- git push origin master The CICD will pick up the changes to both the application code and infrastructure and mutate both. Once the pipeline runs you can hit the domain name to see the new changes (remember cloudfront cache may be enabled). Architecture Overview The project implements the serverless web application pattern. 1. React front end (leveraging and integrating the react boilerplate ) 2. Back end lambdas 3. CICD pipeline to deploy everything (mixing codepipeline, codebuild and cdkpipelines) Overview 'Everything is Code' awsboilerplate has a small novelty. The project leverages CDK and all infrastructure, pipeline and app is expressed in code. Furthermore, awsboilerplate leverages one of the latest features within CDK - CDKPipelines. The project wires these technologies and builds a custom deployment pipeline. This then enables: 1. Every element (front end, back end, cicd, infrastructure, monitoring) is implemented in code, in a single mono repository. 2. It is possible to commit a change to any element and the pipeline should auto-magically make it happen (including changes to the pipeline itself) We are calling this pattern 'Everything is Code' which is further detailed here Documentation 1. 'Everything is Code' 2. Alternatives 3. Roadmap 4. Limitations Acknowledgements awsboilerplate assemble and integrates multiple technologies into a full architecture/toolkit. The only novelty is stretching CDK to support a single mono-repository and combined pipeline. Acknowledgements 1. react-boilerplate and @mxstbr. awsboilerplate obviously incorporates the react-boilerplate as a component. The react boilerplate provided additional inspiration in the ability to solve a ton of developer friction and time (if you have ever tried to assemble a react-redux-webpack project from scratch) 2. @rix0rrr provided invaluable help to answer a number of CDK questions 3. @muymoo for answering every single other question! Other Reading 1. I found this too late into building awsboilerplate CDK Patterns 2. Which is different from the official AWS pattern library Contributing All contributions greatly appreciated. Trying to follow the edict from Reid Hoffman. If you are not embarrassed by the first version of your product, you've launched too late The launch version of the project is 'good enough' and solves many hours of development time for people starting new project. There are many many features which could be added. Please submit a pull request. Also see the features page for open features/issues. License Copyright 2021 geod Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. About A complete starter kit to get your project live on AWS in minutes and a CICD pipeline to allow you to move quickly awsboilerplate.io/ Topics react aws boilerplate aws-lambda startup aws-cloudformation starter-project cdk reactboilerplate Resources Readme License Apache-2.0 License Releases 1 Beta Launch Latest Aug 23, 2021 Packages 0 No packages published Languages * JavaScript 80.8% * Python 13.9% * Handlebars 3.8% * Other 1.5% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.