Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

LeadFlow CRM

A modern, intelligent Customer Relationship Management system built with the MERN stack, designed to streamline lead management, automate workflows, and provide powerful analytics for growing businesses.

Features

Core Functionality

  • Lead Management: Create, update, and track leads with detailed project descriptions
  • User Authentication: Role-based access control (Admin/User) with JWT authentication
  • Contact Form: Professional contact form with project requirement capture
  • Admin Dashboard: Comprehensive dashboard with analytics and lead management
  • Real-time Analytics: Interactive charts showing lead growth and project distribution

Advanced Features

  • Session Persistence: Automatic login restoration across page refreshes
  • Multiple Submissions: Allow multiple lead submissions from the same email
  • Project Categorization: Intelligent categorization of project types from descriptions
  • Responsive Design: Mobile-first design that works seamlessly on all devices
  • Loading States: Professional loading spinners and skeleton screens
  • Toast Notifications: User-friendly feedback system

Technology Stack

Frontend

  • React 18: Modern React with hooks and functional components
  • React Router: Client-side routing with protected routes
  • Tailwind CSS: Utility-first CSS framework for rapid UI development
  • Recharts: Data visualization library for analytics charts
  • Axios: HTTP client for API requests
  • React Context: State management for authentication

Backend

  • Node.js: JavaScript runtime environment
  • Express.js: Web application framework
  • MongoDB: NoSQL database for data storage
  • Mongoose: MongoDB object modeling for Node.js
  • JWT: JSON Web Tokens for authentication
  • bcryptjs: Password hashing for security

Development Tools

  • dotenv: Environment variable management
  • nodemon: Auto-restart server during development
  • Git: Version control system

Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB Atlas account or local MongoDB installation
  • Git

1. Clone the Repository

git clone <repository-url>
cd leadflow-crm

2. Backend Setup

# Navigate to server directory
cd server

# Install dependencies
npm install

# Create .env file
cp .env.example .env

3. Environment Variables

Update the .env file with your credentials:

# MongoDB Connection URI
MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/<database>?retryWrites=true&w=majority

# Server Configuration
PORT=5000
NODE_ENV=development

# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRE=30d

# Admin Credentials
ADMIN_EMAIL=your-admin-email@example.com
ADMIN_PASSWORD=your-admin-password

4. Frontend Setup

# Navigate to client directory
cd ../client

# Install dependencies
npm install

5. Running the Application

Start the Backend Server

cd server
npm start

Start the Frontend Application

cd client
npm start

The application will be available at:

Usage

For Regular Users

  1. Sign Up: Create a new account with your email and password
  2. Login: Access your personalized dashboard
  3. Submit Projects: Use the contact form to submit project requirements
  4. Track Progress: View your submitted projects and their status

For Admin Users

  1. Admin Login: Use admin credentials to access the admin dashboard
  2. Lead Management: View, update, and manage all submitted leads
  3. Analytics: Access comprehensive analytics with interactive charts
  4. User Management: Monitor user activity and project submissions

Demo Credentials

Note: To set up your own admin account, run node seedAdmin.js after configuring your .env file with your preferred admin credentials.

API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/signup - User registration

Lead Management

  • GET /api/leads - Get all leads (Admin only)
  • POST /api/leads - Create new lead
  • GET /api/leads/:id - Get single lead
  • PUT /api/leads/:id - Update lead
  • DELETE /api/leads/:id - Delete lead
  • POST /api/leads/:id/notes - Add note to lead

Health Check

  • GET /api/health - Server health status

Project Structure

leadflow-crm/
|-- client/                 # React frontend
|   |-- public/
|   |-- src/
|   |   |-- components/     # Reusable components
|   |   |-- context/        # React context providers
|   |   |-- pages/          # Page components
|   |   |-- services/       # API services
|   |   |-- App.js          # Main App component
|   |   |-- index.js        # App entry point
|   |-- package.json
|-- server/                 # Node.js backend
|   |-- controllers/        # Route controllers
|   |-- models/            # Database models
|   |-- middleware/        # Custom middleware
|   |-- routes/            # API routes
|   |-- .env               # Environment variables
|   |-- .gitignore         # Git ignore file
|   |-- index.js           # Server entry point
|   |-- package.json
|-- README.md               # Project documentation

Features in Detail

Analytics Dashboard

  • Lead Growth Chart: 7-day trend visualization of lead submissions
  • Project Distribution: Pie chart showing project type breakdown
  • Statistics Cards: Total leads, new leads today, conversion rate
  • Real-time Updates: Charts update automatically with new data

Lead Management

  • Detailed View: Complete lead information with project descriptions
  • Status Tracking: New, Contacted, Converted, Lost status management
  • Notes System: Add internal notes for each lead
  • Bulk Actions: Multiple lead management capabilities

Security Features

  • JWT Authentication: Secure token-based authentication
  • Role-Based Access: Admin and user role separation
  • Password Hashing: Secure password storage with bcrypt
  • Input Validation: Comprehensive input sanitization and validation

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please contact:

Acknowledgments

  • React team for the excellent framework
  • Tailwind CSS for the utility-first CSS framework
  • Recharts for the data visualization library
  • MongoDB for the robust database solution
  • All contributors and users of this project

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages