Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8625965
chore: make base file structure
kennanLu Nov 17, 2025
c90a816
Merge branch 'feature/sign-up-page' into feature/find-a-ride
kennanLu Nov 17, 2025
431f301
feature(rides): initialized FindRideScreen.kt and created header section
kennanLu Nov 17, 2025
04dd8ff
docs: updated dev journal
kennanLu Nov 17, 2025
a8bb67e
feature(rides): initialized floating white card for the UI
kennanLu Nov 21, 2025
37719b5
docs: updated dev journal
kennanLu Nov 21, 2025
9589b7b
feature(rides): intialized the rest of the input fields for FindRideS…
kennanLu Nov 21, 2025
62457fb
feature(rides): initialized OfferRideScreen.kt for tracking ride offe…
kennanLu Nov 21, 2025
eb37b77
feature(rides): initialized input fields for OfferRideScreen.kt
kennanLu Nov 21, 2025
c0ee6fb
docs: updated dev journal entry from 11/16/2025 to provide additonal …
kennanLu Nov 21, 2025
e758c13
feature(rides): updated placeholder icons with favicons
kennanLu Nov 21, 2025
0a8d868
feature(rides): refactored function for input fields into its own fil…
Nov 26, 2025
655a448
feature(rides): created new screen to track available ride offers aft…
kennanLu Nov 26, 2025
7a6592d
feature(rides): created new screen to track available ride offers aft…
kennanLu Nov 26, 2025
e865d13
feature(test_db): initial db test
SamiiShabuse Nov 28, 2025
86a1924
feature(rides): created new screen to track available matches with ri…
kennanLu Nov 29, 2025
2d4492d
feature(db): pushing db to github
SamiiShabuse Nov 29, 2025
feb15cf
feature(db): making db appear and connect to emulator
SamiiShabuse Nov 29, 2025
fbdca6c
feature(auth_db_connect): getting the auth connection to db
SamiiShabuse Nov 29, 2025
1c1697a
feature(db): populate db
SamiiShabuse Nov 29, 2025
4995d32
feature(db): connect login with db
SamiiShabuse Nov 30, 2025
35835bf
feature(db): connect profile page with db
SamiiShabuse Nov 30, 2025
150c45c
feature(db): update db with MESSAGES and MESSAGE_THREAD
SamiiShabuse Nov 30, 2025
49788f1
feature(db): connect messages with db
SamiiShabuse Nov 30, 2025
0931a23
feature(db): connect messages with db
SamiiShabuse Nov 30, 2025
ce2dc5c
feature(db): connect messages with db
SamiiShabuse Nov 30, 2025
158a6cc
Merge remote-tracking branch 'origin/feature/available-offers-page' i…
SamiiShabuse Nov 30, 2025
ee9b5b4
feature(home_screen): refactor to use images from kotlin
SamiiShabuse Nov 30, 2025
ea2c541
feature(my_ride): create my ride screen to show history of rides
SamiiShabuse Nov 30, 2025
427467d
docs: Finished README.md
SamiiShabuse Dec 1, 2025
a5c5378
database: update database
SamiiShabuse Dec 1, 2025
9b21de1
push
SamiiShabuse Dec 1, 2025
c6bc3fb
fixed db for profile page to show crud
SamiiShabuse Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.db

__pycache__/
*.log
.env
Expand Down
6 changes: 6 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

307 changes: 296 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,279 @@
# Find-My-Ride
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
# Find My Ride – Kotlin Multiplatform Ride-Sharing App
### Drexel University – CS 461 Final Project
### Built by:
- Mustafa Bookwala
- Samii Shabuse
- Kennan Lu

# Coding Standards
---

## Overview

## Commit Messages
**Find My Ride** is a full-stack **Kotlin Multiplatform (KMP)** mobile application that simulates a Drexel-focused ride-sharing service.
The app allows students to:

Following the committing convention of [Conventional Commits](conventionalcommits.org/en/)
- Create an account & log in
- View their profile
- Browse available ride offers
- Publish a ride offer as a driver
- Send messages to other users
- Store all data in a pre-loaded SQLite database

# Authors
- Mustafa Bookwala
- Samii Shabuse
- Kennan Lu
The purpose of the project is to demonstrate **end-to-end database integration**, clean architecture, multiplatform UI, and CRUD operations learned in CS461.

