Book Image

Full Stack FastAPI, React, and MongoDB - Second Edition

By : Marko Aleksendrić, Shrey Batra, Rachelle Palmer, Shubham Ranjan
5 (2)
Book Image

Full Stack FastAPI, React, and MongoDB - Second Edition

5 (2)
By: Marko Aleksendrić, Shrey Batra, Rachelle Palmer, Shubham Ranjan

Overview of this book

Discover how to harness the power of the FARM stack—FastAPI, React, and MongoDB—to develop production-ready web applications of varying complexity. Written by a team of industry experts, including MongoDB champions and product leaders, this fast-paced, hands-on guide equips beginners with essential skills to build web applications efficiently. Introducing each element of the stack, the book demonstrates how to seamlessly integrate them to create a medium-sized web application. You'll set up MongoDB as a document store, construct a simple API with FastAPI, and build an application using React. The guide also covers enhancing application security through authentication and authorization with JSON Web Tokens. Beyond mastering the stack, you'll get to grips with integrating Large Language Models (like ChatGPT) for advanced functionality, such as automated email sending. Additionally, you'll learn how to make the most of Next.js 14, a robust full-stack framework offering improved developer experience. By the end of the book, you'll have created functional applications and gained the foundation to explore diverse and more specialized domains, expanding your development horizons.
Table of Contents (14 chapters)

Web Development and the FARM Stack

Websites are built using a set of technology that is often called a stack. Every component of the stack is responsible for one layer of the application. While in theory, you could combine any type of frontend technology with any type of backend technology and, thus, end up with a custom stack, some have proven their worth in terms of agility and reduced development time. If you are a web developer or an analyst who must put some data online from time to time, or you just want to broaden your developer horizons, this chapter should give you some perspective on this set of tools, and how they compare to alternative technologies.

This chapter provides an overview of today’s web development landscape in terms of the available technologies and demands, and at the end of this chapter, we will make a case for using the FARM stack—a combination of FastAPI for the REST API layer, React for the frontend, and MongoDB as the database.

This book focuses on the high-level concepts of the technologies that constitute the FARM stack. By learning these concepts, you will be able to develop your next web development project at a fast pace and with modern capabilities. For now, we will not go into details or concrete examples, but rather compare the selected stack components (MongoDB, FastAPI, and React) with their possible counterparts.

By the end of this chapter, you will have a good understanding of the benefits that individual FARM stack components bring to a development project, how they relate to each other, and why this particular set of technologies is a great fit for web apps that have fluid specifications—both in terms of the data handled and desired functionalities.

This chapter will cover the following topics:

  • What is the FARM stack and how do the components fit together?
  • Why use MongoDB for data storage?
  • What is FastAPI?
  • The frontend—React