MentorQ
Setting up environment for the first time
- For Mac users:
- Install Homebrew if you haven't already.
brew install docker
brew install docker-compose
brew install node
brew install yarn
- For windows users:
- Install Docker:
- Windows 10 Pro: https://docs.docker.com/docker-for-windows/install/
- Windows 10 Home and below: https://docs.docker.com/toolbox/toolbox_install_windows/
- If you have Windows 10 Pro and don't have
docker-compose
yet, go to https://docs.docker.com/compose/install/#install-compose to install Docker Compose. - Go to https://nodejs.org/en/download/ to install node.js
- Go to https://yarnpkg.com/lang/en/docs/install/#windows-stable to install Yarn.
- Install Docker:
With those steps done:
- Navigate to the root of this project directory and run
./scripts/setup.sh
- Run
yarn
in the root of this project directory. - Run
yarn
inapi/
. - Run
yarn
inclient/
.
Note: for steps 2-4 you only need to do that 1) when you first set up the server and 2) whenever we update packages. If in doubt, do it again won't hurt.
Overall Development Workflow
- Navigate to the project directory
- Make sure your Docker Daemon is running. For Mac, you'll see the whale icon on the top right corner which is the daemon, so make sure that is running.
- Run
docker-compose up --build
. You will need to restart the server every time you change the backend code, through Ctrl+C and running that command again. - In another terminal tab/window:
cd client
and thenyarn start
. - Go to http://localhost:3000/
Git Development Workflow
git checkout -b <your-name>/<feature-name>
- Code until you hit a good checkpoint. Make sure there are no errors/broken builds.
git status
shows you what files you have changed.- Commit your files
- If you want to commit all modified files:
git add -A
- Otherwise to add the particular files you want to commit:
git add <file1> <file2> <...>
- If you want to commit all modified files:
git commit -m "some commit message"
- Push your branch
- For brand new branches:
git push -u origin <branch name>
- For previously pushed branches:
git push
- you can find your branch names with
git branch
- For brand new branches:
Pull Request Workflow
-
Make a new branch formatted
<your-name>/<feature-name>
to submit a pull request to master. -
Notify team that a PR has been made :)
-
After a pull request is approved, rebase and squash commits before merging into master
- Checkout to master
git checkout master
- Pull the most recent changes from master
git pull
- Check into the branch of the PR
git checkout <your branch name>
- Rebase and squash commits:
git rebase master
- Push changes to GitHub.
git push -f
Do NOT force push to other people's branches or shared branches