Skip to content

Latest commit

 

History

History
120 lines (91 loc) · 2.7 KB

getting-setup-without-docker.md

File metadata and controls

120 lines (91 loc) · 2.7 KB

Civil Services Logo

↤ Developer Overview

Getting Setup without Docker

Requirements

Installing Requirements

OSX

It's recommended that you install and use Homebrew for the system-level requirements for the project. Once you have it installed, you can run the following:

brew tap homebrew/services
brew install node mysql [email protected] bcrypt redis

Linux

Please use the requirement links above to review install instructions for each dependency.

NPM Packages

npm install -g forever

Running the API

Once you have downloaded the API you will need to create some config files for the local installation.

The possible environment options are local, mobile, staging, production, test & docker.

There are two config files you will need to initial create. Using the name of the environment you wish to setup.
For example, if you are setting up a local environment, you would need to create ./app/config/db-local.json & ./app/config/local.json.

Example of ./app/config/local.json

{
  "debug": true,
  "env": "local",
  "secret": "F8E1577B-DDAF-8234-4DD5-9301E7223582",
  "sessionKey": "F41CF60C-9A23-55C4-DDE3-7642B13B6276",
  "debugKey": "BD52B1DC-C396-A714-B5B4-21AE9B6A0971",
  "bugsnag": "",
  "hashID": {
    "secret": "4B1AB909-EA83-4E34-3D43-280273497137"
  },
  "database": {
    "api": {
      "host": "localhost",
      "database": "civil_services_api",
      "username": "root",
      "password": ""
    }
  },
  "mandrill": {
    "key": "CHANGE_ME"
  },
  "ipinfodb": {
    "key": "CHANGE_ME"
  },
  "openStates": {
    "key": "CHANGE_ME"
  },
  "elasticsearch": {
    "log": "error"
  },
  "logzio": {
    "token": "CHANGE_ME",
    "type": "CivilServiceAPI"
  }
}

Example of ./app/config/db-local.json

{
  "username": "root",
  "password": "",
  "database": "civil_services_api",
  "host": "localhost",
  "dialect": "mysql"
}

Start API

cd /path/to/api
export API_NODE_ENV=local && npm start

Accessing the API via Browser

Once the API is up and running you can access a local URL via:

http://localhost:5000/v1/geolocation/zipcode/10001?apikey=7E07D864-209A-F9E4-819F-2DD7E76B6F24&pretty

The default API Key for Development is 7E07D864-209A-F9E4-819F-2DD7E76B6F24 so you can just append ?apikey=7E07D864-209A-F9E4-819F-2DD7E76B6F24 to any API endpoint for authentication.