Production-ready ride-sharing web app inspired by BlaBlaCar. Monorepo with frontend (Vite + React + Tailwind + Framer Motion + React Router) and backend (Node.js + Express + MongoDB Atlas).
- Smooth signup/login (no OTP)
- JWT auth, password hashing, protected routes, role-based access
- Auto admin role if email matches
ADMIN_EMAIL - Post/search rides; booking with history
- Courier: request delivery or book parcel weight on a ride
- Persistent SOS button stores alerts visible in admin dashboard
- Clean UI, responsive, loading + basic error handling
frontend/— Vite React appbackend/— Express API server
Create .env files.
Backend .env:
PORT=5000
CLIENT_URL=http://localhost:5173,http://localhost:5174
MONGODB_URI=your_mongodb_atlas_uri
JWT_SECRET=supersecret
[email protected]
# Note: Email/SMS are not used in the current auth flow
Frontend .env:
VITE_API_URL=http://localhost:5000/api
In two terminals:
Backend:
Push-Location "c:\Users\abhiv\Desktop\S81_Abhi_Shareocar\backend"
npm run devFrontend:
Push-Location "c:\Users\abhiv\Desktop\S81_Abhi_Shareocar\frontend"
npm run devOpen http://localhost:5173 (or :5174 if Vite switches)
POST /api/auth/signupPOST /api/auth/loginGET /api/auth/meGET /api/ridesPOST /api/ridesGET /api/rides/:idPUT /api/rides/:id(update)POST /api/rides/:id/bookGET /api/bookings/mePOST /api/courierGET /api/courier/mePOST /api/rides/:id/courier-bookGET /api/courier/me/bookingsPOST /api/sosGET /api/sos(admin)PATCH /api/sos/:id/resolve(admin)
- Admin role is assigned automatically when logging in if email matches
ADMIN_EMAIL. - Courier capacity/pricing can be set by drivers when posting rides.