This is the backend API for berkmancenter/nymspace_client.
- Create file
.env.local
and copy contents of.env.example
. Feel free to change the port number in the file but make sure to make changes on fronend env file to reflect the correct port number. Also, if you change the port number, make sure to change the port numbers indocker-compose.yml
as well. Certain optional app functionality, like polls and LLM agents can be enabled or disabled with environment variables. - Edit
docker-compose.dev.yml
file to add the following block to thenode-app
service
env_file:
- .env.local
the full block should then look like this:
services:
node-app:
env_file:
- .env.local
- Run below docker compose command to start the server
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
- Start by copying
.env.example
to.env.local
. - Install
mongodb
- Run MongoDB with
mongod
💡 Note: Mac users who have used Homebrew to install MongoDB should use the command
brew services start mongodb-community
to run the MongoDB service instead.
- Install
node.js
and set to version specified inpackage.json
file (Consider using nvm) - Install yarn
- Install all dependencies with
yarn install
. - Run
yarn run dev
to serve the API locally.
Unit and integration tests can be run with yarn run test
, and a coverage report can be seen with yarn run coverage
.
Note that the tests use the .env
file instead of .env.local
. Copy .env.local
to .env
for local running tests in local development environment.
Stress tests can be run from the client repo in the k6 directory.
- Pull the latest code from Github (currently the dev branch)
- Configure .env and install dependencies
- Run
yarn run start
to serve the API with PM2