You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full-stack, AI-powered retail CRM with ML analytics, sales pipeline, real-time dashboards, and an intelligent chatbot β built with React, Node.js, PostgreSQL, and ASI:One AI.
Created by AH AH Coders Γ Claude AI π€
β¨ Key Features
π§ AI-Powered Intelligence
DB-Aware AI Chatbot β Ask natural language questions like "Who is my top customer?" and get answers from your real database
AI Description Helper β β¨ AI Suggest button auto-writes professional descriptions for activities, deals, and notes
AI Dashboard Summary β One-click executive briefing of your business health
AI Segment Explainer β Plain-English explanations of your customer clusters
AI Campaign Generator β Generates SMS marketing copy tailored to your audience
AI Customer Risk Assessment β Predicts individual customer churn probability
AI Sales Forecasting β Revenue projection with confidence scoring
AI Report Summaries β Executive-level automated report narratives
π 7 ML Analytics Modules
Module
What It Does
K-Means Segmentation
Groups customers into behavioral clusters (Champions, Loyal, At-Risk, Lost)
RFM Analysis
Scores every customer on Recency, Frequency, and Monetary value (1-5 scale)
Churn Risk Prediction
Identifies at-risk customers with risk scores and recommended actions
Customer LTV
Predicts 3-year Customer Lifetime Value with tier classification
Product Affinity
Discovers which products are frequently purchased together
Revenue Forecasting
90-day trend analysis with 7-day moving average and projections
Cohort Analysis
Monthly acquisition cohorts with retention rates and revenue tracking
π€ Sales Pipeline (Deals)
Visual Kanban-style pipeline with drag-and-drop stage changes
Stages: Lead β Qualified β Proposal β Negotiation β Closed Won / Closed Lost
Auto-sync: When a deal is won/lost, customer's total_spent and total_purchases are automatically updated
Deal stats visible on Customer detail page (Won / Active / Lost counts with values)
π₯ Customer 360Β° View
Contact information with phone, email, location
Purchase History with itemized breakdowns
Deals & Pipeline section showing deal stats and list
Notes & Interactions β Add, pin, delete notes by type (General, Call, Meeting, Complaint, Feedback, Internal)
Filter by type (Call, Meeting, Email, Task, Follow-up, Note)
Filter by priority and completion status
Toggle completion, CRUD operations via modals
Associate activities with customers
π Dashboard & Insights
Real-time KPIs: Total Customers, Active, Revenue, VIP count
Revenue trend charts and growth metrics
AI-powered dashboard summary with one click
π£ Campaigns
SMS/Email campaign management
Audience targeting by customer segment
AI-generated campaign messages
Send tracking per customer
π Reports
PDF and Excel export
Sales, Customer, and Segment reports
AI-generated executive summaries
Monthly business reports with date filtering
π Online Store
Public storefront with product display
Cart, checkout, and order management
Coupon/discount code system
QR code generation for products
π¦ Inventory / Stock Management
Product catalog with SKU tracking
Stock in/out transactions with audit trail
Low stock alerts
Barcode scanning support
π€ Data Import
CSV and XLSX file import for customers and products
Google Sheets auto-sync (every 60 seconds)
Smart field mapping
π€ User Roles
Admin / Manager / Viewer role-based access
JWT authentication with token refresh
π Technology Stack
Backend
Technology
Purpose
Node.js + TypeScript
Server runtime
Express.js 4
REST API framework
PostgreSQL 17
Relational database
pg (node-postgres)
Database driver with connection pooling
ASI:One (OpenAI-compatible)
AI/ML inference engine
pdfkit
PDF report generation
exceljs
Excel report generation
jsonwebtoken
JWT authentication
multer
File upload handling
csv-parser
CSV file parsing
node-cron
Scheduled tasks
Frontend
Technology
Purpose
React 19 + TypeScript
UI framework
Vite 7
Build tool and dev server
React Router v7
Client-side routing
Tailwind CSS 3
Utility-first CSS framework
Recharts
Charts and data visualization
Lucide React
Icon library (200+ icons)
Axios
HTTP client with interceptors
react-hot-toast
Toast notifications
Radix UI
Headless UI primitives (Dialog, Dropdown)
html2canvas + jspdf
Client-side PDF generation
Database
Table
Purpose
users
User accounts and authentication
customers
Customer contact information and aggregates
purchases
Purchase/order records with itemized details
products
Product catalog with prices and stock
inventory_transactions
Stock movement audit trail
campaigns
Email/SMS marketing campaigns
campaign_sends
Individual campaign message records
customer_segments
K-means clustering results
store_settings
Online store configuration
online_orders
Orders from online storefront
coupons
Discount codes and promotions
deals
Sales pipeline deals
activities
CRM activity tracking (calls, meetings, tasks)
notes
Customer interaction notes
π Quick Start
Prerequisites
Node.js 18+ and npm
PostgreSQL 17
Git
Setup
# 1. Clone the project
git clone <your-repo-url>cd Astro_CRM
# 2. Create PostgreSQL database
psql -U postgres -c "CREATE DATABASE astrocrm;"# 3. Configure backendcd backend
cp .env.example .env # Edit with your DB credentials
npm install
# 4. Configure frontendcd ../frontend
npm install
# 5. Start backend (Terminal 1)cd backend
npm run dev
# β Listening on port 3001# 6. Start frontend (Terminal 2)cd frontend
npm run dev
# β http://localhost:5173
Environment Variables (backend/.env)
PORT=3001JWT_SECRET=your-secret-keyPG_USER=postgresPG_PASSWORD=postgresPG_HOST=localhostPG_PORT=5432PG_DATABASE=astrocrmASI_ONE_API_KEY=your-asi-one-api-key# For AI features