Skip to content

Full-stack driver feedback management system with intelligent sentiment analysis. Features JWT authentication, multi-dimensional ratings, automated driver scoring, and comprehensive admin analytics. Built with React, Node.js, Express, and MongoDB.

Notifications You must be signed in to change notification settings

SagarMaddela/Driver-Sentiment-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RideX - Driver Feedback Management System

A full-stack web application for managing and analyzing driver feedback with intelligent sentiment analysis and comprehensive admin analytics.

πŸš€ Overview

RideX is a modern feedback management system designed for ride-sharing platforms. It enables users to submit detailed feedback about their drivers, while providing administrators with powerful analytics and insights through sentiment analysis of user comments.

Key Features

  • User Authentication - Secure JWT-based authentication with role-based access control (User, Driver, Admin)
  • Multi-Dimensional Feedback - Rate drivers across multiple categories:
    • Overall Rating
    • Ride Quality
    • Driving Behavior
    • Cleanliness
    • Punctuality (On Time)
  • Intelligent Sentiment Analysis - Automatic text-based rating prediction from user comments
  • Driver Scoring System - Automated driver performance scoring (0-100 scale) based on feedback
  • Admin Dashboard - Comprehensive analytics including:
    • Driver performance metrics
    • Feedback trends and statistics
    • Sentiment analysis (positive/negative comments)
    • Average ratings and text scores
  • Real-time Updates - Dynamic driver selection and feedback submission
  • Responsive Design - Modern UI built with React and Tailwind CSS

πŸ› οΈ Tech Stack

Frontend

  • React 19.2.0 - Modern UI library
  • React Router DOM 7.9.6 - Client-side routing
  • Tailwind CSS 4.1.17 - Utility-first CSS framework
  • Axios 1.13.2 - HTTP client for API requests
  • Vite 7.2.4 - Fast build tool and dev server

Backend

  • Node.js with Express 5.1.0 - Web application framework
  • MongoDB with Mongoose 9.0.0 - NoSQL database and ODM
  • JWT (jsonwebtoken 9.0.2) - Secure authentication
  • bcrypt 6.0.0 - Password hashing
  • CORS - Cross-origin resource sharing
  • dotenv - Environment variable management

πŸ“ Project Structure

feedback_system/
β”œβ”€β”€ client/                 # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ LandingPage.jsx      # Landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.jsx        # User login
β”‚   β”‚   β”‚   β”œβ”€β”€ SignupPage.jsx       # User registration
β”‚   β”‚   β”‚   β”œβ”€β”€ Homepage.jsx         # User feedback form
β”‚   β”‚   β”‚   └── AdminHome.jsx        # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   └── axios.js             # Axios configuration
β”‚   β”‚   β”œβ”€β”€ App.jsx                  # Main app component
β”‚   β”‚   └── main.jsx                 # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
└── server/                 # Backend Node.js application
    β”œβ”€β”€ controllers/
    β”‚   β”œβ”€β”€ auth.controller.js       # Authentication logic
    β”‚   └── feedback.controller.js   # Feedback & driver logic
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ User.model.js            # User schema
    β”‚   └── Feedback.model.js        # Feedback schema
    β”œβ”€β”€ routes/
    β”‚   β”œβ”€β”€ auth.router.js           # Auth routes
    β”‚   └── feedback.router.js       # Feedback routes
    β”œβ”€β”€ middlewares/
    β”‚   └── auth.js                  # JWT authentication middleware
    β”œβ”€β”€ .env                         # Environment variables
    β”œβ”€β”€ index.js                     # Server entry point
    └── package.json

πŸ”§ Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or cloud instance)
  • npm or yarn package manager

Backend Setup

  1. Navigate to the server directory:
cd server
  1. Install dependencies:
npm install
  1. Create a .env file in the server directory:
PORT=3000
MONGO_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
  1. Start the server:
node index.js

The server will run on http://localhost:3000

