-
Notifications
You must be signed in to change notification settings - Fork 14
How to: run dev locally
Local Dev:Run all the services locally with the command ./dev local
Node - we enforce using a specific version of node, specified in the file .nvmrc. This version matches the Lambda runtime. We recommend managing node versions using NVM.
Serverless - Get help installing it here: Serverless Getting Started page
Yarn - in order to install dependencies, you need to install yarn. If you are on a Mac, you should be able to install all the dependencies like so:
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
# select the version specified in .nvmrc
nvm install
nvm use
# install yarn
brew install yarn
- Open and run the following command in terminal from the project root directory:
./dev local
Local Dev
Run all the services locally with the command ./dev local
See the prerequisite section if the command asks for any prerequisites you don't have installed.
Local dev is configured in typescript project in ./src. The entrypoint is ./src/dev.ts, it manages running the moving pieces locally: the API, the database, the filestore, and the frontend.
Local dev is built around the Serverless plugin serverless-offline. serverless-offline runs an API gateway locally configured by ./services/app-api/serverless.yml and hot reloads your lambdas on every save. The plugins serverless-dynamodb-local and serverless-s3-local stand up the local db and local s3 in a similar fashion.
When run locally, auth bypasses Cognito. The frontend mimics login in local storage with a mock user and sends an id in the cognito-identity-id header on every request. serverless-offline expects that and sets it as the cognitoId in the requestContext for your lambdas, just like Cognito would in AWS.
- Home
- Design
- How to
- Configure an Okta application
- Configure an environment for Okta
- Create an SSM parameter
- Get cloudformation stack outputs
- Clone this repo
- Install Homebrew
- Install Git
- Install nvm
- Install Node.js
- Install Java
- Install AWS CLI
- Install awslogs
- Install Docker Desktop
- Install Code Climate CLI
- Install serverless
- Install Yarn
- Install testcafe
- Re run a github actions workflow
- Workflows