The application allows admin(s) to manage the library resources(books) efficiently. Registered/authenticated users can borrow,return and view the books they owe the library. Anybody can see the list of available books.
With the app Hello-Books:
- Add a book
- Update book information/details
- View users who owns the library book(s)
- View all books in the library
- Remove a book from the list of available books
- Create an account
- Login into the account
- Logout
- Borrow books
- View books owed to the library
- Return a book
- First install the virtual environment globally
sudo pip instal virtualenv - create the virtual enviroment
virtualenv --python=python3 myenv - change directory to myenv
- activate virtual environment
source myenv/bin/activate - clone the repo by running on terminal
git clone https://github.com/TheSteelGuy/Hello-BooksAPI.git - run pip install requirements.txt
- change directory to the repo
cd /Hell-BooksAPI - type
export APP_SETTINGS=development run python manage.pyrun python manage.py initrun python manage.py migraterun python manage.py upgrade
- Run
python run.py
-
Install nosetests
pip install nose -
Run the tests
nosetests
| Endpoints | Functionality |
|---|---|
POST /api/v1/auth/register |
Creates a user account |
POST /api/v1/auth/reset-password |
Password reset |
POST /api/v1/auth/login |
login a user |
| `GET /api/v1/books/ | Get a book |
GET /api/v1/books |
Retrieves all books |
PUT /api/v1/books/<bookId> |
modify a book’s information |
DELETE /api/v1/books/<bookId> |
Remove a book |
POST /api/v1/users/books/<bookId> |
Borrow book |
POST /api/v1/logout |
logs out a user |