Skip to content

Starter kit for new RealWorld framework implementations wanting to use Serverless with AWS as the provider; DynamoDB; SSM; JWT

License

Notifications You must be signed in to change notification settings

bakerstreet-industries/aws-realworld-starter

 
 

Repository files navigation

AWS Serverless RealWorld Example App

Example Serverless+Typescript codebase that adheres to the RealWorld API spec and opinionated patterns of the aws-ts-starter.

Codacy Badge Build Status Coverage Status License: MIT serverless

How it works

aws-realworld-starter is a serverless seed written in Typescript that provides the following out of the box:

  • Follows The Repository Pattern
  • Structured in a way to have features carved out into microservices
  • Strives for 100% unit test coverage to encourage BDD/TDD
  • Fully functional end-to-end testing of the RealWorld API spec via a Serverless YAML
  • A default Repository implementation against a Dynamo DB
  • An AWS handler wrapper that takes care of the API Gateway callback and error handling, either by thrown errors or by caught promises

Getting started

  1. Fork / Clone this repository
  2. Install the AWS CLI - npm install -g aws
  3. Install the Serverless CLI - npm install -g serverless
  4. Run npm install in your working directory
  5. Configure your AWS CLI - aws configure with your aws_access_key_id and aws_secret_access_key
  6. Create a JWT signing secret in the AWS System Manager's Parameter Store:

TODO: Serverless Generator

Integrate with Travis CI

A .travis.yml file is already included for you. If you do not have a Travis CI account, go here. Once registered, activate your repository, navigate to settings, and add the following Environment Variables:

  1. AWS_ACCESS_KEY_ID
  2. AWS_SECRET_ACCESS_KEY

This seed uses AWS as the provider by default and these credentials are used to deploy and run your serverless application.

Integrate with Coveralls

A public place to display code coverage of your API. Add this Environment Variable to your Travis CI repository's settings:

  1. repo_token - Coveralls token for uploading code coverage report

Running the tests

Unit tests can be run via npm test. If you have never run the end to end tests, or have code changes that need to be deployed before running the end to end tests, use npm run test:e2e:deploy, otherwise to execute the end to end tests of what is deployed to your serverless provider, use npm run test:e2e.

Note: that when you run the deploy routine, it will run a gulp task that will automatically replace the token [[ENDPOINT]] in each e2e test file and replace it with the base URL of the deployed AWS api gateway.

About

Starter kit for new RealWorld framework implementations wanting to use Serverless with AWS as the provider; DynamoDB; SSM; JWT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.4%
  • JavaScript 1.6%