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.
- Host: GitHub
- URL: https://github.com/abynxv/ride-sharing-api
- Owner: abynxv
- Created: 2025-08-06T13:13:22.000Z (10 months ago)
- Default Branch: featured
- Last Pushed: 2025-08-19T06:57:00.000Z (10 months ago)
- Last Synced: 2025-08-31T20:55:18.073Z (9 months ago)
- Topics: celery, celerybeat, django, django-rest-framework, djangorestframework-simplejwt, haversine-distance, modelviewset, python3, redis, viewsets
- Language: Python
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```

## 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
```

## 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
```

```bash
# Start Celery beat scheduler
celery -A ride_sharing_api beat --loglevel=info
```
