Skip to content
priyanshusharan-cmdPublic

About

๐Ÿš— Ridify is a real-time peer-to-peer ride-sharing and cost-splitting platform that connects drivers and riders for shared journeys. It features smart ride matching, live location tracking, real-time chat, automated fare splitting, secure authentication, KYC, and an admin dashboard. Built with Flutter, Node.js, MongoDB, Socket.IO, etc

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

456 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Ridify Logo

Ridify

Real-time peer-to-peer ride-sharing & cost-splitting โ€” built for everyone.

Flutter Dart Node.js Express MongoDB Socket.IO License: MIT


Overview

Ridify is a production-grade, real-time ride-sharing and cost-splitting application that connects drivers and riders for shared journeys. With live map tracking, instant in-app messaging, transparent fare splitting, and a dedicated admin moderation layer, Ridify delivers a complete end-to-end mobility experience โ€” from OTP-verified sign-up to trip completion.

Built with Flutter for mobile and Node.js + Express + MongoDB on the backend, Ridify features JWT authentication with silent refresh, Socket.IO-powered real-time updates, OpenStreetMap routing via OSRM, and a sweep-line capacity algorithm for optimal ride matching.


๐ŸŽฅ Video Demo

demo.mp4

โœจ Key Features

Feature Description
๐Ÿ” Secure Auth OTP-verified email sign-up, SHA-256 hashed OTPs, JWT + refresh token rotation
๐Ÿ—บ๏ธ Live Tracking Real-time driver and rider positions on an interactive flutter_map + OpenStreetMap
๐Ÿš— Ride Lifecycle Full state machine: scheduled โ†’ started โ†’ boarding โ†’ inTransit โ†’ completed
๐Ÿ’ฌ In-app Chat Per-ride Socket.IO messaging between driver and all co-passengers
๐Ÿ’ฐ Cost Splitting Automated fare calculation and equal cost-split across all confirmed riders
๐Ÿ” Smart Matching Sweep-line geometry algorithm for pickup/dropoff proximity matching
๐Ÿ‘ค KYC Verification Document upload via Google Drive integration with admin-side review
๐Ÿ›ก๏ธ Admin Panel Full user/ride management, ban controls, live ride monitoring, and stats dashboard
โšก Real-time Events Ride requests, acceptances, boarding, drop-off, and chat โ€” all over WebSocket
๐Ÿ”’ Production Security Helmet, rate limiting, input sanitisation, CORS locking, and optimistic locking

๐Ÿ› ๏ธ Tech Stack

Frontend

Technology Purpose
Flutter Cross-platform mobile UI framework
Dart Application language
Provider Reactive state management
socket_io_client WebSocket real-time communication
flutter_map Interactive OpenStreetMap integration
geolocator Device GPS & location permissions
flutter_secure_storage Encrypted JWT token storage
http REST API client

Backend

Technology Purpose
Node.js Runtime environment
Express HTTP framework
MongoDB Primary database
Mongoose ODM / schema validation
Socket.IO Bidirectional real-time events
JSON Web Token Authentication & authorisation
bcrypt Password hashing
@turf/turf Geospatial sweep-line calculations
Winston Structured logging
Helmet HTTP security headers
express-rate-limit API abuse prevention
sanitize-html XSS input sanitisation

External Services

Service Purpose
EmailJS OTP & transactional email delivery
OSRM Open-source route calculation engine
Nominatim Geocoding and reverse geocoding
Google Apps Script KYC document upload to Google Drive

๐Ÿ—๏ธ System Architecture

graph LR
    %% Theming for Nodes
    classDef client fill:#E3F2FD,stroke:#1565C0,stroke-width:2px,color:#0D47A1,rx:5,ry:5
    classDef backend fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px,color:#1B5E20,rx:5,ry:5
    classDef db fill:#FFF3E0,stroke:#E65100,stroke-width:2px,color:#E65100,rx:5,ry:5
    classDef external fill:#F3E5F5,stroke:#6A1B9A,stroke-width:2px,color:#4A148C,rx:5,ry:5

    %% Subgraph Styling to remove default yellow backgrounds
    style ClientLayer fill:#f8fafc,stroke:#94a3b8,stroke-width:2px,color:#334155,rx:10,ry:10
    style BackendLayer fill:#f0fdf4,stroke:#86efac,stroke-width:2px,color:#166534,rx:10,ry:10
    style DataLayer fill:#fff7ed,stroke:#fdba74,stroke-width:2px,color:#9a3412,rx:10,ry:10
    style ExternalLayer fill:#faf5ff,stroke:#d8b4fe,stroke-width:2px,color:#6b21a8,rx:10,ry:10

    subgraph ClientLayer [๐Ÿ“ฑ Client Layer]
        UI[Flutter UI & State]
        AuthSvc[Auth & API Services]
        RideSvc[Ride & Socket Services]
        Admin[Admin Web Interface]
    end

    subgraph BackendLayer [โš™๏ธ Node.js + Express Server]
        API[Express REST API]
        WSS[Socket.IO Server]
        
        AuthCtrl[Auth Controller]
        RideCtrl[Ride Controller]
        AdminCtrl[Admin Controller]
        
        SocketMgr[Socket Event Manager]
    end

    subgraph DataLayer [๐Ÿ—„๏ธ Database Layer]
        UserMod[(Users Collection)]
        RideMod[(Rides Collection)]
        OTPMod[(OTP Verifications)]
    end

    subgraph ExternalLayer [๐ŸŒ External Services]
        Maps[OSRM & Nominatim]
        SMTP[EmailJS]
        Drive[Google Drive KYC]
    end

    %% Wiring Client Layer Internals
    UI --> AuthSvc
    UI --> RideSvc

    %% Wiring Client to Backend
    AuthSvc <-->|REST| API
    RideSvc <-->|REST| API
    RideSvc <-->|WSS| WSS
    Admin <-->|REST| API

    %% Wiring Backend Internals
    API --> AuthCtrl
    API --> RideCtrl
    API --> AdminCtrl
    WSS --> SocketMgr

    %% Wiring Backend to DB
    AuthCtrl --> UserMod
    AuthCtrl --> OTPMod
    
    RideCtrl --> RideMod
    RideCtrl --> UserMod
    
    AdminCtrl --> UserMod
    AdminCtrl --> RideMod

    SocketMgr --> RideMod

    %% Wiring Backend to External
    RideCtrl -->|Routing| Maps
    AuthCtrl -->|OTP| SMTP
    AuthCtrl -->|KYC Upload| Drive

    %% Apply Classes
    class UI,AuthSvc,RideSvc,Admin client;
    class API,WSS,AuthCtrl,RideCtrl,AdminCtrl,SocketMgr backend;
    class UserMod,RideMod,OTPMod db;
    class Maps,SMTP,Drive external;
