Giter Club home page Giter Club logo

yennanliu / yelpreviews Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 14.77 MB

Build an end to end data application with Yelp review dataset. (data collect -> DB config -> data ETL -> data dashboard (analysis/ML)

Home Page: https://app.redash.io/yen_dev/public/dashboards/xpfG9wKgb9qEcMHlGiSpjhFn8dCZuun8XbCN52GN

Shell 10.01% Python 57.94% Dockerfile 5.64% TSQL 25.14% Mako 1.27%
spark spark-batch database database-modeling data-processing etl docker redash kaggle yelp

yelpreviews's Introduction

INTRO

Build a POC data app that start from data source to final application. Process : data collect -> data process -> db modeling -> data storage -> ETL -> data analysis / ML -> data visualization. This project will focus on : 1) database modeling / schema design (per business understanding, use cases) 2) data process 3) analysis that extract business insights 4) framework design logic (why this database, why this schema, why this BI tool..)

Framework

DB model

DB model

DB model

DB model V2

Visualization

Visualization

File structure

├── README.md
├── alembic.ini      : configuration for alembic DB version control
├── config           : configuration  for database, RDS, s3...
├── data             : file saved Yelp dataset
├── db               : sql for redash dashboard, and analysis 
├── ddl              : alembic database migration (ddl/versions)
├── doc              : file for documentation 
├── etl              : Main ETL scripts 
├── redash           : Dockerfile redash env (BI tool)
├── requirements.txt : Needed python libraries 
├── script           : Scripts run data preprocess 
├── spark            : Dockerfile build spark env 
└── superset         : Dockerfile superset env (BI tool)

Prerequisites

Prerequisites
  1. Fork the repo : git clone https://github.com/yennanliu/YelpReviews.git
  2. Download Kaggle dataset and and save at data file
  3. Download/launch mysql server local, and create a database yelp (for development)
  4. Set up AWS RDS mysql database (for prodution, optional)
  5. Modify mysql db config with yours
  6. Modify RDS mysql db config with yours (optional)
  7. Modify DB connection (e.g. sqlalchemy.url = <your_mysql_url>)in alembic.ini with yours

Quick start

Quick start
# STEP 0) install libraries 
$ cd ~ && cd YelpReviews && git install -r requirements.txt 
# STEP 1) db migration 
$ alembic init --template generic ddl &&  alembic upgrade head  # downgrade : $ alembic downgrade -1 
# STEP 2) data preprocess 
$ bash script/transform_all_json_2_csv.sh  # json to csv 
# csv -> mysql 
$ bash script/all_csv_2_mysql.sh
# STEP 3) spark etl
$ docker build spark/. -t spark_env 
$ bash etl/run_etl_digest_business.sh
$ bash etl/etl_user_friend_count.sh

Development

Development
  • dev

TODO

TODO
  • Add tests
  • Dockerize all end to end applications (can run all functionalities offline)
  • Tune spark code raise IO efficiency

Ref

Ref

yelpreviews's People

Contributors

yennanliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.