Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DavidCevallos15/Crucidrive---APP/llms.txt

Use this file to discover all available pages before exploring further.

CruciDrive is a hyperlocal mobility platform built for the parish of Crucita, Manabí, Ecuador. It replaces random street patrolling (“vuelteo”) with proximity-based ride dispatch, reducing fuel waste and improving citizen safety through a dual-role mobile app backed by a Node.js/Express API and PostgreSQL with PostGIS.

Quickstart

Get the backend and frontend running locally in under 10 minutes.

Architecture

Understand the monorepo structure, tech stack, and data flow.

Backend API

Explore REST endpoints for auth, rides, and chat with full parameter docs.

WebSockets

Real-time GPS tracking and in-ride chat via Socket.io events.

Frontend Hooks

TypeScript hooks for auth, socket, tariff calculation, and location.

Design System

Glassmorphic design tokens — colors, typography, spacing, and effects.

How CruciDrive works

1

Authenticate via SMS OTP

Users sign in with their phone number. Supabase Auth sends a one-time code — no passwords required. After verifying, users register a profile as either a passenger or a driver.
2

Connect to real-time infrastructure

The mobile app opens a Socket.io WebSocket connection authenticated with the Supabase JWT. Drivers join sector rooms and begin broadcasting their GPS coordinates every 5 seconds.
3

Request and dispatch rides

A passenger selects an origin and destination sector, sees a pre-calculated fixed tariff, and submits a ride request. Nearby drivers receive the request and can accept it via the REST API.
4

In-ride communication

When a driver accepts a ride, CruciDrive automatically creates a private chat thread. Both parties join the thread room over WebSockets for real-time messaging until the ride ends.

Key features

GPS Tracking

Sector-based Socket.io rooms broadcast driver locations to passengers in real time with PostGIS storage.

Fixed Tariffs

10 pre-defined routes between 5 sectors of Crucita with flat pricing, distance, and time estimates.

Panic Button

Passengers can trigger an SOS alert with a hold gesture, sharing their live route with administrators.

Role-Based Access

Every REST endpoint and WebSocket event validates the caller’s role — passenger, driver, or admin.

Row Level Security

Supabase RLS policies ensure users can only read and write data they own or are participants in.

Glassmorphic UI

60fps Reanimated animations, backdrop blur via expo-blur, and a full Glassmorphism design token system.

Build docs developers (and LLMs) love