Clone from GitHub with:
git clone https://www.github.com/waterloop/teamhub.git
Navigate to /backend/data/config.template.json.
Make a copy and rename it to config.json.
Follow the instructions listed under Setting Up Development Environment
Here are the steps to run locally:
- Install Docker and Docker Compose
- Copy the contents of
/backend/data/config.template.jsoninto/backend/data/config.json - Install MongoDB and MongoDB Compass
- Go to the root directory and run
npm run build:docker - To start the server, simply go to the root directory and run
docker-compose up -d teamhub - If this is your first time setting up, run
npm ci. Wait for the installation to finish. - Wait a second then try opening localhost:3000 in your browser
- If this is your first time setting up, you may need to populate the database with mock data.
Do this by running
mongorestore -d teamhub docker/mongodb/docker-entrypoint-initdb.d/dumpfrom the teamhub directory
After finishing a work session, you can stop all containers by running docker-compose stop
Additional Notes:
- To run a command in the docker container, first run
docker exec -it teamhub_nodejs /bin/sh, which will open up a shell into the container and then you can run whichever commands you wish. To exit out of the container, press Ctrl + C.
To run tests locally:
- Run
docker-compose up -d test - Run
docker exec -it teamhub_testing /bin/shto go into the docker container and access the docker shell - Run
npm run testto execute all test cases.
-
To use the MongoDB Compass desktop app, use
localhostas the hostname and the default port 27017. -
If the DB did not load successfully from the dump and is empty, run
docker-compose rmand then restart the server withdocker-compose up.
- Install
Node.jsandMongoDBlocally - Run the script under
/docker/mongodb/docker-entrypoint-initdb.d/import.shif you are on Linux system. If you are on Windows or Mac, you may have to modify the command the script slightly. - Run
npm installin the root directory of this repo to install all othe dependencies - Run
npm run devto start the dev environment
Please create a new Git branch and work on your issue/feature on that branch. Ask the team lead which branch you should branch out from.
Use the following branch naming convention: {first_name}.{last_name}/{descriptive_name_for_your_task}
https://docs.google.com/document/d/10TdYNHSy5nAID4gu48gxqB8-lJWQHVfyYjl5rlyP6HU/edit