Skip to main content

Local development setup

Use cases:

  • You would like to develop the platform APIs or the internal dashboard

Requirements

  • Node.js 12+ (LTS)
  • yarn

Install Docker

Easiest solution is to install Docker Desktop for Mac or Docker Desktop for Windows.

Add your Healthblocks auth token to your terminal configuration

Using Bash:

echo 'export HEALTHBLOCKS_NODE_AUTH_TOKEN=<YOUR-TOKEN>' >> ~/.bash_profile

Using Zsh:

echo 'export HEALTHBLOCKS_NODE_AUTH_TOKEN=<YOUR-TOKEN>' >> ~/.zshenv

Clone the platform repo

This repo contains two projects:

  • API: Nest project that connects to a postgres database
  • Admin UI: Next.js project that connects to the API
git clone git@github.com:healthblocks-io/nest.git
cd nest

Run a postgres database

This Docker Compose contains just a basic postgres database.

docker compose up -d

Configure .env

Create .env files from the .env.example files in the admin and api project.

cp api/.env.example api/.env
cp integration-admin-ui/.env.example integration-admin-ui/.env

Run the migrations

cd api; npx prisma migrate deploy; cd ..
cd integration-admin-ui; npx prisma migrate deploy; cd ..

Run the API and Admin UI

You will need two terminals for this:

cd api; yarn dev
cd integration-admin-ui; yarn dev

Start by visiting the API, it is available at http://localhost:21111. After choosing an authenticator, you are redirected to the Admin UI which is available at http://localhost:21118.