Skip to content

ntuscse/be

Repository files navigation

be

Serverless backend

Docs (prod) [TBD]: https://api.docs.ntuscse.com
Docs (dev) [TBD]: https://api.docs.dev.ntuscse.com
API (prod) [TBD]: https://api.ntuscse.com
API (dev): https://api.dev.ntuscse.com

Requirements:

Node v14

If you don't have node currently installed on your system, use the following steps to install:

  • To use the installer, click here
  • Alternatively, you can install node using the terminal:

macOS

$ brew install node

Debian/Ubuntu

$ sudo apt-get install -y nodejs

Other Linux distros

See the instructions to install via your distro's package manager here.

Windows via chocolatey

Run as admin:

$ choco install nodejs.install

To verify node installation, you can use the following command in your terminal/cmd:

$ node -v

Python 3.9

If you don't have python currently installed on your system, use the following steps to install:

  • To use the installer, click here
  • Alternatively, on macOS you can install python using the terminal: Install Homebrew, and then write the following command in your terminal:
    $ brew install python

To verify python installation, you can use the following command on your terminal/cmd:

$ python --version

If you already have an older version of python installed on your system, you can update it using the online installer (linked above) or by entering the following commands on your terminal/cmd:

macOS

$ brew update && brew upgrade python

Windows or macOS

Install conda via https://conda.io/miniconda.html, and then run the following commands:

$ conda update python

OR

$ conda install python=<version-number>

Poetry

Run the following command on your terminal/cmd:

macOS & Linux

$ curl -sSL https://install.python-poetry.org | python3 -

Windows

$ (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -

AWS CLI

You can install the AWS CLI using the online installer, or by using the terminal/cmd:

macOS

$ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
$ sudo installer -pkg AWSCLIV2.pkg -target /

Linux x64

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ sudo ./aws/install

Windows

$ msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

To verify installation and check version, use:

$ aws --version

AWS Credentials

You can use the following guide to refer to docs related to generating AWS credentials and configuring the CLI for use on your system

Install

Run the following commands to install the necessary node and python dependencies in your environment and run the serverless app offline:

$ npm run setup
$ npm run offline

Test

Create a dotenv file and follow the format as shown in stub.env

Run the following command to run tests:

$ npm run test

To run tests in watch mode:

$ npm run test:watch