← All case studies
PaymentsCompleted

E-Commerce REST API.

Catalog, Checkout & Payments Backend

A production-style commerce backend: catalog, cart and orders with Stripe Checkout. Order state only changes after a webhook's signature is verified.

  • —Catalog, cart and order management over JPA / Hibernate
  • —Stripe Checkout with signature-verified webhooks
  • —JWT auth with BCrypt hashing and role-based access

01

Problem & goal

A commerce backend is a domain everyone builds — and most builds trust the wire: hand-written converters that drift, API contracts nobody can read, and order state that changes on whatever webhook arrives. This project is the same domain built with the trust checks in place.

02

How it works

  • —Clients browse the catalog and manage a cart; checkout hands payment over to Stripe.
  • —Cart becomes an order through JPA / Hibernate, with the schema managed by Flyway migrations.
  • —Stripe webhooks are signature-verified before any order state changes.

Architecture

  1. Client
  2. JWT + RBAC
  3. Orders
  4. Stripe Checkout
  5. Verify Signature
  6. MySQL
05 /

Webhook signature checked before state changes.

VISUALS

Project screens

Catalog & checkout

Project screenshot pending

03

Security model

  • —JWT authentication with BCrypt-hashed passwords.
  • —Role-based access control separating admin and customer routes.
  • —Webhook signature verification as the gate on payment state.

04

Built with

Java 17Spring BootSpring SecuritySpring Data JPAHibernateMySQLFlywayStripe APIMapStructOpenAPI

05

Challenges & tradeoffs

Trust nothing from the wire

A forged webhook could mark an order paid for free. Signature verification runs before any mutation, and unverified events are rejected outright.

Mapping at scale

Hand-written converters drift as fields change. MapStruct generates DTO/entity mapping, so a renamed field fails at compile time — not in production.

Schema as a contract

Ad-hoc DDL changes break the team's understanding of the data model. Flyway versioned migrations and OpenAPI-generated docs mean every schema and API change is explicit, reviewable, and reproducible.

06

Decisions

Webhook signature verification before any order mutation

Webhook signature verification before any order mutation — a forged event never touches state.

MapStruct for DTO/entity mapping instead of hand-written converters.

MapStruct for DTO/entity mapping instead of hand-written converters.

Flyway for versioned schema and OpenAPI so API contracts are explicit, not guessed.

Flyway for versioned schema and OpenAPI so API contracts are explicit, not guessed.

Next