Rakib Hassan - Full-Stack Developer
Projects
Blog
About
Contact
RESUMEGITHUB
Back to ProjectsProjectsE-Commerce Solution

InputGears—TechGadgetStore

A production-grade e-commerce engine designed around complex multi-warehouse inventory, 4-tier role-based operations, and real-time checkout with sub-50ms Redis caching and Stripe webhooks.

Client

Independent Build

Year

2025

Role

Lead Full Stack Developer

LiveSource
Input Gears — Tech Gadget Store — case study by Rakib Hassan, Full-Stack Developer
0%

Type Safety

0ms

State Updates

Powered by Upstash Redis Caching

0/100

Performance Score

The Challenge

Building a complex shopping cart system that persists state across reloads without hydration errors, while ensuring secure user authentication and inventory synchronization with a PostgreSQL database.

Technologies used

Frontend
(7)
Next.js 16TypeScriptTailwind CSS v4Shadcn UIFramer MotionZustandRecharts
Backend
(5)
Server ActionsBetter-AuthStripe WebhooksUpstash RedisZod Validation
Database
(2)
PostgreSQLPrisma ORM
DevOps
(2)
VercelCloudinary

The Solution

→ Zustand state management for instant cart interactions. → Better-Auth for secure, type-safe credential & social logins. → Next.js 16 App Router + Prisma ORM for ACID-compliant order transactions. → Stripe integration for secure webhook-based payments.

typescript.ts
Loading code...

System Architecture & Security

src/Domain-Driven Design (DDD)
src/├── app/                  # Next.js App Router│   ├── (admin)/          # Secure Dashboard Routes│   ├── (home)/           # Public Storefront│   └── api/              # Backend API & Webhooks├── components/           # Global Reusable UI├── lib/                  # Core Configurations│   ├── prisma.ts         # Database ORM Client│   └── redis.ts          # Upstash Caching Layer└── modules/              # Domain-Driven Core (DDD)    ├── admin/            # RBAC & Inventory Logic    ├── auth/             # Better-Auth Integration    ├── cart/             # Zustand State & Actions    ├── checkout/         # Stripe Payment Flows    └── products/         # Catalog & Search Logic
swipe →

Security model

Role-Based Access Control

SUPER_ADMIN

Full system and database access.

MANAGER

Inventory, order fulfillment, and coupon management.

CONTENT_EDITOR

Product descriptions and review moderation.

USER

Cart, wishlist, and personal order history.

Secured via Better-Auth sessions and middleware edge-routing.

Key Decisions

Why Better Auth over Clerk?

Full control over auth logic, no vendor lock-in, type-safe session management.

Why Upstash Redis?

Serverless-compatible rate limiting and caching without managing infrastructure.

Why Domain-Driven Modules?

Features scale independently. Each module owns its own logic — easier to maintain and extend.

What I Learned

Hardest Part

Multi-role access control with 4 permission levels across storefront and admin — getting the middleware logic right took significant planning.

Biggest Insight

Redis caching strategy matters more than raw database optimization for read-heavy e-commerce pages.

Do Differently

I would implement optimistic UI updates for the cart actions to make the user experience feel even more instantaneous.

Key Highlights

Multi-Role Admin

Comprehensive role-based access control and inventory management dashboard.

Redis Caching

Lightning-fast data retrieval and session management using Upstash Redis.

Stripe + COD

Flexible checkout options supporting both secure Stripe payments and Cash on Delivery.

Domain-Driven Design

Scalable architecture separating core business logic from UI components.

Next project · Full Stack Application

Sneho - Child Care Connect

Next case study