Book description
Get to grips with UI interaction, data modeling, API development, and documentation while building modern web apps for cloud deployment
Key Features
- Combine Flask's pagination techniques with React's dynamic rendering for an enhanced user experience
- Implement robust API development within Flask applications by performing CRUD operations
- Improve Flask app scalability with blueprints using a modular development approach
- Purchase of the print or Kindle book includes a free PDF eBook
Book Description
Developing an interactive, efficient, and fast enterprise web application requires both the right approach and tooling. If you are a web developer looking for a way to tap the power of React’s reusable UI components and the simplicity of Flask for backend development to develop production-ready, scalable web apps in Python, then this book is for you.
Starting with an introduction to React, a JavaScript library for building highly interactive and reusable user interfaces, you’ll progress to data modeling for the web using SQLAlchemy and PostgreSQL, and then get to grips with Restful API development. This book will aid you in identifying your app users and managing access to your web application. You’ll also explore modular architectural design for Flask-based web applications and master error-handling techniques. Before you deploy your web app on AWS, this book will show you how to integrate unit testing best practices to ensure code reliability and functionality, making your apps not only efficient and fast but also robust and dependable.
By the end of this book, you’ll have acquired deep knowledge of the Flask and React technology stacks, which will help you undertake web application development with confidence.
What you will learn
- Explore the fundamentals of React for building user interfaces
- Understand how to use JSX to render React components
- Handle data and integrate third-party libraries and APIs into React applications
- Secure your Flask application with user authentication and authorization
- Discover how to use Flask RESTful API to build backend services with React frontend
- Build modular and scalable Flask applications using blueprints
Who this book is for
This book is for Python web developers who want to build full-stack applications, as well as for frontend developers seeking to expand their skillset by employing Flask as a backend development tool. You’ll gain proficiency in both frontend and backend skills, and acquire the knowledge necessary to deploy solutions in the cloud using AWS. Prior knowledge of basic HTML, CSS, JavaScript, and Python programming will help you to get the most out of this book.
Table of contents
- Full-Stack Flask and React
- Contributors
- About the author
- About the reviewers
- Acknowledgment
- Preface
- Part 1 – Frontend Development with React
- Chapter 1: Getting Full Stack Ready with React and Flask
- Chapter 2: Getting Started with React
-
Chapter 3: Managing State with React Hooks
- Technical requirements
- What is a Hook in React?
- Why use Hooks in React?
- Using useState to develop stateful components
- Using useEffect to create side effects
- Using useContext to manage global state in React applications
- Using useRef to directly access DOM elements and persist state values
- Using useReducer for state management
- Using useMemo to improve performance
- Using useCallback to avoid re-rendering functions
- Using custom Hooks for code reusability
- Summary
- Chapter 4: Fetching Data with React APIs
- Chapter 5: JSX and Displaying Lists in React
- Chapter 6: Working with React Router and Forms
- Chapter 7: React Unit Testing
- Part 2 – Backend Development with Flask
-
Chapter 8: SQL and Data Modeling
- Technical requirements
- What is the relational data model?
- Exploring the different database relationships
- Setting up PostgreSQL, SQLAlchemy, and Alembic
- Understanding database concepts for Flask applications
- Understanding SQLAlchemy ORM basics
- Modeling data for a speakers’ conference web application
- Sending data to the PostgreSQL database from a Flask app
- Migration with Alembic
- Summary
-
Chapter 9: API Development and Documentation
- Technical requirements
- What is an API?
- Why use an API in web development
- Endpoint and payload anatomy
- Understanding HTTP requests/responses
- Understanding HTTP status codes
- REST API design principles
- Implementing a REST API in a Flask application
- API interaction with a database via CRUD operations
- API documentation
- Testing and documenting with Postman
- Summary
- Chapter 10: Integrating the React Frontend with the Flask Backend
- Chapter 11: Fetching and Displaying Data in a React-Flask Application
-
Chapter 12: Authentication and Authorization
- Technical requirements
- Understanding the fundamentals of information security
- Defining authentication and the authentication role in web application
- Implementing password security and hashing passwords
- Understanding access and authorization in web application development
- Adding authentication to your Flask application
- Identifying system users and managing their information
- Session management
- Creating a password-protected dashboard
- Implementing flash messages in Flask
- Summary
- Chapter 13: Error Handling
- Chapter 14: Modular Architecture – Harnessing the Power of Blueprints
- Chapter 15: Flask Unit Testing
- Chapter 16: Containerization and Flask Application Deployment
- Index
- Other Books You May Enjoy
Product information
- Title: Full-Stack Flask and React
- Author(s):
- Release date: October 2023
- Publisher(s): Packt Publishing
- ISBN: 9781803248448
You might also like
book
Flask Web Development, 2nd Edition
Take full creative control of your web applications with Flask, the Python-based microframework. With the second …
book
React and React Native - Fifth Edition
Get a big-picture view of modern React and React Native and see how they go hand-in-hand …
book
Just React!: Learn React the React Way
Here is your perfect companion for learning about and developing React applications. This book introduces concepts …
book
Full Stack Quarkus and React
Create and deploy standalone, fully functional, web applications using Quarkus and React Key Features Book Description …