A database management system for ride-sharing applications — efficiently managing users, drivers, rides, and transactions with optimized real-time request handling, secure authentication, and scalable data architecture.
┌─────────────┐ ┌───────────────────────────────────────────────┐
│ React │ │ Node.js / Express API │
│ Frontend │◄───►│ ┌─────────────────────────────────────────┐ │
│ (Optional)│ │ │ Auth Middleware (JWT) │ │
│ │ │ │ Ride Logic │ │
│ │ │ │ Payment Processing │ │
│ │ │ │ Real-time Request Handler │ │
│ │ │ └─────────────────────────────────────────┘ │
└─────────────┘ └───────────────────┬───────────────────────────┘
│
┌─────────▼─────────┐
│ MySQL 8.0 │
│ ┌─────────────┐ │
│ │ users │ │
│ │ drivers │ │
│ │ rides │ │
│ │ payments │ │
│ │ ratings │ │
│ └─────────────┘ │
└───────────────────┘
- Registration & Profiles — Register, log in, manage personal profiles
- Driver Onboarding — Vehicle registration, document verification, availability toggling
- Role-Based Access — Distinct user/driver/admin dashboards with permission control
- Real-Time Requests — Handle ride requests with live driver assignment
- Ride Lifecycle — Initiation → acceptance → ride in progress → completion
- Status Tracking — Real-time ride status updates with timestamps
- Transaction History — Complete ledger of all completed rides and payments
- Payment Processing — Secure payment flow between riders and drivers
- Invoice Generation — Per-ride receipts with fare breakdown
- JWT Authentication — Token-based secure access for all endpoints
- Password Hashing — bcrypt-based credential storage
- API Protection — Route guards and middleware-level authorization
godrive/
├── users # Rider accounts (name, email, phone, location, rating)
├── drivers # Driver profiles (vehicle info, license, availability, rating)
├── rides # Ride records (pickup/dropoff, status, fare, timestamps)
├── payments # Transaction records (amount, method, status, ride_id)
├── ratings # User & driver ratings (score, review, ride_id)
└── ride_requests # Pending ride requests with real-time matching
- PHP 8.2+
- MySQL 8.0+
- Node.js 18+
- Composer
# 1. Clone the repository
git clone https://github.com/JimmYCHUU/GoDrive.git
cd GoDrive
# 2. Install backend dependencies
npm install
# 3. Configure database
# Import the schema
mysql -u root -p < godrive.sql
# Configure .env with your database credentials
cp .env.example .env
# 4. Start the server
npm start
# → API available at http://localhost:3000| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user/driver |
| POST | /api/auth/login |
Authenticate & get JWT |
| GET | /api/rides |
List available rides |
| POST | /api/rides |
Request a new ride |
| PUT | /api/rides/:id/accept |
Driver accepts ride |
| GET | /api/rides/history |
Ride history for user/driver |
| GET | /api/payments |
Transaction history |
| POST | /api/ratings |
Submit ride rating |
| Variable | Description | Default |
|---|---|---|
DB_HOST |
MySQL host | localhost |
DB_PORT |
MySQL port | 3306 |
DB_NAME |
Database name | godrive |
DB_USER |
Database user | root |
DB_PASS |
Database password | — |
JWT_SECRET |
JWT signing secret | (required) |
PORT |
API server port | 3000 |
MIT
Go Drive is a database management system for a ride-sharing app, designed to efficiently handle user, driver, and ride data with optimized real-time ride requests, secure authentication, and scalable data management using MySQL and Node.js.