This guide is designed to allow any developer to set up and run Roulette's development environment locally. If you think anything should be clarified, please make edits!
This guide includes setup instructions for backend
repository.
- Get a Docker ID: https://hub.docker.com/signup
- Log in with your new Docker account.
- Download Docker for your OS: https://hub.docker.com/?overlay=onboarding
We are currently using Node 14.0 and recommend installing it using a version manager like nvm or nodenv.
https://yarnpkg.com/getting-started/install
$ npm i -g yarn
- Sign in to Docker using the icon at the top of the your operating system.
- Adjust two Docker Preferences: increase CPUs, memory, and swap to 50% of your machine's capacity.
From the roulette
directory:
$ yarn install
There are Docker Compose file in the application which serves for running backend:
docker-compose.yml
- base configuration for all services
There are corresponding scripts in the top-level package.json
to spin up Docker containers and start a watch task for building common modules shared by application services:
yarn start:app:dev
-
To monitor the server logs:
docker logs -f main
docker logs -f random_number_generator
-
Wait! The server logs may show
Starting compilation in watch mode...
for a few minutes before the application is ready.
Running DB migrations will set up the tables in your local DB populate some tables with application data.
From the roulette directory, execute yarn db:run
Note: May take a few minutes to run while the SSL is off. reason: undefined file not exists
message is shown.
In the future, you can use the same command to run any new data or schema migrations created by other engineers. You can read more about them in the TypeORM docs.
Before pulling new code or installing new dependencies, you should stop and restart Docker:
yarn stop
We recommending using either Webstorm or VS Code as your code editor. Installing the plugins / extensions is highly recommended to prevent errors.
Download and install a Postgres GUI:
- TablePlus: https://tableplus.com/
- Postico: https://eggerapps.at/postico/
- DBeaver Community edition: https://dbeaver.io/download/
Connection details:
- Host: 127.0.0.1
- Port: 5432
- User: postgres
- There's no password - leave it blank
- Database: roulette