RESTful API for Cab Booking System
- Create the virtual environment by hitting following command in the Terminal
virtualenv env
- Activate the virtual environment -
env\scripts\activate
- Install all the depedencies given in the requirements.txt file -
pip install -r requirements.txt
- Once all the depedencies get successfully installed in your virtualenvironment, then run the local server -
python manage.py runserver
- Python 3
- Sqlite 3 (default)
- Django==2.0.7
- djangorestframework==3.8.2
-
To register a new commuter in the database -
localhost:<port number>/zayacab/user/register
and pass username and password inPOST
request parameters. -
To register new driver in the database -
localhost:<port number>/zayacab/driver/register
and pass username and password inPOST
request parameters and none forGET
request -
To get user trip history -
localhost:<port number>/zayacab/<commuter_id>/history
-
To get user trip history -
localhost:<port number>/zayacab/<driver_id>/history
-
To get the user location -
localhost:<port number>/zayacab/user/location/<commuter_id>
-
To change the status of a driver after booking and completion of a trip -
localhost:<port number>/zayacab/update/<driver_id>
and pass status params in POST request. -
To book a cab -
localhost:<port number>/zayacab/<commuter_id>/<driver_id>
and pass source, destination and fare inPOST
request. -
Get the list of all available drivers-
localhost:<port number>/zayacab/driver/available