0.0.0 • Published 1 year ago

inbound-events-backend v0.0.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
1 year ago

Inbound Events Backend

This is the mobile backend for inbound events API.

Instructions for setup

Setup AWS Credentials

  • Install AWS CLI to your local repository. you can use this link.
  • Configure your credentials. You can find the credentials and instructions by visiting programatic access link on the SV AWS accounts ( Make sure to only configure the respective environment credentials)

Configure CDK Toolkit

  • Install AWS CDK CLI by using this link. Once installed you should be able to run the CDK CLI commands.

before npm install you need following

There is a library that we are using from Service Victoria that requires you to be logged in before you run any installations these are the steps to have the library include in the project:

  • Login to the registry with the command npm login --scope=@service-victoria --registry=https://npm.pkg.github.com

  • Provide the following details. To create the Personal Access Token (PAT) go to this link and create a PAT. Make sure you authorize Service Victoria. username : lowercasegithubusername \ password: your PAT \ email: your service victoria email

  • Create a .npmrc file in the root folder with the following code. (Do note that this will also be generated by the npm run projen command which has more details further down below.)

    # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
    @service-victoria:registry=https://npm.pkg.github.com/
    @sv-oss:registry=https://npm.pkg.github.com/

Working with Projen

This project uses Projen, a node module that will generate all the CDK, CI, Git Flow and other configuration settings. It is an all in one place config. If you are making any changes to node modules you have to add them to .projenrc.ts then run npm run projen it generates new config files for all new changes you made. For more detail please check https://github.com/projen/projen or https://dev.to/aws-builders/projen-the-next-cdk-suprise-13b2

pre-deploy

Before you commit and deploy you need to run the following command so that you don't get any error on the git action build. npm run build then you can add and commit your code as it will build all the code and push it directly to Git Actions and on Git Actions it does a code comparion to see if there are any mutations happening on the fly.

How to commit a code

Deployment Guideline

Before integration or deployment

  • it is required to copy the credentials for AWSPowerUserAccess. Select the correct Account, and click on "Command Line or programmatic access" link next to AWSPowerUserAccess. Copy the details listed under option number 1, it will look like the following format:
export AWS_ACCESS_KEY_ID="ASIA47DMQBSWXJSXYIYJ" 
export AWS_SECRET_ACCESS_KEY="z3nGtHMs7/4gcA45sU2/RDCVxVIFx5P"
export AWS_SESSION_TOKEN="IQoJb3JpZ2luX2VjEPL/////////wEaDmFwLXNvdXRoZWFzdC0yIkcwRQIgU7UjdckJU0ya0XRB826RLe2YamckqkyOTN1XEQMmOmYCIQDVe"

Then paste the copied code in your terminal and run it by pressing 'Enter'.

How to Deploy to the Sandbox Inbound Events backend stack

  • To deploy to the sandbox first you need to run npm run build to compile your code and then deploy to your sandbox with the stack name you want it to be deployed to e.g npm run build && npm run deploy-sandbox devstack1-inbound-events-backend or npm run build-deploy-sandbox devstack1-inbound-events-backend