🚖 Nimbus Booking Terminal

Step 1 — Set Pickup & Destination

Click "Locate Me" to auto-detect your current location via GPS, or click anywhere on the map while Pickup / Destination is selected (top-right toggle) to drop a pin manually. You can also drag the green (pickup) and red (destination) markers directly on the map. The address for each pin is fetched automatically using OpenStreetMap's reverse-geocoding service.

Step 2 — Create Booking

Fill in the customer name & phone, then click "Create Booking". The form sends the pickup/destination coordinates and addresses to the backend API (POST /api/bookings). The backend — not the browser — calculates the distance, duration, and fare, so the numbers can't be tampered with on the client side.

Step 3 — Server Calculates Distance

The backend uses the Haversine formula to calculate the straight-line distance (in km) between the pickup and destination coordinates. This formula accounts for the Earth's curvature, giving an accurate "as the crow flies" distance between two latitude/longitude points.

Step 4 — Duration Estimate

Duration is approximated assuming an average speed of ~30 km/h:

duration_min = distance_km × 2
Step 5 — Fare Calculation

The fare is calculated using a simple base fare + per-km rate formula:

total_fare = base_fare + (distance_km × per_km_rate)
  • Base Fare: $. 100 (flat starting charge)
  • Per KM Rate: $. 50 / km

Example: a 5 km trip → 100 + (5 × 50) = $. 350

Step 6 — Booking Saved

Once calculated, the booking is saved with status pending and payment status unpaid. It immediately appears in the All Bookings table below, which you can also refresh manually at any time.

Customer Details
Route Details
Locate Me
API Response
Ready...
All Bookings
ID Customer Phone Pickup Destination Distance (km) Duration (min) Fare Status Payment Created