Riders are the primary consumers on TrustRide. They search for intercity routes, select individual seats on a visual seat map, transfer payment to the driver’s bank account, and track confirmation status in their personal dashboard. All rider actions are scoped to users withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/trustride/llms.txt
Use this file to discover all available pages before exploring further.
role=rider.
Registration
Riders register atPOST /register/ by submitting a form with the following required fields:
| Field | Type | Notes |
|---|---|---|
email | EmailField | Used as the username for login. Must be unique. |
phone | CharField | Must be a valid Nigerian number (e.g., 08012345678 or +2348012345678). |
first_name | CharField | Max 100 characters. |
last_name | CharField | Max 100 characters. |
gender | CharField | male or female. Used to enforce driver-set gender restrictions on trips. |
role | CharField | Must be set to rider at registration. |
password | — | Standard Django password with hashing. |
Riders do not need email verification to search for trips, but the dashboard displays a prompt until
is_email_verified is True. Profile completeness (first_name, last_name, phone, gender all non-empty) is required to place bookings.Rider Dashboard
GET /rider/dashboard/ — requires login and role=rider.
The rider dashboard is the central hub for all rider activity. It displays:
- Upcoming trips — bookings with
statusinreservedorconfirmedand a future departure date. - Booking history — all bookings ordered by date, with status badges.
- Stats summary — total trips taken, total amount spent, and count of pending refund requests.
- Quick actions — links to search trips, view all bookings, and manage refunds.
- Ambassador panel — if the rider is also an active ambassador, their trip approvals and pending requests are shown in the same view.
Booking Flow
Riders book seats through a multi-step process initiated from the trip detail page.Search for a Trip
Use the homepage search form or
GET /search/ with query parameters origin, destination, departure_date, and passengers. Only published trips with available_seats >= passengers are returned. Gender-restricted trips are filtered automatically for logged-in users.Select a Seat
Open the trip detail page at
/trip/<uuid>/. The page renders a visual seat map built from the vehicle’s seat_layout JSON. Each seat is labelled (e.g., A1, B2) and coloured to indicate availability. Booked seats (status reserved, pending_verification, or confirmed) are disabled.Submit Booking
POST /book/<uuid>/ with seat_ids (comma-separated seat IDs) or a single seat_id. The server places a row-level lock on the trip, checks availability, and creates one Booking record per seat with status=reserved. Available seat count is decremented atomically.Upload Payment Receipt
A payment instructions screen is shown immediately after booking at
/booking-success/<uuid>/. The rider transfers the exact amount to the bank account listed and uploads a receipt screenshot in the booking chat (using the 📷 icon). The booking advances to pending_verification.My Bookings
GET /my-bookings/ lists all bookings for the logged-in rider, with tab-based filtering:
| Filter | Shows |
|---|---|
all | Every booking regardless of status |
upcoming | reserved or confirmed bookings with a future departure date |
pending | Bookings awaiting driver verification (pending_verification) |
confirmed | Confirmed bookings |
past | Completed, cancelled, expired, or refunded bookings |
GET /booking/<uuid>/ for the full booking detail, which includes the payment receipt chat, trip info, and available actions (cancel, refund request, or rate).
Refund Requests
Riders can request a refund on anyconfirmed booking before the departure date.
- View refunds —
GET /rider/refunds/shows all refund requests with their status (requested,approved,rejected), alongside a list of refundable bookings not yet submitted. - Submit a refund —
POST /booking/<uuid>/refund/with areasonfield. ARefundrecord is created withstatus=requestedand the driver is notified. - Outcome — the driver approves at
POST /refund/<uuid>/approve/or rejects atPOST /refund/<uuid>/reject/. On approval, the seat is released and the rider receives a confirmation email.
Rating a Driver
After a trip is markedcompleted, a rider can rate the driver once.
GET /booking/<uuid>/rate/ — renders a 1–5 star rating form with an optional written review.POST /booking/<uuid>/rate/ — creates a Rating record linking the trip, reviewer (rider), and reviewee (driver). Each reviewer can submit only one rating per trip (unique_together = ['trip', 'reviewer', 'reviewee']).
Avg('rating') and displayed on the trip detail page and driver profile.
Future Trip Interest
If no trip exists for a rider’s desired route and date, they can register interest so TrustRide notifies them when a matching trip is published.GET/POST /interest/future-interest/ — riders submit:
| Field | Description |
|---|---|
origin | Departure city |
destination | Arrival city |
preferred_date | Must be a future date |
time_of_day | morning (6 AM–12 PM), afternoon (12–6 PM), or evening (6–12 AM) |
gender | Gender preference for the trip: anyone, male, or female |
FutureTripInterest model enforces a unique_together constraint on [user, origin, destination, preferred_date], preventing duplicate interests for the same route and day. When a matching trip is published, is_notified is set to True and notified_at is recorded.
Waitlist
When a trip is fully booked (available_seats = 0), riders can join a position-based waitlist.
POST /join-waitlist/<uuid>/ — creates a WaitlistEntry with:
queue_position— automatically assigned ascurrent_count + 1status— starts aspendingexpires_at— defaults to 30 minutes from entry creation
seating_capacity. When a seat becomes available (booking cancelled or refunded), the next rider in queue is notified automatically via notify_next_in_waitlist().
Next of Kin
For safety, TrustRide stores next-of-kin information in theUserProfile model. Riders fill this in at /profile/edit/.
| Field | Description |
|---|---|
next_of_kin_name | Full name of the emergency contact |
next_of_kin_phone | Phone number of the emergency contact |
next_of_kin_relationship | Relationship to the rider (e.g., parent, spouse) |
Next-of-kin information is only visible to TrustRide administrators and is never shared with drivers or ambassadors.