---

## Tech Stack

### **Frontend / App UI**
- **Kotlin Multiplatform (KMP)**
- **JetBrains Compose Multiplatform**
- **Material3 Components**
- **Navigation built manually via sealed classes**

### **Database Layer**
- **SQLite** (preloaded DB file in `assets/findmyride.db`)
- **Custom repository layer** for all DB tables
- **Android SQLiteOpenHelper** for managing the database (Android-only)
- **Raw SQL queries** (no ORM) for maximum clarity

### **Platforms Supported**
- **Android** (Primary target)
- **Compose Desktop** (Compilation supported, no DB)
- KMP structure prepared for iOS/JS, but **DB only implemented on Android** for this assignment.

---

## Project Structure
```SQL
composeApp/
├── src/
│ ├── commonMain/
│ │ ├── feature/
│ │ │ ├── auth/ # Login, Registration
│ │ │ ├── profile/ # User profile screen
│ │ │ ├── rides/ # Find Ride & Offer Ride
│ │ │ ├── messages/ # Messaging system
│ │ │ └── db/ # Repository interfaces & shared data models
│ │ ├── App.kt # Root-level navigation deciding Login/Main
│ │ └── MainRoute.kt # In-app navigation (Dashboard → Screens)
│ │
│ ├── androidMain/
│ │ ├── db/
│ │ │ ├── FindMyRideDbProvider.kt # Loads SQLite DB from assets
│ │ │ ├── AndroidAuthRepository.kt # USER table
│ │ │ ├── AndroidProfileRepository.kt # USER + VEHICLE
│ │ │ ├── AndroidMessagesRepository.kt # MESSAGE table
│ │ │ └── AndroidRideRepository.kt # RIDE_OFFER + RIDE_REQUEST
│ │ └── MainActivity.kt # Android entry point
│ │
│ └── iosMain/ # (Not used)
└── assets/
└── findmyride.db # Preloaded SQLite database
```


---

## Database Schema Overview

The app uses a **pre-populated SQLite database** stored in `assets/findmyride.db`.
This database contains all tables required for the ride-sharing scenario:

### **USER**
| Column | Type | Description |
|--------|------|-------------|
| user_id | INTEGER PK | Unique user ID |
| email | TEXT | Login credential |
| password | TEXT | User password |
| display_name | TEXT | Display name |
| phone | TEXT | User contact number |

### **VEHICLE**
| Column | Type |
|--------|------|
| vehicle_id | INTEGER PK |
| owner_user_id | INTEGER FK → USER |
| make | TEXT |
| model | TEXT |
| color | TEXT |

### **LOCATION**
Preset Drexel locations:
- University Crossings
- Korman Center
- Main Building
- etc.

### **RIDE_OFFER**
Driver-created ride offers
(Read by AvailableRidesScreen, written by AvailableOfferScreen)

| Column | Type |
|--------|------|
| offer_id | INTEGER PK |
| driver_id | INTEGER FK → USER |
| vehicle_id | INTEGER FK → VEHICLE |
| original_location_id | INTEGER FK → LOCATION |
| dest_location_id | INTEGER FK → LOCATION |
| depart_at | TEXT |
| seats_available | INTEGER |
| price_base | REAL |
| price_per_mile | REAL |
| status | TEXT |

### **RIDE_REQUEST**
Stores ride requests created by riders
(Used by repository, not fully exposed in UI)

### **MESSAGE**
Messaging between users
| Column | Type |
|--------|------|
| message_id | INTEGER PK |
| sender_id | INTEGER FK → USER |
| receiver_id | INTEGER |
| content | TEXT |
| timestamp | TEXT |

---

## Database Architecture & Access Layer

This project uses a clean Repository Pattern to keep all SQLite logic isolated to the Android layer while allowing the UI layer (commonMain) to stay fully multiplatform.

1. FindMyRideDbProvider (Android-only)

- Loads the SQLite database file (findmyride.db) from the assets folder.
- Copies it into Android internal storage on first launch.
- Exposes functions for obtaining readable and writable database instances.
- Ensures all repositories use the same initialized database.

Located at: androidMain/db/FindMyRideDbProvider.kt


2. Repository Interfaces (commonMain)

Each feature defines an interface that represents its database API. These interfaces are platform-agnostic.

