Skip to content

Serverless Framework Server Side Rendering Application Starter Kit

Notifications You must be signed in to change notification settings

trellistk/trellis-sls-ssr-starter-V1

Repository files navigation

Trellis Serverless-Server Server-Side-Rendering Application

This project exists to quickly set up an SSR website using AWS lambda functions and dynamoDB.

Table of Contents

Technologies

Quick Start

  1. Clone the repo

    git clone https://github.com/trellistk/trellis-sls-ssr-starter.git
  2. Install the serverless CLI

    npm install -g serverless
  3. Install npm packages/dependencies

    npm i
  4. Install serverless plugins

    sls dynamodb install
  5. Run the app locally

    sls offline start

Available routes will be printed out in the terminal.

Repository Quick Overview

  • .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.
  • package.json: You can find scripts to run the app here
  • serverless.yaml: Serverless settings and route declarations

Troubleshooting

  • 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.

About

Serverless Framework Server Side Rendering Application Starter Kit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published