All Projects → alexcasalboni → serverless-multi-region-client-demo

alexcasalboni / serverless-multi-region-client-demo

Licence: MIT License
Sample frontend for a multi-region serverless application on AWS

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Serverless Multi-Region Client Demo

Sample React application to demonstrate multi-region applications.

How to setup

  1. Configure the Google Maps API Key as environment variable (you can create one here):
export REACT_APP_GOOGLE_MAP_API_KEY=YOUR_GOOGLE_MAP_API_KEY
  1. Setup your regional endpoints in src/regions.yml. For example:
us-west-2:
    name: Oregon (US)
    lat: 43.791332
    long: -120.728691
    endpoint: YOUR_REGIONAL_API_GATEWAY_ENDPOINT

How to run locally

  1. Install local dependencies:
npm install
  1. Run the local server:
npm start

How to deploy to AWS

  1. Build the React app:
npm run build
  1. Configure your AWS CLI (doc here, installation guide here):
aws configure
  1. Configure the bucket name as environment variable:
export S3_BUCKET_NAME=YOUR_BUCKET_NAME
  1. Deploy the static assets to S3:
# using the default AWS profile
npm run deploy
# using your own AWS profile
npm run deploy -- --profile YOUR_PROFILE
# with dryrun (unless YOLO)
npm run deploy -- --dryrun

Serverless Backend

You can find the Serverless backend at alexdebrie/serverless-multi-region.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].