FastAPI+React全栈开发01 FARM技术栈概述

发布于:2024-03-21 ⋅ 阅读:(73) ⋅ 点赞:(0)

Chapter01 Web Development and the FARM Stack

01 Summary

FastAPI+React全栈开发01 FARM技术栈概述

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 app. Although, in theory, you could combine any type of frontend technology with any type of background technology and, thus, end up with a custom stack, some have proven their worth in terms of agility and reduced development time, and they have strong communities and companies backing them.

网站是使用一组通常称为堆栈的技术构建的 - 堆栈的每个组件都负责应用程序的一层。 尽管从理论上讲,您可以将任何类型的前端技术与任何类型的后台技术相结合,从而最终得到自定义技术栈,但有些技术已经证明了它们在敏捷性和减少开发时间方面的价值,并且它们拥有强大的社区和支持他们的公司。

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

在本章中,我们将从可用技术和需求方面概述当今的 Web 开发前景,并介绍 FARM 技术栈 - 用于 REST API 层的 FastAPI、用于前端的 React 和作为数据库的 MongoDB 组合 。

If you are a web developer, an analyst who must put some data online from time to time, or if you just want to broaden your developer’s horizon, this chapter should give you some perspective on this set of tools, the choices that tend to it, and how it compares to alternative technologies.

如果您是一名 Web 开发人员、一名必须不时将一些数据放到网上的分析师,或者您只是想拓宽开发人员的视野,那么本章应该让您对这套工具以及倾向于使用它的选择有一些看法,以及它与替代技术的比较。

I will try to give a broad overview of the high-level concepts of the technologies that constitue the FARM stack, and I will discuss the ways that your next web development project might benefit from using this set of tools. 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 and make the case for the FARM stack.

我将尝试对构成 FARM 堆栈的技术的高级概念进行广泛概述,并将讨论您的下一个 Web 开发项目可能从使用这套工具中受益的方式。 现在,我们不会讨论细节或具体示例,而是将选定的堆栈组件(MongoDB、FastAPI 和 React)与其可能的对应组件进行比较,并为 FARM 堆栈提供案例。

As someone who has begun their journey through web development in what is considered the early days of yore, I remember Microsoft Frontpage and the possibility of turning Word documents into web pages. I remember using tables for layouts, and I remember animated GIF banners poping up everywhere. I also remember the excitement of putting a page online for the world to see.

作为一个在早期就开始了 Web 开发之旅的人,我记得 Microsoft Frontpage 以及将 Word 文档转换为网页的可能性。 我记得使用表格进行布局,还记得动画 GIF 横幅随处弹出。 我还记得在网上发布一个页面供全世界查看时的兴奋之情。

Today, we have so many options for building websites and apps that it can become overwhelming to navigate and try to figue out the tools that satisfy often contradictory criteria. Websites aren’t just websites anymore - they are living creatures of the web that might evolve into, say, a mobile app or a lightweight CRM solution. Rapid tools such as React Native enable us to reuse the same (backend) code base and deliver a pretty good mobile app with almost all the native app features. Maybe the web app will need to provide some type of analytics that involves some heavy math - statistical analysis (a Spanish political party made great use of a simple statistical mobile app a couple of years ago and made a real impact by enabling its members to participate more directly in the decision - making process at all levels) or a simple recommendation algorithm. Maybe we want to add some fancy interactive charts and graphs displaying the many advanced metrics of our favorite NBA player’s statistics?

如今,我们有太多构建网站和应用程序的选择,以至于导航和尝试找出满足经常相互矛盾的标准的工具可能会变得令人不知所措。 网站不再只是网站 - 它们是网络的生物,可能会演变成移动应用程序或轻量级 CRM 解决方案。 React Native 等快速工具使我们能够重用相同的(后端)代码库,并提供具有几乎所有本机应用程序功能的相当不错的移动应用程序。 也许网络应用程序需要提供某种类型的分析,其中涉及一些繁重的数学统计分析(西班牙政党几年前充分利用了一个简单的统计移动应用程序,并通过使其成员能够参与而产生了真正的影响 更直接地在各级决策过程中)或简单的推荐算法。 也许我们想添加一些精美的交互式图表和图形来显示我们最喜欢的 NBA 球员统计数据的许多高级指标?

In this chapter, we will cover the following topics:

  • What is the FARM stack and how does it fit together?
  • Why use MongoDB for data storage?
  • What is FastAPI?
  • The frontend wit React

在本章中,我们将讨论以下主题:

  • 什么是 FARM 堆栈以及它如何组合在一起?
  • 为什么使用MongoDB进行数据存储?
  • FastAPI是什么?
  • 前端框架React

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 might be a great fit for web apps that have fluid specifications - both in terms of the data handled and desired functionalities.

在本章结束时,您将很好地理解各个 FARM 堆栈组件给开发项目带来的好处、它们之间的相互关系,以及为什么这套特定的技术可能非常适合以下 Web 应用程序: 具有流动的规格——无论是在处理的数据还是所需的功能方面。

本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到