Skip to content

cleverchuk/discussion-mapper

Repository files navigation

title author date output
README
Chukwubuikem Ume-Ugwa
December 16, 2019
html_document
default

Project structure

discussion-mapper
┣ 🗂api
┃ ┣ 🗂migrations
┃ ┃ ┗ 📄__ init__.py
┃ ┣ 📄__ init__.py
┃ ┣ 📄admin.py
┃ ┣ 📄apps.py
┃ ┣ 📄mapper.py
┃ ┣ 📄models.py
┃ ┣ 📄test.py
┃ ┣ 📄urls.py
┃ ┗ 📄views.py
┣ 🗂libs
┃ ┣ 📄__ init__.py
┃ ┣ 📄analyzers.py
┃ ┣ 📄base_crawler.py
┃ ┣ 📄database_api.py
┃ ┣ 📄db_loaders.py
┃ ┣ 📄graph_writers.py
┃ ┣ 📄json_models.py
┃ ┣ 📄mapper.py
┃ ┣ 📄models.py
┃ ┣ 📄mp_test.py
┃ ┣ 📄reddit_crawler.py
┃ ┣ 📄redditor_attributes.py
┃ ┗ 📄textsim.py
┣ 🗂main
┃ ┣ 🗂migrations
┃ ┃ ┗ 📄__ init__.py
┃ ┣ 🗂static
┃ ┃ ┗ 🗂main
┃ ┃ ┃ ┣ 🗂css
┃ ┃ ┃ ┃ ┗ 📄style.css
┃ ┃ ┃ ┗ 🗂js
┃ ┃ ┃ ┃ ┣ 📄event_handlers.js
┃ ┃ ┃ ┃ ┣ 📄jquery-3.3.1.min.js
┃ ┃ ┃ ┃ ┣ 📄loaders.js
┃ ┃ ┃ ┃ ┣ 📄main.js
┃ ┃ ┃ ┃ ┣ 📄mapper_module.js
┃ ┃ ┃ ┃ ┣ 📄render_main.js
┃ ┃ ┃ ┃ ┗ 📄render_mapper.js
┃ ┣ 🗂templates
┃ ┃ ┗ 🗂main
┃ ┃ ┃ ┣ 📄header.html
┃ ┃ ┃ ┗ 📄viz.html
┃ ┣ 📄__ init__.py
┃ ┣ 📄admin.py
┃ ┣ 📄apps.py
┃ ┣ 📄models.py
┃ ┣ 📄tests.py
┃ ┣ 📄urls.py
┃ ┗ 📄views.py
┣ 🗂mapper
┃ ┣ 📄__ init__.py
┃ ┣ 📄settings.py
┃ ┣ 📄urls.py
┃ ┗ 📄wsgi.py
┣ 🗂misc
┃ ┣ 🗂graphML
┃ ┣ 🗂images
┃ ┗ 🗂raw
┣ 🗂pictures
┣ 📄.gitignore
┣ 📄Dockerfile
┣ 📄docker-compose.yml
┣ 📄README.md
┣ 📄_config.yml
┣ 📄db.sqlite3
┣ 📄main.py
┣ 📄manage.py
┣ 📄requirements.txt
┗ 📄test.py

The mapper folder is where the Django project settings files live. There is one application in the project, api. api is the backend support that implements mapper logic and provides endpoints to interact with mapper. The frontend to interact with mapper is mapper_ui. libs package contains the system modules.

Development Setup

  1. clone this repo
  2. cd into the repo folder
  3. run pip3 install -r requirements.txt
  4. you're set for development! cheers!

Setup For running the system

Build docker image for backend

  1. Prerequisite
  2. clone this repository
  3. open a new terminal
  4. cd into discussion-mapper/
  5. run docker build -t [username]/[repository]:[tag] .

For the backend to communicate with the neo4j database you need to use docker-compose to start the whole system. See the docker-compose.yml file. You can modified the file to use the image you built.

Running the system

  1. make sure you're in repository folder
  2. run docker-compose up
  3. browse to http://localhost:7474
  4. when prompted enter neo4j for password
  5. change password to neo4j2
  6. cd into discussion-mapper/libs/
  7. make sure that credential.json is in discussion-mapper/libs dir and contains your login for Reddit
sample: credential.json file content
{
  "client_secret":"client secret",
  "client_id":"client id",
  "username": "username",
  "password":  "password"
}
  1. set the following environment variables: NEO4J_URL=0.0.0.0:7474, NEO4J_USERNAME=neo4j,NEO4J_PASSWORD=neo4j2
  2. navigate back to repository folder
  3. run python3 main.py to start uploading data from reddit to neo4j
  4. browse to http://localhost:3000
  5. interact with the application

About

Research Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published