Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

moleculer-api

0.2.26 • Public • Published

moleculer-api

A dynamic API Gateway which updates REST endpoints, GraphQL schema, Websocket handlers and access control policies by integrating metadata of discovered remote services.

Build Status Coverage Status David Known Vulnerabilities NPM version Moleculer

Project Architecture Diagram

Usage

1. Documents

2. Examples

Project Architecture Diagram

3. Quick Start

yarn add moleculer-api

...

Release Road-map

  • 0.1.x Pre-alpha
    • Service Broker
      • Service Registry which can discover and distinguish equally named but different services
      • Collect action params and response, subscribed events examples
      • Delegate action call with Dataloader batching support
      • Delegate event publishing
      • Delegate event subscription with either handler or async iterator
      • Delegate health check
      • Reporter which reports errors and information to origin services
      • Inline function parser (VM)
      • Explicit/implicit parameters mapping from service action validation schema
      • Support multiple Service Broker for a single gateway
      • MoleculerJS Delegator
    • Schema Registry
      • Validate service API schema and report
      • Integrations compile and major plugins
        • REST protocol plugin
        • GraphQL protocol plugin with subscription support
      • Retry failed integrations compile
      • Branch and version managements
    • Logger
      • Winston: also can be used with MoleculerJS delegator logger
    • API Server
      • Branch, Version specific routes while reusing handlers
      • HTTP, WebSocket components (express, ws modules)
      • HTTP protocol which mounts HTTP/WS components' modules
  • 0.2.x Alpha
    • Middleware
      • Helmet (disabled by default)
      • CORS (enabled, including WebSocket)
      • Serve Static (disabled)
      • Body Parser (enabled)
      • Logging (enabled, including WebSocket)
      • Error Handler (enabled, including WebSocket)
    • Context Factory
      • ID (enabled; request id generation)
      • User Agent (enabled)
      • Cookie Parser (enabled)
      • Locale (enabled)
      • Auth (enabled; Bearer/OAuth, Basic, Digest, AWS, RFC7235)
    • Schema Registry plugins
      • WebSocket protocol plugin
    • Streaming support for GraphQL/REST plugin multipart/form-data request
    • Streaming support for REST plugin response
    • Bidirectional streaming support for WebSocket plugin
  • [] 0.3.x Beta
    • Integration example with moleculer-iam (OIDC provider)
    • [] Schema Registry plugins
      • [] Filter access control policy plugin
      • [] Scope access control policy plugin
    • [] Gateway schema presets
      • [] Service Catalog and API Catalog in GraphQL
      • [] Health Check endpoints in REST
    • [] Normalized errors
  • [] 1.0.x First Stable release
    • API Server additional protocols
      • HTTPS
      • [] HTTP2, HTTP2S
    • [] Integration example with moleculer-file
    • [] Unit tests coverage over 90%
    • [] Memory leak test
    • [] Stress test and performance profiling
    • [] Update documents and translate to English

Development

1. Yarn Scripts

  • yarn dev [example=simple] - Start development (nodemon with ts-node)
  • yarn build- Uses typescript to transpile service to javascript
  • yarn lint - Run TSLint
  • yarn test - Run tests & generate coverage report
  • yarn test --watch - Watch and run tests

Contribution

Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.

License

The project is available under the MIT license.

Contact

Copyright (c) 2019 QMIT Inc.

Install

npm i moleculer-api

DownloadsWeekly Downloads

395

Version

0.2.26

License

MIT

Unpacked Size

845 kB

Total Files

476

Last publish

Collaborators

  • avatar