1. Project Overview
RydeZee is a smart mobility platform connecting Users (Passengers), Vendors (Vehicle Owners), and Admin.
It supports one-time traveller/group bookings and monthly subscriptions.
Key Roles:
- User: Books rides and subscriptions
- Vendor: Manages vehicles and accepts ride orders
- Admin: Manages platform, users, vendors, and generates vendor invite links
2. Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React.js + Vite + Tailwind CSS + React Router v6 |
| State Management | Zustand |
| Backend | Node.js + Express.js |
| Database | MongoDB + Mongoose |
| Authentication | JWT (JSON Web Tokens) |
| File Upload | Cloudinary |
| Maps | Google Maps API |
| Emails | Nodemailer |
| Deployment | Frontend: Vercel, Backend: Render/Railway |
3. System Architecture
- Client-Server Architecture: React frontend communicates with Node.js backend via REST APIs.
- Database: MongoDB (NoSQL) for flexible schema.
- Authentication: JWT tokens stored in localStorage (Frontend).
- Authorization: Role-based access (User / Vendor / Admin) using middleware.
4. Database Schema (MongoDB)
1. User Model
js
{
_id,
name,
email,
phone,
password (hashed),
role: ["user", "vendor", "admin"],
profilePic,
isActive: Boolean,
createdAt
}
2. VendorInvite Model
js
{
inviteCode,
email,
expiresAt,
createdBy (adminId),
usedBy (vendorId),
isUsed: Boolean
}
3. Vehicle Model
js
{
_id,
vendorId,
vehicleType: ["Car", "SUV", "Mini Van", "Tempo Traveller"],
model,
numberPlate,
capacity,
photos: [String],
features: [String],
isAvailable: Boolean,
createdAt
}
4. Booking Model
js
{
_id,
userId,
vendorId,
pickup: { address, coordinates },
drop: { address, coordinates },
stops: [{ address, coordinates }],
passengers,
travelDate,
timing,
vehicleType,
fare,
status: ["pending", "accepted", "ongoing", "completed", "cancelled"],
createdAt
}
5. Subscription Model
js
{
_id,
userId,
vendorId,
pickup, drop,
daysOfWeek: ["Mon", "Tue", ...],
pickupTime,
returnTime,
vehicleType,
monthlyFare,
startDate,
status
}
5. API Endpoints
Auth APIs
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/verify-invite(for vendors)
User APIs
GET /api/user/profilePUT /api/user/profilePOST /api/bookings(Create Traveller Booking)POST /api/subscriptions(Create Monthly Subscription)GET /api/bookings/myGET /api/subscriptions/my
Vendor APIs
POST /api/vehiclesGET /api/vehicles/myPUT /api/vehicles/:idGET /api/bookings/requests(New ride requests)PUT /api/bookings/:id/acceptPUT /api/bookings/:id/status
Admin APIs
POST /api/admin/invite(Generate vendor invite link)GET /api/admin/usersGET /api/admin/vendorsGET /api/admin/bookingsPATCH /api/admin/users/:id/status
6. Folder Structure
Frontend (React)
src/
├── components/ # Reusable components
├── pages/ # Main pages (Login, Dashboard, Booking etc.)
├── context/ # AuthContext, ThemeContext
├── store/ # Zustand stores
├── utils/ # API calls, helpers
├── assets/
└── App.jsx
Backend (Node.js)
src/
├── config/ # db.js, cloudinary.js
├── controllers/ # authController, bookingController etc.
├── middleware/ # auth.js, roleCheck.js
├── models/ # User.js, Vehicle.js, Booking.js
├── routes/ # authRoutes, userRoutes, vendorRoutes, adminRoutes
├── utils/ # sendEmail, calculateFare
├── server.js
├── .env
7. Security Measures
- Password hashing using bcrypt
- JWT authentication with expiry
- Role-based authorization middleware
- MongoDB input validation using Mongoose
- Environment variables for secrets
- Cloudinary for secure image upload
- CORS enabled
8. Key Features Implementation Notes
- Vehicle Recommendation: Backend finds available vehicles matching capacity, vehicle type, and location.
- Fare Calculation: Simple formula (Base Fare + Distance * Rate + Stops Charge).
- Google Maps: Used for location selection and distance calculation.
- Notifications: Email notifications on booking status change.
- Invite System: Admin generates unique link/code valid for 7 days.
9. Development Guidelines
- Use Git with proper branching (main, dev, feature/*)
- Follow REST API standards
- Keep code clean and commented
- Error handling on both frontend and backend
- Responsive design (Mobile + Desktop)