Coder Social home page Coder Social logo

naveenbavu / api-gateway-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hemantsonu20/api-gateway-sample

0.0 1.0 0.0 100 KB

A simple micro services architecture with api gateway implementation

License: Apache License 2.0

Java 100.00%

api-gateway-sample's Introduction

api-gateway-sample

This repository integrates following into micro services architechture based on spring boot.

  • Swagger for automatic nice doc generation of the rest apis exposed.
  • Zuul for implementing a gateway service for single point access to the platform.

Swagger

It automatically generates a swagger ui html page with all the rest apis in the application. It also provides a rest client to hit request to micro services directly from the swagger ui page.

Swagger UI

Zuul

It is used to proxy requests to other micro services and returns the response. In a micro services architechture, there may be many micor services, but we may not expose all of them to public. There may be some security reasons, there may be some private apis. Using Zuul we cater this issue by exposing only one gateway service to public.
Gateway Service proxies the request to different micro services based on the request url and relays the response back to consumers. Now we need to secure only one micro service from the public. We can use high security while communication between public and gateway service, whereas we may use less security while communication among gateway and other micro services.
Gateway

How to run

Clone this repository, and run all three micro services (gateway, product and user).

  • Open http://localhost:8081 in a browser, it will redirect to user service swagger ui page.
  • Open http://localhost:8082 in a browser, it will redirect to product service swagger ui page.
  • Open http://localhost:8080 in a browser, it will redirect to gateway service swagger ui page. One important thing to note that, gateway service doesn't have their own apis, so its swagger ui page will list all the micorservices swagger ui page. So from one place we can test all our micro services.

    Gateway

api-gateway-sample's People

Contributors

hemantsonu20 avatar

Watchers

James Cloos avatar

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.