An project template for creating a web project using Flask, React, and SQL Alchemy
Built from the flask_angular_template but using React and Browserify instead of Angular.
This template requires node for compiling assets. It uses gulp. I use invoker to start all processes at once for development.
The db commands for interacting with alembic are modified commands from Flask-Migrate updated to work with Click
$ git clone [email protected]:surgeforward/flask_react_template.git
$ cd flask_react_template
$ mkvirtualenv flask_react_template
$ pip install -r requirements.txt
$ npm install
$ python manage.py db upgrade
$ python manage.py db seed
$ gulp scripts styles
$ python manage.py runserver
$ celery -A project.tasks worker
You can also use invoker for steps 6 through 8. This will start the flask server and run gulp. The default task includes a watch task to update the assets wihen they change.
$ invoker start invoker.ini
Management commands can be listed with the following command:
$ python manage.py
These can sometimes be useful to manipulate data while debugging in the browser.
To create a database migration, run the following command:
$ python manage.py db migrate
Then run the upgrade command
$ python manage.py db upgrade
To run the tests use the following command:
$ nosetests