NIVON Commerce
Premium clothing store with branch-aware stock, GST-correct orders and an owner console — storefront, admin and API on one platform.
- Type
- Commerce platform
- My role
- Product & engineering
- Platforms
- Web storefront · Admin console
- Status
- In progress
Overview
NIVON Commerce is a premium menswear store built on Medusa 2. One catalog and one price list serve every branch, while each branch keeps its own stock and ships the orders for the states it covers. Shoppers browse a fast, SEO-first storefront; owners and branch staff run orders, returns, discounts, homepage content and GST reports from a separate admin console.
The problem
A clothing brand with several branches needs one online store, but stock, shipping and GST all depend on which branch fulfils an order. Off-the-shelf store builders can't model branches, and their tax reports rarely match what an accountant files.
Architecture
Next.js 16 · SSR
React Router 8
Razorpay · COD
Medusa 2 · workflows · custom modules
Catalog · orders
Events · cache · locks
Subscribers · jobs
- Commerce API
- Medusa 2 with custom modules — wishlist, content, looks, staff, size charts, GST tax and payments
- Storefront
- Next.js 16, server-rendered for SEO, with caches refreshed the moment the admin saves
- Admin console
- React Router 8 app for orders, returns, discounts, reports, departments, homepage and looks
- Worker
- Medusa worker mode for events, subscribers and scheduled jobs, separate from the API
- Operations
- Docker images, Caddy for TLS and nightly database backups with a tested restore
Modules
- Departments, categories, collections and occasions
- Branches as stock locations with their own stock
- Order routing by delivery state
- Phone OTP sign-in for shoppers
- Razorpay and cash on delivery
- Tax-inclusive GST pricing
- Pack, ship, deliver and COD collection
- Refunds, 15-day returns and order tracking
- Discount codes
- Wishlist and Shop the look
- Editable homepage
- Sales, product and GST reports with CSV export
Engineering decisions
The guarantees I designed in, not bolted on.
- 01
A branch is a stock location
Every branch shares one catalog and price list but holds its own stock. Each branch's service zones cover the states it ships to, so an order routes to the right branch by its delivery address.
- 02
Branch staff see only their branch
Medusa's role-based access is enterprise-only, so staff roles and permissions are a custom module. Every admin route checks them and scopes orders, stock and reports to the user's branch.
- 03
GST reports an accountant can file
Reports reuse Medusa's own tax-inclusive arithmetic so totals match each order. The register splits IGST from CGST + SGST by delivery state, and a return is booked as a credit note on the day it arrives, so a closed month never changes.
- 04
One rule hides a department
The owner can switch Men, Women or Kids off. A single SQL rule hides every product in that category tree at any depth — from listings, search, best sellers, looks, wishlists and the sitemap.
- 05
Caches that refresh on save
Product, category, homepage and look changes call an authenticated revalidation endpoint, so the storefront updates at once. If it can't be reached, the save still succeeds and the short cache expires on its own.
- 06
OTP limits per shopper, not per server
The storefront forwards each shopper's IP with an internal key, so sign-in rate limits apply to the person sending codes instead of locking out the whole site.
Technology
- Medusa 2
- Node.js
- TypeScript
- PostgreSQL
- Redis
- Next.js 16
- React 19
- React Router 8
- TanStack Query
- Tailwind CSS
- Razorpay
- Turborepo
- Docker
- Caddy
- GitHub Actions
Engineering quality
- Lighthouse 100 for accessibility, SEO and best practices on the storefront
- Unit tests across the API, storefront and admin, plus API end-to-end tests
- GitHub Actions CI for types, lint, tests, end-to-end runs and Docker builds
- Security headers and a content security policy; architecture decisions recorded as ADRs