Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Building a Trust Layer: Ratings in GusLift (Current State)

DEV Community·Kofi Amo-Antwi·20 days ago
#lF9jO58V
#api#backend#database#showdev#ride#history
Reading 0:00
15s threshold

GusLift is a campus rideshare app for students at our university. After shipping ride history and profile photos, the next obvious gap was trust: before someone gets in a car (or offers a seat), they want a signal that the other person has shown up and behaved well on past trips. Data model: one row per person, per ride Ratings live in Supabase in a ratings table keyed by the ride and who is giving the rating. Conceptually each row stores: which ride it was, who rated (from_user_id), who was rated (to_user_id), and an integer score from 1 to 5. On the API side, POST /api/ratings validates that payload and upserts on conflict so a user can adjust their score for the same ride without creating duplicates. GET /api/ratings?user_id=… aggregates every rating received by that user and returns a rounded average plus a count, which is what powers the driver’s headline number on the home screen. Ride history as the glue The ride history endpoint already loads completed trips, riders, drivers, and cars.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More