Skip to content
Mohammad Hassaan Mirza edited this page Apr 4, 2020 · 17 revisions

Tools

  • Heroku - Cloud platform for hosting applications
  • MongoDB Atlas - Cloud database
  • Github Actions - Run tasks automatically
  • Firebase - Authentication

Continuous Integration

The Continuous Integration Pipeline ensures that any changes to code is tested before it is merged with the shared repository.

Workflow

Pull request created -> Run build -> Run unit tests -> Only allow merge to master if tests pass

Firebase

To run for firebaseConfig, (in order to use the authentication present), need to npm install for Firebase, and create a .env inside the frontend/ folder.
The contents of the .env are as follows. REACT_APP_FIREBASE_CONFIG=eyJhcGlLZXkiOiJBSXphU3lEeTZmR0NMSlo0MGtHdDVvTjNjc0JsbGRTS1o2T1ZtSzQiLCJhdXRoRG9tYWluIjoidGhyZWFkZXItNjllODEuZmlyZWJhc2VhcHAuY29tIiwiZGF0YWJhc2VVUkwiOiJodHRwczovL3RocmVhZGVyLTY5ZTgxLmZpcmViYXNlaW8uY29tIiwicHJvamVjdElkIjoidGhyZWFkZXItNjllODEiLCJzdG9yYWdlQnVja2V0IjoidGhyZWFkZXItNjllODEuYXBwc3BvdC5jb20iLCJtZXNzYWdpbmdTZW5kZXJJZCI6IjIzMzYyOTQ5NTkzNiIsImFwcElkIjoiMToyMzM2Mjk0OTU5MzY6d2ViOmJmNjEyZDUwNzVhN2I3MzA3NzJjNjUiLCJtZWFzdXJlbWVudElkIjoiRy1RRDRTVEtWWjRRIn0=

Documentation

GitHub Actions

Two CI workflow files are configured to run on pull requests to master. The ci_server.yml file runs on pull requests that contain changes within the server directory, excluding changes to only the README file. Similarly, the ci_frontend.yml file runs on pull requests that contain changes within the frontend directory, and also excludes changes to only the README file.

When a workflow run is successfully completed, the pull request is ready to be reviewed by a team member and then merged. If the pull request fails, the workflow run can be reviewed to see which changes have caused the error.

Continuous Deployment

Continuous deployment allows new features to be automatically deployed to a production environment once a pull request is merged.

Workflow

Pull request merged -> Deploy build

Documentation

Heroku

The build pack used for the front-end is create-react-app. This creates a production build that serves static pages.

In order to make API calls, all requests to /api/ are proxied to the back-end server which handles API requests. This is done by adding API_URL as a config var under settings. The back-end server is located here.

Link to application

MongoDB Atlas

Free tier in region ap-southeast-2. The DB is currently configured to accept connections from all IP addresses.

GitHub Actions

cd_server.yml and cd_frontend.yml are triggered when changes are made to server and frontend respectively on master. The source files are then built, which then gets deployed on Heroku. An API_KEY for deploying to Heroku is located in Secrets under the repo settings.

Clone this wiki locally