Getting Started
Installation
- Clone the
equetronic-devrepo from Git6- Follow the install instructions of the Equetronic Dev Getting Started Doc
- Keep the note of the name of your local
.envfile.
- Clone the repo of
equetronic-apifromGithubaccount ofwebreinvent. - Checkout to master branch
- Initialize GitFlow
- Initialize
equetronic-helpersubmodule (recommended to use GitKracken) - Open submodule and checkout to its latest develop branch.
- In the root directory of the
equetronic-apiproject, run the following command in terminalnpm install - Go to the
env.jsfile and change the env variable to the name of your local environment file
Note : if you are deploying this to develop then the env should be
develop, similarily forstage,hotfixorproduction. Before merging to any specific branch this env should be set correctly according to the branch it will be deployed upon. - 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
- Go to
FaunaDBand signup- Create a new database named
equetronic-api. - Go to the security section and get the
db secretkey
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
- Create a new database named
- In
env.jsfind theswitch(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 forsurajlocal environment.
Changesurajwith 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; ... } - To start the api server, run the following npm script
npm run start - 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" }