3.2 KiB
ipfs-service-provider
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. It has all the same features as that boilerplate:
- Koa framework for REST APIs
- User management
- Access and rate-limit control using JWT tokens.
This boilerplate extends that code to provide the basic features required to be a 'service provider' on the IPFS network. See this article if you're new to the concept of service providers on IPFS. These basic features include:
- ipfs-coord for coordinating service providers and consumers across the IPFS network.
- JSON RPC for creating an API between providers and consumers.
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 framework for REST APIs
- Authentication (passport & jwt)
- Database (mongoose)
- Testing (mocha)
- Doc generation with apidoc
- Linting using Standard
- Packaged for production environment as a Docker container
- ipfs-coord for coordinating peers over IPFS
- JSON RPC for mirroring the REST API over IPFS
Requirements
- node ^14.17.0
- npm ^7.13.0
Installation
git clone https://github.com/Permissionless-Software-Foundation/ipfs-service-provider
cd ipfs-service-provider
npm install
npm start
Structure
The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of Clean Architecture.
Usage
npm startStart server on live modenpm run docsGenerate API documentationnpm testRun mocha testsdocker-compose buildBuild a 'production' Docker containerdocker-compose upRun the docker container
Documentation
API documentation is written inline and generated by apidoc.
Visit http://localhost:5000/docs/ to view docs
Dependencies
- koa2
- koa-router
- koa-bodyparser
- koa-generic-session
- koa-logger
- MongoDB
- Mongoose
- Passport
- Nodemon
- Mocha
- apidoc
- ESLint
- ipfs-coord
IPFS
Snapshots pinned to IPFS will be listed here.