A modern, full-stack Customer Relationship Management (CRM) system built with Node.js, MongoDB, and React. This system allows you to efficiently manage leads and contacts with a clean, intuitive interface.
- β Complete Lead Lifecycle: Track leads from initial contact to conversion
- β Advanced Search & Filtering: Find leads by name, company, status, or source
- β Lead Sources Tracking: Monitor where your leads come from
- β Priority Management: Set and track lead priorities
- β Sales Pipeline: Track estimated values and probabilities
- β Follow-up Scheduling: Set next follow-up dates
- β Bulk Import: Import multiple leads at once
- β Customer Database: Manage existing customers and prospects
- β Company Information: Track job titles, departments, and company details
- β Contact Types: Categorize as customers, prospects, vendors, or partners
- β Account Management: Assign account managers to contacts
- β Real-time Statistics: View lead counts, pipeline value, and conversion rates
- β Source Analytics: See which channels generate the most leads
- β Recent Activity: Quick overview of new leads and updates
- β Performance Metrics: Track your CRM performance
- β Modern UI: Clean, responsive design with smooth interactions
- β Real-time Updates: Live data updates across the application
- β Data Validation: Comprehensive input validation and error handling
- β Search & Pagination: Efficient data browsing for large datasets
- β API Documentation: RESTful API with proper error responses
Backend:
- Node.js with Express.js
- MongoDB with Mongoose ODM
- Joi for data validation
- CORS, Helmet for security
- Rate limiting for API protection
Frontend:
- React 18 with modern hooks
- React Router for navigation
- React Query for state management
- React Hook Form for form handling
- Lucide React for icons
- Custom CSS with modern design
- Node.js (v16 or higher)
- MongoDB (local installation or cloud instance)
- Git
-
Clone the repository
git clone <your-repo-url> cd CRM
-
Install dependencies
# Install root dependencies and all sub-dependencies npm run install:all -
Set up environment variables
# Copy the example environment file cp server/.env.example server/.env # Edit the .env file with your MongoDB connection string # Default: MONGODB_URI=mongodb://localhost:27017/crm_database
-
Start MongoDB
- If using local MongoDB:
mongod - If using MongoDB Atlas: Ensure your connection string is in
.env
- If using local MongoDB:
-
Run the application
# Development mode (runs both client and server) npm run dev -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Health check: http://localhost:5000/api/health
CRM/
βββ package.json # Root package.json with scripts
βββ README.md # This file
βββ server/ # Backend Node.js application
β βββ package.json # Server dependencies
β βββ index.js # Main server file
β βββ models/ # MongoDB models
β β βββ Lead.js # Lead model
β β βββ Contact.js # Contact model
β βββ routes/ # API routes
β β βββ leads.js # Lead endpoints
β β βββ contacts.js # Contact endpoints
β β βββ pipeline.js # Pipeline analytics
β βββ .env.example # Environment variables template
βββ client/ # Frontend React application
βββ package.json # Client dependencies
βββ public/
β βββ index.html # Main HTML file
βββ src/
βββ App.js # Main App component
βββ App.css # Global styles
βββ index.js # React entry point
βββ components/ # Reusable components
β βββ Layout.js # Main layout with sidebar
βββ pages/ # Page components
β βββ Dashboard.js # Dashboard with statistics
β βββ Leads.js # Lead listing page
β βββ LeadForm.js # Lead create/edit form
β βββ Contacts.js # Contact listing page
β βββ ContactForm.js # Contact create/edit form
βββ utils/
βββ api.js # Axios API configuration
GET /api/leads- Get all leads (with pagination, search, filtering)GET /api/leads/:id- Get specific leadPOST /api/leads- Create new leadPUT /api/leads/:id- Update leadDELETE /api/leads/:id- Delete lead (soft delete)POST /api/leads/bulk- Bulk import leadsGET /api/leads/stats/summary- Get lead statistics
GET /api/contacts- Get all contactsGET /api/contacts/:id- Get specific contactPOST /api/contacts- Create new contactPUT /api/contacts/:id- Update contactDELETE /api/contacts/:id- Delete contact
GET /api/pipeline- Get pipeline overview
GET /api/health- Server health status
curl -X POST http://localhost:5000/api/leads \
-H "Content-Type: application/json" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"company": "Acme Corp",
"source": "website",
"status": "new",
"estimatedValue": 5000
}'curl "http://localhost:5000/api/leads?search=acme&status=new&page=1&limit=10"PORT=5000 # Server port
MONGODB_URI=mongodb://localhost:27017/crm_database # MongoDB connection
NODE_ENV=development # Environment# Root level commands
npm run dev # Start both client and server in development
npm run install:all # Install all dependencies
npm run start # Start server in production
# Server commands
npm run server:dev # Start server with nodemon
npm run server:start # Start server in production
# Client commands
npm run client:dev # Start React development server
npm run client:build # Build React for production- Modern Design: Clean, professional interface with consistent styling
- Responsive Layout: Works perfectly on desktop, tablet, and mobile
- Dark Sidebar: Professional navigation with active state indicators
- Status Badges: Color-coded status and priority indicators
- Form Validation: Real-time validation with helpful error messages
- Loading States: Smooth loading indicators and skeleton screens
- Toast Notifications: User-friendly success and error messages
- Empty States: Helpful guidance when no data is available
- Rate Limiting: Prevents API abuse
- Input Validation: Server-side validation with Joi
- Helmet: Security headers for Express
- CORS: Configured cross-origin resource sharing
- Data Sanitization: Protection against injection attacks
-
Build the React application:
cd client && npm run build
-
Start the server:
cd server && npm start
- Set
NODE_ENV=productionin your environment - Use a production MongoDB instance
- Configure proper CORS origins
- Set up environment variables on your hosting platform
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include error messages and steps to reproduce
- User authentication and authorization
- Email integration for lead communication
- Advanced reporting and analytics
- Task and activity management
- Integration with external services (email marketing, etc.)
- Mobile app development
- Advanced pipeline management with drag-and-drop
- Custom fields and lead scoring
Built with β€οΈ for modern CRM needs