Skip to content

ryanyen2/mAtrIx

Repository files navigation

Multi-armed bandit visualization for personal sociale media recommendation

React Flask starter template from tutorial

Tech

  • Frontend: ReactJs
  • Backend: python
    • serve the frontend static page in build by Flask
  • Container: Docker & docker-compose
  • Visualization: d3.js
  • Frontend Framework: React Bootstrap

Structure

_
|__ api         # python server with flask
|__ deployment  # docker compose
|__ public      # static file
|__ src         # react app

Code Smell

  • all the pages (web) should be in view folder
  • all the components in different pages should places under component > view_name
  • install only needed dependencies without making the whole bundle size too large

Init

Python Server

cd api
python3 -m venv venv
source venv/bin/activate

(vevnv)

 pip install flask python-dotenv

React Frontend

using yarn for package manage

# chechk your node version, using 16 is better
nvm use 16

# install yarn gloabally
npm i -g yarn

Install all Dependencies

yarn 

Run React (port 3000)

yarn start
# "start": "react-scripts start"

Run Python Server

yarn start-api
# "start-api": "cd api && venv/bin/flask run --no-debugger"

Build Static website in Public

yarn build
# "build": "react-scripts build"

This structure of the repos created on top of this tutorial

About

CS889 course project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7