Author: Ben Hurst
Version: 0.1.0
Book Share Pro is a Facebook-integrated web community where users can lend and borrow their personally owned books. Once logged in, users will have access to the shared book collections of all their Facebook friends registered on our site. Check-out requests and due date reminders are facilitated through an easy-to-use notification system.
- Featuring "Shelf Scan" - the web's only automatic book loading image recognition tool! By loading just a single photo of their book shelf, "Shelf Scan" will parse out the text from each book and automatically load each book to the user's personal collection.
- Book Share Pro is built using Django Web Framework and PostgreSQL.
- The "Shelf Scan" tool leverages Google's Cloud Vision API along with various image processing and computer vision tools (NumPy, Matplotlib, OpenCV).
- Clone this repository.
- In the terminal, run
cd final_project
- Run
touch .env
- In the .env file, paste the appropriate environment variables (ask a team member).
- In a separate terminal instance, run
psql
- Run
CREATE DATABASE book_share;
- Back in the main terminal instance, run
pipenv shell
- Run
pipenv install
- Run
./manage.py makemigrations
- Run
./manage.py migrate
- Run
./manage.py createsuperuser
and follow the prompts to create an admin account. - Run
./manage.py runserver
-
In your browser, navigate to
localhost:8000/admin/
and login with superuser credentials. -
Under
Sites
click onSites
-
In the upper right, click on
Add site +
-
In the domain name field, type
localhost:8000
. In the Display Name field, typeBooks Share
. ClickSave
. On the top left, navigate back toHome
-
On the admin console Home page, under
Social Accounts
, click onSocial Applications
. On this page, click onAdd social application +
. -
Under the provider dropdown, choose
Facebook
. -
In the
Name
field, typeBooks Share
. -
In the
Client id
andSecret key
fields, type in the App ID and App Secret from this app onhttps://developers.facebook.com/
(ask a team member) -
In the
Sites
field, selectlocalhost:8000
and click on the right arrow so it appears underChosen sites
. Then clickSave
. -
Logout from the admin console.
- Navigate to
localhost:8000
. - Login using FB Oauth.
GET /
Description: Renders homepage view.
GET /admin/
Description: Access to the admin console (configure OAuth, direct CRUD operations to database)
GET /accounts/
Description: Various endpoints provided by Django-allauth - an integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (Facebook) account authentication.
GET /add/
Description: Add to your collection landing page.
GET /add/search/
Description: Standard Google Books API search view.
POST /add/search/
Description: Form submission ('query' key/value in POST body) to Google Books API.
POST /add/post/
Description: Creates book model instance with foreign key relationship to user's profile.
GET /add/scan/
Description: Renders "Shelf Scan" view.
POST /add/scan/
Description: Passes uploaded shelf image through Book Spine Extraction pipeline.
Profile{
user foreign key
username string
email string
first_name string
last_name string
fb_id string
picture url
friends array
}
Book{
user foreign key
owner string
borrower string
requester string
title string
author string
image_url url
year string
status string
data_added datetime
last_borrowed datetime
pre_save_status datetime
}
Document{
user foreign key
docfile file
}
Notification{
type string
status string
from_user string
to_user string
date_added string
book_id string
}