Skip to content

API Discovery Solution for Microservice Architectures

License

Notifications You must be signed in to change notification settings

fmueller/api-discovery

 
 

Repository files navigation

Build Status Codacy Badge Codacy Badge

API Discovery Solution for Microservice Architectures

Purpose

In Microservice architectures many services and APIs are built. Over time it becomes quite hard for each developer to keep track which APIs exist and what services an API offers. As a solution for this problem, this API Discovery solution offers easy to implement auto discovery of available APIs and gathers all found API specifications in one central storage system. It's built upon OpenAPI specifications (formerly Swagger). It also comes with an adapted Swagger UI to display all APIs.

IMPORTANT Currently the crawler is still depending on an application registry, called Kio. From this application registry all services, which potentially have an API definition, are crawled. In near future, this will change and retrieving of crawlable services will be configurable. By this you can adapt API Discovery to your needs. Please contribute if you have requirements or ideas to this issue.

Architecture Overview

+------------+     +---------+     +---------+     +------+
| Swagger UI +---->+ Storage +<----+ Crawler +---->+ APIs |
+------------+     +---------+     +---------+     +------+

How does it work?

The crawler constantly fetches a list of all available services from an application registry (currently Kio) and then tries to retrieve an API definition per service. For that, it first crawls /.well-known/schema-discovery which should respond with payload like:

{
  "schema_url": "/swagger.json",
  "schema_type": "swagger-2.0",
  "ui_url": "/ui/"
}

schema_url points to an API definition endpoint. The API definition can be provided either in JSON or YAML format. After the crawler loaded the definition it tries to store it in the storage system. An adapted Swagger UI displays all API definitions which were stored in this storage system.

Currently the /.well-known/schema-discovery endpoint and the endpoint provided by schema_url are requested with OAuth uid token by the crawler. By this services can secure their API definition if necessary or just ignore the uid token.

Features

  • Auto-discovery of your APIs
  • Basic UI support for auto-discovered APIs
  • API Lifecycle Management Support (see storage for more information)

Dependencies

  • Java 8
  • NPM

Installation

Please refer to individual installation instructions of sub-projects for more detailed information and configuration parameters.

Run locally

As prerequisite the Python SCM Source Generator should be in place:

pip install --upgrade scm-source

You can start the whole stack locally (Swagger UI and Storage incl. PostgreSQL DB and test data) by running:

./start.sh localhost

If your docker host is not your localhost (e.g. MacOS), replace localhost in the link with the docker machine host name or IP address:

docker-machine ip ${machine_name}

Swagger UI is accessible on https://localhost:8080. You can also access Storage API https://localhost:8010/apps and PostgreSQL database postgresql:https://localhost:54321/apis directly.

Contributing

We are happy to accept contributions. First, take a look at our contributing guidelines.

You can see our current status in this task board.

TODO

Please check the Issues Page for contribution ideas.

Contact

Feel free to contact one of the maintainers.

License

MIT

About

API Discovery Solution for Microservice Architectures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 39.1%
  • CSS 24.4%
  • JavaScript 19.7%
  • TypeScript 11.8%
  • HTML 3.7%
  • Shell 0.8%
  • Python 0.5%