This project exists to quickly set up an SSR website using AWS lambda functions and dynamoDB.
- JavaScript
- Serverless
- AWS
- Testing
-
Clone the repo
git clone https://github.com/trellistk/trellis-sls-ssr-starter.git
-
Install the serverless CLI
npm install -g serverless
-
Install npm packages/dependencies
npm i
-
Install serverless plugins
sls dynamodb install
-
Run the app locally
sls offline start
Available routes will be printed out in the terminal.
- .github: github actions for our CI/CD pipeline
- database
- dynamodb.js: helps us run the aws dynamodb client
- helpers
- db.js: database calls to DynamoDB
- logger.js: logging helper
- response.js: http response helper.
- src
- functions: ourlambda functions:
- authorize.js: middleware function that gates requests that use bearer tokens.
- schema: schemas for post requests which API Gateway uses for validating requests.
- tests: contains tests against the app
- test-utils: helpers for running the tests
- data_factories: generates data for testing
- offline: runs serverless in a child process so we can run integration tests against it.
- test-utils: helpers for running the tests
- functions: ourlambda functions:
- package.json: You can find scripts to run the app here
- serverless.yaml: Serverless settings and route declarations
- Database Validation Error: Check if the keys are all there. If developing locally with offline and changes to the db schema has happened recently, delete
shared-local-instance-db
to reset the local table.