# unacademic-api

> The API for CTH's unacademic application

Latest version **0.0.2** (published 2015-04-26) · 0 weekly downloads

## Install

```sh
npm install unacademic-api
pnpm add unacademic-api
yarn add unacademic-api
bun add unacademic-api
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-26 |
| First published | 2015-04-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Coding the Humanities |
| Maintainers | yeehaa |

## Links

- npm: https://www.npmjs.com/package/unacademic-api
- Repository: https://github.com/coding-the-humanities/unacademic-API
- Issues: https://github.com/coding-the-humanities/unacademic-API/issues
- npm.io page: https://npm.io/package/unacademic-api

## Dependencies (7)

- [cors](https://npm.io/package/cors.md) ^2.5.2
- [yamljs](https://npm.io/package/yamljs.md) ^0.2.1
- [express](https://npm.io/package/express.md) ^4.10.6
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.2.7
- [bluebird](https://npm.io/package/bluebird.md) ^2.5.2
- [mongoose](https://npm.io/package/mongoose.md) ^3.8.20
- [body-parser](https://npm.io/package/body-parser.md) ^1.10.0

## Recent versions

- 0.0.2 (latest) — 2015-04-26
- 0.0.1 — 2015-04-26

## README

# unacademic-API

This is the repository of the API for the Coding the Humanities unacademic web application.

## Up and Running (quick and dirty)

1. Fork and clone this repository.
2. Move into the repo directory with `cd unacademic-api`.
3. Install dependencies with `npm install`.
4. Run `grunt` to begin a watch and lint task.
5. Run `mocha test/<resource name>`(e.g. `mocha test/places.js`)   to run the tests.
5. Run `node index.js` to start the server.

## Setting up local development environment with vagrant
1. ensure [ansible > 1.8.2](http://docs.ansible.com/intro_installation.html), [virtualbox](https://www.virtualbox.org/wiki/Downloads) and [vagrant > 1.7.2](https://www.vagrantup.com/downloads.html) are installed.
2. `npm install`.
3. `vagrant up`
4. `npm run provision-vagrant`
5. `vagrant ssh`
6. inside the vagrant box, run
    - `cd /home/deploy/unacademic/`
    - `pm2 start index.js`
    - when necessary, reload the server with `pm2 reload all`
    - view logs of pm2 with `pm2 logs`
7. visit browser `33.33.33.33` and `33.33.33.33/api/0`

## Setting up staging environment
1. create a box on [digitalocean](digitalocean.com) and change the root password through SSH
2. configure the ip adress in `devops/inventories/staging.yml`
3. `npm run provision-staging`

## Deploying to environment
1. commit all required changes to repository
2. `npm run deploy-staging`

## Seeding the databse
1. move to seeding directory
	- `cd seeding`
2. run yaml to json transformation
	- `node prepare_seeds.js`
3a. seed database if it’s empty:
	- `node seedData.js`
3b. alternatively, empty database and seed it:
	- `node dropAndSeedData.js`

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