# chau165/microservice architecture

> Architecture diagram of the GitHub repository chau165/microservice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chau165/microservice
- Repository: https://github.com/chau165/microservice

## Overview

This repository is a Spring-based service suite: an API gateway, an authentication and customer-engagement service, and a metadata service covering franchise/contract administration and staff shifts/attendance. The visible workflows are HTTP requests handled by controllers and delegated to service interfaces; the sampled promotion and shift controllers show those delegations directly. The README is empty, and most implementation and gateway-routing sources were not sampled, so the graph preserves major capabilities visible in the tree but omits unverified wiring.

Main entry points: [`CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/PromotionController.java`](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/PromotionController.java) (Promotion endpoints), [`metadataservice/src/main/java/com/group1/app/shift/controller/ShiftController.java`](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/controller/ShiftController.java) (Shift endpoints), [`CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/common/security/CustomerUserDetailsService.java`](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/common/security/CustomerUserDetailsService.java) (User lookup), [`CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/repository/UsersRepository.java`](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/repository/UsersRepository.java) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["API Gateway"]
  node_gateway_app["Gateway application"]
  node_gateway_security["Gateway security"]
  node_gateway_rate["IP rate limiting"]
  node_gateway_fallback["Fallback responses"]
  node_discovery["Service discovery"]
end

subgraph group_auth["Identity and Engagement"]
  node_auth_app["Auth service"]
  node_auth_controller["Authentication endpoints"]
  node_auth_service["Authentication operations"]
  node_user_details["User lookup"]
  node_users_repo[("User records")]
  node_promotion_controller["Promotion endpoints"]
  node_promotion_service["Promotion operations"]
  node_coupon_controller["Coupon endpoints"]
  node_redemption_controller["Reward redemption"]
end

subgraph group_metadata["Franchise Metadata"]
  node_metadata_app["Metadata service"]
  node_franchise_controller["Franchise management"]
  node_contract_controller["Contract management"]
  node_contract_service["Contract operations"]
end

subgraph group_shifts["Shift Operations"]
  node_shift_controller["Shift endpoints"]
  node_shift_service["Shift operations<br/>[ShiftService.java]"]
  node_attendance_service["Attendance reporting"]
end

node_client(("API client"))

node_client -->|"HTTP request"| node_promotion_controller
node_promotion_controller -->|"delegates"| node_promotion_service
node_client -->|"HTTP request"| node_shift_controller
node_shift_controller -->|"delegates"| node_shift_service
node_user_details -->|"loads user"| node_users_repo

