SnappAPI – Online Ride Request System 🚖
SnappAPI is an online taxi request system developed using Laravel 12. This project enables users to request rides, manage trip statuses, and facilitates interaction between passengers and drivers.
-
Request a Ride: Each user can submit a ride request using the
storemethod. -
Request Processing: The ride request is processed by a Listener, which calculates the distance between the origin and destination. Based on this distance, the trip cost is calculated.
-
Broadcast to Drivers: Ride details (origin, destination, distance, and price) are broadcasted via the
driverchannel to the nearest available drivers. -
Driver Accepts Request: If a driver accepts the request using the
acceptmethod, the driver's and request information is broadcasted on theuserschannel. -
Track Ride Status: Users can check their current trip status with the
statusmethod (e.g., whether the driver has arrived).
Drivers can also monitor their current status using thestatusmethod. -
Complete Ride: Once the ride finishes, the driver signals completion with the
completemethod, and their status changes back to "available."
-
Laravel 12 🚀 (Primary backend framework)
-
Laravel Sanctum 🔐 (User and driver authentication)
-
Redis ⚡ (Caching and performance optimization)
-
Laravel Reverb 📡 (Event broadcasting and real-time communication)
-
SQLite 🛢️ (Primary database)
-
l5-swagger 📜 (API documentation)
-
PhpUnit 🧪 (Code quality testing)
- Clone the project:
git clone git@github.com:pouria-azad/SnappAPI.git
cd SnappAPI- Install dependencies:
composer install
npm install- Configure
.envfile with database details:
cp .env.example .env
php artisan key:generate- Run migrations and seed database:
php artisan migrate --seed- Generate API documentation:
php artisan l5-swagger:generate- Start Redis for optimized performance:
redis-server- Run the project:
php artisan serve
php artisan reverb:start
php artisan queue:work⏳ A user cannot submit a new request until their current request is accepted or ongoing trip is completed.
🚗 Similarly, drivers cannot accept new requests while on a trip.
🔄 Ride requests are currently processed via a Listener.
📊 The database keeps track of drivers who have received the request. Future enhancements could use Jobs to manage request processing, gradually expanding the search radius for nearby drivers every few seconds—similar to Snapp.
🔑 All users (drivers and passengers) authenticate using Sanctum tokens.
📜 All methods are fully documented, and PHPUnit tests cover functionality.
-
Role: Developer
-
GitHub: Amyrosein
📌 This project is designed as a clone of Snapp / Uber, with extensibility and customization in mind.
🚀 Feel free to contribute or suggest improvements on GitHub! 😎
This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.


