How kjmbibang/cartsense works
CartSense imports grocery-order CSVs, validates and stores order lines, then generates an order-level basket-analysis payload that powers a scoped analytics workspace. The documented Python workflow covers preprocessing, user-disjoint holdout evaluation, Apriori mining, and recommendations with a popularity fallback; the UI exposes dashboard, behavior, product, bundle, network, reliability, and export views. The API also supports import history, deletion, and filtered data checks. Some route and pipeline internals were not shown, so unverified runtime links are omitted or marked dashed.
Main entry points: AnalysisScreen.jsx Payload views · uploads.js Upload jobs · analysis.js Analysis routes · api.js HTTP client
Components 25
Analytics workspace
- Screen navigation
src/App.jsx - Upload and scope
src/client/screens/UploadDataCheck.jsx - Payload views
src/client/AnalysisScreen.jsx - Executive dashboard
src/client/screens/ExecutiveDashboard.jsx - Behavior insights
src/client/screens/ShoppingBehavior.jsx - Buying patterns
src/client/screens/BuyingPatterns.jsx - Bundle opportunities
src/client/screens/BundleOpportunities.jsx - Association network
src/client/screens/AssociationNetwork.jsx - Reliability report
src/client/screens/ReliabilityReport.jsx - Product explorer
src/client/screens/ProductExplorer.jsx - Department insights
src/client/screens/DepartmentInsights.jsx - Method trace
src/client/screens/HowItWorks.jsx - Reports and export
src/client/screens/ReportsExport.jsx - HTTP client
src/client/api.js
Import and API
- Express API
server/index.js - Upload jobs
server/routes/uploads.js - Analysis routes
server/routes/analysis.js - CSV importer
server/services/importOrders.js
Basket analysis
- Payload pipeline
server/services/analysisPipeline.js - Python CLI
python/cartsense_analysis/cli.py - Basket analysis
python/cartsense_analysis/analysis.py
Persistence
- Payload file store
server/services/analysisPayload.js - MySQL access
server/config/database.js - MySQL tables
server/sql/schema.sql
Other components
- Analyst
Connections 30
- Analyst → Screen navigation: uses
README.md - Screen navigation → Upload and scope: selects screen
src/App.jsx - Screen navigation → Executive dashboard: selects screen
src/App.jsx - Upload and scope → HTTP client: requests imports
src/client/screens/UploadDataCheck.jsx - Payload views → HTTP client: loads payload
src/client/AnalysisScreen.jsx - Executive dashboard → Payload views: renders
src/client/screens/ExecutiveDashboard.jsx - Behavior insights → Payload views: renders
src/client/screens/ShoppingBehavior.jsx - Buying patterns → Payload views: renders
src/client/screens/BuyingPatterns.jsx - Bundle opportunities → Payload views: renders
src/client/screens/BundleOpportunities.jsx - Association network → Payload views: renders
src/client/screens/AssociationNetwork.jsx - Reliability report → Payload views: renders
src/client/screens/ReliabilityReport.jsx - Product explorer → Payload views: renders
src/client/screens/ProductExplorer.jsx - Department insights → Payload views: renders
src/client/screens/DepartmentInsights.jsx - Method trace → Payload views: renders
src/client/screens/HowItWorks.jsx - Reports and export → Payload views: renders
src/client/screens/ReportsExport.jsx - HTTP client → Upload jobs: uploads and polls
src/client/api.js - HTTP client → Analysis routes: requests analysis
src/client/api.js - Express API → Upload jobs: mounts routes
server/index.js - Express API → Analysis routes: mounts routes
server/index.js - Upload jobs → CSV importer: imports rows
server/routes/uploads.js - Upload jobs → Payload pipeline: publishes analysis
server/routes/uploads.js - Upload jobs → MySQL access: checks database
server/routes/uploads.js - Analysis routes → Payload pipeline: generates scoped payload
server/routes/analysis.js - Analysis routes → Payload file store: reads and saves
server/routes/analysis.js - CSV importer → MySQL access: writes imports
server/services/importOrders.js - Payload pipeline → Python CLI: runs analysis
- Python CLI → Basket analysis: builds payload
python/cartsense_analysis/cli.py - Payload pipeline → Payload file store: publishes payload
server/services/analysisPipeline.js - Analysis routes → MySQL access: queries imports
server/routes/analysis.js - MySQL access → MySQL tables: connects to
server/config/database.js