Git Product home page Git Product logo

react-flask's Introduction

Screenshot

Contains:

  • SQLALCHEMY with basic user schema for authentication in app/models

  • Facebook and Google authentication and form login

  • ReactJS and Redux are in: app/static/src

  • Bootstrap v4 which can easily be replaced. Styles are in: app/static/src/styles

  • Mailgun transactional mails. All settings are in: app/settings.py

  • Webpack asset management

Others include Babel internationalizing, WTForms, timeago jinja filter (app/tpl_filter.py) and a simple json serializer in `app/models/serialize.py.

Get started:

Back end:

The configurations are in app/settings.py. You can customize the Makefile to suit your setup.

    git clone https://github.com/lassegit/flask-reactjs my-project-name
    cd my-project-name && rm -r .git

Then install the static assets and run webpack:

    npm install && npm run dev (to build run npm run build)

Then install Flask, create the database schema:

    make env

    make createdb

    make local

It is now running locally on: localhost:5000.

You can also run the flask using:

    source venv/bin/activate
    ./manage.py runserver (or app_ENV="prod" ./manage.py runserver for production)

Front end

You can run two commands with the webpack server: webpack --dev for development which will watch for changes and generate files in app/static/dev. And for production: webpack --build which will build assets for production in app/build.

All webpack configuration are in webpack.config.js and webpack.parts.js.

Note: If you want to use react-lite instead, you can enable it in the webpack.config.js under resolve alias.

ReactJS command line

Since the ReactJS/Redux is based on React Webpack Generator including Redux support you can also use its command line tools.notice

    Install dependencies

    npm install -g yo
    npm install -g generator-react-webpack-redux

    ----

    Navigate to: app/static

    ----

    Generating new reducers

    yo react-webpack-redux:reducer my/namespaced/reducers/name
    yo react-webpack-redux:reducer items

    ----

    Generating new actions

    yo react-webpack-redux:action my/namespaced/actions/name
    yo react-webpack-redux:action addItem
    
    ----

    Generating new components

    yo react-webpack-redux:component my/namespaced/components/name
    yo react-webpack-redux:component button
    
    ----

    Generating new containers

    yo react-webpack-redux:container my/namespaced/container/Name
    yo react-webpack-redux:container wrapper

Thanks

Special thanks to: React Webpack Generator including Redux support for which this boilerplate is partly based.

SurviveJS for a thorough Webpack guide and examples.

react-flask's People

Contributors

soliddev66 avatar

Watchers

 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.