Marketplace REST API
Full marketplace API: Golang, Gin, MySQL, JWT. 7 modul, clean architecture, pagination, multi-image upload, atomic transactions.
Why I Built It
I wanted hands-on proof that I could design a backend from scratch, not just consume APIs someone else built. Evermos x Rakamin's brief was open enough to let me make real architectural calls instead of following a fixed spec.
Project Goal
Build a marketplace REST API that could plausibly sit behind a real e-commerce app: sellers manage stores and products, buyers browse and transact, everything auth-gated and consistent even under concurrent writes.
What It Does
- check_circleJWT authentication with role-based access control
- check_circleStore, address, and category management per seller
- check_circleMulti-image product upload with pagination and price-range filtering
- check_circleAtomic transactions for order/checkout consistency
Key Screens
Auth & User
JWT-based login/register with role checks enforced at the middleware layer, not scattered across handlers.
Store & Product
Sellers manage store profiles and products with multi-image upload and category assignment.
Transaction
Checkout flow wrapped in atomic DB transactions so a failure partway through never leaves stock or balances inconsistent.
Tech Stack
Clean Architecture (Handler-Service-Repository) was the deliberate choice here over a quick MVC dump: it keeps business logic in the Service layer testable and independent of Gin's request/response types, so swapping the HTTP framework later wouldn't touch the domain logic at all. Atomic transactions on the Transaction module specifically guard against the classic race condition where two requests read the same stock count before either writes back.