Back to Projects
Next.js Fashion Storefront & Shopping Experience
Click to Expand
Feature 1 of 3

Next.js Fashion Storefront & Shopping Experience

High-performance customer storefront featuring responsive product catalog, coupon promotions, pre-order reservation engine, and PromptPay checkout.

Nida

Fullstack Developer

E-Commerce Platform for Fashion Brand

An e-commerce platform engineered on a Turborepo monorepo architecture, featuring a Next.js customer storefront, a React back-office admin portal, dual decoupled NestJS APIs, and PostgreSQL with Prisma ORM. Powered by automated background queues via BullMQ and Redis for auto-cancellation of unpaid orders and stock restocking, accompanied by a Dual-Token authentication system with Refresh Token Rotation and Redis session invalidation.

Technologies Leveraged

TurborepoTurborepoNext.jsNext.jsNestJSNestJSPostgreSQLPostgreSQLPrismaPrismaRedisRedisBullMQBullMQDockerDockerTypeScriptTypeScriptTailwindCSSTailwindCSS

The Problem & Challenge

E-commerce retail faces severe operational challenges: stock-hoarding by unpaid orders and bots locking up inventory, unreviewed return requests leading to customer dissatisfaction, payment gateway webhook race conditions, and vulnerabilities in administrative access that could compromise customer financial transactions and stock accuracy.

The Solution

I engineered a unified Turborepo monorepo with automated background job queues using @nestjs/bullmq and Redis to manage order lifecycle timeouts (auto-cancelling unpaid orders and restocking within 15 mins for PromptPay). Additionally, I implemented a Dual-Token authentication architecture featuring Refresh Token Rotation with token reuse detection, one-time token admin invitation onboarding, a pro-rated net price calculation engine for partial refunds, and Omise payment webhook idempotency.

Technical System Architecture

1

Turborepo Monorepo structure managing Next.js Storefront, React Admin Portal, NestJS Store API, NestJS Admin API, and shared Prisma/Zod validation packages.

2

BullMQ & Redis 7 background worker cluster managing delayed jobs for unpaid order auto-cancellation, 48-hour return review timeouts, and 5-day delivery auto-completion.

3

Dual-Token Authentication (15-min Access Token + 7-day Refresh Token) with Token Family Rotation, replay attack revocation, and Redis-backed session invalidation.

4

Secure Admin Onboarding via Redis-backed One-Time Setup Tokens (48h TTL) sent through automated email invitations without hardcoded initial passwords.

5

Pre-Order reservation quotas, Coupon abuse-prevention engine, pro-rated net cost refund ledger, and weight-based shipping matrix.

6

PostgreSQL relational database with Prisma ORM, implementing comprehensive audit trails (StockMovement and AdminAuditLog) for full operational traceability.

Key System Highlights

Automated Order Lifecycles

BullMQ & Redis delayed workers handle auto-cancellation, restocking, and return timeouts automatically.

Dual-Token Authentication

15-min JWTs + 7-day Refresh Tokens with token rotation, replay attack detection, and instant multi-device revocation.

Turborepo Modular Monorepo

Decoupled Next.js storefront, React admin back-office, and separate NestJS APIs sharing Prisma and Zod packages.

Pro-Rated Refund Ledger

Automated item-level net cost breakdown ensuring precise partial refunds and immutable transaction audit trails.