Skip to content

An API for the customer management of an online motorbike shop

Notifications You must be signed in to change notification settings

Sevi7/crm-motorbike-shop

Repository files navigation

CRM Online Motorbike Shop

An API for the customer management of an online motorbike shop.

Prerequisites

Testing Locally

  • Run the following command to create a docker network, run a local dynamodb container in it and create the DynamoDB tables
    sh initialize-docker-dynamodb.sh
    
  • Compile TypeScript files
    npm run build
    
  • Synthesize the CloudFormation template:
    npm run cdk:synth
    
  • Use AWS SAM CLI for testing locally the resources of the CloudFormation template generated.
    • To invoke the lambda function locally (you can use a different event by replacing the file path after -e):
      sam local invoke crmMotorbikeShopApp -e tests/mocks/events/createCustomer/createCustomerValid.json --docker-network crm-motorbike-shop-network | jq
      
    • To debug the lambda function locally:
      • Run the following command:
        sam local invoke crmMotorbikeShopApp -e tests/mocks/events/createCustomer/createCustomerValid.json --debug-port 5858 --docker-network crm-motorbike-shop-network
        
      • Go to VSCode section Run and Debug and select Attach to SAM crmMotorbikeShopApp
    • To create a local HTTP server that hosts all the lambda functions:
      sam local start-api --warm-containers EAGER --docker-network crm-motorbike-shop-network
      

Deployment in AWS (not needed)

  • The first time you need to bootstrap your AWS environment
    npm run cdk bootstrap -- aws://ACCOUNT-NUMBER-1/REGION-1
    
  • Compile TypeScript files
    npm run build
    
  • Deploy the CDK App into the AWS environment
    npm run cdk:deploy
    

About

An API for the customer management of an online motorbike shop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published