This repository contains an example on how to use the Dynamoose library (https://dynamoosejs.com/getting_started/Introduction) to communicate with DynamoDB.
The diagram below illustrates the different components and how they interact with each other:
-
Setup AWS & Serverless, make sure you have an .aws directory in your user home folder that contains your credentials and config.
-
Duplicate the .env.template file based on the stage and set the variable values:
cp .env.template .env.<stage> vim .env.<stage>
for example:
cp .env.template .env.personal vim .env.personal
-
Install dependencies in the root folder:
npm i
-
Install dependencies for each app in the apps folder:
cd apps/<app_name> npm i
for example:
cd apps/comments npm i
- Run the following command:
for example:
npm run deploy --stage=<stage> --application=db
npm run deploy --stage=personal --application=db
- Go to the apps folder and run the following command:
for example:
cd apps/<app_name> npm run dev --stage=<stage>
cd apps/comments npm run dev --stage=personal
- Dynamoose Documentation: https://dynamoosejs.com/
- NestJS Dynamoose Implementation: https://blog.logrocket.com/nestjs-data-dynamoose/