Example: RideRepository defines functions like:
- getOpenRideOffers()
- createRideOffer(...)

The UI talks ONLY to these interfaces, never SQLite directly.


3. Android Implementations (androidMain)

Each repository interface has a real implementation in androidMain that uses:
- SQLiteDatabase
- rawQuery()
- insert()
- update()
- delete()

Examples:
- AndroidRideRepository reads/writes RIDE_OFFER and RIDE_REQUEST
- AndroidAuthRepository reads USER for login
- AndroidProfileRepository reads USER + VEHICLE
- AndroidMessagesRepository reads/writes MESSAGE

This keeps SQL isolated to Android while UI stays pure KMP.


## Database Setup
4. UI Layer (commonMain) Consumes Repositories

1. Install SQLite if you don’t have it (`sqlite3 --version` to check).
The UI never touches SQLite.

Examples:
- Reading from DB: rideRepository.getOpenRideOffers()
- Writing to DB: rideRepository.createRideOffer(...)

This separation ensures portability and clean architecture.


-------------------------------------------------------------

## Feature-by-Feature Explanation

1. Login Screen
- Reads from USER through AuthRepository.
- Validates email + password.
- Stores currentUserId inside MainRoute.
- On success -> navigates to Dashboard.


2. Dashboard
Acts as the main navigation hub for:
- Profile
- Find Ride
- Offer Ride
- Messages

No DB calls here.


3. AvailableRidesScreen — Database READ
- Uses rideRepository.getOpenRideOffers().
- Shows list of all open rides from RIDE_OFFER table.
- Displays origin, destination, seats, price, driver info.
- Splits results into “Best Matches” and “Other Matches”.

Backend: AndroidRideRepository using SELECT queries.


4. AvailableOfferScreen — Database WRITE
This screen lets a driver publish a ride.

When user taps Publish:
- createRideOffer() is called with driverId, vehicleId, locations, pricing, etc.
- This performs INSERT INTO RIDE_OFFER.
- App returns to Dashboard afterward.


5. Profile Screen — Database READ
Reads from USER and VEHICLE:
- display_name
- email
- phone
- car make/model/color

Used to show account info.


6. Messages Screen — Database READ & WRITE
- Reads conversations via SELECT on MESSAGE table.
- Displays messages in a thread-style list.
- Sends messages using INSERT INTO MESSAGE.
- Powered by MessagesRepository and AndroidMessagesRepository.


-------------------------------------------------------------

## How To Run the Project

Requirements:
- Android Studio (Ladybug / Koala / modern KMP version)
- Kotlin Multiplatform plugin enabled
- Android SDK 34 or higher

Steps:
1. Open the project in Android Studio.
2. Wait for Gradle sync to complete.
3. Select run configuration: composeApp:androidApp
4. Run on emulator or Android device.
5. App starts and automatically copies SQLite database from assets.

No server required.
No external API required.
Database is bundled inside the APK.

-------------------------------------------------------------

## How To Create A New Database

1. Install SQLite if you don’t have it (`sqlite3 --version` to check).
- Using Version: 3.50.4 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3 (64-bit)
2. In the root project folder, run:
```bash
Expand All @@ -27,3 +284,31 @@ sqlite3 findmyride.db < database/schema.sql
sqlite3 findmyride.db
sqlite> .tables
```

-------------------------------------------------------------

## Key Implementation Notes

- UI state uses Jetpack Compose’s remember { mutableStateOf() }.
- Navigation uses sealed classes (RootScreen, HomePage).
- UI + Repository Interfaces live in commonMain.
- SQLite logic lives exclusively in androidMain.
- Database access uses raw SQL for transparency (no ORM).
- Database lifecycle & copying handled by FindMyRideDbProvider.


-------------------------------------------------------------

## Future Improvements

- Add ride filtering by time, price, seats.
- Add vehicle picker tied to VEHICLE table.
- Add a full chat UI per ride.
- Support for iOS using SQLDelight or KMP-SQLite.
- Add push-style notifications for new rides.
- Implement ride request matching algorithm.


-------------------------------------------------------------


2 changes: 1 addition & 1 deletion app/composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:theme="@android:style/Theme.Material.Light.NoActionBar">
<activity
android:exported="true"
android:name=".MainActivity">
android:name="com.example.rideshare.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
Binary file not shown.
Loading
Loading