# DesiDigiMart β Multi-Vendor E-Commerce Platform Blueprint
### Tagline: *Spice to Spark*
---
## 1. Brand & Design System
### 1.1 Identity
| Element | Detail |
|---|---|
| Brand Name | DesiDigiMart |
| Tagline | Spice to Spark |
| Positioning | Authentic Indian goods (spices, handmade/desi products) meets modern digital retail |
| Design Reference | Rohit Digital Academy visual language β premium, high-energy, trustworthy |
### 1.2 Visual Language (align to Rohit Digital Academy palette)
Since exact brand assets from Rohit Digital Academy aren't in this document, the design system below is built to match that academy's known style pattern (bold gradient primary, dark premium backgrounds, high-contrast CTA accents). Swap hex codes for the exact brand kit when available.
| Token | Value | Usage |
|---|---|---|
| `--color-primary` | `#FF4C29` (spicy saffron-red) | CTAs, highlights, "Spark" energy |
| `--color-primary-dark` | `#C21807` | Hover states, gradients |
| `--color-secondary` | `#1E1E2F` (deep charcoal navy) | Headers, footer, premium backgrounds |
| `--color-accent-gold` | `#FFB800` | Badges, ratings, premium tags ("Sudh"/"Handmade") |
| `--color-success` | `#1DB954` | In-stock, order confirmed |
| `--color-bg-light` | `#FFF8F0` | Product cards, light sections |
| `--font-heading` | Poppins / Baloo 2 (Bold) | Headings β energetic, rounded |
| `--font-body` | Inter / Nunito Sans | Body copy β clean, readable |
### 1.3 UX Principles
- **Trust-first UI**: verified badges, vendor ratings, "100% Original Guarantee" ribbon on every listing.
- **PWA-ready**: installable app shell, offline cart persistence, push notifications for order status.
- **Mobile-first responsive grid** (360px β 1920px breakpoints), thumb-friendly bottom nav on mobile.
- **Micro-interactions**: animated add-to-cart, skeleton loaders, festival-themed banners (Diwali/Holi campaign themes reusing the primary palette).
---
## 2. Tech Stack Recommendation
| Layer | Recommendation | Why |
|---|---|---|
| Frontend (Web) | **Next.js 14 (App Router) + TypeScript + Tailwind CSS** | SSR/ISR for SEO, image optimization, PWA plugin support |
| State Mgmt | **Zustand / Redux Toolkit** + React Query (TanStack Query) | Cart/session state + server cache |
| Mobile Wrapper | **Capacitor** (wraps the PWA) or React Native (Phase 2) | Ship to Play Store/App Store from the same codebase |
| Backend API | **Node.js (NestJS)** or Django REST Framework | NestJS: modular, TypeScript end-to-end, great for microservices |
| Database | **PostgreSQL** (primary relational) + **Redis** (cache/session/cart) | ACID compliance for orders/payments; Redis for speed |
| Search | **Elasticsearch / Meilisearch** | Multi-level category + attribute filtering at scale |
| File/Media Storage | **AWS S3 / Cloudflare R2** + Cloudflare CDN | Product images, review photos/videos |
| Queue/Jobs | **BullMQ (Redis-backed)** | Payout cycles, abandoned cart emails, AWB generation |
| Auth | **NextAuth.js / Auth0** + JWT + OAuth (Google/Facebook) | Social login, refresh-token rotation |
| Payments | **Razorpay** (India) + **PayPal** (International) + Bank Transfer (manual reconciliation) | Full domestic + global coverage |
| Logistics | **Shiprocket API** (primary aggregator: covers Delhivery, Bluedart, etc.) | Single integration β multiple couriers |
| Notifications | **MSG91/Twilio (SMS)**, **SendGrid/Resend (Email)**, **WhatsApp Business Cloud API** | Transactional + support |
| Analytics | **Google Analytics 4 + Meta Pixel + Google Tag Manager** | Conversion & funnel tracking |
| Hosting/Infra | **Vercel (frontend)** + **AWS/DigitalOcean (backend, containerized via Docker + Kubernetes/ECS)** | Scalable, isolated services |
| Security | **Cloudflare WAF**, **Let's Encrypt SSL**, **AWS KMS/Vault for secrets** | Perimeter + encryption |
| CI/CD | **GitHub Actions** | Automated test/build/deploy |
---
## 3. System Architecture (High-Level)
```
βββββββββββββββββββββββββββββ
β Cloudflare CDN + WAF β
βββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββββββββββ΄ββββββββββββββββββββββ
β β
ββββββββββΌββββββββββ ββββββββββΌββββββββββ
β Next.js Storefrontβ β Admin/Vendor Web β
β (PWA, SSR/ISR) β β Panel (React) β
ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ
β REST/GraphQL API β
ββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β API Gateway (NestJS) β
βββββββββββββββ¬ββββββββββββββ
βββββββββββββ¬ββββββββββββ¬ββββββ΄ββββββ¬ββββββββββββ¬ββββββββββββ
β β β β β β
ββββββΌββββ ββββββΌβββββ ββββββΌββββ βββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
β Auth/ β β Catalog/β β Order/ β β Vendor/ β β Payment β β Notif/ β
β User β β Search β β Cart β β Payout β β Service β β Logisticsβ
β Serviceβ β Service β β Serviceβ β Service β β β β Service β
ββββββ¬ββββ ββββββ¬βββββ ββββββ¬ββββ βββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ
β β β β β β
βββββββββββββ΄ββββββββββββ΄ββββββ¬ββββββ΄ββββββββββββ΄ββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β PostgreSQL (primary) β
β Redis (cache/queue) β
β Elasticsearch (search) β
β S3/R2 (media) β
βββββββββββββββββββββββββββββ
```
Each domain (Auth, Catalog, Order, Vendor, Payment, Notification/Logistics) can start as modules inside a single NestJS monolith and be split into microservices later as traffic grows β avoids premature complexity.
---
## 4. Database Schema (Core Tables)
### 4.1 Users & Roles
```sql
users (
id UUID PK,
name VARCHAR,
email VARCHAR UNIQUE,
phone VARCHAR UNIQUE,
password_hash VARCHAR,
role ENUM('customer','vendor','admin','support'),
auth_provider ENUM('email','google','facebook'),
is_verified BOOLEAN DEFAULT false,
created_at, updated_at
)
addresses (
id UUID PK,
user_id UUID FK -> users,
label VARCHAR, -- Home/Work
line1, line2, city, state, pincode, country,
is_default BOOLEAN
)
```
### 4.2 Vendors & KYC
```sql
vendors (
id UUID PK,
user_id UUID FK -> users,
business_name VARCHAR,
gstin VARCHAR,
pan_number VARCHAR,
bank_account_number VARCHAR (encrypted),
ifsc_code VARCHAR,
status ENUM('pending','approved','blocked','suspended'),
commission_rate DECIMAL(5,2), -- platform commission %
kyc_doc_urls JSONB, -- aadhaar, PAN, GST cert, shop photo
created_at, updated_at
)
vendor_appeals (
id UUID PK,
vendor_id UUID FK -> vendors,
reason TEXT,
status ENUM('open','under_review','resolved','rejected'),
admin_notes TEXT,
created_at, resolved_at
)
vendor_payouts (
id UUID PK,
vendor_id UUID FK -> vendors,
order_id UUID FK -> orders,
amount DECIMAL(10,2),
commission_deducted DECIMAL(10,2),
status ENUM('pending','processing','paid','failed'),
payout_cycle_date DATE, -- triggered post return-window
transaction_ref VARCHAR
)
```
### 4.3 Catalog (Multi-Level Categories)
```sql
categories (
id UUID PK,
parent_id UUID FK -> categories (nullable, self-referencing for unlimited depth),
name VARCHAR,
slug VARCHAR UNIQUE,
image_url VARCHAR,
is_active BOOLEAN
)
products (
id UUID PK,
vendor_id UUID FK -> vendors,
category_id UUID FK -> categories,
title VARCHAR,
slug VARCHAR UNIQUE,
description TEXT,
sku VARCHAR UNIQUE, -- auto-generated: DDM-{CAT}-{VENDOR}-{SEQ}
base_price DECIMAL(10,2),
discount_price DECIMAL(10,2),
is_organic BOOLEAN,
status ENUM('draft','pending_review','approved','rejected','suspended'),
meta_title, meta_description, schema_markup JSONB, -- SEO
created_at, updated_at
)
product_variants (
id UUID PK,
product_id UUID FK -> products,
attribute_set JSONB, -- {"weight":"500g","brand":"Desi Farms"}
price DECIMAL(10,2),
stock_qty INT,
low_stock_threshold INT DEFAULT 5
)
product_images (
id UUID PK, product_id UUID FK -> products, url, sort_order
)
product_filters (
id UUID PK,
category_id UUID FK -> categories,
filter_name VARCHAR, -- Weight, Brand, Price Range, Organic/Regular
filter_type ENUM('range','multi_select','boolean')
)
```
### 4.4 Orders, Cart & Returns
```sql
carts (
id UUID PK, user_id UUID FK -> users, session_id VARCHAR, updated_at
)
cart_items (
id UUID PK, cart_id UUID FK -> carts,
product_variant_id UUID FK -> product_variants, qty INT
)
orders (
id UUID PK,
user_id UUID FK -> users,
order_number VARCHAR UNIQUE,
status ENUM('placed','confirmed','shipped','delivered','cancelled','returned'),
payment_status ENUM('pending','paid','refunded','failed'),
payment_method ENUM('razorpay','paypal','bank_transfer'),
subtotal, shipping_fee, discount, tax, total DECIMAL(10,2),
shipping_address_id UUID FK -> addresses,
awb_number VARCHAR, -- from Shiprocket
courier_partner VARCHAR,
created_at, updated_at
)
order_items (
id UUID PK, order_id UUID FK -> orders,
product_variant_id UUID FK -> product_variants,
vendor_id UUID FK -> vendors, -- split by vendor for multi-vendor payouts
qty INT, unit_price DECIMAL(10,2), item_status ENUM(...)
)
returns_requests (
id UUID PK,
order_item_id UUID FK -> order_items,
type ENUM('return','replace','reorder'),
reason TEXT,
status ENUM('requested','approved','rejected','picked_up','refunded'),
created_at, resolved_at
)
coupons (
id UUID PK, code VARCHAR UNIQUE, discount_type ENUM('flat','percent'),
value DECIMAL, min_order_value, usage_limit, expiry_date
)
```
### 4.5 Reviews & Support
```sql
reviews (
id UUID PK, product_id UUID FK -> products, user_id UUID FK -> users,
order_item_id UUID FK -> order_items, -- verified purchase link
rating INT CHECK (1-5), comment TEXT,
media_urls JSONB, -- photos/videos
is_approved BOOLEAN DEFAULT true,
created_at
)
support_tickets (
id UUID PK,
user_id UUID FK -> users,
vendor_id UUID FK -> vendors (nullable),
order_id UUID FK -> orders (nullable),
subject, description TEXT,
status ENUM('open','in_progress','resolved','closed'),
assigned_to UUID FK -> users, -- support agent or vendor
created_at, resolved_at
)
```
### 4.6 Audit & Security
```sql
audit_logs (
id UUID PK, actor_id UUID FK -> users, action VARCHAR,
entity_type VARCHAR, entity_id UUID, metadata JSONB, ip_address, created_at
)
```
---
## 5. Feature Modules Deep-Dive
### 5.1 Super Admin Dashboard
- Global product moderation queue (approve/reject/edit any listing).
- Vendor management: KYC review, block/suspend with reason logging, commission rate override per vendor/category.
- Payout ledger: view/export all pending & completed payouts; manual override for disputes.
- Platform analytics: GMV, top categories, vendor performance leaderboard.
- Appeal review workflow: blocked vendors submit an appeal β admin reviews evidence β approve/reject with audit trail.
### 5.2 Vendor Dashboard
- Inventory manager (bulk CSV upload/update, low-stock alerts).
- Order fulfillment queue (pack β ship β generate AWB via Shiprocket).
- Support ticket inbox scoped to their own products only.
- Payout history + downloadable statements (GST-compliant invoices).
- Vendor T&C acceptance gate before first product upload (originality guarantee, anti-counterfeit clause).
### 5.3 Return/Replacement Automation
Flow: `Customer requests return β auto-check against return window (e.g., 7 days) β vendor notified β pickup scheduled via courier API β refund/replacement triggered on pickup confirmation β payout held/released accordingly.`
### 5.4 Automated Payout Cycle
`Order delivered β return window timer starts β window expires with no return β BullMQ job marks payout "eligible" β weekly payout batch job runs β funds transferred (Razorpay Route / RazorpayX for vendor splits) β payout status updated + vendor notified.`
---
## 6. Payments & Security
### 6.1 Payment Integration
- **Razorpay**: UPI, cards, netbanking, wallets β use **Razorpay Route** for automatic vendor-split settlement.
- **PayPal**: PayPal Checkout SDK for international buyers (USD/other currencies with live conversion display).
- **Bank Transfer**: manual order flag β admin confirms receipt β order proceeds.
- All payment flows use **server-side signature verification** (never trust client-side "payment success" callbacks alone).
### 6.2 Security Checklist
| Threat | Mitigation |
|---|---|
| SQL Injection | Parameterized queries / ORM (Prisma or TypeORM), input validation via class-validator/Zod |
| XSS | Content Security Policy headers, DOMPurify on any user-rendered HTML, output encoding |
| CSRF | SameSite cookies + CSRF tokens on state-changing requests |
| Scraping | Rate limiting (Cloudflare + API gateway), CAPTCHA on repeated automated patterns |
| Data at rest | AES-256 encryption for PII/bank details in DB |
| Data in transit | TLS 1.3 everywhere |
| Right-click/text-select/drag protection | CSS `user-select: none` + JS `oncontextmenu`/`ondragstart` disablers *(note: this deters casual copying but is not a real security control β determined users can bypass via dev tools; pair it with visible watermarks on product images for real IP protection)* |
| Secrets management | AWS Secrets Manager / HashiCorp Vault, never in repo |
| Auth | bcrypt/argon2 password hashing, JWT short-lived access + rotating refresh tokens, 2FA optional for vendors/admin |
---
## 7. Logistics, Marketing & Trust Features
- **Shiprocket API**: real-time shipping rate calculation at checkout, one-click AWB generation, webhook-based tracking updates pushed to customer order page + SMS/WhatsApp.
- **SEO**: dynamic meta tags per product/category, JSON-LD schema (`Product`, `Review`, `Offer`, `BreadcrumbList`), auto-generated sitemap.xml, server-rendered pages via Next.js for crawlability.
- **Abandoned Cart Recovery**: cron job detects carts idle >1hr β triggers email/SMS with cart link + optional discount nudge.
- **Coupons**: flat/percentage, min-order-value, usage caps, category/vendor-specific codes.
- **Review System**: verified-purchase-only reviews, photo/video upload (moderated queue for authenticity, especially useful for showcasing handmade product quality).
- **WhatsApp Business API**: order confirmations, dispatch alerts, quick-reply support chat widget.
---
## 8. Footer / Support Configuration
| Field | Value |
|---|---|
| Address | Balaji Market, Shikarpur, Bulandshahar, Uttar Pradesh, India |
| Phone/WhatsApp | 9528 843 120 |
| Email | desidigimartskr@gmail.com |
| Facebook | facebook.com/profile.php?id=61590445287328 |
| Instagram | instagram.com/desidigimartskr |
| Map | Embed Google Maps iframe (place pin) pointing to Balaji Market, Shikarpur |
| Support | Contact form β `support_tickets` table, FAQ accordion, WhatsApp chat bubble (floating, bottom-right) |
---
## 9. Development Roadmap
| Phase | Duration | Deliverables |
|---|---|---|
| **Phase 0 β Discovery & Design** | 2 weeks | Finalize Rohit Digital Academy brand kit (exact hex/fonts/logo), wireframes, DB schema sign-off, tech stack finalization |
| **Phase 1 β Core Foundation** | 4 weeks | Auth (email + social login), user/vendor onboarding + KYC upload, category tree CRUD, basic product CRUD, admin skeleton |
| **Phase 2 β Storefront & Catalog** | 4 weeks | Product listing/detail pages, multi-level filters, search (Elasticsearch), cart, wishlist, SEO schema, PWA setup |
| **Phase 3 β Checkout & Payments** | 3 weeks | Razorpay + PayPal + bank transfer integration, order placement, invoice generation, coupon engine |
| **Phase 4 β Vendor Ops & Payouts** | 3 weeks | Vendor dashboard (inventory, orders), automated payout engine, return/replace workflow, appeal system |
| **Phase 5 β Logistics & Notifications** | 2 weeks | Shiprocket integration (AWB, tracking), SMS/Email/WhatsApp triggers, abandoned cart flow |
| **Phase 6 β Trust, Reviews & Marketing** | 2 weeks | Review system with media upload, GA4/Meta Pixel, admin moderation queues |
| **Phase 7 β Security Hardening & QA** | 2 weeks | Penetration testing, WAF rules, load testing, right-click/image protection, accessibility audit |
| **Phase 8 β Beta Launch & Iteration** | 2 weeks | Soft launch with limited vendors, monitor, bug-fix, performance tuning |
| **Phase 9 β Full Public Launch** | Ongoing | Marketing push, vendor acquisition, feature backlog (mobile apps, loyalty program, subscriptions) |
**Estimated total to public launch: ~24 weeks (~6 months)** with a small dedicated team (1 PM, 2 backend, 2 frontend, 1 UI/UX designer, 1 QA).
---
## 10. Notes & Recommendations
1. **Brand kit**: the exact colors/fonts of "Rohit Digital Academy" weren't supplied β send the logo/brand guide and this palette can be swapped in precisely.
2. **Right-click/copy protection** is UX theater against casual users, not real IP protection β combine with visible/invisible image watermarking and DMCA takedown process for real enforcement.
3. Start as a **modular monolith** (NestJS) rather than full microservices on day one β split into services only once specific modules (e.g., search, payments) need independent scaling.
4. Get **Razorpay Route / RazorpayX** approved early β vendor-split payouts require business KYC approval that can take 1β2 weeks.
5. Plan **GST-compliant invoicing** per vendor from day one β retrofitting billing/tax logic later is expensive.
---
*This blueprint is a starting architecture β treat table/field names as a working draft to be refined with your dev team during Phase 0 discovery.*