Skip to content

Latest commit

 

History

History
612 lines (478 loc) · 29.6 KB

File metadata and controls

612 lines (478 loc) · 29.6 KB

GitHub Repository Naming Standard for Sika365 Microservices Architecture

Overview

This document defines the standard naming convention for GitHub repositories in the sika365 organization. The naming standard is designed to:

  • Clearly reflect the microservices architecture
  • Be self-documenting and intuitive
  • Support future scalability
  • Enable easy categorization and discovery

Naming Pattern Structure

The general pattern follows:

[category-prefix]-[service-name]-[suffix]

Where:

  • category-prefix: Optional prefix indicating the service category (e.g., cdc-, payment-)
  • service-name: The core service identifier (e.g., core, product, auth)
  • suffix: Optional suffix indicating type (e.g., -service, -template, -docs, -connector-service)

Category-Based Naming Rules

1. Core Services (/services/)

Pattern: {service-name}-service

Core business services without prefix:

  • core-service
  • product-service
  • auth-service
  • billing-service
  • notification-service
  • presentation-service
  • delivery-service
  • shipping-service
  • courier-service
  • wallet-service
  • promotion-service
  • report-service
  • comment-service
  • finance-service
  • qanda-service
  • storage-service
  • packaging-service
  • agent-service
  • frontier-service (from frontier-gateway)

Exceptions:

  • adapter-servicecustomer-agent-service (legacy naming, consider renaming to customer-service)

2. External Services (/services/external/)

2.1 Finance Services (/payment-gateway-adapters/)

Pattern: {gateway-name}-finance-service

Description: Finance Services include all financial gateway services that handle payment and credit operations. These services integrate with external financial gateways for various financial transactions.

Service Types:

  • Payment Gateways: Handle direct payment processing for transactions (e.g., Zarinpal, Sadad, Saman)
  • Credit Gateways: Handle financial credit operations (e.g., Sibank for receiving financial credit)

Note: The specific service type (payment vs credit) is documented in each service's description and README.

Examples:

  • zarinpal-finance-service - Zarinpal payment gateway
  • sadad-finance-service - Sadad payment gateway
  • saman-finance-service - Saman payment gateway
  • behpardakht-finance-service - Behpardakht payment gateway
  • sepehr-finance-service - Sepehr payment gateway
  • stripe-finance-service - Stripe payment gateway
  • enovin-finance-service - Enovin payment gateway
  • sibank-finance-service - Sibank credit gateway (for receiving financial credit)

2.2 Connector Services (/external/ endpoints)

Connector Services are integration services that connect the platform with external business systems. They are divided into two types based on their deployment model:

2.2.1 Customer-Deployed Connector Services

Pattern: {provider-name}-connector-service

Description: Customer-Deployed Connector Services are integration services that connect the platform with external business systems including Point of Sale (POS) systems, ERP platforms, and enterprise software solutions. These services are typically installed on the customer's server (on-premise deployment) and communicate with the platform via WebSocket connections.

Initially developed for registering customers and sales invoices from e-commerce stores into POS systems, they have since evolved to provide broader integration capabilities with various enterprise systems including:

  • POS Systems: Point of Sale systems (e.g., Darian, Sepidar, Baran, Holiday, etc.)
  • ERP Platforms: Enterprise Resource Planning systems (e.g., Dolibarr, Microsoft Navision, SAP)
  • Multi-purpose Platforms: Large enterprise platforms that combine multiple functionalities

Key Characteristics:

  • Installed on customer servers (on-premise deployment)
  • WebSocket-based communication with the platform
  • Integration with POS/ERP/Enterprise systems
  • Handle customer and invoice synchronization
  • Extended integration features for various business processes

Examples:

  • darian-connector-service - Integration with Darian POS system
  • kyansoft-connector-service - Integration with Kyansoft POS system
  • msnav-connector-service - Integration with Microsoft Navision ERP system
  • sepidar-connector-service - Integration with Sepidar POS system
  • baran-connector-service - Integration with Baran POS system
  • holiday-connector-service - Integration with Holiday POS system
  • paliz-connector-service - Integration with Paliz POS system
  • greenware-connector-service - Integration with Greenware POS system
  • wira-connector-service - Integration with Wira POS system
  • dolibarr-connector-service - Integration with Dolibarr ERP system
  • liyam-connector-service - Integration with Liyam system
  • sepids-connector-service - Integration with Sepids system
  • marjan-connector-service - Integration with Marjan system
