http:
  routers:
    iam-service-router:
      rule: "PathPrefix(`/api/v1/auth`)"
      service: iam-service
      priority: 100
      middlewares:
        - auth-ratelimit
        - cors
        - secure-headers
      entryPoints:
        - web

    iam-service-users-router:
      rule: "PathPrefix(`/api/v1/users`) || PathPrefix(`/api/v1/identity`) || PathPrefix(`/api/v1/access`) || PathPrefix(`/api/v1/governance`) || PathPrefix(`/api/v1/rbac`) || PathPrefix(`/api/v1/mfa`) || PathPrefix(`/api/v1/sessions`)"
      service: iam-service
      priority: 100
      middlewares:
        - auth-ratelimit
        - cors
        - secure-headers
      entryPoints:
        - web

    # EN: IdentityServer OAuth2/OIDC Endpoints
    # VI: IdentityServer OAuth2/OIDC Endpoints
    iam-oidc-router:
      rule: "PathPrefix(`/connect`) || PathPrefix(`/.well-known`)"
      service: iam-service
      priority: 150
      middlewares:
        - auth-ratelimit
        - cors
        - secure-headers
      entryPoints:
        - web

    web-admin-router:
      rule: "Host(`admin.goodgo.vn`) || Host(`admin.localhost`)"
      service: web-admin
      middlewares:
        - cors
        - secure-headers
      entryPoints:
        - web

    web-client-router:
      rule: "Host(`goodgo.vn`) || Host(`localhost`)"
      service: web-client
      middlewares:
        - cors
        - secure-headers
      entryPoints:
        - web

    # EN: Storage Service - File Management
    # VI: Storage Service - Quản lý File
    storage-service-router:
      rule: "PathPrefix(`/api/v1/files`) || PathPrefix(`/api/v1/quota`) || PathPrefix(`/api/v1/uploads`)"
      service: storage-service
      priority: 100
      middlewares:
        - cors
        - secure-headers
      entryPoints:
        - web

    # EN: Membership Service - Member & Level Management
    # VI: Membership Service - Quản lý Member & Level
    membership-service-router:
      rule: "PathPrefix(`/api/v1/members`) || PathPrefix(`/api/v1/levels`)"
      service: membership-service
      priority: 100
      middlewares:
        - cors
        - secure-headers
      entryPoints:
        - web

    # EN: Merchant Service - Merchant & Shop Management
    # VI: Merchant Service - Quản lý Merchant & Shop
    merchant-service-router:
      rule: "PathPrefix(`/api/v1/merchants`) || PathPrefix(`/api/v1/shops`)"
      service: merchant-service
      priority: 100
      middlewares:
        - cors
        - secure-headers
      entryPoints:
        - web

  services:
    iam-service:
      loadBalancer:
        servers:
          - url: "http://iam-service-net:8080"
    
    web-admin:
      loadBalancer:
        servers:
          - url: "http://web-admin:3000"
    
    web-client:
      loadBalancer:
        servers:
          - url: "http://web-client:3001"

    # EN: Storage Service
    # VI: Storage Service  
    storage-service:
      loadBalancer:
        servers:
          - url: "http://storage-service:8080"

    # EN: Membership Service
    # VI: Membership Service
    membership-service:
      loadBalancer:
        servers:
          - url: "http://membership-service-net:8080"

    # EN: Merchant Service
    # VI: Merchant Service
    merchant-service:
      loadBalancer:
        servers:
          - url: "http://merchant-service-net:8080"