Getting Started
Before continuing with this section, follow the installation instructions in our Contribute section.
Development Instructions
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:
- The actual server (NodeJS + Express)
- The database (PostgreSQL)
- 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)
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
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.
Accessing a URL through a browser is equivalent to making a GET request to the same URL through Postman.
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:
PressMashctrl+c
to stop the running process, then runyarn run dev
again.