https://github.com/alexcasalboni/serverless-multi-region-client-demo
Sample frontend for a multi-region serverless application on AWS
https://github.com/alexcasalboni/serverless-multi-region-client-demo
Last synced: 6 months ago
JSON representation
Sample frontend for a multi-region serverless application on AWS
- Host: GitHub
- URL: https://github.com/alexcasalboni/serverless-multi-region-client-demo
- Owner: alexcasalboni
- License: mit
- Created: 2018-01-28T16:47:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-04T19:12:16.000Z (almost 6 years ago)
- Last Synced: 2025-04-06T19:45:39.993Z (6 months ago)
- Language: JavaScript
- Homepage: https://map.global.faas.website
- Size: 67.4 KB
- Stars: 25
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://developers.google.com/maps/documentation/javascript/get-api-key)):
```bash
export REACT_APP_GOOGLE_MAP_API_KEY=YOUR_GOOGLE_MAP_API_KEY
```2. Setup your regional endpoints in [src/regions.yml](src/regions.yml). For example:
```yaml
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:
```bash
npm install
```2. Run the local server:
```bash
npm start
```## How to deploy to AWS
1. Build the React app:
```bash
npm run build
```2. Configure your AWS CLI ([doc here](https://docs.aws.amazon.com/cli/latest/reference/configure/), [installation guide here](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)):
```bash
aws configure
```3. Configure the bucket name as environment variable:
```bash
export S3_BUCKET_NAME=YOUR_BUCKET_NAME
```4. Deploy the static assets to S3:
```bash
# 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](https://github.com/alexdebrie/serverless-multi-region).