An application that allows users to book flights and pay for the tickets. Documentation
In order to run the API Application
-
Clone this repository and create a virtual environment in a terminal shell
virtualenv env
and Install the dependenciespip install -r requirements.txt
You could as well usepipenv
. Install pipenv and runpipenv install
to install the requirements -
Make a copy of
.env-example
, rename it to.env
and replace the details belowDB_NAME=your-database-name DB_USER=your-database-user DB_PASSWORD=your-password DB_PORT=5432 DEBUG=True ALLOWED_HOSTS=.localhost REDIS_URL=your-url-for-redis EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_HOST_USER=your-email-host-username EMAIL_HOST_PASSWORD=your-email-host-password
-
Run the migrations using the dev settings file:
./manage.py migrate
-
Run the command
source .env
and then run the application by running commands./manage.py runserver
EndPoint | Method | Description |
---|---|---|
/api/auth/signup |
POST | Register a user |
/api/auth/signin |
POST | Login a user |
/api/v1/flights/ |
GET | Get flights |
/api/v1/flight/<flight_id>/ |
GET | Get a specific flight |
/api/v1/flight/<flight_id>/book/ |
POST | Book a flight |
/api/v1/flight/<flight_id>/payment/ |
POST | Pay for a flight ticket |
The project is licensed under Apache License.