Skip to content
This repository was archived by the owner on Jun 23, 2021. It is now read-only.

Quick Start

usamanaseem edited this page Oct 9, 2019 · 36 revisions

The Quickstart guide is meant to help you get started. By using one of the approaches below, you can deploy all the modules (backend, frontend, analytics and operations) in this project together in your AWS Account.

1-click Deploy

To make it easy to deploy the service and see how it works, we have published the service, including all the modules in the repository, as a serverless application on AWS Serverless Application Repository. Follow the steps below to deploy this application in your AWS account:

  1. Create an AWS account if you do not already have one and login
  2. Go to this app's page on the Serverless Application Repository (TODO: link) and click "Deploy"
  3. Provide the required app parameters and click "Deploy"

Parameters

The app has the following parameters:

  1. Stage (optional) - The stage where the application is running in, e.g., dev, prod. Default: test

Manually Deploy from Source

To manually deploy the application from the source code, follow the steps described in this section. At the end, you will have a running instance of this application in your AWS account.

Pre-requisites

The source code of the repository is written and built using Java8 and node.js10 runtimes. You will need to install Java8 and node.js10:

To build and deploy the service manually from your machine, you will also need to install and configure Maven, Vue CLI and AWS CLI

Build

After downloading the source code from GitHub, run the following commands to build the source code:

cd aws-serverless-app-repo-reference-static-website
npm install
npm run ci
cd ..
mvn clean test

The command will compile the code and run unit tests

Package

The AWS resources used in the service are defined in SAM (AWS Serverless Application Model) templates. You can install the service into your own AWS account by packaging and deploying the SAM template template.yaml under sam/app folder.

To package the SAM templates, first you will need an S3 bucket to store the artifacts such as your AWS Lambda function code. AWS CloudFormation will use the artifacts from the S3 bucket for deployment. If you don't have an S3 bucket yet, you can run the following command to create an S3 bucket:

aws s3 mb s3://<your bucket name>

Then run the following maven command to package the templates:

mvn clean package -DpackageBucket=<your bucket name>

The command generates a packaged-template.yaml file under folder target/sam/app. The packaged template is now deployable to AWS CloudFormation.

Deploy

Run the following AWS CLI command to deploy the packaged templates to your AWS account:

aws cloudformation deploy --template-file target/sam/app/packaged-template.yaml --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND --stack-name <your-stack-name>

After Deployment

After deployment, you will be able to access the service APIs via static website. You can find the URL of the static website in the output section of the deployed CloudFormation stack.

To dive deep into each module you have deployed from this project, continue to read the walkthroughs:

Clone this wiki locally