2.2.2 Platform Connector Services

Pattern: {provider-name}-connector-service

Description: Platform Connector Services are integration services that connect the platform with external third-party platforms and services. Unlike Customer-Deployed Connector Services, these services are deployed within the platform's infrastructure and handle communication with external platforms on behalf of the platform.

Key Characteristics:

  • Deployed in platform infrastructure (not on customer servers)
  • Part of the platform's infrastructure layer
  • Handle communication with external third-party platforms
  • Manage integration with external services (e.g., logistics, delivery, shipping platforms)

Examples:

  • tipax-connector-service - Integration with Tipax logistics platform
  • miare-connector-service - Integration with Miare platform
  • alopeyk-connector-service - Integration with Alopeyk delivery platform

Note: Platform Connector Services use the same *-connector-service pattern as Customer-Deployed Connector Services for consistency. The difference is in the deployment model (platform infrastructure vs. customer servers), not in the service type.

2.2.3 Sync Services

Pattern: {service-name}-service or sync-service

Description: Sync Services are data synchronization services that are installed on customer servers alongside POS connector services. These services compare their local database with the source database to detect changes in products, prices, inventory, new customers, and other data, then synchronize this information to the eShop platform (typically SaaS).

Key Characteristics:

  • Installed on customer servers (on-premise deployment, alongside POS connectors)
  • Compare local database with source database
  • Detect changes in products, prices, inventory, customers, etc.
  • Synchronize data to eShop platform (SaaS)
  • Work alongside POS connector services

Examples:

  • sync-service - Data synchronization service that compares local database with source and syncs to eShop platform

Note: These are different from CDC Agents (see section 3.1). Sync Services are customer-deployed synchronization services, while CDC Agents are part of the Change Data Capture infrastructure deployed in the platform.

3. CDC (Change Data Capture) Services (/cdc/)

Description: CDC Services implement an ETL (Extract, Transform, Load) pipeline that processes data from multiple store databases with different structures and transforms them into a standardized format for the platform.

Architecture Overview:

  1. Data Replication: Each store's database (MSSQL) replicates data to a central SQL Server that the platform has direct access to
  2. Database Access: Each store receives a database with specific access credentials to configure their SQL Server connection to the cloud database
  3. ETL Process: CDC services connect to each database, extract data (which may have different structures for different companies), transform it into a standardized format, and load it into a unified database

Key Characteristics:

  • Acts as an ETL pipeline (Extract, Transform, Load)
  • Handles databases with different structures (each company may have different schema)
  • Transforms heterogeneous data into a standardized format
  • Loads transformed data into a unified platform database
  • Works with replicated data from store databases to central SQL Server

Note: CDC Agents are different from Connector Services (section 2.2). CDC Agents are part of the Change Data Capture infrastructure and handle ETL operations, while Connector Services are external integration services for POS/ERP systems.

3.1 CDC Agents (/cdc/agents/)

Pattern: cdc-{agent-name}-agent

Description: CDC Agents are ETL agents that connect to different store databases (which may have different structures for different companies), extract data, transform it into a standardized format, and load it into the platform's unified database. Each agent is typically designed to handle a specific database structure or company schema.

Key Characteristics:

  • Part of the CDC ETL infrastructure
  • Connect to replicated store databases on central SQL Server
  • Extract data from databases with potentially different structures
  • Transform data into standardized format
  • Load transformed data into unified platform database
  • Handle schema differences between different companies/stores

Examples:

  • cdc-sepidar-agent - CDC ETL agent for Sepidar system database structure
  • cdc-holiday-agent (from holyday_agent) - CDC ETL agent for Holiday system database structure
  • cdc-greenware-agent - CDC ETL agent for Greenware system database structure
  • cdc-baran-agent - CDC ETL agent for Baran system database structure
  • cdc-paliz-agent - CDC ETL agent for Paliz system database structure
  • cdc-new-agent (from cdcnew) - New CDC ETL agent implementation

3.2 CDC Infrastructure

Pattern: cdc-{component-name}

Description: CDC Infrastructure components provide the underlying infrastructure and tooling for the CDC ETL pipeline.