click node_gateway_app "https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/ApiGatewayApplication.java"
click node_gateway_security "https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/infrastructure/security/SecurityConfig.java"
click node_gateway_rate "https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/infrastructure/security/IpRateLimitWebFilter.java"
click node_gateway_fallback "https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/controller/GlobalFallbackController.java"
click node_auth_app "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/CsfcAuthServiceApplication.java"
click node_auth_controller "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/AuthenticationController.java"
click node_auth_service "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/AuthenticationService.java"
click node_user_details "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/common/security/CustomerUserDetailsService.java"
click node_users_repo "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/repository/UsersRepository.java"
click node_promotion_controller "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/PromotionController.java"
click node_promotion_service "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/PromotionService.java"
click node_coupon_controller "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/CouponController.java"
click node_redemption_controller "https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/RedemptionController.java"
click node_metadata_app "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/MetadataShiftApplication.java"
click node_franchise_controller "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/controller/franchise/FranchiseController.java"
click node_contract_controller "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/controller/contract/ContractController.java"
click node_contract_service "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/service/ContractService.java"
click node_shift_controller "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/controller/ShiftController.java"
click node_shift_service "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/service/ShiftService.java"
click node_attendance_service "https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/service/AttendanceService.java"
click node_discovery "https://github.com/chau165/microservice/blob/main/discovery-service/src/main/java/com/group1/discovery_service/DiscoveryServerApplication.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gateway_app,node_gateway_security,node_gateway_rate,node_gateway_fallback,node_discovery,node_client toneBlue
class node_auth_app,node_auth_controller,node_auth_service,node_user_details,node_users_repo,node_promotion_controller,node_promotion_service,node_coupon_controller,node_redemption_controller toneAmber
class node_metadata_app,node_franchise_controller,node_contract_controller,node_contract_service toneMint
class node_shift_controller,node_shift_service,node_attendance_service toneRose
```

## Components

### API Gateway

- [Gateway application](https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/ApiGatewayApplication.java): `apigateway/src/main/java/com/group1/apigateway/ApiGatewayApplication.java`
- [Gateway security](https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/infrastructure/security/SecurityConfig.java): `apigateway/src/main/java/com/group1/apigateway/infrastructure/security/SecurityConfig.java`
- [IP rate limiting](https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/infrastructure/security/IpRateLimitWebFilter.java): `apigateway/src/main/java/com/group1/apigateway/infrastructure/security/IpRateLimitWebFilter.java`
- [Fallback responses](https://github.com/chau165/microservice/blob/main/apigateway/src/main/java/com/group1/apigateway/controller/GlobalFallbackController.java): `apigateway/src/main/java/com/group1/apigateway/controller/GlobalFallbackController.java`
- [Service discovery](https://github.com/chau165/microservice/blob/main/discovery-service/src/main/java/com/group1/discovery_service/DiscoveryServerApplication.java): `discovery-service/src/main/java/com/group1/discovery_service/DiscoveryServerApplication.java`

### Identity and Engagement

- [Auth service](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/CsfcAuthServiceApplication.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/CsfcAuthServiceApplication.java`
- [Authentication endpoints](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/AuthenticationController.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/AuthenticationController.java`
- [Authentication operations](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/AuthenticationService.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/AuthenticationService.java`
- [User lookup](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/common/security/CustomerUserDetailsService.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/common/security/CustomerUserDetailsService.java`
- [User records](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/repository/UsersRepository.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/repository/UsersRepository.java`
- [Promotion endpoints](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/PromotionController.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/PromotionController.java`
- [Promotion operations](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/PromotionService.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/service/PromotionService.java`
- [Coupon endpoints](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/CouponController.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/CouponController.java`
- [Reward redemption](https://github.com/chau165/microservice/blob/main/CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/RedemptionController.java): `CSFC-auth-service/src/main/java/service/CSFC/CSFC_auth_service/controller/RedemptionController.java`

### Franchise Metadata

- [Metadata service](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/MetadataShiftApplication.java): `metadataservice/src/main/java/com/group1/app/MetadataShiftApplication.java`
- [Franchise management](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/controller/franchise/FranchiseController.java): `metadataservice/src/main/java/com/group1/app/metadata/controller/franchise/FranchiseController.java`
- [Contract management](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/controller/contract/ContractController.java): `metadataservice/src/main/java/com/group1/app/metadata/controller/contract/ContractController.java`
- [Contract operations](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/metadata/service/ContractService.java): `metadataservice/src/main/java/com/group1/app/metadata/service/ContractService.java`

### Shift Operations

- [Shift endpoints](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/controller/ShiftController.java): `metadataservice/src/main/java/com/group1/app/shift/controller/ShiftController.java`
- [Shift operations](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/service/ShiftService.java): `metadataservice/src/main/java/com/group1/app/shift/service/ShiftService.java`
- [Attendance reporting](https://github.com/chau165/microservice/blob/main/metadataservice/src/main/java/com/group1/app/shift/service/AttendanceService.java): `metadataservice/src/main/java/com/group1/app/shift/service/AttendanceService.java`

### Other components

- **API client**

## Connections

- API client → Promotion endpoints: HTTP request
- Promotion endpoints → Promotion operations: delegates
- API client → Shift endpoints: HTTP request
- Shift endpoints → Shift operations: delegates
- User lookup → User records: loads user
