Unified ride booking and car rental application with a monochrome, high‑contrast UI, real data integration, and extensible service architecture.
- On‑demand ride booking & multi‑day car rentals
- Monochrome design system (high contrast, Sora font)
- Auth flow with protected routes and token handling
- INR currency formatting across all monetary values
- Rebook flow (Book Again from history → prefilled booking forms)
- Recent locations memory (localStorage aided suggestions)
- Toast notification system (no native alerts)
- Dashboard metrics & histories (rides, rentals)
- Payments history (user payments list)
- Responsive, accessible Tailwind-based components
- Frontend: React 19 + Vite 7, React Router, Tailwind CSS 4
- Backend: Node.js (Express 5), Mongoose (MongoDB)
- Auth: JWT (middleware protected routes)
- Validation: express-validator
- Tooling: ESLint 9, Nodemon (dev), Intl f.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; border: 1px solid var(--mono-border); padding: .85rem 1.35rem; border-radius: .75rem; background: var(--mono-bg-2); color: var(--mono-text-high); transition: .18s background, .18s border-color, .18s color; }
.btn:hover { background: var(--mono-bg-3); border-color: var(--mono-border-light); color: var(--mono-text-high); /* keep dark text on hover */ }
/* Primary - Dark Background / .btn-primary { background: var(--mono-text-high); color: #fff !important; / enforce light text */ border-color: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); transition: background .18s, border-color .18s, box-shadow .18s, color .18s; }
.btn-primary:hover { background: #000; /* darker background on hover / border-color: #333; color: #fff !important; / always light text */ box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
/* Accessibility for disabled */ button, .btn, [role="button"], .nav-link, a.btn, input[type=submit], input[type=button] { cursor: pointer; }
button:disabled, .btn:disabled, [aria-disabled="true"], button[disabled] { cursor: not-allowed; opacity: .55; } or currency formatting
client/ # React SPA (UI, components, context, pages, services)
server/ # Express API (routes, controllers, models, services)
README.md # (This file)
- Node.js 18+ (recommended LTS)
- MongoDB instance (local or cloud)
- PowerShell / bash terminal
Create server/.env with:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/cresta
JWT_SECRET=replace_with_secure_secret
(Optional) Additional vars as features expand (payments, logging, etc.).
Create client/.env (NOT committed) with:
VITE_GOOGLE_PLACES_API_KEY=YOUR_BROWSER_RESTRICTED_KEY
Key should be restricted to Maps JavaScript API + Places API, HTTP referrers. Autocomplete gracefully degrades to plain text inputs if absent.
From repo root:
# Install server deps
cd server; npm install; cd ..
# Install client deps
cd client; npm install; cd ..Run API and client in separate terminals.
# Terminal 1 - API
cd server
npm run dev
# Terminal 2 - Client
cd client
npm run devFrontend dev server defaults to: http://localhost:5173 Backend defaults to: http://localhost:5000
Adjust CORS or proxy if deploying separately.
cd client
npm run buildBuild output: client/dist/ (configure static hosting or reverse proxy to serve).
cd server
npm startsrc/context/AuthContext.jsx– auth state & token managementsrc/services/– API abstraction (rides, rentals, payments, etc.)src/pages/– primary route views (Landing, Booking, Rentals, History, Payments, Profile)src/components/– UI primitives (Navbar, Tabs, StatCard, Skeleton, Toasts)src/utils/currency.js– INR formatter helper
routes/– Express route definitionscontrollers/– HTTP layer logic & response shapingservices/– Business logic (DB queries, validation)models/– Mongoose schemas (User, Booking, Payment, Car, Driver)middleware/auth.middleware.js– JWT validation + role guarddb/db.js– Mongo connection bootstrap
Endpoints (protected):
POST /api/payments– create payment for bookingGET /api/payments/:id– retrieve paymentGET /api/payments/user/:userId– list user paymentsPUT /api/payments/:id/status– update status (admin) UI page:/paymentsshows list with status chips.
- Monochrome tokens in
theme-mono.css - Reusable components:
StatCard,StatusBadge,Tabs,EmptyState,Skeleton,FormInput - High contrast buttons & pill tabs
- Create function in
server/services/*.service.js - Expose via controller + route file
- Consume from
client/src/services/*.jsusing sharedapiClient - Integrate into page/component w/ loading + error states + toasts
| Area | Script | Purpose |
|---|---|---|
| Client | npm run dev |
Vite dev server |
| Client | npm run build |
Production bundle |
| Client | npm run preview |
Preview production build |
| Server | npm run dev |
Nodemon reload API |
| Server | npm start |
Start API (prod mode) |
- Add Jest + React Testing Library for UI
- Add supertest for API endpoints
- Integrate GitHub Actions for CI
- Real payment provider integration (UPI / gateway)
- Driver assignment UI & live tracking
- Push notifications / WebSockets for status updates
- Profile edit persistence endpoint
- Advanced filters & export for histories
- Multi-language + dark/high-contrast accessibility audit
- Fork & branch:
feat/short-description - Commit using conventional style (optional)
- Open PR with clear before/after context & screenshots for UI
Proprietary (update if you decide to open-source). Add a LICENSE file if needed.
Questions or need enhancements? Open an issue or extend the roadmap section.