Skip to content

eCommerce microservices using gRPC, Kafka, Postgres, Fiber, JWT

Notifications You must be signed in to change notification settings

i101dev/gRPC-Kafka-eCommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC - Kafka - Microservices

Components:

  1. Microservices Architecture:

    • Multiple microservices: User Service, Order Service, Product Service. This architecture allows for scalability, flexibility, and easier management.
  2. Fiber for HTTP API Gateway:

    • Fiber to create a lightweight, high-performance HTTP API gateway that acts as a central entry point for clients (e.g., frontend applications, mobile apps). This API gateway handles authentication, authorization, and routing requests to the appropriate microservices.
  3. PostgreSQL & GORM for Data Storage:

    • Each microservice has its own PostgreSQL database for data storage, using GORM as the ORM layer to interact with the database. This decouples the microservices and provides data isolation and consistency.
  4. Kafka for Event-Driven Communication:

    • Kafka for asynchronous communication between microservices, allowing for decoupled services that can publish and consume events, enabling real-time processing and scalability.
  5. gRPC for Inter-Service Communication:

    • gRPC for synchronous communication between microservices when direct communication is required, such as getting product details from the Product Service when placing an order.

Implementation Details:

  1. User Service:

    • This microservice handles user registration, authentication, and authorization. It interacts with PostgreSQL through GORM to manage user data.
    • Provides REST endpoints for user-related actions via Fiber.
    • Communicates with other microservices using gRPC and Kafka when user-related events occur (e.g., "User Registered").
  2. Product Service:

    • Manages product data, including product details, inventory, and pricing.
    • Exposes REST endpoints for product-related operations via Fiber.
    • Communicates with other services using Kafka for product-related events and gRPC for real-time data requests.
  3. Order Service:

    • Handles order placement, tracking, and status updates.
    • Uses Kafka to publish "Order Placed" events and listens to Kafka topics for inventory changes.
    • Communicates with Product Service via gRPC to fetch product information for order processing.

  • Authentication and Authorization: JWT-based authentication and authorization to ensure secure access to the API gateway and microservices.

About

eCommerce microservices using gRPC, Kafka, Postgres, Fiber, JWT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published