The Problem

Car rental platforms typically require stitching together a customer-facing web app, a mobile app, an admin backend, and payment processing—each with its own stack and deployment story. BookCars packages all four into one repository, so an operator gets a single source for fleet management, bookings, and payments without building integrations from scratch.

What This Does

BookCars is a full car rental platform with five self-contained projects: admin/ (339 files) for fleet and booking management, frontend/ (268 files) for customer web booking, mobile/ (135 files) for a React Native app, backend/ (123 files) for the API, and packages/ (41 files) for shared code. It supports Stripe and PayPal payment gateways and both single-supplier and multi-supplier modes.

The backend exposes a REST API with controllers for bookings, users, and suppliers. The admin panel includes a scheduler component for managing availability. The mobile app is built with React Native and can be deployed via EAS (.easignore present).

How It Is Wired

Execution starts at backend/src/index.ts, which boots the Express server defined in backend/src/app.ts. That app wires routes to controllers like backend/src/controllers/bookingController.ts (876 lines—the largest file) and userController.ts. The most-connected module is backend/src/config/env.config.ts, which 64 modules import; changing it ripples across the entire backend.

The admin panel's scheduler is the other hotspot: admin/src/components/scheduler/hooks/useStore.ts (32 importers) and types.ts (27 importers) sit inside a circular dependency cycle with helpers/generals.tsx. That cycle means changing any one of those files requires understanding how the others re-import it.

The frontend and mobile apps call the backend API over HTTP. The stack uses npm workspaces with lockfiles at admin/, backend/, and frontend/ levels. Dockerfiles exist for admin/ and backend/.

How To Use It

Setup: Clone and install dependencies per project:

git clone https://github.com/moses-y/bookcars
cd bookcars/backend && npm install
cd ../admin && npm install
cd ../frontend && npm install

Configuration: Each project has an .env.example file (backend/.env.example, admin/.env.example) defining required variables—database connection, Stripe/PayPal keys, and the API URL. Copy these to .env and fill in values.

Running it: Start the backend first, then the frontend/admin:

cd backend && npm run dev
cd ../admin && npm run dev
cd ../frontend && npm run dev

Docker deployments are supported via admin/Dockerfile and backend/Dockerfile, with __config/nginx.conf for reverse proxying.

Real-World Use

A regional car rental operator deploys the backend and admin panel on a VPS, runs the frontend for customer bookings, and publishes the mobile app to app stores. The admin panel handles fleet management, the scheduler handles availability, and Stripe/PayPal handle payments. Multi-supplier mode lets independent operators each manage their own fleet through the same admin interface.

Code Health & Issues

Static analysis found 139 issues (56 high, 83 medium). Key findings:

  • High - Circular imports in the admin scheduler (useStore.ts, types.ts, generals.tsx) make changes risky; extract shared types to break the cycle.
  • High - Hub modules: backend/src/config/env.config.ts has 64 dependents; keep it stable and small.
  • High - Duplicated code: 8,217 repeated 6-line blocks across 405 files, including deploy scripts and ESLint configs.
  • High - Oversized controllers: bookingController.ts and userController.ts exceed 800 lines each.
  • High - CI workflows use unpinned third-party actions (codecov/codecov-action@v5); pin to commit SHAs.
  • High - Wildcard CORS in backend/src/app.ts; replace with an explicit allow list.
  • High - bump-version.yml pushes directly to main; open a PR instead.
  • Medium - No Dependabot, no npm ci in CI, unpinned Docker base images, no non-root user in Dockerfiles, no dependency vulnerability scan.

The Bottom Line

BookCars is a complete, working car rental platform with real payment integration and a mobile app—substantial coverage for a single repository. The architecture is sound but the admin scheduler's circular dependencies and oversized controllers will make maintenance harder as the codebase grows. Suitable for operators who want a self-hosted platform rather than a SaaS subscription.