A full-stack Customer Relationship Management System where admins can manage customers, segment them using advanced rules or AI text input, and create personalized campaigns with communication logs and AI-generated summaries.
- Admin logs in via Google, GitHub, or credentials (using Passport.js).
- Admin can:
- Add customers via a form
- Add orders per customer via a modal popup
- View customer profile and order in a quick popup
-
Two options:
-
A rule based form to build customer segments:
- Fields:
daysInactive,totalSpend,numberOfVisits,accountType,lastPurchaseDate,isSubscribed,mostCategoryOfProductsPurchased - Flexible
AND/ORlogic - Matching customers can be previewed with total count
- Fields:
-
✨ AI text area to describe desired segment in natural language → generates JSON rules
- Matching customers can be previewed with total count
-
- Two options:
- ✨ AI-generated message suggestions
- ✍️ Personalized Campaign messages suggestions by inputting topic and description
- On submission:
- Campaign is saved
- Communication logs created per customer
- Message sent → status updates (
pending→sent/failed)
- Displays:
- Campaign details & message
- Delivery stats (from communication log)
- AI-generated summary, e.g.:
“Your campaign reached 1,200 users. 1,050 were successfully delivered. 150 failed. Customers who spent more than ₹10K had the highest success rate.”
| Tool | Purpose |
|---|---|
| Google Generative AI | Campaign summaries, segment rule generation, personalized message suggestions |
Avoided cluttering with too many AND/OR dropdowns.
Used a rule-builder UI: React Query Builder
✅ Cleaner UX
✅ Nested conditions
✅ Easy to understand
- Message delivery is simulated (no real messaging API)
- No retry mechanism for failed messages
- AI generation depends on quality of text input
- Node.js (v18+)
- MongoDB (local or Atlas)
- npm
# Backend
cd backend
npm install
npm start# Frontend
cd frontend
npm install
npm run dev| Package | Purpose |
|---|---|
| Next.js | As a Frontend Framework |
| React,ReactDom | Next is build on React |
| tailwind css | Styling |
| Shadcn | Enhanced UI |
| axios | API calls |
| react-hot-toast | Toast notifications |
| react-querybuilder | Advanced rule builder UI |
| Package | Purpose |
|---|---|
| Express.js | Web server |
| Mongo DB | MongoDB |
| passport, passport-local, passport-google-oauth20, passport-github2 | Authentication strategies |
| express-session | Session management |
| jsonwebtoken, bcrypt | JWT + password hashing |
| Google Gemini API | AI integration |
| dotenv, cors | Config and CORS |








