Skip to content

A microservices-based e-commerce system demonstrating integration between different service architectures

Notifications You must be signed in to change notification settings

helioLJ/bridge-commerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bridge Commerce

A microservices-based e-commerce system demonstrating integration between different service architectures.

Architecture Overview

This project demonstrates modern microservices architecture integrating different communication protocols:

graph TD
    FE[Frontend<br/>React + Apollo] -->|GraphQL| GW[Gateway API<br/>Apollo Server]
    GW -->|gRPC| PS[Product Service<br/>gRPC]
    GW -->|REST| LS[Legacy Service<br/>Express]
    
    subgraph "Client Layer"
        FE
    end
    
    subgraph "Gateway Layer"
        GW
    end
    
    subgraph "Service Layer"
        PS
        LS
    end

    style FE fill:#f9f,stroke:#333
    style GW fill:#bbf,stroke:#333
    style PS fill:#bfb,stroke:#333
    style LS fill:#fbb,stroke:#333
Loading

Service Communication

  • Frontend β†’ Gateway: GraphQL provides a flexible, type-safe API
  • Gateway β†’ Product Service: gRPC enables efficient, high-performance communication
  • Gateway β†’ Legacy Service: REST API maintains compatibility with legacy systems

Technologies & Patterns

Frontend

  • React 18 with TypeScript
  • Apollo Client for GraphQL state management
  • Tailwind CSS for styling
  • React Query for server state management

Gateway API

  • Apollo Server for GraphQL implementation
  • Express.js as the web framework
  • TypeScript for type safety
  • Implements the Backend-for-Frontend (BFF) pattern

Product Service (gRPC)

  • Node.js with gRPC implementation
  • Protocol Buffers for service definitions
  • TypeScript for type safety
  • Demonstrates modern microservice patterns

Legacy Service (REST)

  • Express.js REST API
  • Traditional HTTP/JSON communication
  • Simulates legacy system integration

Quick Start

# Start all services
docker compose up --build

# Access services:
Frontend: http://localhost:3002
GraphQL Gateway: http://localhost:3000/graphql
Legacy API: http://localhost:3001
gRPC Service: localhost:50051

Project Structure

bridge-commerce/
β”œβ”€β”€ frontend/          # React dashboard
β”œβ”€β”€ gateway-api/       # GraphQL gateway service
β”œβ”€β”€ grpc-service/      # gRPC product service
β”œβ”€β”€ legacy-api/        # REST order service
└── shared/           # Shared types and protocols

Key Features

  1. Protocol Integration

    • GraphQL for flexible data fetching
    • gRPC for efficient service communication
    • REST for legacy system compatibility
  2. Type Safety

    • TypeScript across all services
    • GraphQL schema validation
    • Protocol Buffers type definitions
  3. Modern Patterns

    • Microservices architecture
    • API Gateway pattern
    • Backend-for-Frontend pattern

Development

Prerequisites

  • Node.js 18+
  • Docker and Docker Compose
  • TypeScript knowledge
  • Basic understanding of GraphQL, gRPC, and REST

Local Development

Each service can be developed independently:

# Frontend
cd frontend && npm start

# Gateway API
cd gateway-api && npm run dev

# gRPC Service
cd grpc-service && npm run dev

# Legacy API
cd legacy-api && npm start

About

A microservices-based e-commerce system demonstrating integration between different service architectures

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published