Clinic Sign In
This is a template for creating a monorepo with a React frontend and a Node.js backend.
Installation
- Clone this repo
- Create a new repo and push the code
- Login to Heroku and create a new pipeline with a
staging
andproduction
api and web service. - Add a these buildpacks: https://github.com/timanovsky/subdir-heroku-buildpack, heroku/node.js -- the subdir buildpack needs to come first.
- Add
PROJECT_PATH=services/server
to the api Heroku env variables andPROJECT_PATH=services/website
to the react Heroku app. - Login to CircleCI and follow your new repo
- Add
HEROKU_APP_NAME
andHEROKU_API_KEY
env variables to the new CircleCI project settings. (heroku profile/account settings/ towards the bottom) - Use CircleCI to generate an api token and add adjust the environments table below (in this README) to use the new token and the new addresses
Developing
- make sure there is a
.env
file atservices/server/.env
-- even if it is empty - type
docker-compose up
This will fire up the Node.js api on port 10020 and the react app on port 10060.
Important commands
run server tests:
docker-compose exec server yarn test
reset server test db:
docker-compose exec server yarn build
Environments
Environment | Branch | URL | CI | Documentation |
---|---|---|---|---|
Development | develop | https://template-for-zach-staging.herokuapp.com | ||
Production | master | https://template-for-zach.herokuapp.com |