An open API service indexing awesome lists of open source software.

https://github.com/abynxv/ride-sharing-api

A backend API built with Django Rest Framework for ride-sharing applications. The system enables riders to request rides and drivers to manage ride requests through a comprehensive REST API.
https://github.com/abynxv/ride-sharing-api

celery celerybeat django django-rest-framework djangorestframework-simplejwt haversine-distance modelviewset python3 redis viewsets

Last synced: 17 days ago
JSON representation

A backend API built with Django Rest Framework for ride-sharing applications. The system enables riders to request rides and drivers to manage ride requests through a comprehensive REST API.

Awesome Lists containing this project

README

          

> ## Development Status

This branch contains ongoing development for real-time ride tracking,matching ride requests and permission classes. Updates and implementations are in progress.

## API Endpoints

## Rider Endpoints
```bash
/api/rider/rides/ GET - List all rides requested by the rider
/api/rider/rides/ POST - Create a new ride request (Only if there is no active rides)
/api/rider/rides/{id}/ GET - Retrieve details of a specific ride
/api/rider/rides/{id}/ PUT/PATCH - Update ride info (only if status is 'requested')
/api/rider/rides/{id}/cancel-ride/ - POST Cancel a ride (only if status is 'requested' or 'accepted')
/api/rider/rides/{id}/track-ride/ GET - Get current ride status and driver location
```
image

## Driver Endpoints
```bash
api/driver/rides/ — List available ride requests nearby
api/driver/rides/{id}/accept-ride/ — Accept a ride request
api/driver/rides/{id}/update_status/ — Update the ride status
api/driver/update-location/ — Update driver’s current location (no ride ID needed)
api/driver/rides/assigned-rides/ — List all rides assigned to the driver
api/driver/rides/{id}/assigned-ride-detail/ — Get details of a specific assigned ride
```
image

## Real-time Ride Tracking with Celery

To enable real-time ride tracking simulation in this project, you need to run both **Celery worker** and **Celery beat scheduler**. Celery worker executes asynchronous tasks, while Celery beat schedules periodic tasks, such as updating ride locations every few seconds.

### Running Celery and Celery Beat

Use the following commands in separate terminal windows:

```bash
# Start Celery worker
celery -A ride_sharing_api worker --loglevel=info
```
Screenshot from 2025-08-11 01-33-10

```bash
# Start Celery beat scheduler
celery -A ride_sharing_api beat --loglevel=info
```
Screenshot from 2025-08-11 01-32-55