Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Excel Sales Data Processor - A full-stack web application for processing, managing, and analyzing retail inventory and sales data from Excel files. Features include file upload/parsing, database storage, real-time statistics dashboard, data management with search/pagination, and upload history tracking.
npm run dev - Starts the development server with Vite HMR and Express backend (port 5000)npm run build - Builds the client (Vite) and server (esbuild) for productionnpm start - Runs the production buildnpm run check - Runs TypeScript compiler to check typesnpm run db:push - Pushes Drizzle schema changes to the database (no migrations folder - uses direct push)This is a full-stack TypeScript application with React frontend and Express backend, using a monorepo structure.
Frontend:
Backend:
client/ ├── src/ │ ├── components/ │ │ ├── ui/ # 48 shadcn/ui components │ │ ├── excel-formatter.tsx # Main upload/processing UI │ │ ├── file-upload-tabs.tsx # Tabbed upload interface │ │ ├── stats-overview.tsx # Dashboard metrics │ │ ├── upload-progress.tsx # Progress tracking │ │ └── recent-activity.tsx # Upload history │ ├── pages/ │ │ ├── dashboard.tsx # Main landing page │ │ ├── item-list.tsx # Item management (399 lines) │ │ └── not-found.tsx # 404 page │ ├── lib/ │ │ ├── excel-processor.ts # Excel parsing & validation │ │ ├── formatters.ts # Complex Excel formatting (760 lines!) │ │ ├── api.ts # API client functions │ │ ├── queryClient.ts # React Query setup │ │ └── utils.ts # Utility functions │ ├── hooks/ # Custom React hooks │ ├── App.tsx # Root component with routing │ └── main.tsx # Entry point server/ ├── index.ts # Server entry point (71 lines) ├── routes.ts # 10 REST API endpoints (240 lines) ├── storage.ts # Database operations (238 lines) ├── db.ts # Drizzle connection (16 lines) └── vite.ts # Vite dev middleware shared/ └── schema.ts # Drizzle schemas + Zod validation (109 lines)
Uses Drizzle ORM with Neon serverless PostgreSQL (WebSocket-based connection):
Tables:
item_list (22 fields) - Inventory items with quantities across 8 store locations, pricing, dates, metadatasales_transactions (9 fields) - Sales records with receipt info, SKU, pricingupload_history (8 fields) - Tracks file uploads with success/failure statisticsusers (3 fields) - User management stub (not actively used - no auth implemented)Key Details:
shared/schema.ts (shared between client/server for type consistency)server/storage.ts exports storage singleton implementing IStoragedbdrizzle-kit push directly (⚠️ risky for production)@/ → client/src/@shared/ → shared/@assets/ → attached_assets/In development mode (
npm run dev):
/api/* handled by ExpressIn production mode (
npm start):
dist/publicItem List Upload:
client/src/components/excel-formatter.tsxclient/src/lib/excel-processor.tsshared/schema.tsPOST /api/upload/item-list → server/routes.ts:85server/storage.ts:73 (createItemList or upsertItemList)item_list table via Drizzle ORMupload_history table with statsUpload Modes:
initial - Inserts new records (fails on duplicates)weekly_update - Upserts by item_number (updates existing records)Sales Transaction Upload:
POST /api/upload/sales-transactionssales_transactions tableGET /api/health - Health checkGET /api/stats/item-list - Item statistics (COUNT, SUM, DISTINCT aggregations)GET /api/stats/sales - Sales statisticsGET /api/item-list?limit=50&offset=0&search=... - Paginated item list with searchDELETE /api/item-list/:id - Delete single itemDELETE /api/item-list - Clear all items (⚠️ destructive)POST /api/upload/item-list - Upload item data (batch processing)POST /api/upload/sales-transactions - Upload sales dataGET /api/upload-history?limit=10 - Recent upload historyFile:
(760 lines)client/src/lib/formatters.ts
Key functions:
formatItemList() - Deletes top 5 rows + specific columns from "Item Detail" sheetformatSalesFile() - Processes multiple "Sales Detail" sheets, deletes rows/columnsflattenSalesData() - Parses hierarchical transaction structure (header rows + line items)normalizeHeaders() - Maps Excel headers to DB field names (handles variations)coerceTypes() - Type conversion for dates, numbers, stringsHardcoded Values:
express-session with memorystore (⚠️ in-memory, not production-ready)ws package required)dist/public/ (client) + dist/index.js (server)client/src/lib/api.ts:32)client/src/pages/item-list.tsx:56)drizzle-kit push directly (dangerous)attached_assets/excel-formatter.tsx and file-upload-tabs.tsx overlap/api/v1/...any types in Excel processing codeserver/storage.ts) for database operations, never query directlyshared/schema.ts are the single source of truth for validation