This project is for the Nanodegree Full Stack Development. For my project I created a RESTful web application using the Python framework Flask that features a third-party OAuth authentication login system. This application provides a list of authors as categories. Each category or author contains a book or a series of books written by that author. CRUD operations allow the user to create, read, update, and delete books and authors.
Install Prerequisites
- Python 2.7
- vagrant
- flask
- sqlalchemy
- Oauth 2.0
Resources Used
- https://developers.google.com/books/ - a key is required to access their API
Running Code
-
Clone the project from (https://github.com/mm101006/Library)
-
Open up a terminal, navigate to the folder where the Vagrantfile resides, and in terminal type in: vagrant up
-
Then type in: vagrant ssh
-
Then type in: cd /vagrant
-
Then type in: cd ItemCatalog
-
Then type in: python BookCatalog.py
-
In a browser type in http://localhost:5000/login
Site Navigation
- http://localhost:5000/login -- user is able to login in from here
- http://localhost:5000/index -- user can view all authors within database
- http://localhost:5000/index/int:author_id/books/ -- user can view all books by that author
- http://localhost:5000/index/books -- user can view all books within database
- http://localhost:5000/index/int:author_id/books/int:book_id/ -- user can view a particular book
- http://localhost:5000/index/int:author_id/books/edit/int:book_id/ -- user can edit that book
- http://localhost:5000/index/user/books -- user can view all of their books
- http://localhost:5000/index/user/authors -- user can view all of their authors
- http://localhost:5000/index -- if user is not logged in, user can still view all authors and books within database
Other If you decide to delete the database and want to create a new database:
- In the database folder, comment line 14 in books.py
- Same folder, uncomment lines 88 and 89 in databaseSchema.py
- in your vagrant terminal (see instructions above to get it started) navigate to the Database folder
- Then type in: books.py
- Once done running, undo what you did for step 1 and 2.