Built with Django Rest Framework.
Deployed successfully on Render -> online-bus-booking-api
Clone the repository in your terminal
git clone https://github.com/raykipkorir/online-bus-booking-api.git
Navigate into the repo
cd online-bus-booking-api
Create virtual environment
virtualenv venv
Activate virtual environment
- For windows users
venv\Scripts\activate
- For unix based systems
source venv/bin/activate
Install dependencies
pip install -r requirements.txt
Run migrations and server
make server
Note: Create .env file in the root directory to store your environment variables. Check .env.example to see environment variables that should be created.
/api/token/ - to login users
/api/token/refresh/
/api/users/ - create and retrieve all users(admin only)
/api/users/<id>/ - retrieve, update, delete specific user by id (admin only)
/api/users/me/ - retrieve, update, delete logged in user
/api/users/set_password/ - change password
/api/users/reset_password/ - reset password
/api/buses/<id>/trip-bus/ (admin only)- All trips for a certain bus
/api/buses/<id>/trip-bus/<id>/ (admin only) - Retrieve, update or delete a trip for a certain bus
/api/trip-bus/?from=&to=&travel_date= - Query trips using start, destination and date of travel
/api/buses/<id>/trip-bus/<id>/tickets/ - Create ticket for a certain trip(all users) or list all tickets for a certain trip(admin only)
/api/buses/<id>/trip-bus/<id>/tickets/<id> - Retrieve ticket(all users) or update, delete ticket for a certain trip(admin only)
/api/buses/ - list and create bus (admin only)
/api/buses<id> - retrieve, update and delete bus (admin only)
/api/drivers/ - list and create driver (admin only)
/api/drivers/<id> - retrieve, update and delete driver (admin only)
/api/routes/ - list and create route (admin only)
/api/routes/<id> - retrieve, update and delete route (admin only)
/api/admins/ - list and create new admins (admin only)
/api/admins/<id> - retrieve, update and delete admin (admin only)
Any minor contribution would be greatly appreciated
Happy coding 💚