This is a sample project to showcase the following capabilities:
- JavaScript/React/Apollo GraphQL/Mongo stack
- Optimistic components rendering
- Apollo GraphQL subscription
-
Install brew Follow instruction https://brew.sh/
-
Install nvm
brew install nvm
*Hint:*
if you use zsh and get a message `zsh: command not found: nvm` then add the snippet below to your .zshrc file
# For brew, at least
export PATH=/usr/local/opt:/usr/local/bin:$PATH
# NVM Stuff
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
- Install node
nvm install 12
nvm alias default 12
nvm use 12
- Install npx
npm install -g npx
-
Install docker
Follow instruction https://docs.docker.com/docker-for-mac/install/
-
Install docker-compose
Follow instruction https://docs.docker.com/compose/install/
Start mongo database
docker-compose up -d
Start server in one console tab
cd server
npm install
npm start
Access GraphQL playground
http://localhost:4000/graphql
Start client in another console tab
cd client
npm install
npm start
Access the application
http://localhost:3000/