How kgcorner/topspin works
Project Type and Purpose
• This is a full-stack, cloud-native microservices application (“Topspin”) that implements an online mall.
• Key parts: an Angular “admin-client” frontend, a Spring-based microservices backend (auth, user, store, offer, product-offer, agent), a config service, a discovery service, an API gateway, plus common libraries and utilities.
High-Level Components
• Client Layer
• admin-client (Angular app)
• Edge Layer
• API Gateway (“topspin-gateway-service”)
• Infrastructure Services
• Configuration Service (Spring Cloud Config)
• Service Registry / Discovery (Eureka)
• Health/Monitoring (health endpoint package)
• Domain Services (each a Spring Boot microservice)
• Auth Service
• User Service
• Store Service
• Offer Service
• Product-Offer Service
• Agent Service
• Data Stores
• MongoDB (user-service, store-service, auth-service via mongo-port modules)
• MySQL (offer-service)
• Redis (cache via common/topspin-common RedisCache)
• External Integrations
• OAuth providers (Facebook, Google via auth-service modules)
• AWS S3 (via aws-utilities)
Relationships & Data Flows
• The Angular client sends all HTTP(S) requests to the API Gateway.
• API Gateway consults Discovery to locate service instances, then routes requests to the appropriate microservice.
• On startup each microservice:
a. Fetches its configuration from Config Service
b. Registers its endpoint(s) with Discovery
• Microservices interact only through well-defined REST APIs.
• Each microservice uses its own persistence module (MySQL or Mongo) via common persistence libraries.
• Common libraries (topspin-common, mongodb-util, mysql-util, aws-utilities) are build-time dependencies for domain modules.
• Caching layer (Redis) used by services via the RedisCache handler.
• OAuth flows contact external Facebook/Google endpoints.
Architectural Patterns & Principles
• Microservices pattern: each bounded context deployed independently.
• Spring Cloud ecosystem: Config Service, Eureka Discovery, Gateway.
• Shared libraries only for cross-cutting concerns (security, persistence, HATEOAS, caching).
• Infrastructure as code: Docker-Compose and Dockerfiles for each service.
• CI/CD: Travis, Sonar, Codecov badges in README.
• Integration testing with Cucumber/TestNG in separate “integration-tests” modules.