Code Monkey home page Code Monkey logo

jwt-bch-api's Introduction

jwt-bch-api

This repository is forked from jwt-bch-api in the PSF repository. It was forked so the Developer Services team can play with the code and evaluate if it's a good fit for our product plan.

This is a prototype REST API webserver written in node.js and using this koa webserver boilerplate app. This prototype back end is intended to be paired with this front end.

This very lightweight API server acts as an auth server. It allows:

  • The creation and management of users.
  • The persistance of user data (models) in a Mongo Database.
  • Users can pay BCH to recieve a JWT token to access a REST API or other web service.
  • REST APIs and web services can quickly query this web server to validate JWT tokens.

Requirements

  • node ^10.15.1
  • npm ^6.7.0

Installation

git clone https://github.com/Permissionless-Software-Foundation/jwt-bch-api
cd jwt-bch-api
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
│   ├── 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
  • 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.

Visit http://localhost:5001/docs/ to view docs

Dependencies

License

MIT

jwt-bch-api's People

Contributors

christroutner avatar adrianobel avatar greenkeeper[bot] avatar emilos avatar dependabot[bot] avatar alansikora avatar connorbrathwaite avatar marcofiset avatar danielhumgon avatar

Watchers

James Cloos avatar  avatar

Forkers

vinarmani slpswap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.