dapps-framework

Install notes for dHealth dApps Framework

lerna License Discord

dHealth dApps Framework for dHealth Network.

NOTE: This software package is still experimental and we do not recommend to use the source code in production environment.

NOTE: The author(s) and contributor(s) of this package cannot be held responsible for any loss of money or for any malintentioned usage forms of this package. Please use this package with caution.

Getting started

Dependencies

This project is maintained with lerna to permit joining multiple sub-projects together in one codebase.

  - node v16+ (stable LTS)
  - lerna v4

You can install lerna globally using npm install -g lerna@4.0.0.

Following command installs the dapp-framework dependencies:

lerna bootstrap

Production server

We recommend using our docker images to run dHealth dApps that are powered by the dHealth dApps Framework.

Following commands can be used to deploy a production environment:

docker-compose up --build -d
lerna run serve --stream --scope @dhealthdapps/frontend

Caution: As mentioned here, this software is still experimental and we do not recommend running production environments with the alpha versions of the software.

Development server

Running a development server

You can start a full development server using the following command:

docker-compose up --build -d

The development server’s API runs on port 9229 and the mongodb instances uses port 27017 (default).

Running Mongo as a background process (Optional)

Developers may also start the mongo container as a stand-alone background process:

docker-compose up mongodb -d

Using lerna to create faster builds (Optional)

Using lerna, starting a development server can be done [faster] using the following command:

# Starting a VueJS frontend development server
lerna run serve --stream --scope @dhealthdapps/frontend

# Stating a NestJS backend development server
# Note that the following needs a running mongo server (locally)
# Note also that you must create a `.env` file in the root folder
cp runtime/backend/.env-sample runtime/backend/.env
lerna run serve --stream --scope @dhealthdapps/backend

Note that the above two processes are long-running processes that watch individual file changes and rebuilds packages accordingly.

Compiling and testing the software

You can also run the build and test scripts individually without serving the compiled software:

# Compiling and testing the components library
lerna run build --stream --scope @dhealth/components
lerna run test --stream --scope @dhealth/components

# Compiling and testing the VueJS frontend
lerna run build --stream --scope @dhealthdapps/frontend
lerna run test --stream --scope @dhealthdapps/frontend

# Compiling and testing the NestJS backend
cp runtime/backend/.env-sample runtime/backend/.env
lerna run build --stream --scope @dhealthdapps/backend
lerna run test --stream --scope @dhealthdapps/backend

Getting help

Use the following available resources to get help:

License

Copyright 2022-present dHealth Network, All rights reserved.

Licensed under the LGPL v3.0