Book Image

Full Stack FastAPI, React, and MongoDB

By : Marko Aleksendrić
4 (1)
Book Image

Full Stack FastAPI, React, and MongoDB

4 (1)
By: Marko Aleksendrić

Overview of this book

If you need to develop web applications quickly, where do you turn? Enter the FARM stack. The FARM stack combines the power of the Python ecosystem with REST and MongoDB and makes building web applications easy and fast. This book is a fast-paced, concise, and hands-on beginner’s guide that will equip you with the skills you need to quickly build web applications by diving just deep enough into the intricacies of the stack's components. The book quickly introduces each element of the stack and then helps you merge them to build a medium-sized web application. You'll set up a document store with MongoDB, build a simple API with FastAPI, and create an application with React. Security is crucial on the web, so you'll learn about authentication and authorization with JSON Web Tokens. You'll also understand how to optimize images, cache responses with Redis, and add additional features to your application as well as explore tips, tricks, and best practices to make your development experience a breeze. Before you know it, you'll be deploying the application to different platforms. By the end of this book, you will have built a couple of functional applications efficiently and will have the springboard you need to delve into diverse and more specialized domains.
Table of Contents (17 chapters)
1
Part 1 – Introduction to the FARM Stack and the Components
6
Part 2 – Parts of the Stack Working Together
10
Part 3 – Deployment and Final Thoughts

Preface

FastAPI is a Python-based asynchronous web framework for building fast and performant APIs (REST or GraphQL) that has seen great growth in popularity over the last couple of years. It enables developers to create flexible and powerful standards-compliant APIs as it is based on Python type hinting, it provides automatic documentation out of the box, and its performance is comparable to APIs developed in Go or Node.js.

React is arguably still the most popular solution for building user interfaces on the web. It is a library that adopts a declarative approach and simplifies the workflow by allowing developers to use only JavaScript or JSX, without a templating engine. With frameworks such as Next.js and a Node.js server, React enables us to create server-side generated or statically created web pages, while it is relatively easy to reuse an existing code base in React Native (for native applications), and with the plethora of third-party libraries, one of the strongest online communities, and the introduction of the Hooks mechanism, it has you covered whatever your specific need might be.

MongoDB is the most popular NoSQL database solution and offers numerous benefits – it is flexible and schemaless, it’s ideal for rapid prototyping, and it is also highly scalable and fast.

Combined together, these technologies blend very well, and though they bear a funny acronym (the FARM stack), they allow for a pleasant and fast developer experience, offer speed and flexibility, but most importantly, the opportunity to peruse the wide Python ecosystem, which is suitable for the most diverse problems – from data science and machine learning to analytics and image processing, task automation, and more.

This book aims to teach you how to design, build and deploy fast, scalable, standards-compliant, and flexible full-stack applications in an efficient and, hopefully, fun way. By the end of this book, you should be comfortable modeling the most diverse business problems with fluid requirements through a set of modern technologies and online services.