Mannaiah Go is a modular monolith built with Go, DDD, and hexagonal architecture. The repository is organized as a container workspace with independent modules under module/, composed by the core runtime.
Frontend integration is documented through the aggregated API docs at /docs and /openapi.json.
module/core: shared runtime foundation (config, HTTP server, logging, database, messaging, cron, swagger aggregation).module/auth: authentication and authorization integration.module/contacts: contact domain.module/orders: order domain.module/products: product domain.module/assets: asset/storage domain.module/falabella: Falabella integration module.module/syncrecord: centralized sync execution registry and query API.module/membership: auditable consent/membership stamping module.module/analytics: ClickHouse analytics ingestion/bootstrap module for BI fact data.module/email: optional email delivery tracking and webhook module.module/shipping: carrier-agnostic shipping module (quotation, mark generation, dispatch batches, tracking).e2e/: root end-to-end validation flows.
GET /status: health/status endpoint.GET /metrics: Prometheus metrics endpoint (protect this at ingress/network layer).GET /openapi.json: aggregated OpenAPI document from core + modules.GET /docs: API documentation UI.
- Go
1.25.5 - Docker (optional, for containerized runs)
cp .env.example .env
go run ./module/core/cmd/apiThe API listens on CORE_HOST:CORE_PORT (0.0.0.0:8080 by default).
ANALYTICS_ENABLED=trueenables ClickHouse analytics and integration consumers.- Run
POST /analytics/seedonce to backfill ClickHouse fact tables from transactional data. - Analytics no longer exposes CRM-facing routes as of
v2.0.0; the retained module is write-focused infrastructure for BI.
EMAIL_TRACKING_BASE_URLdefines the public base URL for open-tracking pixel injection.- When empty, runtime falls back to
https://<sender-domain>fromEMAIL_SES_FROM_ADDRESS/EMAIL_SENDER_ADDRESS.
Use these env vars to convert tagged assets to .jpg through scheduled jobs:
ASSETS_JPG_WORKER_ENABLEDASSETS_JPG_WORKER_CRONASSETS_JPG_WORKER_TAGS(comma-separated tag names, for examplemarketplaces,feeds)ASSETS_JPG_WORKER_BATCH_SIZEASSETS_JPG_WORKER_JPEG_QUALITYASSETS_JPG_WORKER_TIMEOUT_MS
SHIPPING_TCC_ENABLED=trueenables the TCC provider.SHIPPING_TCC_SANDBOX=truetargets sandbox (https://testsomos.tcc.com.co).SHIPPING_TCC_SANDBOX=falsetargets production (https://somos.tcc.com.co).SHIPPING_TCC_SANDBOX_ACCESS_TOKENis used whenSHIPPING_TCC_SANDBOX=true.SHIPPING_TCC_PRODUCTION_ACCESS_TOKENis used whenSHIPPING_TCC_SANDBOX=false.SHIPPING_TCC_COD_FEE_PERCENTapplies TCC COD fee percent over requested collection amount.SHIPPING_QUOTATION_DISCOUNT_PERCENTapplies a global percentage discount to carrier quotations and exposes both full and discounted values in API responses.
for module in module/core module/auth module/contacts module/orders module/assets module/products module/falabella module/syncrecord module/membership module/analytics module/email module/shipping; do
(cd "$module" && go test ./...)
donego test ./e2e -v -count=1cd module/core
go test ./search -run '^$' -bench BenchmarkSpotlightFanout -benchmem -benchtime=100x -count=1docker build -t mannaiah-go:local .docker run --rm -p 8080:8080 --env-file .env mannaiah-go:localdocker build -f Dockerfile.docs -t mannaiah-go-wiki:local .docker run --rm -p 3001:3001 mannaiah-go-wiki:localSet WIKI_PORT in .env to change the host port used for the docs container.
Set WIKI_ENABLED=true to include the wiki in your deployment stack.
The internal knowledge base is built with Fumadocs and lives in the docs/
directory as a Next.js 16 application.
cd docs
npm install
npm run devThe wiki listens on http://localhost:3001 by default (controlled by WIKI_PORT).
cd docs
npm run build| Variable | Default | Description |
|---|---|---|
WIKI_ENABLED |
false |
Enable the wiki deployment in CI/CD and container stacks. |
WIKI_PORT |
3001 |
Port the docs container listens on. |
- CI/CD is managed by Drone via
.drone.yml. - Validation pipeline runs module tests, e2e tests, and performance benchmark checks.
- Docker images are published to Nexus registry:
- Registry:
docker.niflaot.dev - API repository:
fl-docker/mannaiah-go - Wiki repository:
fl-docker/mannaiah-go-wiki(published whenWIKI_ENABLED=true)
- Registry:
- Drone secrets required for publish:
nexus_usernamenexus_password
- Metrics:
- Prometheus exposition is available at
GET /metrics. - Keep
HTTP_PREFORK=falsewhen you need single-process metric accuracy. - Restrict
/metricsto internal scrapers using proxy/network controls.
- Prometheus exposition is available at
- Tracing:
- Distributed tracing uses OpenTelemetry with OTLP gRPC export support.
- Configure collector endpoint with
TELEMETRY_OTLP_ENDPOINT. - Trace context propagation uses W3C
traceparentacross HTTP and messaging.
TELEMETRY_ENABLEDTELEMETRY_SERVICE_NAMETELEMETRY_SERVICE_VERSIONTELEMETRY_TRACES_ENABLEDTELEMETRY_TRACES_EXPORTERTELEMETRY_OTLP_ENDPOINTTELEMETRY_OTLP_INSECURETELEMETRY_TRACES_SAMPLERTELEMETRY_TRACES_SAMPLER_RATIOTELEMETRY_METRICS_ENABLEDTELEMETRY_METRICS_PATHTELEMETRY_DB_STATS_INTERVAL_MS