Hello-Books is a simple application that helps manage a library and its processes like stocking, tracking and renting books. With this application users are able to find and rent books using RESTful API's. The application also has an admin section where the admin add books, delete books, increase the quantity of a book etc using RESTful API's.
Endpoint | Functionality |
---|---|
POST /api/books | add a book |
PUT /api/books/ | modify a book’s information |
DELETE /api//books/ | Remove a book |
GET /api/books | Retrieves all books |
GET /api/books/ | Get a book |
POST /api/users/books/ | Borrow a book |
POST /api/auth/register | Creates a user account |
POST /api/auth/login | Logs in a user |
POST /api/auth/logout | Logs out a user |
POST /api/auth/reset-password | Password reset |
- Download & Install Python
- Head over to the Python Downloads Site and download a version compatible with your operating system
- To confirm that you have successfully installed Python:
- Open the Command Prompt on Windows or Terminal on Mac/Linux
- Type python
- If the Python installation was successfull you the Python version will be printed on your screen and the python REPL will start
- Clone the repository to your personal computer to any folder
- On GitHub, go to the main page of the repository Flask-Hello-Api
- On your right, click the green button 'Clone or download'
- Copy the URL
- Enter the terminal on Mac/Linux or Git Bash on Windows
- Type
git clone
and paste the URL you copied from GitHub [https://github.com/Emichira/Flask-Hello-Api.git] - Press Enter to complete the cloning process
- Virtual Environment Installation
- Install the virtual environment by typing:
pip install virtualenv
on your terminal
- Install the virtual environment by typing:
- Create a virtual environment by running
virtualenv --python python venv
. This will create the virtual environment in which you can run the project. - Activate the virtual environment by running
source venv/bin/activate
- Enter the project directory by running
cd flask-helo-api
- Once inside the directory install the required modules
- Run
pip install -r requirements.txt
- Run
- Inside the application folder run the run.py file:
- On the terminal type
python run.py
to start the application
To run the tests for the app, run;
- nosetests -v
- Emmanuel Michira
This project is licensed under the MIT License