Skip to main content
Under Reviewv0.1.0-alpha

Modules Overview

AxCom is organized into independent core modules. Each module owns its domain — its data model, business logic, HTTP controllers, repository contract, and events. Modules communicate with each other exclusively through the event bus; they do not import each other directly.


Core Modules

For detailed development status of each module, see Project Status.

ModuleStatusDescriptionSource
AuthenticationUnder ReviewUser registration, login, JWT sessions, role-based accessinternal/core/auth
CartUnder ReviewCart management, item enrichment, guest cart mergeinternal/core/cart
CatalogUnder ReviewProducts, variants, images, discounts, bulk ops, reviewsinternal/core/catalog
InventoryUnder ReviewStock availability, reservations, history, adjustmentsinternal/core/inventory
OrdersUnder ReviewOrder creation, lifecycle state machine, guest checkoutinternal/core/orders
PaymentsUnder ReviewPayment intents, refunds. No gateway integration-tested.internal/core/payments
ShippingUnder ReviewRate calculation, shipment creation. No real provider tested.internal/core/shipping

Module Conventions

Every module follows the same internal structure:

internal/core/<module>/
├── controller.go # HTTP handlers and request validation
├── service.go # Business logic and Service interface
├── repository.go # Storage port (interface)
├── model.go # Domain models and DTOs
├── errors.go # Sentinel error definitions
├── routes.go # Route registration
├── README.md # Lightweight orientation (links here)
└── tests.md # Unit and integration test documentation

Larger modules (catalog, inventory) are further split into features/ subdirectories, each with their own controller, service, and repository.


Testing Convention

Each module keeps a tests.md file in its source directory alongside its code. This covers:

  • Unit test cases and what they validate
  • Integration test setup and dependencies
  • How to run tests for that specific module

This keeps test documentation co-located with the code it describes, making it easy to find without leaving the module directory.


Event Bus

Modules publish and subscribe to events through a shared event bus. Key cross-module events:

EventPublisherSubscribers
order.createdOrdersInventory (reserve stock)
payment.succeededPaymentsOrders (mark paid), Inventory (finalize reservation)
payment.failedPaymentsInventory (release reservation)
order.shippedShippingNotifications (send tracking to customer)