Inspiration

As student populations expand, local transit infrastructure frequently bottlenecks. At universities like FUTO, thousands of students are left stranded at bus terminals every evening, haggling over arbitrary pricing or waiting in unsafe conditions at dark gates to catch shuttles back to external lodge clusters like Ihiagwa, Nekede, or Eziobodo. Existing global ride-hailing services completely ignore these micro-economies because campus layouts change rapidly and student pricing constraints are incredibly tight. We were inspired to build a highly localized, intelligent mobility tool that addresses student safety, logistics equity, and vehicle fuel efficiency.

What it does

ridR eliminates the need to manually browse routes, filter bus lines, or guess departure times. Conversational Booking Routing: A student simply types a natural language intent (e.g., "Heading back to my lodge after my last lecture"). Predictive Habit Allocation: The platform passes this context to an AI agent that cross-references the current time, location parameters, and the user's historical booking habits to predict and select the absolute best vehicle option. Contextual Geofencing: The system intelligently identifies and rejects intra-campus destination requests, keeping the fleet focused strictly on outbound cross-border commutes. Interactive Seating Assignment: The AI returns the real-time manifest of the matched bus, transforming the chat interface into a visual, interactive 2-column SeatGrid where the passenger selects their exact seating position before reserving their ticket.

How we built it

We engineered a unified full-stack application optimized for real-time performance and low-latency interaction loops: Frontend Architecture: Built with React, Next.js, and TypeScript, styled using Tailwind CSS, and utilizing Zustand for global client-side state memory. Component layers use custom, highly scannable design tokens (Modal, Input, Button). Backend Workspace API: Powered by a high-performance FastAPI wrapper running an asynchronous Uvicorn worker server cycle. Database & Live Streams: Leveraged Google Cloud Firestore to establish live network synchronization listeners (onSnapshot) that watch vehicle status loops and passenger allocations. AI Core Integration: Implemented the Google GenAI SDK using the gemini-2.5-flash model. We utilized strict JSON Schema formatting constraints alongside structured prompt engineering to ensure reliable, structured data outputs from the LLM. Security Layer: Enforced end-to-end token validation middleware (get_current_user) hooked into Firebase Authentication.

Challenges we ran into

State Synchronization Across Pipelines: We initially struggled to pull valid authentication credentials safely into the AI workflow modal because tokens were generated asynchronously at startup. We resolved this by extracting token chains directly via Firebase's native user.getIdToken() listener right at the execution moment. Database Query Performance Faults: Combining complex data filtering (isolating active buses) with timeline sorting constraints threw a critical database exception. We resolved this by building a dedicated Firestore Composite Index, reducing database query resolution latency down to milliseconds. Data Inconsistencies: We fixed an edge-case 500 server crash caused by cross-language string operations (accidentally invoking JavaScript .trim() inside our Python backend parsing array loops) by standardizing data formatting using .strip().lower() across all application boundaries.

Accomplishments that we're proud of

Fluid Step-Based UX: We successfully engineered a multi-step user experience loop inside a single modal dialog frame that transitions smoothly from raw natural language input to a visual seat configuration matrix without jarring layout shifts or mobile screen overlaps. No Hardcoded Values: We successfully removed all static parameters—including a persistent "A1" seat placeholder default—ensuring every piece of user data maps directly from active UI selections straight to the live database ledger. Real-time Manifest Computations: We built backend logic that replicates the frontend engine's reactive state filters, allowing Gemini to accurately see live seat availability and completely prevent double-booking.

What we learned

The Power of Structured AI Schemas: We learned that forcing large language models to respond strictly within fixed JSON schemas is vital when building production features. It bridges the gap between chaotic text interpretation and deterministic code logic. Local Optimization Over Broad Assumptions: Designing a system tailored specifically for unique, real-world campus boundaries taught us that micro-mobility solutions often outperform generic, one-size-fits-all tech platforms.

What's next for ridR — AI-Driven Smart Campus Logistics

Predictive Fleet Balancing for Drivers: We plan to build out an interface for drivers that uses aggregated passenger demand data to predict student exit rushes before they even happen, telling drivers exactly when and where to dispatch vehicles. Offline Token Validation: To account for cellular network drops around campus boundaries, we aim to implement offline QR-code pass validations that sync automatically once internet access is restored. Multi-Modal Transit Integration: Expanding the platform to support tricycle (Keke) clusters and motorcycle transit lines to offer end-to-end door-to-door safety tracking for students traveling deep into off-campus areas.

Built With

Share this project:

Updates

Submission history