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.
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.
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.
Duration is approximated assuming an average speed of ~30 km/h:
duration_min = distance_km × 2
The fare is calculated using a simple base fare + per-km rate formula:
total_fare = base_fare + (distance_km × per_km_rate)
Example: a 5 km trip → 100 + (5 × 50) = $. 350
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.
Ready...
| ID | Customer | Phone | Pickup | Destination | Distance (km) | Duration (min) | Fare | Status | Payment | Created |
|---|