← all projects

05project

ecommerce-api

A REST API for e-commerce platforms: catalog, cart, orders and JWT authentication.

ecommerce-api
Year
2024
Type
Open source
Tech stack
Node.jsExpressMongoDB
View source on GitHub

About the project

A complete e-commerce backend: catalog, cart, orders and JWT authentication, structured the way I build production APIs — documented, versioned and testable.

Gallery

  1. 01

    The challenge

    Commerce backends fail at the edges: race conditions in carts, order state machines and auth rules that differ for customers, managers and admins.

  2. 02

    The solution

    A REST API with an explicit order state machine, transactional cart operations, role-based JWT auth and OpenAPI documentation for every endpoint.

  3. 03

    The result

    A backend a frontend team can build against without asking questions — documented, versioned and covered by integration tests on the money paths.

Key features

  • 01Order state machineExplicit transitions from cart to delivered — invalid states are unrepresentable.
  • 02Role-based authCustomer, manager and admin scopes enforced at the route layer with JWT.
  • 03Documented contractAn OpenAPI spec plus a runnable request collection for instant onboarding.

My role

  • API design and implementation
  • Node.js + Express + MongoDB
  • Integration tests on critical flows

Related service

REST & GraphQL APIs