A multi-vendor marketplace case study.
Cartlabs is a deployable full-stack system running on self-hosted Kubernetes. I built it as a hands-on lab for experimenting with infrastructure and backend tools while solving real systems problems such as transactional checkout, authorization, service boundaries, and operational recovery.
Modular core, measured extraction.
The commerce core stays transactional. Search is the first extracted boundary because it tolerates eventual consistency.
Request, state, events, extraction.
Deployables run inside self-hosted k3s. Synchronous commerce stays authoritative in PostgreSQL; projections and delivery move through explicit boundaries.
web · api · worker · search · mock payment
Request path
Browser traffic stays REST at platform edge.
State plane
Commerce state and short-lived coordination.
Async delivery
Committed facts leave the request path safely.
Search boundary
Extracted retrieval, PostgreSQL visibility authority.
Worker-published catalog events update the projection. If gRPC is unavailable, API falls back to PostgreSQL text search.
Payment callback
External behavior stays behind a signed interface.
Checkout under contention.
One checkout crosses inventory, payment, orders, and async delivery without losing state between boundaries.
- Read authoritative stateReload published products, approved stores, prices, and available stock from PostgreSQL.
- Reserve under lockUse row-level locks and atomic updates so concurrent checkout cannot oversell inventory.
- Create the order graphCreate one parent purchase and one seller order per store, with immutable item snapshots.
- Verify paymentValidate the mock provider signature, timestamp, reference, amount, currency, and event ID.
- Publish and fulfillCommit domain state with an outbox fact, then let workers deliver events while sellers advance owned orders.
What to inspect
The mechanics that make this more than a catalog mockup.
Built for inspection.
Cross-cutting choices keep behavior testable and explainable.
Explicitly not production commerce.
The project demonstrates credible system behavior while keeping external integrations and operational scope honest.
- Payment is simulated; no live financial provider is connected.
- IDR only; shipping, email, refunds, and promotions are deferred.
- Search is a read projection; PostgreSQL remains final authority.
- Seeded demo data is resettable and quick-login is opt-in.