From 2629bfd7b67df006bd1641d4f3eb0ffd6333bdf1 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Tue, 13 Jul 2021 10:00:39 -0700 Subject: [PATCH] Updating README --- LICENSE => LICENSE.md | 0 README.md | 105 ++++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 61 deletions(-) rename LICENSE => LICENSE.md (100%) diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index 4190294..44123bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ipfs-service-provider + [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) This is a 'boilerplate' repository. It's intended to be forked to start new projects. This repository has been forked from the [koa-api-boilerplate](https://github.com/christroutner/koa-api-boilerplate). It has all the same features as that boilerplate: @@ -7,7 +8,7 @@ This is a 'boilerplate' repository. It's intended to be forked to start new proj - User management - Access control using [JWT tokens](https://jwt.io/). -This boilerplate extends that code to provide the basic features required to be a 'service provider' on the IPFS network. See [this article](https://troutsblog.com/blog/ipfs-api) if you're new to the concept of service provides on IPFS. These basic features include: +This boilerplate extends that code to provide the basic features required to be a 'service provider' on the IPFS network. See [this article](https://troutsblog.com/blog/ipfs-api) if you're new to the concept of service providers on IPFS. These basic features include: - [ipfs-coord](https://www.npmjs.com/package/ipfs-coord) for coordinating service providers and consumers across the IPFS network. - JSON RPC for creating an API between providers and consumers. @@ -15,89 +16,71 @@ This boilerplate extends that code to provide the basic features required to be If you are interested in creating your own service provider on the IPFS network, fork this repository and start building. ## Features + This project covers basic necessities of most APIs. -* [Koa](https://koajs.com/) framework for REST APIs -* Authentication (passport & jwt) -* Database (mongoose) -* Testing (mocha) -* Doc generation with apidoc -* Linting using standard -* Packaged as a Docker container -* [ipfs-coord](https://www.npmjs.com/package/ipfs-coord) -* JSON RPC for mirroring the REST API over IPFS - +- [Koa](https://koajs.com/) framework for REST APIs +- Authentication (passport & jwt) +- Database (mongoose) +- Testing (mocha) +- Doc generation with apidoc +- Linting using standard +- Packaged as a Docker container +- [ipfs-coord](https://www.npmjs.com/package/ipfs-coord) +- JSON RPC for mirroring the REST API over IPFS ## Requirements -* node __^10.15.1__ -* npm __^6.7.0__ + +- node **^14.17.0** +- npm **^7.13.0** ## Installation + ```bash -git clone https://github.com/christroutner/koa-api-boilerplate -cd koa-api-boilerplate +git clone https://github.com/Permissionless-Software-Foundation/ipfs-service-provider +cd ipfs-service-provider npm install npm start ``` ## 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 -| -├── production # Dockerfile for build production container -| -├── src # Source code -│ ├── lib # Business logic libraries -│ ├── modules -│ │ ├── controller.js # Module-specific controllers -│ │ └── router.js # Router definitions for module -| ├── rpc # JSON RPC over IPFS -│ ├── models # Mongoose models -│ └── middleware # Custom middleware -│ └── validators # Validation middleware -└── test # Unit tests -``` + +The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of [Clean Architecture](troutsblog.com/blog/clean-architecture). ## Usage -* `npm start` Start server on live mode -* `npm run dev` Start server on dev mode with nodemon -* `npm run docs` Generate API documentation -* `npm test` Run mocha tests -* `docker-compose build` Build a 'production' Docker container -* `docker-compose up` Run the docker container + +- `npm start` Start server on live mode +- `npm run docs` Generate API documentation +- `npm test` Run mocha tests +- `docker-compose build` Build a 'production' Docker container +- `docker-compose up` Run the docker container ## Documentation + API documentation is written inline and generated by [apidoc](http://apidocjs.com/). Visit `http://localhost:5000/docs/` to view docs - ## Dependencies -* [koa2](https://github.com/koajs/koa/tree/v2.x) -* [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/) -* [apidoc](http://apidocjs.com/) -* [ESLint](http://eslint.org/) -* [ipfs-coord](https://www.npmjs.com/package/ipfs-coord) + +- [koa2](https://github.com/koajs/koa/tree/v2.x) +- [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/) +- [apidoc](http://apidocjs.com/) +- [ESLint](http://eslint.org/) +- [ipfs-coord](https://www.npmjs.com/package/ipfs-coord) ## IPFS + Snapshots pinned to IPFS will be listed here. ## License -MIT + +[MIT](./LICENSE.md)