Loading

๐Ÿš€ Installation & Setup

Prerequisites

  • Node.js v20 or higher
  • npm v9 or higher
  • Flutter SDK 3.x โ€” Flutter install guide
  • MongoDB 7.x โ€” local instance or MongoDB Atlas
  • Android device or emulator (iOS support planned)

1. Clone the Repository

git clone https://github.com/priyanshusharan-cmd/ridify.git
cd ridify

2. Backend Setup

cd backend
npm install
cp .env.example .env
# Fill in your .env values โ€” see the Environment Variables section below
node server.js

The server starts on http://localhost:3000 by default.


3. Frontend Setup

cd frontend
flutter pub get

Create a .env file in the frontend/ directory:

BASE_URL=http://10.0.2.2:3000     # Android emulator pointing to host localhost
# BASE_URL=http://<your-lan-ip>:3000  # Physical device on the same network

Run the app:

flutter run

๐Ÿ”ง Environment Variables

Copy backend/.env.example to backend/.env and fill in each value.

Server

Variable Description Example
PORT HTTP server port 3000
NODE_ENV Runtime environment development
ALLOWED_ORIGINS CORS whitelist (comma-separated) http://localhost:3000

Database

Variable Description Example
MONGODB_URI MongoDB connection string mongodb://localhost:27017/ridify

Authentication

Variable Description How to Generate
JWT_SECRET Access token signing secret node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
JWT_REFRESH_SECRET Refresh token signing secret node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
JWT_EXPIRY Access token TTL 15m
JWT_REFRESH_EXPIRY Refresh token TTL 7d

Email (EmailJS)

Variable Description
EMAILJS_SERVICE_ID Your EmailJS service ID
EMAILJS_TEMPLATE_ID OTP email template ID
EMAILJS_PUBLIC_KEY EmailJS public API key
EMAILJS_PRIVATE_KEY EmailJS private API key

KYC Storage (Google Apps Script)

Variable Description
GOOGLE_SCRIPT_URL Deployed Apps Script web app URL

Routing (OSRM)

Variable Description Default
OSRM_URL OSRM instance base URL http://router.project-osrm.org

๐Ÿ“ธ Screenshots

๐ŸŽฌ Onboarding & Auth

Splash Screen

ย ย 


Login

ย ย 


Sign Up

ย ย 


๐Ÿ  Home & Ride Discovery

Home Screen

ย ย 


Offer a Ride

ย ย 


Location Picker

ย ย 


Find a Ride

ย ย 


Available Rides

ย ย 


Filters

ย ย 


๐Ÿ“‹ Activity & Ride Details

Activity Screen

ย ย 


Ride Details

ย ย 


๐Ÿšฆ Live Ride Tracking

Driver โ€” Ride Started

ย ย 


Rider โ€” Waiting for Pickup

ย ย 


Driver โ€” At Boarding Point

ย ย 


Rider โ€” Driver Arrived

ย ย 


Driver โ€” Rider Boarded

ย ย 


Rider โ€” In Transit

ย ย 


In-app Chat

ย ย 


Driver โ€” Trip Complete

ย ย 


Rider โ€” Trip Complete

ย ย 


๐Ÿ“œ History & Profile

Ride History

ย ย 


Co-Passengers

ย ย 


Profile

ย ย 


๐Ÿ›ก๏ธ Admin Panel

Admin Dashboard

ย ย 


Admin โ€” Users

ย ย 


Admin โ€” User Actions

ย ย 


Admin โ€” Active Rides

ย ย 


Admin โ€” KYC Verification

ย ย 



๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


Crafted with โค๏ธ by Priyanshu Sharan
LinkedIn

About

๐Ÿš— Ridify is a real-time peer-to-peer ride-sharing and cost-splitting platform that connects drivers and riders for shared journeys. It features smart ride matching, live location tracking, real-time chat, automated fare splitting, secure authentication, KYC, and an admin dashboard. Built with Flutter, Node.js, MongoDB, Socket.IO, etc

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages