Skip to main content

Getting Started

important

Before continuing with this section, follow the installation instructions in our Contribute section.

Development Instructions

warning

This codebase requires Node 18. If you're using Node Version Manager, you can switch to version 18 by running nvm use 18 in your terminal.

You can check the current Node version by running node -v.

BobaBackend needs 3 different components to run:

  1. The actual server (NodeJS + Express)
  2. The database (PostgreSQL)
  3. The cache (Redis)

You can choose to run these in the same command, or separately. Unless you're running tests, you'll likely want to start them all together.

Quickstart (single command)

warning

Make sure you have Docker installed and running

In a terminal, run the following command:

yarn run dev

Individual commands

In a terminal, run the following commands:

Start the database and the cache

yarn run db:start

Start the server (development mode)

yarn run server:dev

Run tests

warning

You should start the database independently before running tests

yarn run test

Making sure the server is running

You can test the server is running by opening http://localhost:4200/realms/slug/twisted-minds in any browser. You should now see a list of all the realm properties in JSON format.

tip

Accessing a URL through a browser is equivalent to making a GET request to the same URL through Postman.

tip

The above commands will automatically restart the server on any code change you make.

How to manually restart the development server

Both of these actions need to be performed on the console where yarn run dev:watch is currently running.

  • Fancy Way: Type rs and press enter.
  • Bruteforce Way: Press Mash ctrl+c to stop the running process, then run yarn run dev again.