🖍️
Coronasafe Logistics - Deployment
  • Introduction
  • Prerequisites
  • Setting Up Locally
  • Setting Up Super Hero Dashboard
  • Setting Up Backend
  • Setting Up Superhero Android App
Powered by GitBook
On this page
  • Cloning the repository
  • Setting up the database

Was this helpful?

Setting Up Backend

PreviousSetting Up Super Hero DashboardNextSetting Up Superhero Android App

Last updated 3 years ago

Was this helpful?

Cloning the repository

Clone the repository available at

git clone https://github.com/coronasafe/superhero_frontend.git

Setting up the database

In src/config/config.js

{
  "db": {
    "development": {
      "username": "",
      "password": "",
      "database": "",
      "host": "",
      "dialect": "postgres",
      "port": 5432
    },
    "staging": {
      "username": "",
      "password": "",
      "database": "",
      "host": "",
      "dialect": "postgres",
      "port": 5432
    },
    "production": {
      "username": "",
      "password": "",
      "database": "",
      "host": "",
      "dialect": "postgres",
      "port": 5432
    },
    "staging_heroku": {
      "username": "",
      "password": "",
      "database": "",
      "host": "",
      "dialect": "postgres",
      "port": 5432
    }
  },
  "env": {
    "HOST": "",
    "JWT_SECRET": "",
    "KCC_GMAPS_API_KEY" : "",
    "NODE_ENV": "production"
  }
}

Add database credentials corresponding to each stage.

Only Relational databases supported by Sequelize ORM can be used.

Set NODE_ENV to correct stage before deployment or remove this key and set it for each server.

Set KCC_GMAPS_API_KEY to your Google Maps API Key

Copy your Firebase Service Account JSON to src/keys

In src/utils/fcm.js

const serviceAccount = require("../keys/");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: ""
});

Add Firebase serviceAccount file and database URL

Go to the root directory of the project

Run npm install and npm start

https://github.com/coronasafe/superhero_frontend