mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
0f3384eb571276442be168117cc6f97c57ba302d
#koa2-api-boilerplate Boilerplate for building APIs with koa2 and mongodb.
This project covers basic necessities of most APIs.
- Authentication (passport & jwt)
- Database (mongoose)
- Testing (mocha)
- Doc generation with jsondoc
##Requirements
- node ^4.0.0
- npm ^3.0.0
##Installation
git clone https://github.com/adrianObel/koa2-api-boilerplate.git
##Features
- koa2
- koa-router
- koa-bodyparser
- koa-generic-session
- koa-logger
- MongoDB
- Mongoose
- Passport
- Nodemon
- Mocha
- jsondoc
- Babel
- ESLint
##Structure
├── bin
│ └── server.js # Bootstrapping and entry point
├── config # Server configuration settings
│ ├── env # Environment specific config
│ │ ├── common.js
│ │ ├── development.js
│ │ ├── production.js
│ │ └── test.js
│ ├── index.js # Config entrypoint - exports config according to envionrment and commons
│ └── passport.js # Passportjs config of strategies
├── src # Source code
│ ├── controllers # Routes
│ ├── models # Mongoose models
│ └── middleware # Custom middleware
│ └── validators # Validation middleware
└── test # Unit tests
##Usage
npm startStart server on live modenpm run devStart server on dev mode with nodemonnpm run docsGenerate API documentationnpm testRun mocha tests
##Documentation API documentation is written inline and generated by jsondoc.
Visit http://localhost:5000/docs/ to view docs
##License MIT
Languages
JavaScript
97.4%
Shell
1.3%
HTML
0.8%
Dockerfile
0.5%