# api.fuelrats.com

> [![node](https://img.shields.io/node/v/api.fuelrats.com.svg?style=flat-square)](https://nodejs.org) [![Dependencies](http://img.shields.io/david/FuelRats/api.fuelrats.com.svg?style=flat-square)](https://david-dm.org/FuelRats/api.fuelrats.com) [![Open Gith

Latest version **0.5.0** (published 2017-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install api.fuelrats.com
pnpm add api.fuelrats.com
yarn add api.fuelrats.com
bun add api.fuelrats.com
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2017-07-05 |
| First published | 2017-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.4.3 |
| Dependencies | 79 |
| Known vulnerabilities | 0 (+39 in 12 direct dependencies) |
| Install scripts | no |
| Maintainers | xlexious |

## Links

- npm: https://www.npmjs.com/package/api.fuelrats.com
- npm.io page: https://npm.io/package/api.fuelrats.com

## Dependencies (79)

- [d3](https://npm.io/package/d3.md) ^3.5.17
- [pg](https://npm.io/package/pg.md) ^6.0.1
- [ws](https://npm.io/package/ws.md) ^1.0.1
- [csv](https://npm.io/package/csv.md) ^0.4.6
- [koa](https://npm.io/package/koa.md) ^2.2.0
- [npm](https://npm.io/package/npm.md) ^5.0.4
- [chai](https://npm.io/package/chai.md) ^3.4.1
- [cors](https://npm.io/package/cors.md) ^2.7.1
- [intl](https://npm.io/package/intl.md) ^1.2.4
- [npid](https://npm.io/package/npid.md) ^0.4.0
- [swig](https://npm.io/package/swig.md) ^1.4.2
- [grunt](https://npm.io/package/grunt.md) ^0.4.5
- [https](https://npm.io/package/https.md) ^1.0.0
- [mocha](https://npm.io/package/mocha.md) ^2.3.4
- [bcrypt](https://npm.io/package/bcrypt.md) ^1.0.2
- [crypto](https://npm.io/package/crypto.md) 0.0.3
- [eslint](https://npm.io/package/eslint.md) ^3.3.1
- [moment](https://npm.io/package/moment.md) ^2.11.2
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.17
- [xmlrpc](https://npm.io/package/xmlrpc.md) ^1.3.2
- [yayson](https://npm.io/package/yayson.md) ^2.0.3
- [express](https://npm.io/package/express.md) ^4.13.3
- [git-rev](https://npm.io/package/git-rev.md) ^0.2.1
- [i18next](https://npm.io/package/i18next.md) ^7.1.2
- [install](https://npm.io/package/install.md) ^0.10.1
- [koa-ejs](https://npm.io/package/koa-ejs.md) ^4.1.0
- [winston](https://npm.io/package/winston.md) ^2.1.1
- [download](https://npm.io/package/download.md) ^4.4.3
- [kerberos](https://npm.io/package/kerberos.md) 0.0.18
- [koa-body](https://npm.io/package/koa-body.md) ^2.3.0
- [koa-cors](https://npm.io/package/koa-cors.md) 0.0.16
- [koa-swig](https://npm.io/package/koa-swig.md) ^2.2.1
- [node-dev](https://npm.io/package/node-dev.md) ^2.7.1
- [nodeunit](https://npm.io/package/nodeunit.md) ^0.11.0
- [passport](https://npm.io/package/passport.md) ^0.3.2
- [uid-safe](https://npm.io/package/uid-safe.md) ^2.1.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.6
- [dedelimit](https://npm.io/package/dedelimit.md) 0.0.4
- [grunt-cli](https://npm.io/package/grunt-cli.md) ^1.2.0
- [grunt-run](https://npm.io/package/grunt-run.md) ^0.5.2
- [sequelize](https://npm.io/package/sequelize.md) ^3.23.4
- [supertest](https://npm.io/package/supertest.md) ^1.2.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.11.4
- [koa-router](https://npm.io/package/koa-router.md) ^7.2.0
- [koa-static](https://npm.io/package/koa-static.md) ^4.0.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^2.2.0
- [time-grunt](https://npm.io/package/time-grunt.md) ^1.3.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.14.2
- [compression](https://npm.io/package/compression.md) ^1.6.1
- [grunt-babel](https://npm.io/package/grunt-babel.md) ^6.0.0
- [koa-session](https://npm.io/package/koa-session.md) ^5.2.0
- [oauth2orize](https://npm.io/package/oauth2orize.md) ^1.8.0
- [babel-loader](https://npm.io/package/babel-loader.md) ^6.2.4
- [ssl-root-cas](https://npm.io/package/ssl-root-cas.md) ^1.2.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.11.6
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.1
- [passport-http](https://npm.io/package/passport-http.md) ^0.3.0
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.2.0
- [passport-local](https://npm.io/package/passport-local.md) ^1.0.0
- [express-session](https://npm.io/package/express-session.md) ^1.13.0
- [oauth2orize-koa](https://npm.io/package/oauth2orize-koa.md) ^1.3.2
- [grunt-mocha-test](https://npm.io/package/grunt-mocha-test.md) ^0.12.7
- [homematic-xmlrpc](https://npm.io/package/homematic-xmlrpc.md) ^1.0.2
- [express-force-ssl](https://npm.io/package/express-force-ssl.md) ^0.3.0
- [grunt-shell-spawn](https://npm.io/package/grunt-shell-spawn.md) ^0.3.10
- [load-grunt-config](https://npm.io/package/load-grunt-config.md) ^0.19.1
- [supertest-session](https://npm.io/package/supertest-session.md) ^2.0.1
- [jsonapi-serializer](https://npm.io/package/jsonapi-serializer.md) ^3.5.3
- [oauth2orize-koa-fr](https://npm.io/package/oauth2orize-koa-fr.md) ^1.3.2
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.9.0
- [grunt-contrib-watch](https://npm.io/package/grunt-contrib-watch.md) ^0.6.1
- [nodeunit-httpclient](https://npm.io/package/nodeunit-httpclient.md) ^0.2.1
- [grunt-contrib-cssmin](https://npm.io/package/grunt-contrib-cssmin.md) ^1.0.1
- [grunt-contrib-uglify](https://npm.io/package/grunt-contrib-uglify.md) ^1.0.1
- [grunt-express-server](https://npm.io/package/grunt-express-server.md) ^0.5.1
- [passport-http-bearer](https://npm.io/package/passport-http-bearer.md) ^1.0.1
- [passport-local-mongoose](https://npm.io/package/passport-local-mongoose.md) ^4.0.0
- [winston-daily-rotate-file](https://npm.io/package/winston-daily-rotate-file.md) ^1.4.0

## Recent versions

- 0.5.0 (latest) — 2017-07-05

## README

# api.fuelrats.com

[![node](https://img.shields.io/node/v/api.fuelrats.com.svg?style=flat-square)](https://nodejs.org)
[![Dependencies](http://img.shields.io/david/FuelRats/api.fuelrats.com.svg?style=flat-square)](https://david-dm.org/FuelRats/api.fuelrats.com)
[![Open Github Issues](http://img.shields.io/github/issues/FuelRats/api.fuelrats.com.svg?style=flat-square)](https://github.com/FuelRats/api.fuelrats.com/issues)
[![Travis CI Build](http://img.shields.io/travis/FuelRats/api.fuelrats.com.svg?style=flat-square)](https://travis-ci.org/FuelRats/api.fuelrats.com)

## Setting up
<!--
### With Vagrant

[Vagrant](vagrantup.com) allows us to run a local virtual machine clone of our production environment with ease. Make sure you have Vagrant installed (Check out [this article](https://servercheck.in/blog/running-ansible-within-windows) if you're on Windows), then run:

Please make note that you need a 64-bit system for this to work.

    vagrant up

Vagrant will do everything we need:

1. Download an Ubuntu virtual machine image;
1. Set up SSH access on the vm which we can access with `vagrant ssh`;
1. Provision our vm using Ansible to set up Node and all the dependencies we need;
1. Start our API with [`forever`](https://www.npmjs.com/package/forever); and
1. Import all archived rats and rescues from the Google spreadsheets.

Once Vagrant finishes doing its thing you should be able to hit the API at `http://localhost:8080`. When you're done you can kill the Vagrant machine with `vagrant destroy` or, if you don't want to wait for the VM to be rebuilt from scratch, you can just pause the VM with `vagrant halt`.

### Without Vagrant

So you wanna do it the hard way? Fine. Make sure you install all of the dependencies:
-->

So, first of you need to fetch a few things and install. These should be available as packages from you favorite package manager.

1. [`nvm`](https://github.com/creationix/nvm)
1. [`node v6.3.1`](https://nodejs.org/en/)
1. [`Postgres v9.4`](https://www.postgresql.org/)

Grab the repo:

    git clone https://github.com/FuelRats/api.fuelrats.com.git

Install all of the required Node modules:

    cd api.fuelrats.com
    npm install webpack@^2.1.0-beta
    npm install -g grunt-cli
    npm install

Make sure that you have created the databases required:

    su postgres
    psql -c 'CREATE DATABASE fuelrats;' -U postgres
    psql -c 'CREATE DATABASE fuelratsTest;' -U postgres
    psql -c 'CREATE USER fuelrats;' -U postgres
    psql -c "ALTER USER fuelrats PASSWORD 'fuelrats';" -U postgres
    exit

And if you want to use a different username or password, you can use them instead and set the new ones in your `config.json`

Now start the server!

    npm run dev

This will ensure that Postgres is running as a service and start the API itself on either port 8080 or whatever port you've set in `config.json`.

### Common Problems

#### "Missing indexes" or an empty object is returned

Your databases are empty, home slice. You can use our [import script](bin/import.js) to grab a bunch of archived FuelRats data.

## Development

To work for realsies you need to copy the `config-example.json` file and update any settings you need changed:

    cp config-example.json config.json


The `npm run dev` task starts the API and will automatically restart it when you change a file. Simply kill the process when you're done. Good luck, and may the force be with you.

## Generating the docs

It's so easy a DerryBear could do it! Just run the generator script:

    node bin/compile-docs.js

## License
Copyright 2017 The Fuel Rats Mischief

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---
_Source: https://npm.io/package/api.fuelrats.com · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
