Skip to content

Latest commit

 

History

History
148 lines (90 loc) · 2.91 KB

developer.md

File metadata and controls

148 lines (90 loc) · 2.91 KB

Developer

This document describes how to set up your development environment to build and test.

Installation

git clone https://github.com/jolana-lab/jo-send.git
cd jo-send
npm ci

Unit tests

You need to write unit tests.

  • During coding:

    Watching if the implemented codes pass the tests, and writing new tests.

    npm run test:watch
  • After coding:

    1. make sure all the tests are passed

      npm run test
    2. Check the test coverage (Tests of controllers and services are collected).

      npm run test:cov

Formatting source code

We use Prettier, and we follow TypeScript ESLint.

You can automatically format your code by running:

npm run lint

VS Code

It will automatically pick up the settings from .vscode/settings.json.

Setup

We provide two development setups:

Docker compose setup

Docker compose is the easiest way to setup.

docker compose up

That's all. :)

Macos local setup

This setup is more complicated than the previous one. But it's faster to launch and recompile. We recommend this way.

This setup needs you to install the software on your machine.

  1. install the software:

  2. start the software

    • mongodb

      brew services start [email protected]
    • redis

      redis-server
    • solana localhost

      solana-test-validator
  3. run nest dev server

    npm run start:dev

Development proxy (Optional)

ngrok http 3030

More details are presented in slack document.

Environment variables

Create .local.env under the root (the same level of .env), and override the variables in the .env.

Tip: If you want to use Macos local setup setup, you can copy all the variables in the .env, and paste them in .local.env.

Update the App version (Admin ONLY)

The following example shows how to create a patch version.

  1. update CHANGELOG.md

    changelog -p
    • patch: -p
    • minor: -m
    • major: -M

    Then, commit the change.

  2. update Swagger version (Optional)

    In main.ts, update setVersion to match the lastest version CHANGELOG.md. then, commit the change.

  3. update version in package

    npm version <patch|minor|major>