React Flask Authentication – Free Sample

Hello Coders!

This article presents an open-source sample that implements a JWT [Authentication using React and Flask](https://blog.appseed.us/react-flask-authentication/). The source code for the React Frontend and the Flask API is available for dow…


This content originally appeared on DEV Community and was authored by Sm0ke

Hello Coders!

This article presents an open-source sample that implements a JWT [Authentication using React and Flask](https://blog.appseed.us/react-flask-authentication/). The source code for the React Frontend and the Flask API is available for download on Github under the MIT license (permits unlimited copies, no footer credit). For newcomers, React is a popular Javascript library for coding UI interfaces baked by Facebook and Flask is a leading web framework written in Python.

Thanks for reading! - Content provided by App Generator.

React Flask Authentication - Free Sample

✨Topics

  • 👉 Project Overview and Features
  • 👉 What is React
  • 👉 What is Flask
  • 👉 Start the project in Docker
  • 👉 Resources & Links

✨ Project Overview

Coding a full-stack project might be a challenging task even for experienced programmers and this article aims to provide a little bit of help regarding this hot topic. The main goal of this article is to provide a tested full-stack codebase enhanced with minimal features and a nice UI powered by React.

The project is built using a two-tier pattern where the frontend is physically and logically decoupled from the backend API server. The features provided by both parts of this open-source product can be found below.

Flask API Features

  • Simple codebase
  • SQLite persistence, SqlAlchemy ORM
  • API & token management: Flask-RestX and Flask-JWT
  • Docker Support

React UI Features

  • Modern UI build with M-UI Library: Berry Template
  • Dependencies: Axios, Redux, and Formik
  • Docker Support

✨ What is React

In 2021 the stats shows that React is used as the primary technology in frontend development superseding other frameworks like Vue, Angular or Svelte. React is actively supported and versioned by Facebook and is widely adopted by big companies and many developers across the globe.

React - Official Banner.

In our sample, we will use an open-source template where the authentication code is added on top of an existing project initially created using the CRA tool. For more resources related to React, please access:

✨ What is Flask

Flask is a popular Python Framework designed to a project quick and easy, with the ability to scale up to complex applications. Flask can be used to code from simple one-page sites to APIs and complex eCommerce solutions.

Flask - Open-source Python Framework.

In our API sample Flask is used to expose a simple Authentication API and manage users and the associated JWT tokens. For more resources linked to this amazing library, please access:

  • 👉 Flask - product page
  • 👉 Flask - the official documentation

✨ Start in Docker

To make the project really useful, the source code comes with Docker support for both parts (frontend and the backend).

Step #1 - Clone the source code

$ git clone  https://github.com/app-generator/react-flask-authentication.git

Step #2 - Start the Flask API

$ cd flask-api
$ docker-compose pull   # download dependencies 
$ docker-compose build  # local set up
$ docker-compose up     # start the app 

At this point, the API should be up & running at http://localhost:5000, and we can test the interface using POSTMAN or curl.

Step #3 - Start the React UI

 $ cd react-ui
 $ docker-compose pull   # download dependencies
 $ docker-compose build  # local set up
 $ docker-compose up     # start the app 

Once all the above commands are executed, the React UI should be visible in the browser. By default, the app redirects the guest users to authenticate. After we register a new user and sign in, all the private pages become accessible.

React Flask Authentication - Login Page.

React Flask Authentication - Icons Page

React Flask Authentication - Icons Page.

React Flask Authentication - Dashboard Page

React Flask Authentication - Dashboard Page.

React Flask Authentication - UI Colors

React Flask Authentication - Colors Page

Thanks for reading! For more resources, please access:


This content originally appeared on DEV Community and was authored by Sm0ke


Print Share Comment Cite Upload Translate Updates
APA

Sm0ke | Sciencx (2021-11-12T19:32:08+00:00) React Flask Authentication – Free Sample. Retrieved from https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/

MLA
" » React Flask Authentication – Free Sample." Sm0ke | Sciencx - Friday November 12, 2021, https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/
HARVARD
Sm0ke | Sciencx Friday November 12, 2021 » React Flask Authentication – Free Sample., viewed ,<https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/>
VANCOUVER
Sm0ke | Sciencx - » React Flask Authentication – Free Sample. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/
CHICAGO
" » React Flask Authentication – Free Sample." Sm0ke | Sciencx - Accessed . https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/
IEEE
" » React Flask Authentication – Free Sample." Sm0ke | Sciencx [Online]. Available: https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/. [Accessed: ]
rf:citation
» React Flask Authentication – Free Sample | Sm0ke | Sciencx | https://www.scien.cx/2021/11/12/react-flask-authentication-free-sample/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.