
Xeno CRM
A modern, AI-powered Customer Relationship Management system with advanced campaign management, intelligent customer segmentation, and real-time analytics.
๐๏ธ Architecture
The XENO CRM platform follows a modern, modular architecture designed for scalability and maintainability:
The architecture consists of three main tiers:
Frontend Layer: React-based UI with modular components
Backend Layer: Node.js/Express API server with RESTful endpoints
Data & External Services Layer: MongoDB database and Groq AI integration
๐ Features
๐น Customer Management
Comprehensive customer profiles with detailed information
Customer activity tracking and history
Advanced search and filtering capabilities
Customer tagging and categorization
๐น Segmentation
AI-powered segment creation using natural language
Rule-based customer segmentation
Dynamic segment updates based on customer behavior
Real-time audience preview
๐น Campaign Management
Multi-channel campaign creation
Campaign performance tracking and analytics
Automated campaign scheduling
A/B testing capabilities
Modern UI with enhanced visual elements:
Key statistics dashboard cards (total campaigns, audience, success rate, segments)
Campaign avatars and visual identifiers
Colorized segment labels with chips
Interactive progress bars for success metrics
Intuitive icon-based action buttons
Helpful empty state guidance for new users
Improved delete confirmation with safety warnings
๐น Analytics & Reporting
Real-time dashboard with key performance indicators
Campaign success metrics and delivery statistics
Customer growth and engagement analytics
Exportable reports and data visualization
๐น Notifications System
Real-time notifications for important events
Customizable notification preferences
Notification history and management
๐น AI-Powered Features
Natural language segment creation
AI-generated messaging suggestions
Intelligent campaign performance insights
Automated customer behavior analysis
Predictive campaign success modeling
Content optimization recommendations
Customer engagement predictions
Churn risk identification
Personalized communication suggestions
๐ Security Features
Authentication & Authorization
JWT-Based Authentication
Secure Token Generation: Uses JSON Web Tokens (JWT) signed with a secure secret key
Token Structure: Contains user ID, email, and other essential claims
Token Storage: Securely stored in localStorage as 'xeno_auth_token'
Expiration: Tokens expire after 30 days for enhanced security
Authorization Flow:
Tokens are generated during login/OAuth authentication
Attached to all API requests in the Authorization header
Verified on the backend with the JWT secret
Failed verification triggers automatic logout
Authentication Middleware
Token Verification: Validates signature, expiration, and required fields
Request Context: Adds authenticated user data to request context (req.user)
Response Headers: Adds user ID to response headers (X-User-ID) for frontend validation
Comprehensive Error Handling: Different error responses for missing, invalid, or expired tokens
Multi-Tenant Data Isolation
Robust Tenant Isolation Strategy
User-Based Data Separation: All data (customers, segments, campaigns, orders) is strictly segregated by user ID
Mandatory Filtering: Every database query includes userId filters to prevent data leakage
Deep Integration: Tenant isolation enforced at every data access point:
MongoDB schemas include userId fields with appropriate indexing
Database query construction consistently applies userId filters
Complex queries (with AND/OR logic) are carefully constructed to maintain isolation
Frontend-Backend Validation
Double-Check Mechanism: Frontend validates that response data belongs to the authenticated user
Cross-Verification: User ID in JWT token is verified against user ID in response headers
Automatic Security Response: Detects and handles potential tenant isolation breaches by:
Clearing invalid tokens
Redirecting to login
Preventing display of unauthorized data
Segment & Campaign Isolation
Segmented Data Access: Users can only access and manipulate their own customer segments
Preview Protection: Audience previews and campaign targeting strictly limited to user's own customers
Logical Query Construction: Complex segment conditions combined with userId filters using MongoDB's $and and $or operators
๐ ๏ธ Technology Stack
Frontend
React.js: Modern UI framework
Material-UI: Component library for consistent design
Context API: State management
Axios: API communication
React Router: Navigation and routing
React Toastify: Notification system
Chart.js: Data visualization
React Hook Form: Form validation and handling
MUI X Data Grid: Advanced data table functionality
Backend
Node.js: JavaScript runtime
Express: Web framework
MongoDB: NoSQL database
Mongoose: MongoDB object modeling
JWT: Authentication
Groq AI: Advanced AI capabilities
๐ Getting Started
Prerequisites
Node.js (v14 or higher)
npm or yarn
MongoDB (local or Atlas)
Git
Cloning the Repository
Copy the example environment file:
Edit the
.env file and fill in your actual values:Backend Setup
Navigate to the backend directory:
Copy the example environment file:
Edit the
.env file and fill in your actual values:๐ฆ Installation & Running
Frontend
The frontend will be available at
http://localhost:3000Development Build
Backend
The API will be available at
http://localhost:5000๐ API Endpoints
Authentication
POST /api/auth/login - User loginPOST /api/auth/register - User registrationGET /api/auth/me - Get current userPOST /api/auth/refresh-token - Refresh access tokenPOST /api/auth/forgot-password - Initiate password resetPOST /api/auth/reset-password - Complete password resetCustomers
GET /api/customers - Get all customersGET /api/customers/:id - Get customer by IDPOST /api/customers - Create new customerPUT /api/customers/:id - Update customerDELETE /api/customers/:id - Delete customerSegments
GET /api/segments - Get all segmentsGET /api/segments/:id - Get segment by IDGET /api/segments/:id/audience - Get segment audiencePOST /api/segments - Create new segmentPOST /api/segments/preview - Preview segment audiencePUT /api/segments/:id - Update segmentDELETE /api/segments/:id - Delete segmentCampaigns
GET /api/campaigns - Get all campaignsGET /api/campaigns/:id - Get campaign by IDPOST /api/campaigns - Create new campaignPUT /api/campaigns/:id - Update campaignDELETE /api/campaigns/:id - Delete campaignGET /api/campaigns/stats - Get campaign statisticsGET /api/campaigns/:id/analytics - Get detailed campaign analyticsPOST /api/campaigns/:id/duplicate - Duplicate existing campaignPUT /api/campaigns/:id/status - Update campaign status๐ง AI Integration
Xeno CRM leverages Groq's powerful AI capabilities for several key features:
1. Natural Language Segment Creation
Users can describe their target audience in plain English, and the AI will convert it into segment rules.
Example: "Customers who spent more than 10000 AND their visits count is less than 3" gets converted to appropriate database queries.
2. Campaign Message Suggestions
AI generates personalized message templates based on campaign goals and target audience.
3. Performance Insights
AI analyzes campaign performance and provides actionable insights to improve future campaigns.
4. Customer Behavior Analysis
AI identifies patterns and trends in customer behavior to inform segmentation strategies.
5. Content Optimization
AI provides recommendations for optimizing campaign content based on historical performance data.
6. Predictive Analytics
AI forecasts campaign performance and customer engagement metrics to guide marketing strategy.
๐ Security
JWT Authentication: Secure user authentication
Environment Variables: All sensitive information stored in .env files
API Key Protection: Groq API keys and other credentials secured
Input Validation: Protection against malicious inputs
CORS Configuration: Controlled access to API endpoints
โ ๏ธ Known Limitations & Assumptions
Browser Compatibility
Optimized for modern browsers (Chrome, Firefox, Safari, Edge)
Limited support for Internet Explorer 11 and below
Not fully responsive; optimized for desktop and tablet views (minimum 768px width)
AI Integration
Groq API has rate limits that may affect heavy usage scenarios
AI predictions are probabilistic and not guaranteed to be 100% accurate
Large language model responses may occasionally contain irrelevant suggestions
Performance
System is designed for up to 100,000 customers and 10,000 campaigns
Dashboard performance may degrade with extremely large datasets
Recommended maximum file upload size: 10MB
Data & Privacy
User data is stored according to the privacy policy and local regulations
Assumes compliance with GDPR, CCPA, and similar regulations for user implementations
No built-in data residency controls for specific geographic requirements
Connectivity
Requires stable internet connection for AI features
Offline functionality is limited to basic viewing of cached data
Localization
Primary language support for English
Limited localization for other languages
Date formats default to MM/DD/YYYY unless configured otherwise
๐งช Testing
๐ Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ฅ Team
Neeraj Jaiswal - Lead Developer - GitHub Profile
๐ Acknowledgements
Material-UI for the UI components
Groq AI for AI capabilities
MongoDB for database services
React for the frontend framework
0 likes ยท 9 views ยท Jul 6, 2025
Developed an AI-powered Customer Relations Management System with advanced features.
Timeline
May 31, 2025 - Jun 5, 2025