Examples:

  • cdc-debezium - Debezium-based CDC infrastructure component
  • cdc-supervisor (from agent-controller) - Supervisor/orchestrator for CDC agents
  • cdc-sdk - SDK for developing CDC agents and components

4. Mobile Applications (/apps/shevi/)

4.1 Main Mobile Apps

Pattern: mobile-app-{version}

Examples:

  • mobile-app-v2 (from mobile-app)
  • mobile-app-v3
  • collector-mobile-app
  • courier-mobile-app

4.2 Mobile App Templates (/mobile-app-v3-templates/)

Pattern: {template-name}-mobile-app-v3-template

Examples:

  • coffee-mobile-app-v3-template
  • market-mobile-app-v3-template
  • market-mobile-app-v3-template-v2
  • food-mobile-app-v3-template
  • clothes-mall-mobile-app-v3-template
  • holiday-mobile-app-v3-template
  • vanmart-mobile-app-v3-template
  • super-milad-mobile-app-v3-template
  • cucina-mobile-app-v3-template
  • 60online-mobile-app-v3-template (from iranian-template)
  • senikpet-mobile-app-v3-template
  • bookmall-mobile-app-v3-template
  • tandis-mobile-app-v3-template
  • man-market-mobile-app-v3-template

4.3 Storefront Applications

Pattern: storefront-{version} or {name}-storefront

Examples:

  • storefront-v2 (from landing-v2)
  • zegal-storefront (from zegal-landing)
  • storefront-builder-v2 (from page-builder)

4.4 Mobile App Components

Pattern: mobile-app-v3-components

5. Admin Panels (/admin-panels/)

Pattern: admin-panel-{version}

Examples:

  • admin-panel-v2 (from v2-1/admin-panel-app)
  • admin-panel-v3 (from v4)

6. SDKs

Pattern: {sdk-name}-sdk-{language}-{version} or {prefix}-sdk

Examples:

  • eshop-sdk-go-v1
  • eshop-sdk-js
  • cdc-sdk

7. Documentation

Pattern: {doc-type}-docs

Examples:

  • technical-docs
  • user-guide-docs
  • api-docs (from api-documentation)

8. Helper Tools (/helpers/)

Pattern: {tool-name} or {tool-name}-toolkit

Examples:

  • data-entry-toolkit
  • migrator-toolkit (from eshop-migrator)

9. Infrastructure & Utilities

Pattern: {component-name} or {service-name}-service

Description: Infrastructure and utility services that provide foundational capabilities for the platform, including communication infrastructure, workflow management, and other platform-level utilities.

9.1 Communication Infrastructure

Pattern: {service-name}-service

Description: Communication infrastructure services that manage connections between platform and customer-deployed services, handling WebSocket connections and routing requests.

Examples:

  • toonel-service - WebSocket management service that is installed on both store servers (client) and platform server (server). It manages WebSocket connections and routes requests between the platform and connectors on store servers. Connectors can use this service if they haven't implemented WebSocket directly, enabling communication with the platform and bypassing firewall and NAT issues at store locations.

9.2 Other Infrastructure & Utilities

Pattern: {component-name}

Examples:

  • workflows - Workflow management
  • runner - CI/CD runner
  • php-xfpm - PHP-FPM infrastructure component

10. Other Projects

Pattern: {project-name}

Examples:

  • (No repositories in this category)

Naming Rules & Guidelines

1. Use Hyphens, Not Underscores

  • ✅ Correct: core-service, mobile-app-v3
  • ❌ Wrong: core_service, mobile_app_v3

2. Use Lowercase Only

  • ✅ Correct: auth-service, product-service
  • ❌ Wrong: Auth-Service, ProductService

3. Be Descriptive but Concise

  • ✅ Good: zarinpal-payment-service
  • ❌ Too verbose: zarinpal-payment-gateway-adapter-service
  • ❌ Too vague: payment-service

4. Version Suffixes

  • Use -v{number} for major versions (e.g., mobile-app-v3, admin-panel-v3)
  • Use -v{number}-{subversion} for sub-versions (e.g., market-mobile-app-v3-template-v2)

5. Category Prefixes

Use prefixes to group related services:

  • cdc-* for Change Data Capture services
  • finance-* for finance-related services (payment and credit gateways)
  • mobile-app-* for mobile application templates

