egommerce.
Egommerce · microservices e-commerce platform

The backbone beneath the storefront.

Egommerce is a microservices e-commerce platform written in Go and PHP, deployed on Kubernetes. These six components are its runtime core: an edge gateway, a cache, a message bus, a log pipeline, a datastore, and the one service that knows who its customers are.

Go PHP 8.4 Symfony 8.1 Traefik v3 Redis RabbitMQ PostgreSQL 16 Consul Kubernetes
Topology

One request, four hops, one source of truth

Traffic enters through the gateway, gets authenticated against identity-svc, and lands in PostgreSQL. Along the way it is cached and evented, and every service streams its logs out.

HTTPS :443 HTTP route TCP :5432 Redis AMQP events out to services logs client browser / app api-gateway Traefik v3.7 TLS termination auth plugin identity-svc PHP 8.4 · Symfony 8.1 DDD structure domain: /app/src db-postgres PostgreSQL 16 source of truth migrations api-cache Redis · read cache api-eventbus RabbitMQ · async events api-logger FluentD → Loki / Grafana
sync request path async / streams api-logger collects streams from every service
Services

Six deployables, each with one job

Every one ships as its own Docker image with Kubernetes manifests in stack/deploy/k8s/, and every one registers in Consul where applicable.

Edge

api-gateway

Every request enters here. A Traefik v3 edge instance terminates TLS and routes to the right service, and a custom auth plugin checks tokens before a call reaches one.

  • engineTraefik v3.7
  • guardplugin-egommerce-auth
  • tlsstack root CA
Cache

api-cache

Redis in front of repeated reads: hot lookups hit memory instead of the database, and services reach it through a Redis client in the shared go-api-pkg.

  • engineRedis
  • roleread / write cache
  • clientgo-api-pkg
Transport

api-eventbus

RabbitMQ message queue. Services publish domain events and pick each other up asynchronously, so a change in one service reaches the rest without a synchronous call.

  • engineRabbitMQ
  • protocolAMQP 0-9-1
  • modelpublish / subscribe
Observability

api-logger

FluentD collection point. The service carries Dockerfile variants wired for Grafana, Loki, Promtail and Prometheus, so each build picks the pipeline the stack needs.

  • engineFluentD
  • variantsLoki · Promtail
  • metricsPrometheus + Grafana
Data

db-postgres

PostgreSQL 16, the single source of truth. Schema changes roll out through migrations kept in stack/deploy/db_migrations/, versioned with the rest of the stack.

  • enginePostgreSQL 16
  • port5432
  • migrationsdb_migrations/
Identity

identity-svc

Authentication and customer identity, written in PHP as a DDD-driven Symfony application. It owns the customer domain and issues the tokens the gateway plugin verifies.

  • languagePHP ≥ 8.4
  • frameworkSymfony 8.1
  • patternDDD (app/src)
Inside identity-svc/app/src

A domain service with real boundaries

The source tree splits into three layers, and the direction of imports only ever flows inward: the infrastructure depends on the domain, never the other way around.

Domain

Entities, rules and events. Pure business logic, free of any framework import.

Entity/ Enum/ Event/ Exception/ Repository/ Service/ State/ ValueObject/

Application

Use cases. Commands, controllers, DTOs and event listeners that translate HTTP into domain work.

Command/ Controller/ DTO/ EventListener/ Handler/

Infrastructure

Symfony glue. Doctrine ORM, Redis access, HTTP endpoints and persistence wiring the domain to the real world.

API/ ORM/ Persistence/ Redis/ Service/
Customer.php · AggregateRoot CustomerController HealthController Kernel.php
Deploy

The whole stack in four commands

~/egommerce/stack
$ make certs # TLS certificates for the gateway edge $ make init # k8s dependencies and secrets $ make up # start the stack $ make down # stop the stack

Run these from the stack/ directory. Kubernetes manifests for all six services live in stack/deploy/k8s/ and database migrations in stack/deploy/db_migrations/.