Let's build a world where recommendations give you a breadth of knowledge, not just depth.
This idea started off with the idea of "I don't know what I don't know" when it comes to consuming things like books, music and movies. Every recommendation system is trying to keep you within your bubble of interests but we want to build something that makes you aware of what else is out there, especially to try something new for the first time.
The purpose of this project is to compare a user's book classifications to the total available classifications. One way this is done is by using the Dewey Decimal System. Most data visulizations show what you have consumed but not what you HAVEN'T consumed.
This project uses Flask for the backend in order to return a JSON file to incorporate D3 Zoomable Circle Packing Visualization.
Here are some files which you may find helpful when diving into the project:
wrec-schema.jpg
- diagram of all the modelsclassify_api_flowchart.jpg
- Our project utilizes the Classify API to convert ISBN values to their respective dewey decimal numbers. However, the process isn't straightforward as the API actually returns an XML document of that particular book's data. The XML is converted to JSON, then parsed to find the dewey number value. This process isn't standard hence, a flowchart of the algorithm needed to be created to clarify the steps. There are still some methods missing which need to be added to the flowchart. Here is a snippet of the flowchart:
- You can either clone the project by running
git clone https://github.com/singhshemona/recommmend.git
in your terminal or fork the project in order to contribute later: See Contributing below.
-
Set up your Python virtual environment by running
pyvenv venv
in that directory and runningsource venv/bin/activate
to active it. Or create a conda environment. -
make sure
pip
is installed -
Install Python requirements with
pip install -r requirements.txt
. You may need to install some build prerequisites; on Debian-like systems, they include the packagespython3-dev
andlibpq-dev
. You can try runningpip install psycopg2-binary
first to see if that solves the issue. -
Install PostgreSQL and create an empty database, e.g.
createdb wrec
-
Add environment variables (see next section)
-
At your terminal, you will need to initialize, migrate and upgrade your database:
flask db migrate -m "initial migration
flask db migrate
flask db upgrade
-
Then go to each of the following endpoints to upload the tens, hundreds and thousands csv files. The csv files are located in the
/app/externalFiles/DDS_directory_structure
. The corresponding file needs to be uploaded at it's respective endpoint:- DDSGORun0.csv >
/category/ten/upload
- DDSGORun1.csv >
/category/hundred/upload
- DDSGORun2.csv >
/category/thousand/upload
- DDSGORun0.csv >
-
At your terminal run
flask run
. Click on development server shown in your terminal http://127.0.0.1:5000/
Create a .env
file at the project level and add the following:
- FLASK_APP = wrec.py
- FLASK_DEBUG = 1
- SECRET_KEY = A 24 character random string can be generated by running
python
in your terminal and typing the following one line at a time
import secrets
secrets.token_hex(24)
- DATABASE_URL=postgresql://username:password@hostname/database
- FLASK_CONFIG=development
If you normally log in with username or password, then use the following line: postgresql:///database
. It is recommended setting up test and production databases as well.
npm install
npm start
- Open http://localhost:3000 in browser. The page will reload if you make edits.
Please follow along this excellent step-by-step guide to learn how to contribute to an open-source project
Quick summary
- Make desired changes
- Add, commit, push
- Open pull request