1. Overview
This page defines everything the online store must have: product and catalog model, customer-facing pages and features, customer accounts, admin catalog and admin pages, order and payment flows, architecture, and integration with the existing NIM Co-operative system (members, PNO, member account payment).
2. Product & Catalog (Data Model)
2.1 Product Details (What a Product Has)
| Attribute | Type | Description |
| id | PK | Unique identifier |
| sku | string, unique | Stock Keeping Unit (e.g. RICE-10KG) |
| name | string | Display name |
| slug | string, unique | URL-friendly name (e.g. rice-premium-10kg) |
| short_description | text | 1–2 lines for listing/cards |
| description | text / HTML | Full description (tabs, specs, usage) |
| category_id | FK | Primary category |
| categories | many-to-many, optional | Additional categories (e.g. “On Offer”, “New”) |
| price | decimal | Base / list price |
| sale_price | decimal, nullable | Discounted price; if set, show as “sale” |
| cost_price | decimal, optional | For margin reports (admin only) |
| currency | string | e.g. INR |
| tax_class | FK or string | Taxable / exempt / reduced |
| images | one-to-many | Multiple images: url, alt, sort_order; one primary |
| stock_quantity | int | Available quantity; decrement on order |
| track_inventory | boolean | Whether to enforce stock (yes) or “always available” |
| low_stock_threshold | int, optional | Alert when stock < this |
| weight / dimensions | decimal, optional | For shipping calculation |
| is_active | boolean | Visible on store (false = hidden/draft) |
| is_featured | boolean | Show on homepage / featured section |
| sort_order | int | Order within category/list |
| meta_title, meta_description | string | SEO |
| created_at, updated_at | datetime | Audit |
2.2 Product Variants (Optional but Recommended)
For products with size, colour, pack size:
| Attribute | Description |
| product_id (FK) | Parent product |
| sku | Variant-level SKU (e.g. RICE-10KG-WHITE) |
| name | e.g. “10 kg – White” |
| price / sale_price | Override parent if different |
| stock_quantity | Per variant |
| attributes | JSON or table: e.g. { "size": "10kg", "type": "white" } |
Cart and order items reference variant_id (or product_id if no variants).
2.3 Categories
| Attribute | Description |
| id, name, slug | Unique; slug for URL |
| parent_id (FK) | Hierarchy (e.g. Groceries → Rice → Premium) |
| description | Optional; category page content |
| image_url | Optional banner for category page |
| sort_order, is_active | Order in nav; show/hide |
| meta_title, meta_description | SEO |
2.4 Other Catalog Entities
- Attributes (e.g. Brand, Unit, Pack Size): reusable; linked to categories or products for filtering.
- Brands (optional): brand name, logo, slug; product.brand_id.
- Tags (optional): e.g. “bestseller”, “new”; many-to-many with product for search/filter.
3. Customer-Facing Pages & Features
3.1 Public Pages (No Login Required)
| Page | Purpose | Key elements |
| Homepage | Landing | Hero/banner, featured products, categories grid, promotions, trust (delivery, payment, support) |
| Category listing | Browse by category | Category name/description, product grid (image, name, price, sale price, Add to cart), sort, filters, pagination |
| Product detail | Single product | Image gallery, name, price, sale price, short desc, Add to cart (qty, variant selector), full description, specs, related products, reviews (if enabled) |
| Search results | Query-based | Same as category listing for search query; facets/filters |
| Cart | Current cart | Line items (image, name, variant, qty, price, line total), update qty, remove, subtotal, Proceed to checkout, Continue shopping |
| Checkout | Place order | Steps: (1) Delivery address (2) Shipping method (3) Payment method (4) Review order (5) Place order; guest checkout; optional Login/Register |
| Order confirmation | After place order | Thank-you, order number, summary, View order link, invoice download (PDF) |
| Static / CMS pages | Policy, info | About, Contact, Shipping & returns, Privacy, Terms; editable in admin |
3.2 Customer Account Pages (Login Required)
| Page | Purpose | Key elements |
| Login | Sign in | Email/phone + password; Forgot password; Register link |
| Register | Create account | Name, email, phone, password, optional member PNO link |
| Forgot password | Reset | Email/phone → reset link or OTP |
| Account dashboard | Overview | Greeting, recent orders, default address, quick links |
| Profile | Edit account | Name, email, phone, change password |
| Addresses | Saved addresses | List add/edit/delete; set default shipping/billing |
| Order history | List orders | Table: order no., date, status, total; click → order detail |
| Order detail | Single order | Items, shipping address, payment method, status timeline, invoice download, reorder (optional) |
| Wishlist (optional) | Saved products | Grid; add to cart; remove |
| Payment methods (optional) | Saved cards/UPI | Add/remove; use at checkout (tokenised; PCI-compliant) |
3.3 Customer Features (Behaviour)
- Cart: Persist across sessions (logged-in) or session (guest); merge guest cart into user cart on login.
- Wishlist: Save product/variant; sync when logged in.
- Reviews & ratings (optional): Logged-in users rate/review; show on product page; moderate in admin.
- Notifications: Email (and optional SMS) for order confirmed, shipped, delivered; password reset; optional marketing (opt-in).
- Member integration: If user linked to PNO, show “Member account” at checkout; order amount can be charged to member account (NONOPR).
4. Admin: Catalog & Product Management
4.1 Admin Catalog Pages
| Page / Area | Purpose | Key elements |
| Product list | All products | Table: image, SKU, name, category, price, stock, status, actions (edit, duplicate, delete); filters; search; bulk actions; Add product |
| Product create / edit | Single product form | Tabs: Basic (name, slug, SKU, descriptions), Pricing, Inventory, Categories & attributes, Images (upload, reorder), Variants, SEO, Status (active/draft) |
| Category list | All categories | Tree or flat list; name, slug, parent, product count, sort, actions |
| Category create / edit | Single category | Name, slug, parent, description, image, sort, SEO, active |
| Attributes | Filter/spec attributes | List; create/edit name, type, values; assign to categories |
| Bulk import | Mass product create/update | CSV/Excel template; map columns; validate; import; error report |
| Bulk export | Export products | CSV/Excel of products (and optionally inventory) |
4.2 Admin Inventory (Optional)
- Stock list: Product/variant, current stock, reserved, available; quick-edit qty.
- Stock adjustments: Log reason (receipt, return, damage, correction); audit trail.
- Low-stock alerts: Dashboard widget or report; list products below threshold.
5. Admin: Orders & Customers
5.1 Admin Order Pages
| Page | Purpose | Key elements |
| Order list | All orders | Table: order no., date, customer, total, status, payment; filters (date, status, payment); search; Export |
| Order detail | Single order | Customer, shipping address, items, subtotal, shipping, tax, total; payment method/status; Status workflow: Pending → Confirmed → Processing → Shipped (tracking) → Delivered; Cancel; Refund (full/partial); internal notes; Resend confirmation, regenerate invoice PDF |
| Invoices | Invoice management | List by order; download PDF; reprint |
5.2 Admin Customer Pages
| Page | Purpose | Key elements |
| Customer list | All customers | Table: name, email, phone, orders count, last order, member PNO; search; filters |
| Customer detail | Single customer | Profile, addresses, order history, internal notes; optional tags, segment |
6. Admin: Content, Settings, Reports
6.1 Content / CMS (Optional)
| Page | Purpose |
| Pages | Static: About, Contact, Shipping, Returns, Privacy, Terms; rich text; SEO |
| Banners / promotions | Homepage banners; link URL; schedule (from–to); image upload |
| Menu | Navigation links (categories, custom links) |
6.2 Settings
| Area | Purpose |
| Store info | Store name, logo, contact email, phone, address |
| Tax | Tax rates (e.g. by state, product tax class); inclusive/exclusive |
| Shipping | Methods (flat rate, by weight, free above X); zones if needed |
| Payment methods | Enable/disable: COD, Online PG (Razorpay/PayU etc.), Member account (NIM PNO); PG credentials (secure) |
| Notifications | Email templates (order confirmed, shipped, etc.); SMS if used |
| Currencies | Default currency (INR) |
| Security | HTTPS, password policy, session timeout |
6.3 Reports & Dashboard
| Element | Purpose |
| Dashboard | KPIs: sales (today/week/month), orders count, new customers; low-stock list; recent orders; quick links |
| Sales report | By date range; by product/category; charts (line, bar) |
| Order report | Orders by status; average order value |
| Product report | Best sellers; low stock; out of stock |
| Customer report | New customers; repeat rate; optional RFM |
7. Order & Payment Flows
7.1 Order Lifecycle
- Cart → Customer adds items (product/variant, qty).
- Checkout → Address, shipping method, payment method; validation: stock check, min order if any.
- Place order → Create order (status: Pending); reduce stock (or reserve); if online payment: redirect to PG → success/cancel webhook → confirm order or cancel and restore stock.
- Confirmation → Order confirmed (email + screen); invoice generated (PDF).
- Fulfilment → Admin: Confirm → Processing → Shipped (tracking) → Delivered; optional partial ship, return/refund.
7.2 Payment Methods (Aligned with NIM)
| Method | Flow |
| COD | Order created; payment on delivery; mark “Paid” when delivered if needed |
| Online (PG) | Redirect to gateway; capture; webhook confirms payment; order confirmed |
| Member account (PNO) | Validate PNO; order total charged to member; backend posts to member_monthly_deduction or member_orders; invoice shows “Charged to member account” |
7.3 Invoice
- Content: Store name, logo, invoice no., order no., date, bill-to/ship-to, line items (product, variant, qty, unit price, amount), subtotal, shipping, tax, total, payment method, terms.
- Format: HTML + PDF (same engine as other NIM reports); store in S3; link from order detail and email.
8. Architecture (High-Level)
8.1 Layers
| Layer | Responsibility |
| Frontend (store) | Customer UI: homepage, category, product, cart, checkout, account; responsive; SEO-friendly URLs |
| Frontend (admin) | Admin UI: dashboard, catalog, orders, customers, settings, reports; auth; role-based access |
| API | REST (or GraphQL): catalog, cart, checkout, orders, account, auth; admin APIs for CRUD and reports |
| Services | Order service, payment service (PG, member account), notification service (email/SMS), invoice service (PDF), search service (optional) |
| Data | PostgreSQL: products, categories, variants, cart, orders, customers; Redis (optional): cart session, cache, rate limit |
| Storage | S3: product images, invoice PDFs, exports; CloudFront for images |
8.2 Integration with NIM System
- Shared DB or API: Members table (PNO) used to validate “Member account” and post order amount to member_monthly_deduction or member_orders.
- Same auth (optional): If members can log in, link customer account to PNO once verified.
- Reports: E-store sales can feed store-wise sales for Salary PB (performance bonus) if online is treated as a branch.
8.3 Scalability & Performance
- Catalog: Pagination; index on category, status, slug; optional search index (Elasticsearch/OpenSearch).
- Cart: DB by user/session or Redis; TTL for abandoned cart.
- Images: S3 + CloudFront; responsive image URLs.
- Checkout: Idempotent order creation; stock decrement with lock or optimistic concurrency; queue for emails/invoice if needed.
- Admin: Role-based access (Super admin, Catalog manager, Order manager, Support); audit log for sensitive actions.
9. Security & Compliance
- HTTPS only; secure cookies for session.
- Passwords: Hashed (e.g. bcrypt); optional 2FA for admin.
- Payment: PCI-compliant; no card data stored (use PG tokens or vault); member account updates via secure backend only.
- PII: Customer data encrypted at rest; access logged; privacy policy and consent where required.
- Admin: IP allowlist (optional); strong password policy; session timeout.
10. Summary Checklist
Product & Catalog
- Product: SKU, name, slug, descriptions, price, sale price, images, stock, variants (optional), categories, SEO, status.
- Categories: hierarchy, slug, description, SEO.
- Attributes / brands / tags as needed.
- Bulk import/export.
Customer Pages
- Homepage, category listing, product detail, search, cart, checkout, order confirmation.
- Account: login, register, profile, addresses, order history, order detail, wishlist (optional), payment methods (optional).
- Member integration: PNO link, “Member account” at checkout.
Admin Pages
- Dashboard (KPIs, low stock, recent orders).
- Catalog: product list/create/edit, category list/create/edit, attributes, bulk import/export.
- Orders: list, detail, status workflow, invoice, refund.
- Customers: list, detail.
- Content: pages, banners (optional).
- Settings: store, tax, shipping, payment, notifications.
- Reports: sales, orders, products, customers.
Technical
- API for store and admin; order and payment flows; invoice generation; integration with NIM (member account, NONOPR).
- Scalable: pagination, CDN for images, cart strategy, search if needed.
- Secure: HTTPS, hashed passwords, no card storage, audit where needed.
This specification is the single reference for building a complete, efficient e-commerce store for NIME Co-operative Stores, from product details to admin catalog and customer account pages.