Wrap-up and resources
Key Takeaways
- 1. What is a framework? And why not start from scratch: A framework is a ready skeleton that handles the repeated work (receiving the request, routing, validation, errors, drawing the interface) and calls your functions at the right moment. You call a library; a framework calls you.
- 2. Kinds of frameworks and how to choose: Where a framework runs sets its kind: in the browser (React), on the server (Express, FastAPI), or in both (Next.js). Choose by the language you know and the kind of thing you build, and learn one framework well before the second.
- 3. Node.js and Express: a server in JavaScript: A request flows through a chain of middleware in order. Validate input, return the right code, and make the error handler the last link in the chain.
- 4. FastAPI: modern Python APIs: Write the types once and get validation, documentation and clear errors for free. A Pydantic model is the API contract.
- 5. React: interfaces built from components: The interface is a function of state: UI = f(state). Split the page into small components, pass data down as props, change it upward through functions, and never mutate state directly; create a new copy.
- 6. Next.js: React with a server and routing: A folder is a route, and a component is a server component by default: it fetches data and sends ready HTML. Add "use client" only to the small piece that needs state or events in the browser.
Glossary
| Term | Definition | Part |
|---|---|---|
| Framework | A ready skeleton that handles repeated work and calls your code at the right moment. | 1 |
| Library | A set of ready functions you call whenever you like. | 1 |
| Inversion of control | The framework holds the main loop and calls your functions, not the other way round. | 1 |
| Front-end framework | Runs in the browser and draws the page from state: React, Vue. | 2 |
| Back-end framework | Receives requests and answers them: Express, FastAPI, Django. | 2 |
| Full-stack framework | Interface and server in one project: Next.js, Nuxt. | 2 |
| Event loop | Node's mechanism for running what is ready without waiting on slow work. | 3 |
| Middleware | A (req, res, next) function in the request chain. | 3 |
| req.params | Values of dynamic segments like :id. | 3 |
| Pydantic | A library that validates and converts data from type hints. | 4 |
| 422 | FastAPI's reply when data fails validation. | 4 |
| Depends | Injecting a dependency into a route, swappable in tests. | 4 |
| UI = f(state) | The interface is the result of state; change the state and React recomputes. | 5 |
| Component | A capitalised function returning JSX, used as a tag. | 5 |
| JSX | HTML-like markup inside JavaScript, compiled to createElement. | 5 |
| SSR | Server-side rendering: HTML arrives with the content ready. | 6 |
| App Router | Next.js routing by folders under app/. | 6 |
| page.tsx / layout.tsx | The page itself / the shared wrapper that is not redrawn. | 6 |
Resources for this lesson
Grouped by type. Start with the official docs for precision, or an article or video for the explanation.
Official docs9
MDN: Server-side web frameworksWhat a server framework gives you and how to compare them, with examples from Express and Django.developer.mozilla.orgMDN: Introduction to client-side frameworksWhy front-end frameworks appeared, the problem they solve, and a comparison of the best known.developer.mozilla.orgExpress: Getting startedThe official docs from install to routes and middleware.expressjs.comNode.js: The event loopNode's official explanation of the event loop and its phases.nodejs.orgFastAPI Tutorial - User GuideThe official step-by-step guide, among the clearest docs in Python.fastapi.tiangolo.comPydantic documentationModels, constraints and custom validation.docs.pydantic.devReact: Quick StartThe new official docs, starting from your first component with interactive examples.react.devThinking in ReactHow to split an interface into components and state.
Done with this lesson?
Sign in to save your progress.