6. Service Suffix

Always use -service suffix for microservices:

  • core-service, auth-service
  • core, auth (unless it's not a service, like SDKs or docs)

Complete Repository List

This section lists all repositories with their GitLab names and corresponding GitHub names according to the naming standard.

1. Core Services

GitLab Name GitHub Name Notes
core-service core-service
product-service product-service
auth-service auth-service
billing-service billing-service
notification-service notification-service
presentation-service presentation-service
delivery-service delivery-service
shipping-service shipping-service
courier-service courier-service
wallet-service wallet-service
promotion-service promotion-service
report-service report-service
comment-service comment-service
credit-service finance-service Renamed from credit-service to finance-service
qanda-service qanda-service
storage-service storage-service
packaging packaging-service
agent-service agent-service
frontier-gateway frontier-service
adapter-service customer-agent-service Legacy naming, consider renaming to customer-service

2. Finance Services

GitLab Name GitHub Name Notes
zarinpal-adapter-service zarinpal-payment-service Should be zarinpal-finance-service
sadad-adapter-service sadad-payment-service Should be sadad-finance-service
saman-adapter-service saman-payment-service Should be saman-finance-service
behpardakht-adapter-service behpardakht-payment-service Should be behpardakht-finance-service
sepehr-adapter-service sepehr-payment-service Should be sepehr-finance-service
stripe-adapter-service stripe-payment-service Should be stripe-finance-service
enovin-adapter-service enovin-payment-service Should be enovin-finance-service
sibank-adapter-service sibank-payment-service Should be sibank-finance-service (credit gateway)

3. Customer-Deployed Connector Services

GitLab Name GitHub Name Notes
darian-endpoint darian-agent-service Should be darian-connector-service
kyansoft-endpoint kyansoft-agent-service Should be kyansoft-connector-service
msnav-endpoint msnav-agent-service Should be msnav-connector-service
sepidar-endpoint sepidar-agent-service Should be sepidar-connector-service
baran-endpoint baran-agent-service Should be baran-connector-service
holiday-endpoint holiday-agent-service Should be holiday-connector-service
paliz-endpoint paliz-agent-service Should be paliz-connector-service
greenware-endpoint greenware-agent-service Should be greenware-connector-service
wira-endpoint wira-agent-service Should be wira-connector-service
dolibarr-endpoint dolibarr-agent-service Should be dolibarr-connector-service
liyam-service liyam-agent-service Should be liyam-connector-service
sepids-service sepids-agent-service Should be sepids-connector-service
marjan-service marjan-agent-service Should be marjan-connector-service

4. Platform Connector Services

GitLab Name GitHub Name Notes
tipax-service tipax-service Should be tipax-connector-service
miare miare-service Should be miare-connector-service
alopeyk-service alopeyk-service Should be alopeyk-connector-service

5. Sync Services

GitLab Name GitHub Name Notes
sync-service sync-service

6. CDC Agents

GitLab Name GitHub Name Notes
sepidar_agent cdc-sepidar-agent
holyday_agent cdc-holiday-agent
greenware-agent cdc-greenware-agent
baran_agent cdc-baran-agent
paliz_agent cdc-paliz-agent
cdcnew cdc-new-agent

7. CDC Infrastructure

GitLab Name GitHub Name Notes
debezium cdc-debezium
agent-controller cdc-supervisor
sdk cdc-sdk

8. Mobile Applications

GitLab Name GitHub Name Notes
mobile-app mobile-app-v2
mobile-app-v3 mobile-app-v3
collector_mobile_app collector-mobile-app
courier_mobile_app courier-mobile-app

9. Mobile App Templates

GitLab Name GitHub Name Notes
coffee-template coffee-mobile-app-v3-template
market-template market-mobile-app-v3-template
market-template-v2 market-mobile-app-v3-template-v2
food-template food-mobile-app-v3-template
clothes-mall-template clothes-mall-mobile-app-v3-template
holiday-template holiday-mobile-app-v3-template
vanmart-template vanmart-mobile-app-v3-template
super-milad-template super-milad-mobile-app-v3-template
cucina-template cucina-mobile-app-v3-template
iranian-template 60online-mobile-app-v3-template
senikpet-template senikpet-mobile-app-v3-template
bookmall-template bookmall-mobile-app-v3-template
tandis-template tandis-mobile-app-v3-template
man-market-template man-market-mobile-app-v3-template

10. Storefront Applications

GitLab Name GitHub Name Notes
landing-v2 storefront-v2
zegal-landing zegal-storefront
page-builder storefront-builder-v2

11. Mobile App Components

GitLab Name GitHub Name Notes
mobile-app-v3-components mobile-app-v3-components

12. Admin Panels

GitLab Name GitHub Name Notes
v4 admin-panel-v3
admin-panel-app admin-panel-v2

13. SDKs

GitLab Name GitHub Name Notes
eshop-sdk-go-v1 eshop-sdk-go-v1
eshop-sdk-js eshop-sdk-js
sdk cdc-sdk ✅ (listed in CDC Infrastructure)

14. Documentation

GitLab Name GitHub Name Notes
technical technical-docs
user-guide user-guide-docs
api-documentation api-docs

15. Helper Tools

GitLab Name GitHub Name Notes
data-entry-toolkit data-entry-toolkit
eshop-migrator migrator Should be migrator-toolkit

16. Infrastructure & Utilities

GitLab Name GitHub Name Notes
toonel-service toonel-service ✅ Communication Infrastructure
workflows workflows
runner runner
php-xfpm php-xfpm

Migration Mapping Examples

Current Inconsistencies to Fix

  1. Connector Services Naming:

    • Customer-Deployed Connectors: Mix of *-agent-service and *-endpoint (legacy naming) → Should be *-connector-service
    • Platform Connectors: Currently use *-service pattern (e.g., tipax-service, miare-service, alopeyk-service) → Should be *-connector-service for consistency
    • Sync Services: Already correctly use sync-service pattern ✅
  2. Finance Services Naming:

    • Current: Mix of *-payment-service and *-credit-service
    • Standard: All should use unified pattern *-finance-service
    • Examples: zarinpal-finance-service, sadad-finance-service, sibank-finance-service
  3. Inconsistent CDC Naming:

    • Current: All correctly use cdc-* prefix
    • Status: ✅ Already standardized
  4. Template Naming:

    • Current: All correctly use *-mobile-app-v3-template
    • Status: ✅ Already standardized

Future Extensibility

Adding New Service Categories

When adding new service categories, follow this pattern:

  1. Define the category prefix (if needed)
  2. Document the naming pattern
  3. Add examples to this document
  4. Update the naming logic in code

Example: Adding a New Category

If you add a new category like "Analytics Services":

### 11. Analytics Services (`/analytics/`)
**Pattern**: `analytics-{service-name}-service`

Examples:
- `analytics-event-service`
- `analytics-reporting-service`

Implementation Notes

Automated Naming Generation

The naming standard can be implemented in code using pattern matching:

func GenerateGitHubName(gitlabPath string, category string) string {
    // Extract service name from path
    // Apply category-specific rules
    // Return standardized name
}

Validation Rules

All repository names must:

  1. Be 1-100 characters long
  2. Contain only lowercase letters, numbers, and hyphens
  3. Start and end with alphanumeric characters
  4. Not contain consecutive hyphens
  5. Follow the category-specific pattern

Summary Table

Category Pattern Example Description
Core Services {name}-service core-service Core business microservices
Finance Services {gateway}-finance-service zarinpal-finance-service Financial gateway services (payment and credit gateways)
Connector Services External integration services
└─ Customer-Deployed {provider}-connector-service darian-connector-service Connector services installed on customer servers (on-premise, WebSocket-based) for POS/ERP/Enterprise systems
└─ Platform Connector {provider}-connector-service tipax-connector-service Connector services deployed in platform infrastructure for external third-party platforms
└─ Sync Services {name}-service or sync-service sync-service Data synchronization services installed on customer servers (on-premise) that sync data to eShop platform
CDC Services ETL pipeline for processing replicated store databases
└─ CDC Agents cdc-{name}-agent cdc-sepidar-agent ETL agents that extract, transform, and load data from different store database structures into standardized format
└─ CDC Infrastructure cdc-{component} cdc-debezium CDC ETL infrastructure components (supervisor, SDK, etc.)
Mobile Apps mobile-app-{version} mobile-app-v3 Mobile application repositories
Mobile Templates {name}-mobile-app-v3-template market-mobile-app-v3-template Mobile app template repositories
Storefronts storefront-{version} or {name}-storefront storefront-v2 Storefront/web frontend applications
Admin Panels admin-panel-{version} admin-panel-v3 Admin panel applications
SDKs {name}-sdk-{lang}-{version} or {prefix}-sdk eshop-sdk-go-v1 Software development kits
Documentation {type}-docs technical-docs Documentation repositories
Helpers {name} or {name}-toolkit migrator-toolkit Helper tools and utilities
Infrastructure & Utilities {component-name} or {service-name}-service toonel-service Infrastructure services and utilities (communication infrastructure, workflows, runners, etc.)

Version History

  • v2.11 (2025-11-08): BREAKING CHANGE - Unified Connector Services naming: Changed Platform Connector Services pattern from {provider}-service to {provider}-connector-service for consistency with Customer-Deployed Connector Services. All connector services now use the same *-connector-service pattern. The difference is in the deployment model (platform infrastructure vs. customer servers), not in the service type.
  • v2.10 (2025-11-08): Removed dolibarr-adapter-service from repository list: Removed dolibarr-adapter-service from "Customer-Deployed Connector Services" category as it's no longer part of the repository migration.
  • v2.9 (2025-11-08): Removed sika-erp from repository list: Removed sika-erp from "Other Projects" category as it's no longer part of the repository migration.
  • v2.8 (2025-11-08): Added Complete Repository List: Created comprehensive section listing all repositories from repositories.json with their GitLab names and corresponding GitHub names, organized by category. This provides a complete reference for all repository mappings and highlights naming inconsistencies that need to be fixed.
  • v2.7 (2025-11-08): Enhanced Infrastructure & Utilities section: Added Communication Infrastructure subcategory and moved toonel-service from "Other Projects" to Infrastructure & Utilities. Added detailed description explaining Toonel as a WebSocket management service that routes requests between platform and connectors, helping connectors bypass firewall and NAT issues.
  • v2.6 (2025-11-08): Updated Helper Tools naming: Changed migrator (from eshop-migrator) to migrator-toolkit to follow the {tool-name}-toolkit pattern for better consistency with other helper tools.
  • v2.5 (2025-11-08): Enhanced CDC Services documentation: Added detailed architecture overview explaining CDC as an ETL pipeline that processes replicated store databases with different structures, transforms them into standardized format, and loads into unified platform database. Updated descriptions to clarify CDC's role in the platform architecture.
  • v2.4 (2025-11-08): Added Sync Services category: Created separate "Sync Services" subcategory under Connector Services for customer-deployed data synchronization services. Moved sync-service from Platform Connector Services to Sync Services, as it's installed on customer servers (on-premise) and syncs data to eShop platform.
  • v2.3 (2025-11-08): Reorganized Connector Services: Split Connector Services into two subcategories - Customer-Deployed Connector Services (on-premise, *-connector-service) and Platform Connector Services (platform infrastructure, *-service). Moved tipax-service, miare-service, alopeyk-service, and sync-service from "Other External Services" to Platform Connector Services.
  • v2.2 (2025-11-08): BREAKING CHANGE - Unified Finance Services naming: Changed all finance services to use unified pattern *-finance-service instead of separate *-payment-service and *-credit-service patterns. This provides better consistency and simplicity. Service type (payment vs credit) is documented in service descriptions.
  • v2.1 (2025-11-08): BREAKING CHANGE - Reorganized Finance Services: Created unified "Finance Services" category that includes both Payment Gateway Services and Credit Gateway Services. Renamed sibank-payment-service to sibank-credit-service to accurately reflect its purpose (credit gateway, not payment gateway).
  • v2.0 (2025-11-08): BREAKING CHANGE - Renamed Agent Services to Connector Services (*-agent-service*-connector-service) for better clarity and to avoid confusion with CDC Agents. Updated all examples and documentation to reflect the new naming standard.
  • v1.1 (2025-11-08): Added detailed descriptions for Agent Services and CDC Agents, clarified differences between Agent Services (POS/ERP integration) and CDC Agents (data synchronization)
  • v1.0 (2025-11-08): Initial standard definition based on current repository structure