Frontend Setup

  1. Navigate to the client directory:
cd client
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The client will run on http://localhost:5173

πŸ“‘ API Endpoints

Authentication

  • POST /api/signup - Register a new user
  • POST /api/signin - Login user

Feedback (Protected Routes)

  • POST /api/create - Submit feedback for a driver
  • GET /api/getdrivers - Get list of all drivers
  • GET /api/getfb - Get all feedbacks with analytics

🎯 Core Functionality

Sentiment Analysis Algorithm

The system includes a built-in sentiment analysis feature that automatically evaluates user comments:

  • Positive Keywords: good, great, excellent, amazing, friendly, polite, helpful, clean, comfortable, smooth, perfect, nice, fast, on time, professional, best
  • Negative Keywords: bad, rude, angry, unprofessional, late, dirty, slow, worst, rough, unsafe, careless, annoying, smell, disgusting

The algorithm assigns a text-based score (1-5) based on keyword frequency, which is then combined with the manual rating to calculate the driver's overall performance score.

Driver Scoring System

Driver scores are calculated using:

  1. Average of manual rating and auto-generated text score
  2. Normalized to a 0-100 scale
  3. Updated automatically after each new feedback submission

πŸ‘₯ User Roles

User

  • Submit feedback for drivers
  • Rate across multiple dimensions
  • Add detailed comments

Driver

  • Receive feedback from users
  • Performance tracked via scoring system

Admin

  • View all drivers and their performance metrics
  • Access comprehensive feedback analytics
  • Monitor sentiment trends
  • View positive/negative comment statistics

🎨 UI Features

  • Star Rating Component - Interactive 5-star rating system
  • Driver Selection Dropdown - Dynamic driver list from database
  • Form Validation - Client-side validation for required fields
  • Success/Error Notifications - Toast-style popup messages
  • Responsive Tables - Mobile-friendly data display
  • Analytics Cards - Visual metrics display on admin dashboard

πŸ” Security Features

  • Password hashing with bcrypt (10 salt rounds)
  • HTTP-only cookies for JWT tokens
  • Protected routes with authentication middleware
  • Email uniqueness validation
  • Role-based access control

🚦 Getting Started

  1. Sign Up - Create an account with role selection (User/Driver/Admin)
  2. Login - Authenticate with email and password
  3. Submit Feedback (User) - Select a driver and provide ratings
  4. View Dashboard (Admin) - Access analytics and driver performance data

πŸ“Š Database Schema

User Model

  • name (String, required)
  • email (String, unique, required)
  • password (String, hashed, required)
  • role (Enum: User/Driver/Admin)
  • score (Number, default: 0)
  • count (Number, default: 0)

Feedback Model

  • user (ObjectId, ref: User)
  • Driver (ObjectId, ref: User)
  • rating (Number, 1-5, required)
  • comment (String, max: 500)
  • rideQuality (Number, 1-5)
  • drivingBehavior (Number, 1-5)
  • cleanliness (Number, 1-5)
  • onTime (Number, 1-5)
  • autoTextScore (Number)
  • timestamps (createdAt, updatedAt)

πŸ”„ Future Enhancements

  • Email notifications for low-rated drivers
  • Advanced analytics with charts and graphs
  • Export feedback data to CSV/PDF
  • Driver response system
  • Multi-language support
  • Mobile application
  • Real-time notifications with WebSockets

πŸ“ License

This project is open source and available for educational and commercial use.

πŸ‘¨β€πŸ’» Author

Built with ❀️ for MoveInSync


Note: This is a production-ready feedback management system with intelligent sentiment analysis capabilities. For any issues or feature requests, please open an issue in the repository.

About

Full-stack driver feedback management system with intelligent sentiment analysis. Features JWT authentication, multi-dimensional ratings, automated driver scoring, and comprehensive admin analytics. Built with React, Node.js, Express, and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Contributors