More Premium Hugo Themes Premium React Themes

Flask React Spa

A production-ready boilerplate built with Python 3, Flask and ES6 React/Redux

Flask React Spa

A production-ready boilerplate built with Python 3, Flask and ES6 React/Redux

Author Avatar Theme by briancappello
Github Stars Github Stars: 550
Last Commit Last Commit: Feb 21, 2020 -
First Commit Created: Dec 18, 2023 -
Flask React Spa screenshot

Overview

This product is a Flask React SPA, which is a single page application built using Flask and React.js. The frontend of the application is built with React v16 and is heavily inspired by React Boilerplate. It uses React Router v4, Redux, Redux-Saga, Redux-Form, and Webpack 3 with Babel 6 for state management, side effects, and module bundling. The backend is built with Flask and uses SQLAlchemy ORM with Flask-SQLAlchemy and Flask-Alembic for database management. It provides RESTful APIs using a customized integration between Flask-RESTful and Flask-Marshmallow. Flask-Security is used for authentication, authorization, and user management, and Flask-Login is used for user session management. The backend also uses Celery for running asynchronous tasks and Flask-Mail for sending emails. The application follows the Application Factory Pattern for structuring the backend.

Features

  • React v16 frontend inspired by React Boilerplate
  • React Router v4 for routing
  • Redux, Redux-Saga, and Redux-Form for state management
  • Webpack 3 and Babel 6 for module bundling and transpiling
  • Hot Module Reloading for faster development
  • Tree Shaking for optimizing bundle size
  • Code Splitting with react-loadable for asynchronous component loading
  • Flask backend with SQLAlchemy ORM and Flask-SQLAlchemy for database management
  • Flask-RESTful and Flask-Marshmallow for RESTful APIs
  • Flask-Security for authentication, authorization, and user management
  • Flask-Login for user session management
  • Flask-Principal for user permissions and roles
  • Secrets encryption with passlib and itsdangerous
  • CSRF protection with Flask-WTF
  • Flask-Admin for model CRUD administration
  • Flask-Session for server-side sessions
  • Celery for running asynchronous tasks
  • Flask-Mail for sending emails

Installation

To install the Flask React SPA, you will need the following dependencies:

  • docker and docker-compose
  • Python 3.6+
  • PostgreSQL or MariaDB (MySQL)
  • Redis
  • node.js & npm (v6 or later recommended, only required for development)
  • MailHog (optional, but useful for testing email related tasks)

Once you have the dependencies installed, you can follow these steps to run the application locally:

  1. Clone the repository.
  2. Build and run the application using docker-compose.
  3. Access the application at http://localhost:8888.
  4. Access MailHog at http://localhost:8025 for testing email related tasks.
  5. Access the documentation at http://localhost:5500.
  6. Access the Webpack Bundle Analyzer at http://localhost:5555.
  7. Access the API at http://localhost:5000 for testing with CURL.
  8. The database is exposed on port 5442.

For more detailed documentation, run make docs and browse to http://localhost:5500.

Summary

The Flask React SPA is a full-stack web application built with React.js and Flask. It provides a rich set of features including state management, routing, authentication, authorization, and asynchronous task handling. The application follows best practices and uses popular libraries and tools to ensure a smooth development experience. With easy installation and comprehensive documentation, it is a reliable choice for building single page applications.