Files
ipfs-bch-wallet-consumer/README.md
T

72 lines
2.4 KiB
Markdown
Raw Normal View History

2016-02-15 18:25:12 -05:00
#koa2-api-boilerplate
2016-08-30 16:58:35 -04:00
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
2016-02-17 19:15:43 -05:00
Boilerplate for building APIs with [koa2](https://github.com/koajs/koa/tree/v2.x) and mongodb.
This project covers basic necessities of most APIs.
* Authentication (passport & jwt)
* Database (mongoose)
* Testing (mocha)
2016-08-30 15:27:07 -04:00
* Doc generation with apidoc
2016-08-30 16:58:35 -04:00
* linting using standard
2016-02-17 19:15:43 -05:00
##Requirements
* node __^4.0.0__
* npm __^3.0.0__
##Installation
```bash
git clone https://github.com/adrianObel/koa2-api-boilerplate.git
```
##Features
2016-03-04 23:58:22 -05:00
* [koa2](https://github.com/koajs/koa/tree/v2.x)
2016-02-17 19:15:43 -05:00
* [koa-router](https://github.com/alexmingoia/koa-router)
* [koa-bodyparser](https://github.com/koajs/bodyparser)
* [koa-generic-session](https://github.com/koajs/generic-session)
* [koa-logger](https://github.com/koajs/logger)
* [MongoDB](http://mongodb.org/)
* [Mongoose](http://mongoosejs.com/)
* [Passport](http://passportjs.org/)
* [Nodemon](http://nodemon.io/)
* [Mocha](https://mochajs.org/)
2016-08-30 15:27:07 -04:00
* [apidoc](http://apidocjs.com/)
2016-02-17 19:15:43 -05:00
* [Babel](https://github.com/babel/babel)
2016-03-04 23:58:22 -05:00
* [ESLint](http://eslint.org/)
2016-02-17 19:15:43 -05:00
##Structure
```
2016-03-04 23:58:22 -05:00
├── bin
│ └── server.js # Bootstrapping and entry point
2016-02-17 19:15:43 -05:00
├── config # Server configuration settings
2016-03-04 23:58:22 -05:00
│ ├── env # Environment specific config
│ │ ├── common.js
│ │ ├── development.js
│ │ ├── production.js
│ │ └── test.js
│ ├── index.js # Config entrypoint - exports config according to envionrment and commons
2016-02-17 19:15:43 -05:00
│ └── passport.js # Passportjs config of strategies
├── src # Source code
2016-03-19 11:39:21 -04:00
│ ├── modules
│ │ ├── controller.js # Module-specific controllers
│ │ └── router.js # Router definitions for module
2016-02-17 19:15:43 -05:00
│ ├── models # Mongoose models
│ └── middleware # Custom middleware
│ └── validators # Validation middleware
└── test # Unit tests
```
##Usage
* `npm start` Start server on live mode
* `npm run dev` Start server on dev mode with nodemon
2016-03-04 23:58:22 -05:00
* `npm run docs` Generate API documentation
2016-02-17 19:15:43 -05:00
* `npm test` Run mocha tests
2016-03-04 23:58:22 -05:00
##Documentation
2016-08-30 15:27:07 -04:00
API documentation is written inline and generated by [apidoc](http://apidocjs.com/).
2016-03-04 23:58:22 -05:00
Visit `http://localhost:5000/docs/` to view docs
2016-02-17 19:15:43 -05:00
##License
MIT