Backend for Hotel web application. Developed using django-rest-framework for Data Structure and Algorithms project. Deployed to Heroku and using MongoDB as our main database.
Use the packet manager pip to install virtual environment
pip install virtualenv
Create virtual environment
virtualenv venv
Activate virtual environment
venv\scripts\activate
Install dependencies
pip install django djangorestframework django-cors-headers djangorestframework_simplejwt djongo
We're using mongodb as our database so create a database called hoteldb
then you can make migrations to the database and migrate using
py manage.py makemigrations
py manage.py migrate
Lastly, run the backend server using
py manage.py runserver
api/room/
listing the rooms and creating room
Methods allowed : GET, POSTapi/room/<int:pk>/
get the specified id room, update and delete
Methods allowed : GET, PUT, DELETEapi/roomtype/
listing the room typesand create
Methods allowed : GET, PUT, POSTapi/roomtype/<int:pk>/
update the specified room type
Methods allowed : PUTapi/room/sort/
listing all the room after sorted in the specified method
Methods allowed : GETapi/register/
registrations api (username and password needed)
Methods allowed : POSTapi/user/
getting user information by using jwt token as Authentication
Methods allowed : GETapi/token
getting authentication
Methods allowed : POSTapi/room/book/<int:pk>/
perform booking action to the room
Methods allowed : POSTapi/room/check/date/
update all rooms by check today date to the exp_date
Methods allowed : GET