|
| 1 | +#KOACH |
| 2 | + |
| 3 | +Production ready boilerplate for building APIs with [koa2] and mongodb. |
| 4 | + |
| 5 | +This project covers basic necessities of most APIs. |
| 6 | +* Authentication (passport & jwt) |
| 7 | +* Database (mongoose) |
| 8 | +* Testing (mocha) |
| 9 | +* Doc generation with apidoc |
| 10 | +* linting using standard |
| 11 | + |
| 12 | +##Requirements |
| 13 | +* node > v7.8.0 |
| 14 | + |
| 15 | +##Installation |
| 16 | +```bash |
| 17 | +git clone |
| 18 | +``` |
| 19 | + |
| 20 | +##Features |
| 21 | +* [koa2](https://github.com/koajs/koa) |
| 22 | +* [koa-router](https://github.com/alexmingoia/koa-router) |
| 23 | +* [koa-bodyparser](https://github.com/koajs/bodyparser) |
| 24 | +* [koa-generic-session](https://github.com/koajs/generic-session) |
| 25 | +* [koa-logger](https://github.com/koajs/logger) |
| 26 | +* [MongoDB](http://mongodb.org/) |
| 27 | +* [Mongoose](http://mongoosejs.com/) |
| 28 | +* [Passport](http://passportjs.org/) |
| 29 | +* [Nodemon](http://nodemon.io/) |
| 30 | +* [Mocha](https://mochajs.org/) |
| 31 | +* [apidoc](http://apidocjs.com/) |
| 32 | +* [Babel](https://github.com/babel/babel) |
| 33 | +* [ESLint](http://eslint.org/) |
| 34 | + |
| 35 | +##Structure |
| 36 | +``` |
| 37 | +├── bin |
| 38 | +│ └── server.js # Bootstrapping and entry point |
| 39 | +├── config # Server configuration settings |
| 40 | +│ ├── env # Environment specific config |
| 41 | +│ │ ├── common.js |
| 42 | +│ │ ├── development.js |
| 43 | +│ │ ├── production.js |
| 44 | +│ │ └── test.js |
| 45 | +│ ├── index.js # Config entrypoint - exports config according to envionrment and commons |
| 46 | +│ └── passport.js # Passportjs config of strategies |
| 47 | +├── src # Source code |
| 48 | +│ ├── modules |
| 49 | +│ │ ├── controller.js # Module-specific controllers |
| 50 | +│ │ └── router.js # Router definitions for module |
| 51 | +│ ├── models # Mongoose models |
| 52 | +│ └── middleware # Custom middleware |
| 53 | +│ └── validators # Validation middleware |
| 54 | +└── test # Unit tests |
| 55 | +``` |
| 56 | + |
| 57 | +##Usage |
| 58 | +* `npm start` Start server on live mode |
| 59 | +* `npm run dev` Start server on dev mode with nodemon |
| 60 | +* `npm run docs` Generate API documentation |
| 61 | +* `npm test` Run mocha tests |
| 62 | + |
| 63 | +##Documentation |
| 64 | +API documentation is written inline and generated by [apidoc](http://apidocjs.com/). |
| 65 | + |
| 66 | +Visit `http://localhost:3000/docs/` to view docs |
| 67 | + |
| 68 | +##Contributors |
| 69 | +Systango, Arpit Khandelwal |
| 70 | + |
| 71 | +##License |
| 72 | +MIT |
0 commit comments