Skip to content

Setting up ConGaLi

Miguel Isasmendi edited this page Aug 11, 2017 · 15 revisions

HOME > TECHNICAL DOCUMENTATION > SETTING UP CONGALI

This are the instructions needed to run ConGaLi on your local environment.

This configuration uses a local installation of istambul for coverage, so you won't need to run any particular script before the build process. There are possible failures running Istanbul on Windows so, if any issue arises, yo will have to investigate on that direction.

This server is configured and is suggested to be tested along with the Web fronted developed along, although you can use whenever client you like, as long you provide the proper data to this endpoint.

 Build Setup Backend Build Setup

Using NPM

# install dependencies
npm install

# serve backend at localhost:3000, opens another port for debugging process.
npm run dev

# serve backend at localhost:3000
npm run app

# run unit tests
npm run unit

# run coverage
npm coverage

# run all tests
npm test

 Heroku configuration/setup Heroku configuration/setup

As a first approach to the build process we use Docker to develop in the local environment, so I had to modify the configuration to really be available on Heroku. And we will have to develop inside a container within Docker with the proper net configuration:

In Linux I've had to install node's port of foreman to avoid permissions issues by running "heroku local":

npm install -g foreman

and after that I was able to simulate the build running

rm -rf node_modules && npm install --quiet --production && nf start

"npm run build" "nf start" if you have foreman or "npm start" if you don't.

 Using Docker Using Docker

Create new DB container: localContainerName

docker run -i -t --name localContainerName -p 3000:1996 image_name
(ctrl-c) to stop command

docker start localContainerName
docker network connect localNetworkName localContainerName

Build new WebSocket Backend bundle image:

cd {project-root}
docker build -t remoteurl/image_name:version .
// write a script to update the local version of the app

 Running the game Running the game

The steps to play the game are as follow:

  1. Build & run the Backend "npm run dev"
  2. Build & run the web Frontend interface using "npm run dev"
  3. Open your Web Browser at http://localhost:8080 Enjoy :)