A comprehensive web-based car rental management system built with Node.js, Express, and LevelDB. This system provides separate interfaces for customers and administrators, featuring vehicle search, booking management, and administrative tools.
- User Registration & Authentication - Secure phone-based registration and login
- Vehicle Search & Filter - Advanced search with date availability, make, model, fuel type filters
- Real-time Booking - Reserve vehicles with date/time selection and conflict prevention
- Dashboard - View booking history and manage reservations
- Responsive Design - Mobile-friendly interface with Bootstrap
- Admin Dashboard - Overview of vehicles, bookings, and customer statistics
- Vehicle Management - Add, edit, delete vehicles with comprehensive details
- Advanced Search & Filtering - Search vehicles by VIN, make, model with sortable columns
- Booking Management - View and manage all customer bookings
- Customer Management - View registered customers and their booking history
- Bulk Operations - CSV import/export for vehicle data management
- Pagination & Sorting - Handle large datasets efficiently
- UUID Vehicle Mapping - Hide sensitive VIN numbers from customers
- Session Management - Secure session-based authentication
- Input Validation - Server-side validation with express-validator
- Role-based Access Control - Separate admin and customer access levels
- Password Hashing - Secure password storage with bcrypt
- Backend: Node.js, Express.js
- Database: LevelDB (Key-Value Store)
- Frontend: EJS Templates, Bootstrap 5, jQuery
- Authentication: Express Session, bcrypt
- File Upload: Multer
- Validation: Express Validator
- UI Icons: Bootstrap Icons
- Node.js: Version 18.x or higher
- NPM: Version 8.x or higher (comes with Node.js)
- Operating System: Windows 10+, macOS 10.15+, Ubuntu 18.04+
- Memory: 512MB RAM minimum, 1GB recommended
- Storage: 100MB free disk space
- Node.js: Version 20.x LTS
- NPM: Version 10.x
- Memory: 2GB RAM
- Storage: 500MB free disk space
-
Install Node.js
# Check if Node.js is installed node --version npm --version # If not installed, download from: https://nodejs.org/ # Recommended: Use Node Version Manager (nvm)
-
Install Git (if not already installed)
# Check if Git is installed git --version # If not installed, download from: https://git-scm.com/
-
Clone the Repository
# Using SSH (recommended) git clone git@github.com:resham57/Car-Rental-Management-System.git # Or using HTTPS git clone https://github.com/resham57/Car-Rental-Management-System.git
-
Navigate to Project Directory
cd Car-Rental-Management-System -
Install Dependencies
# Install all required packages npm install # Verify installation npm list --depth=0
-
Environment Configuration (Optional)
# Copy example environment file cp .env.example .env # Edit environment variables (optional) # APP_PORT=3000 # APP_SECRET=your-secret-key
-
Start the Application
# Development mode (with auto-reload) npm run dev # Production mode npm start
-
Access the Application
π Application: http://localhost:3000 π€ Default Admin: Username: admin Password: Admin@123
CRMS/
βββ app.js # Main application entry point
βββ package.json # Dependencies and scripts
βββ README.md # Project documentation
βββ .env.example # Environment variables template
βββ constants.js # Application constants
βββ config/
β βββ database.js # LevelDB configuration and helpers
βββ middleware/
β βββ auth.js # Authentication middleware
βββ routes/
β βββ auth.js # Authentication routes
β βββ admin.js # Admin panel routes
β βββ customer.js # Customer routes
β βββ vehicles.js # Vehicle search routes
βββ views/
β βββ layouts/ # EJS layout templates
β βββ admin/ # Admin panel views
β βββ auth/ # Login/register views
β βββ customer/ # Customer dashboard views
β βββ vehicles/ # Vehicle search views
βββ public/
β βββ css/ # Stylesheets
β βββ js/ # Client-side JavaScript
βββ validations/
β βββ index.js # Validation exports
β βββ userValidation.js # User input validation
βββ database/ # LevelDB data files (auto-created)
βββ uploads/ # Temporary file uploads (auto-created)
# Development with auto-reload
npm run dev
# Production start
npm start
# Check for security vulnerabilities
npm audit
# Fix security vulnerabilities
npm audit fixusers:{phone} # Customer records
admins:{username} # Admin accounts
vehicles:{vin} # Vehicle inventory
vehicle_uuid_map:{uuid} # UUID to VIN mapping
bookings:{id} # Rental bookings
- URL:
/admin/login - Username:
admin - Password:
Admin@123 - Capabilities: Full system access
- URL:
/auth/register - Login:
/auth/login - Requirements: Phone number, full name, password
Access /admin/vehicles/bulk for:
- CSV Export: Download all vehicle data
- CSV Import: Upload vehicle data (sample file:
sample-vehicles-500.csv) - Format: VIN, Make, Model, Year, Body Type, Fuel Type, etc.
- Customer Search: Date-based availability with filters
- Admin Search: Advanced filtering with pagination and sorting
- UUID Security: Customers see UUIDs instead of VINs
- Conflict Prevention: Automatic availability checking
- Status Management: Pending, Confirmed, Cancelled, Completed
- Date Validation: Future dates only, return after pickup
-
Port Already in Use
# Kill process on port 3000 lsof -ti:3000 | xargs kill -9 # Or use different port PORT=3001 npm start
-
Database Lock Error
# Stop all Node.js processes pkill node # Delete lock file if exists rm database/LOCK
-
Permission Errors
# Fix permissions (macOS/Linux) sudo chown -R $USER:$USER . # Clear npm cache npm cache clean --force
-
Module Not Found
# Reinstall dependencies rm -rf node_modules package-lock.json npm install
- Session Secret: Change default secret in production
- File Uploads: Limited to 5MB for CSV files
- Database: Automatic backup recommended for production
- Security: Regular dependency updates recommended
We welcome contributions from all team members! Please follow these guidelines:
-
Fork/Clone the Project
git clone git@github.com:resham57/Car-Rental-Management-System.git cd Car-Rental-Management-System -
Create Feature Branch
git checkout -b feature/AmazingFeatureBranch # or git checkout -b bugfix/ImportantBugFix -
Make Changes & Test
# Make your changes npm run dev # Test locally npm audit # Check for vulnerabilities
-
Commit Changes
git add . git commit -m "Add some AmazingFeature - Detailed description of changes - Any breaking changes noted - References to issues if applicable"
-
Push to Branch
git push origin feature/AmazingFeatureBranch
-
Open Pull Request
- Create PR on GitHub
- Add detailed description
- Request review from team members
- Ensure CI checks pass
- Consistent formatting with existing codebase
- Comments for complex logic
- Validation for all user inputs
- Error handling for all database operations
- Security considerations for new features
β οΈ Never work directly on the main branch- π All PRs require team review
- β Test your changes thoroughly
- π Update documentation as needed
This project is licensed under the ISC License - see the package.json file for details.
Happy Coding! ππ¨