Use Patient Service as example
- Use
ghCLI tool by Github (highly recommended and will use this method for this tutorial) you could also use HTTPS or SSH options, our organization is at https://github.com/meds-com - Clone the Patient Service repository
- Make sure you have
npminstalled (i.e.,node.js) installed and are using the proper version - Use
nvmto managenpmversions. Read more about this in one of the answers of this stackExchange post . - To enable key generation for authentication, make sure the
admin,doctoranddefaultentries forsecretsare not empty. - Install
gulpandnodemonin the global scope to build and start your projects laternpm i -g gulp nodemon - Create
~/.npmrcwith the right credential (ask mentor or a team member for the registry url and authToken) to obtain access modules in the@bluechewscope - Ask your mentor or a team member to create the Google service accounts for you with the right permissions attached, and save them as the
keys/*-develop-key.jsonfile under your dev root folder and the project folder. - Example:
~/development/keys/bluechew-develop-key.jsonand~/development/PatientService/keys/bluechew-develop-key.json. This file will be required for you to run thecloud-sql-proxycommand. - Note for Windows user: add this to the .npmrc file in order to run npm scripts without further modifications
npm config set script-shell "C:\Program Files\Git\bin\bash.exe"=truescript-shell=C:\Program Files\Git\bin\bash.exemodify the bash.exe file path based on the actual location - Ask your mentor or a team member to create the credentials for MySQL database (i.e.
bluechew-develop:bluechew2), you will need it to interact with the data viacloud-sql-proxy. Refer to the first section(Start the Cloud SQL Auth Proxy ) for more info on howcloud-sql-proxyworks; - Example: command
cloud-sql-proxy --credentials-file=/path/to/bluechew-develop-key.json "bluechew-develop:us-central1:bluechew2?port=3308"will use your Google Service Account file to proxy thebluechew2database in thebluechew-developproject inus-central1region locally on port 3308. - By now you should have the key (service account ), added an user account (User Account ) and secret permission enabled (medical-service-env-local ), if not request from your mentor or a team member.
- Install
npmmodules - For local development, please copy the
config/init.config.dev.local.jsonassrc/config/init.config.json. - The following steps are marked as [Optional] since they are a legacy way to set up local credentials. Currently we manage our secrets remotely and they are not needed anymore.
- [Optional] Generate reference config file
/envs/environments.dev.jsonas a copy of/envs/environments.example.json. - [Optional] Update the reference config
/envs/environments.dev.json - Specify the necessary credentials (SQL, intercom etc...) and make sure you are using credential from a development project and not from a production gcloud project.
- [Optional] Rename and copy the reference config from
envs/tosrc/config/ - Build Gulp
- Watch for Development
- Open your browser on http://localhost:5000
- Newer versions of macOS may have the port 5000 occupied by Airplay service, if that happens, prepend
PORT=WXYZto thenpmcommand, for example:PORT=8888 npm run dev, then you can access the service at http://localhost:8888
gh repo clone meds-com/patient-service
$ npm i
cp -rf envs/environments.dev.json src/config/environments.json
$ gulp
$ gulp watch
$ npm run dev
Last updated: @February 17, 2026
