Getting Started

Installation

  1. Clone the equetronic-dev repo from Git6
    1. Follow the install instructions of the Equetronic Dev Getting Started Doc
    2. Keep the note of the name of your local .env file.
  2. Clone the repo of equetronic-api from Github account of webreinvent.
  3. Checkout to master branch
  4. Initialize GitFlow
  5. Initialize equetronic-helper submodule (recommended to use GitKracken)
  6. Open submodule and checkout to its latest develop branch.
  7. In the root directory of the equetronic-api project, run the following command in terminal
    npm install
  8. Go to the env.js file and change the env variable to the name of your local environment file Api ENV

    Note : if you are deploying this to develop then the env should be develop, similarily for stage, hotfix or production. Before merging to any specific branch this env should be set correctly according to the branch it will be deployed upon.

  9. Go to Pusher.com , sign up and create a new channel.
    • Go to App Keys section and create new key and secret

    Note : Check in the credentials section or reporting manager to see if there are already a pusher channel setup for development purposes. In such case, you can skip the above step and just use the existing account and channel keys

  10. Go to FaunaDB and signup
    • Create a new database named equetronic-api.
    • Go to the security section and get the db secret key

    Note : Check in the credentials section or reporting manager to see if there are already a FaunaDB database setup for development purposes. In such case, you can skip the above step and use the secret key of the existing database

  11. In env.js find the switch(params.env) code section. Here you will have to add a switch case for you local environment. Here is an example of for setting site params for suraj local environment.
    Change suraj with the name of your custom environment.
    switch(prams.env){
         ...
         case 'suraj':
         params.host = '127.0.0.1';
         params.api_url = 'http://localhost/suraj/equetronic-dev/public/api/hrc/';
         params.pusher = {
             appId: '', // Pusher App ID
             key: '', // Pusher Key
             secret: '', // Pusher Secret
             cluster: 'eu', // Pusher Cluster
             useTLS: true, 
         };
         params.fauna_secret = ''; // fauna db secret
         break;
         ...
    }
  12. To start the api server, run the following npm script
    npm run start
  13. You can hit your endpoint that you defined in env.js and it will give a response like this for success
    {
       "alive": true,
       "version": "0.1.32"
    }