A Hybris-grade commerce platform, built end to end.
Capsule Commerce is a headless, API-first platform with the architecture of SAP Hybris and commercetools, without the licensing. I designed, built and adversarially audited it alone.
How it fits together
A multi-module Spring Boot 4 backend on Java 21, a Next.js storefront, a React 19 backoffice and a stateless Python AI service. Six services, built in CI and deployed as containers.
Search runs BM25 and vector retrieval. The AI sidecar handles natural-language queries and rescues zero-hit ones, and an AI outage never blocks checkout.
The parts worth showing
A couple of dozen real subsystems. These are the ones people lean in for.
Hybrid and natural-language search
OpenSearch blends BM25 keyword and kNN vector scores. A stateless LLM sidecar turns plain-English queries into grounded, structured filters and rescues zero-hit searches. An AI outage never blocks checkout.
Multi-vendor selling
A merchant registry with per-seller isolation enforced in the persistence layer, and per-merchant consignments so one order can ship from several sellers.
Business-process engine
Fulfilment, consignment and delivery run as XML-defined processes with wait, branch and loop nodes, cluster locks, and a live flow diagram in the admin with replay, restart and signal controls.
Promotion engine
Eight action types (percentage, fixed, BOGO, bundles, tiered ladders, fixed-price groups) with conditions, vouchers, per-customer caps and proportional per-line attribution. Money is computed on the server.
Visual query builder
A FlexibleSearch-style tool: query any entity with explicit joins and mass-edit, every value parameter-bound, with a sensitive-field blocklist. Results round-trip to CSV that ImpEx reads straight back.
ImpEx import and export
Templated CSV, dry-run validation, row-level transactional import, reference resolution by business code and soft-delete semantics, with one shared column-deriver so exports re-import cleanly.
OAuth2 with RS256 and JWKS
Three grants, asymmetric JWTs published at a JWKS endpoint, refresh-token rotation with reuse detection, HttpOnly refresh cookies, and per-IP, per-client and per-user lockouts.
Pluggable payment SPI
Mock, Stripe and Razorpay chosen by config, recurring mandates, signed idempotent webhooks, money in integer minor units, and refunds that are never falsely marked done.
Typed catalog and inventory
Base and variant products, staged-to-online catalog sync, classification attributes, and stock reservation at checkout with a TTL reaper, so concurrent checkouts cannot oversell.
Cron and jobs engine
Scheduled and on-demand jobs with cluster locking, live progress, abort and retry policies, plus a sandboxed Groovy scripting console.
Built like production, audited like an adversary
What separates a portfolio project from a platform: I run adversarial reviews on my own code and act on what they find.
backend tests: 1,000 in Java on real PostgreSQL via Testcontainers, 18 in Python.
Audited like an adversary
A six-lane security and architecture review of my own code found real issues. All fixed.
- Closed an order-code enumeration oracle on the storefront.
- Fixed optimistic-lock lost updates that weakened brute-force lockout.
- Clamped an unbounded discount overshoot in the promotion engine.
- Concurrency discipline: pessimistic lock-then-refresh, atomic conditional-update counters and optimistic versioning. No silent lost updates on money paths.
- The server computes money. Client amounts are never trusted, and entity-level invariants hold even through the generic CRUD path.
- Fail-open by design. Search and AI degrade gracefully, and nothing external can block an order.
- Dev and prod parity. Tests run on real PostgreSQL through Testcontainers with Flyway and schema validation.
What it is, and what it isn't
This is a solo reference platform engineered to production patterns, not a system battle-tested at scale.
Deliberate scope today: single-tenant per deployment with seller-level row isolation, no live payment-gateway round-trip test yet, and no automated frontend test suite.
I know where the gaps are because I audit for them. Knowing your system's edges is the senior skill.
Stack
See it running
Both halves run on the same Spring Boot backend: the storefront a shopper sees and the backoffice that runs it.
"Make my lips pop"
A real recording of natural-language search.

The storefront
The home page a shopper lands on. A React backoffice runs alongside it.
Prefer a guided tour? I give a live 30-minute walkthrough over screen-share. Pick a lane or let me drive:
- Checkout with stacked promotions
- The process engine's live flow diagram
- Plain-English search on the real index
- An ImpEx export and re-import round trip