Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Development Setup

Rupesh Parab edited this page Feb 21, 2021 · 2 revisions

Frontend (Repo)

Steps to run frontend

  1. Setup node >= 12 and npm - Link
  2. Run npm install from the project directory, this will install dependencies for v1 frontend (desktop)
  3. Run npm install from v2 folder in project directory, this will install dependencies for v2 frontend (mobile)
  4. To start v1, run npm run start from main project directory and for v2, run the same command in v2 folder
  5. Both the versions are dependent on Backend and you will need to follow the steps mentioned in the backend section to start the backend service before running the frontend.
  6. (optional) Frontend repo also has an automation folder which runs few tests on QA. These are optional.
  7. Run yarn install in automation folder to install dependencies
  8. Run element run test-case-1.ts in automation folder to start automation

Environment Variables

  1. NODE_ENV - this has 'development' in local and 'production' in all deployed environments
  2. INTERCOM_APP_ID - Intercom App id

Backend (Repo)

Steps to run backend

  1. Install Docker and Docker Compose
  2. Run docker-compose build from the backend project directory
  3. Run docker-compose up to start the backend, ensure that no services are running on 8080 port

Making changes to backend

  1. Stop running docker containers using docker-compose stop or docker-compose down
  2. Run docker-compose build to rebuild backend, this will build java backend as well as the node gateway. It can throw errors if any unit test fails or static code analysis fails in java or node.
  3. Run docker-compose up to start service again

Cleaning DB data

  1. Data is persisted by default in mathsharebackend_db-data
  2. Stop running docker containers using docker-compose stop or docker-compose down
  3. Run docker volume rm mathsharebackend_db-data to remove persisted data
  4. Run docker-compose up to start service again

Environment Variables

  1. SPRING_DATASOURCE_URL - JDBC connection string for postgres
  2. POSTGRES_PASSWORD - Postgres password
  3. POSTGRES_USER - Postgres user
  4. POSTGRES_DB - Postgres database
  5. WATSON_API_KEY - IBM watson API key, used for Speech2Text
  6. GATEWAY_BASE_URL - API base url for gateway
  7. CORS_ORIGIN - Base URL of the frontend app (this prevents other external web-apps from calling API)
  8. DATABASE_URL - Postgres DB url
  9. NODE_ENV - this has 'development' in local and 'production' in all deployed environments
  10. SESSION_SECRET - used for encrypting session as well as for admin api requests
  11. GOOGLE_ID - Google App Id (Used for login in passport js)
  12. GOOGLE_SECRET- Google App Secret (Used for login in passport js)
  13. AZURE_ID - Azure App Id (Used for login in passport js)
  14. AZURE_SECRET - Azure App Secret (Used for login in passport js)