Coder Social home page Coder Social logo

segmentationui's Introduction

React + Flask starter kit

A quick starter repo that includes Flask and React, with Babel and Webpack. For proof-of-concept projects, workshop settings, etc where you don't want to worry about developer setup or writing config files.

TLDR; for the quick and dirty setup, install your dependencies:

pip install virtualenv
virtualenv venv; source venv/bin/activate
pip install -r requirements.txt
npm install -g webpack; npm install

Then in two separate tabs run python app.py and webpack --watch. Make edits to js/Hello.js and app.py to edit the frontend and backend, respectively.

These steps are explained in more detail below.

Prerequisites

You'll need some package managers.

  • npm
  • pip

Setup

For the backend:

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

For the frontend:

If you don't have webpack, install it:

npm install -g webpack

Then, use npm to install the remaining JavaScript dependencies.

npm install

Development

The entry point for the app is in js/app.js. The starter React component is js/Hello.js. Editing this file is a good place to start.

While developing on the frontend, run webpack --watch to keep re-compiling your JavaScript code.

Running webpack creates a file in static/bundle.js, which is the bundled version of your frontend code.

The "backend" here is a bare-bones Flask app. Look in app.py if you want to make edits to the backend.

To run the application, follow the steps in the next section.

Running the app

If you're using a virtualenv, activate it.

source venv/bin/activate

Then run the Flask app:

python app.py

segmentationui's People

Watchers

James Cloos avatar Julien Kervizic 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.