Skip to content

Add CRM system for clothing store#1

Draft
mtanveer66 with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-crm-features
Draft

Add CRM system for clothing store#1
mtanveer66 with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-crm-features

Conversation

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown

Bootstraps a clothing store CRM from an empty repo. Provides full customer, product, and order lifecycle management via a REST API and a single-page frontend.

Backend (server.js, db.js)

  • SQLite schema: customers, products, orders, order_items with FK constraints
  • REST API (Express): full CRUD for customers/products, order creation with multi-line-item support, order status transitions (pending → confirmed → shipped → delivered → cancelled), dashboard aggregate endpoint
  • Rate limiting: express-rate-limit applied to all /api/ routes (500 req / 15 min)
  • Stock guard: order creation validates product.stock >= quantity inside a transaction — rejects with 400 on shortfall and never writes partial state

Frontend (public/)

  • Single-page app with sidebar nav: Dashboard, Customers, Orders, Products
  • Dashboard shows live stats (customers, orders, revenue, pending) plus recent-orders and top-customers tables
  • Customer profile modal includes full order history; order detail modal exposes inline status update
  • All user-sourced strings passed through esc() (HTML-entity encoding) before DOM insertion

Example: insufficient-stock rejection

// POST /api/orders  { customer_id: 1, items: [{ product_id: 2, quantity: 9999 }] }
// → 400 { "error": "Insufficient stock for \"Slim Fit Jeans\" (available: 60)" }
Original prompt

crm

Copilot AI and others added 3 commits April 29, 2026 19:58
Agent-Logs-Url: https://github.com/mtanveer66/clothing/sessions/c1bdd04e-6e4e-4fa0-99de-6a395806ecd0

Co-authored-by: mtanveer66 <240011555+mtanveer66@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mtanveer66/clothing/sessions/c1bdd04e-6e4e-4fa0-99de-6a395806ecd0

Co-authored-by: mtanveer66 <240011555+mtanveer66@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new features to CRM system Add CRM system for clothing store Apr 29, 2026
Copilot AI requested a review from mtanveer66 April 29, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants