Skip to content

This is the flower e-commerce's api-gateway-service

Notifications You must be signed in to change notification settings

JIUNG9/BB-APIGATEWAY-SERVICE

 
 

Repository files navigation

Blooming-blooms MICROSERVICE.API-GATEWAY

Description

This is the Spring Cloud API Gateway server, which handles routing to appropriate services and checks user authentication and authorization. The service consists of an authentication filter and an optional authentication filter. The optional authentication filter is necessary when users look up products without logging in. Additionally, there are authorization filters for each role, providing flexible authentication and authorization.

Getting Started

Prerequisites

Install(Mac brew)

brew install redis

Install(Window)

sudo apt-get install redis

Usage

Redis

redis-cli -h host -p port -a password

Configuration

Routing

spring:
  cloud:
    config:
      name: apigateway-service
    gateway:
      routes:

        # product
        - id: product-service
          uri: lb://PRODUCT-SERVICE
          predicates:
            - Path=/api/products/**
            - Method=GET,POST,OPTIONS,PUT,DELETE
          filters:
            - RewritePath=/api/products/(?<segment>.*), /$\{segment}
            - name: JwtOptionalGatewayFilter

        # delivery store manager
        - id: delivery-service
          uri: lb://DELIVERY-SERVICE
          predicates:
            - Path=/api/delivery/{variable:.*}/**
            - Method=GET,POST,OPTIONS,PUT,DELETE,PATCH
          filters:
            - RewritePath=/api/delivery/(?<segment>.*), /$\{segment}
            - name: JwtValidation
            - name: StoreAuthorization

        # delivery customer
        - id: delivery-service
          uri: lb://DELIVERY-SERVICE
          predicates:
            - Path=/api/delivery/**
            - Method=GET,POST,OPTIONS,PUT,DELETE,PATCH
          filters:
            - RewritePath=/api/delivery/(?<segment>.*), /$\{segment}
            - name: JwtValidation
            - name: SocialAuthorization


API Documentation

https://www.notion.so/0acd63e526144ac3aeac0bea0413704a?pvs=4

ERD

https://www.erdcloud.com/d/PSD5Cgi6GrFQbdxgK

System Architecture

image

Backend Languages and Tools

mysql      redis       kafka       spring

Contacts

📫 How to reach me [email protected]

📄 Know about my experiences https://www.notion.so/704f524047084978836216b3621dc12e?pvs=4

About

This is the flower e-commerce's api-gateway-service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.9%
  • Dockerfile 1.1%