A full-stack Customer Relationship Management (CRM) application built using React, Node.js, Express.js, PostgreSQL, and Prisma ORM.
The application helps organizations manage customer leads, assign them to sales representatives, track user activities, and monitor business performance through a secure role-based system.
- JWT Authentication
- Password hashing using Bcrypt
- Protected Routes
- Secure Login
The application supports three different user roles.
- Create Admin, Manager, and Sales users
- Delete users
- Create, update, assign, and delete leads
- Upload CSV files
- Send test emails
- View dashboard
- View audit logs
- Create Sales users
- Create, update, and assign leads
- Upload CSV files
- Send test emails
- View dashboard
- View assigned leads
- Update assigned lead status
- Cannot create users
- Cannot assign leads
- Cannot delete leads
The CRM provides complete Lead Management functionality.
- Create Lead
- View All Leads
- View Lead Details
- Update Lead
- Delete Lead
- Assign Lead to Sales Users
The dashboard provides real-time statistics including:
- Total Leads
- New Leads
- Assigned Leads
- Converted Leads
Whenever a Manager or Admin assigns a lead to a Sales user, the system automatically sends an email notification using Nodemailer.
Bulk lead import is supported using CSV files.
The uploaded CSV is parsed and all valid records are stored in PostgreSQL.
Expected CSV format:
name,email,phone,company
Every important action performed in the system is stored in the Audit Log.
Logged activities include:
- CREATE Lead
- UPDATE Lead
- DELETE Lead
- ASSIGN Lead
Only Admin users can access Audit Logs.
- React
- Vite
- React Router
- Axios
- Tailwind CSS
- React Hot Toast
- Lucide React
- Node.js
- Express.js
- PostgreSQL
- Prisma ORM
- JWT
- Bcrypt
- Nodemailer
- Multer
- CSV Parser
The application uses three main database models.
- id
- name
- password
- role
- id
- name
- phone
- company
- status
- assignedToId
- id
- action
- entity
- entityId
- userId
- createdAt
Admin creates users
β
βΌ
User Login
β
βΌ
JWT Authentication
β
βΌ
Protected API Access
β
βΌ
Lead Management
β
βΌ
Lead Assignment
β
βΌ
Email Notification
β
βΌ
Audit Log Created
β
βΌ
Dashboard Updated
crm-system
βββ client
β βββ src
β βββ public
β βββ package.json
β
βββ server
β βββ prisma
β βββ src
β β βββ config
β β βββ controllers
β β βββ middleware
β β βββ routes
β β βββ utils
β β βββ app.js
β βββ package.json
β
βββ README.md
git clone https://github.com/your-username/crm-system.gitcd server
npm install
npx prisma generate
npx prisma migrate dev
npm run devcd client
npm install
npm run devVITE_API_URL=http://localhost:5000/api- Authentication
- User Management
- Lead Management
- Dashboard
- CSV Upload
- Audit Logs
- Socket.IO Real-time Notifications
- Docker Support
- Refresh Token Authentication
- Advanced Search & Filtering
- Analytics Dashboard
- Deployment
Ashish Kumar
MERN Stack Developer
- GitHub: https://github.com/ashish-code6
- Email: ashishk810222@gmail.com
β If you found this project useful, consider giving it a star on GitHub!
for Teting API use POsTMAN
Login
Dashboard
Leads deatils
csv file and sending mail
create a user and deatils of user
Audit logs
profile
