This project's goal is to enable teams to collect user feedback and organise work via github issues across multiple repositories.
It enables non github members to raise issues via a bot account, and github members to aggregates and track issues across different repositories.
Once you have a new version to deploy, check the deploy.cmd runs without failing on your dev machine. Then, push to the master branch on the azure git repo. The repo is currently here:
https://res-github-requests.scm.azurewebsites.net:443/res-github-requests.git
You will need to add this as a remote (called azure for example), then you can push the revision that you wish to deploy, push to azure/master.
You can push to this repo using the azure auto-generated application credentials, the username is $res-github-requests, you can recover the password from the azure portal Deployment Center (Preview) panel, click on Deployment Credentials.
Pushing to azure causes the Deploy.cmd script to be executed. This installs the node dependencies and compiles the static client files (javascript). It takes about an hour to complete, which seems excessively long.
The app uses Azure Active Directory to authenticate users, and unlocks more functionalities for administators with a github account. To enable this, you need to create OAuth applications on Azure and Github, and pass the relevant parameters to the app (see below).
to run this application, you need to provide secrets and constants as environment variables. An easy way to do this during development is to do it via a .env
file. You will need to create the file in ./client/.env
.
in production, you will need to setup the environment variables before building and starting the application.
See below for an example .env
file containing the definition for all the variables needed by both the front end and back end code:
# Variables used by both back end and front end code
REACT_APP_TENANT_ID=*your azure tenant id*
REACT_APP_CLIENT_ID=*the azure ad client id for your app*
REACT_APP_GITHUB_CLIENT_ID=*github client id for your app*
# Backend only
GITHUB_CLIENT_SECRET=*github client secret for your app*
GITHUB_BOT_TOKEN=*bot account token with the 'repo' scope and allowed to access the configured repositories*
IDENTITY_METADATA=https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
GROUP_CONFIG_PATH='projects.json' *path to project configuration file. This should live in an folder ignored by git or out of the github repository used by azure deployments*
SENDGRID_API_KEY=*your sendgrid api key*
SENDGRID_EMAIL_SENDER='example@somedomain.com'
# Front end only
REACT_APP_ADMIN_GROUP_ID=*guid of Azure AD groups containing admins. use semicolon delimiter to list multiple groups*
REACT_APP_GITHUB_BOT_LOGIN=*name of the bot account used to proxy requests*
REACT_APP_DOMAIN_HINT= *your-domain.com - if known in advance, specifying this environment variable will ensure the Azure log in page automatically select the correct account if a user is logged in in multiple directories*
# Optional, leave undefined to use the default stylesheets
REACT_APP_BOOTSTRAP_CSS_PATH='./app_data/bootstrap.css'
REACT_APP_APPLICATION_STYLES_PATH='./app_data/index.css'
# Front end in development only
HTTPS=true
run npm install
to install the required back end and front end dependencies.
Press F5 in vscode and choose node. This will start the backend server (which can also serve the static front end files via static.js, but doesn't build them), and allows debugging.
npm run debug
The backend server and the front end dev server can be started in one command using node-foreman. Install node-foreman if needed (npm i -g foreman
). procfile tells foreman what to do.
This has the benefit the nodemon will check for changes to the website and automatically restart the server if required. This definitely works for the backend api code, I haven't checked if it works for the front end code yet.
The front end server in this case serves the unbuilt source files, so is always up to date. In order to have the front end up to date with other methods, we would need to build the front end first.
npm start
will build the front end code and start the server. If this doesn't work, but npm run debug
does, then there is a problem with the backend serving the frontend files.
To start the node back end server / api only (which can also serve the front end static files, but doesn't build them), run npm run debug-server
at the repo root.
To start the front end dev-server only, run cd client && npm start
at the repo root.