وب مدرن، رابط کاربری و تجربهی وب · فصل ۱ — مرورگر، سرور، رندر و معماری صفحه · 34
Astro, Next.js, React, Vite, Node.js, and .NET: Different Roles
Understand and decide framework/library/build-tool/runtime/platform classification without prematurely choosing an implementation stack. Given a stack diagram, place each named technology into its primary responsibility role, explain overlaps without flattening categories, and reject comparisons that do not answer the same architectural question.
Astro، Next.js، React، Vite، Node.js و .NET چه فرقی دارند؟ — fa-IR
Lesson summary
Understand and decide framework/library/build-tool/runtime/platform classification without prematurely choosing an implementation stack.
Given a stack diagram, place each named technology into its primary responsibility role, explain overlaps without flattening categories, and reject comparisons that do not answer the same architectural question.
This lesson produces
Given a stack diagram, place each named technology into its primary responsibility role, explain overlaps without flattening categories, and reject comparisons that do not answer the same architectural question.
Who it is for
Foundation
Use labeled diagrams, one concept per card, and explicit before/after examples.
Repair
Return to the failure counterexample and require the learner to name the collapsed boundary before continuing.
Experienced
Skip basic vocabulary and require exception handling, tradeoff language, and a changed-context decision.
Prerequisites
Stop asking “which one wins?” before you know what each one does
A team says it is choosing between React, Vite, Node.js, Next.js, Astro, and .NET. That sounds like a stack decision, but the list mixes different kinds of tools. React primarily helps describe UI as components. Vite is a build tool with a development server and a production build command. Next.js is a React framework. Astro is a web framework with an architecture that can combine mostly static HTML with interactive islands. Node.js is a JavaScript runtime whose core APIs include event-driven facilities. .NET is a broader developer platform built around a runtime, libraries, compilers, SDKs, and application stacks.
The useful question is therefore not “Which name is best?” but “Which responsibility are we trying to fill?” This lesson builds Web Stack Role Classification Matrix v1 so that comparisons happen between alternatives that answer the same architectural question.
Carry forward only the boundaries you need
From WEBF-001, keep the Browser, Request/Response, resource, and server boundaries distinct. From WEBF-006, keep a component boundary separate from the framework or library that implements it. Those two ideas prevent a common category error: a UI library, a build tool, a runtime, and a backend platform can all appear in one system without competing for the same job.
This page owns only framework/library/build-tool/runtime/developer-platform classification. It does not choose a production stack for every project, teach framework APIs, or claim that a technology can never serve more than one role.
Classify by responsibility, not by brand name
Use five primary-role buckets as a reasoning aid:
- UI library — supplies reusable abstractions for building interfaces. React currently describes itself as a library for web and native user interfaces built from components. [S-REACT]
- Web framework — supplies a broader application structure and conventions. Next.js currently describes itself as a React framework for full-stack web applications. Astro is also a web framework, with its own rendering and islands architecture. [S-NEXT] [S-ASTRO-ISLANDS]
- Build tool / development server — transforms and serves source during development and produces deployable assets. Vite documents a development server and a
vite buildproduction build path. [S-VITE] - Runtime — executes programs in a particular environment. Node.js is a JavaScript runtime; its core APIs include an asynchronous event-driven architecture. [S-NODE]
- Developer platform / runtime stack — provides a runtime plus a broader programming platform. Microsoft describes .NET as a cross-platform developer platform that relies on a runtime and includes a wider ecosystem. [S-DOTNET]
These are primary responsibility labels, not prison cells. A framework may invoke build tools, a platform may include a runtime, and a development tool may itself execute on a runtime. The point is to prevent false equivalence, not to pretend the ecosystem has perfectly disjoint boxes.
Build the role matrix with four separate axes
For each technology, record four things separately:
- Primary role: the architectural responsibility most relevant to the current comparison.
- Execution location: Browser, development machine, build environment, server/runtime host, or multiple locations.
- Lifecycle phase: authoring, development, build, request handling, or browser interaction.
- Dependency/relationship: what it can use, host, integrate with, or sit beside.
Web Stack Role Classification Matrix v1 should include at least: technology, primary_role, responsibility, execution_location, lifecycle_phase, observed_evidence, overlap_or_dependency, comparison_peer, uncertainty, next_evidence, and bounded_decision.
A comparison is meaningful only when the comparison peer answers the same question. “React or Vue?” can be a library/framework-level UI comparison in a bounded context. “React or Node.js?” usually mixes UI construction with runtime execution and therefore needs the question rewritten before any selection is defensible.
The same stack can legitimately contain several of these technologies
Consider the path from source code to a running product. A developer can author React components. Vite can provide a development server and build those browser assets. A server program can run in Node.js, or the backend can instead be implemented on .NET. A framework such as Next.js can organize a React application and automate lower-level tooling. Astro can organize a different application architecture and can even host UI components from multiple UI frameworks in its islands model.
That coexistence is not evidence that the labels are meaningless. It means the system has several responsibilities. Confusion appears when one role is silently substituted for another: calling Vite “the backend,” calling Node.js “the UI framework,” or treating React and .NET as if they are mutually exclusive substitutes.
A robust classification also preserves uncertainty. A repository containing package.json does not prove that Node.js serves production requests. It may only be used during build. Seeing React source does not prove Next.js is present. Seeing .NET assemblies does not prove the Browser UI is generated by .NET. Record the evidence you actually have.
Worked example: documentation site with Astro and a React search widget
Suppose a documentation site uses Astro for page structure and rendering. Most pages are static HTML. One search widget is implemented as a React component and activated in the Browser. The project uses Node.js tooling during local development and build.
A defensible matrix has separate rows:
- Astro: primary role = web framework; responsibility = page/application architecture and rendering conventions.
- React: primary role = UI library; responsibility = the search widget's component implementation.
- Node.js: primary role in this scenario = runtime used by development/build tooling; production request-serving role remains unknown unless deployment evidence says otherwise.
Notice what is not concluded: React does not “replace” Astro here, and Astro does not make React stop being a library. The same product uses both because the responsibilities differ.
Diagnose category collapse before choosing a tool
Failure 1 — “Next.js vs Node.js vs React: choose one.” The question mixes a React framework, a runtime, and a UI library. Repair it into separate questions: UI construction, application framework, and server/runtime execution.
Failure 2 — “Vite is our runtime because vite dev runs the site.” A development server proves a development/build-tool responsibility. It does not by itself establish the production runtime.
Failure 3 — “.NET means the frontend cannot use React.” A backend platform decision and a Browser UI library decision can coexist. The architecture must show the interface between them rather than forcing one brand to own the entire system.
Failure 4 — “Framework means it always runs on the server.” Framework is a responsibility category, not a guaranteed execution location. Inspect the concrete framework mode and deployment path.
For experienced programmers: add phase and ownership to your stack diagrams
Legacy architecture diagrams often have boxes labeled only by product name. Modern tooling makes that insufficient because one repository may have build-time, server-time, and browser-time execution with different ownership. Add two annotations to each box: when does it matter? and what contract does it own?
This also improves incident diagnosis. If a production API is failing, changing Vite configuration is irrelevant unless evidence connects the failure to generated client assets. If a Browser bundle fails to compile, the .NET request handler may be healthy. Role classification narrows the search space before debugging begins.
Compare alternatives only after normalizing the decision
There is no universal “best stack.” First define the responsibility and constraints, then compare peers. A framework decision can consider routing, rendering modes, data integration, deployment model, team expertise, or compatibility requirements. A runtime/platform decision can consider language/runtime constraints, hosting, libraries, operational requirements, and existing systems. A build-tool decision can consider source transformation, development workflow, plugin needs, output targets, and integration with the chosen framework.
The matrix should explicitly record when two tools overlap partially. Partial overlap is not identity. For example, a full-stack framework may configure lower-level build tools for you; that does not make “framework” and “build tool” interchangeable categories.
Practice with responsibility-first questions
Guided case: A team uses Next.js for its React application and deploys server-side behavior to a Node.js environment. Write two rows. For each row, name the primary role, the lifecycle phase, and one piece of evidence that would be needed before claiming the technology serves another role.
Independent case: You inherit a repository containing React source, Vite configuration, and a separately deployed backend whose implementation is not shown. Complete the matrix without inventing the backend runtime. Mark unknowns explicitly. Then rewrite any “X versus Y” question whose candidates do not fill the same role.
A high-quality answer contains fewer confident guesses, not more labels.
What counts as evidence
Your matrix is acceptable when another reviewer can trace each classification to either scenario evidence or a current declared source and can distinguish fact, inference/design choice, and unknown. At minimum, verify:
- every named technology has a primary responsibility tied to the current scenario;
- comparison peers answer the same architectural question;
- overlaps are described without flattening categories;
- execution location and lifecycle phase are not inferred from the product name alone;
- at least one uncertainty and one decision-changing evidence item are recorded;
- the matrix keeps the non-claims: these tools are not necessarily mutually exclusive, and no source authorizes a universal best stack.
Transfer without copying the worked example
The final transfer changes the architecture: a project uses React components, Vite during development/build, and a .NET backend. Build the matrix from evidence, explain why all three can coexist, and identify which pairs would be invalid direct comparisons unless the decision question is rewritten. Do not infer a Node.js production runtime merely because Vite is present.
The goal is not memorizing six labels. The goal is refusing category errors when a new stack diagram appears.
Source boundary and freshness
The named-tool classifications in this lesson are review-dated because vendor descriptions and tooling behavior can evolve. The declared source set is limited to the current official React, Astro, Next.js, Vite, Node.js, and .NET documentation. Those sources support the bounded role descriptions used here; they do not prove that one stack is universally superior or that a tool can never participate in another responsibility.
Assessment
There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.
WEBF-007-SUM1 retrieval
Define UI library, web framework, build tool/development server, runtime, and developer platform as responsibility categories. State one non-claim that prevents category collapse.
WEBF-007-SUM2 application
A repository uses Astro for page structure, React for one interactive account widget, and Vite during development/build. Classify each named technology by primary role, execution/lifecycle evidence, overlap, and one uncertainty.
WEBF-007-SUM3 diagnosis
A team proposes replacing its Node.js process with React because “both are JavaScript technologies.” Diagnose the category error and state the evidence needed to compare actual alternatives for the runtime responsibility.
WEBF-007-SUM4 decision
You inherit an unfamiliar project that uses Vite scripts. Before claiming Vite is the production runtime, state the observations you need about build output, deployed process, request handling, and any runtime/platform. Make a bounded decision only from supplied evidence.
WEBF-007-SUM5 transfer
A project uses React components, Vite during development/build, and a .NET backend. Complete Web Stack Role Classification Matrix v1 and explain why all three can coexist without category contradiction. Preserve overlap, uncertainty, and at least two non-claims.
Assessment rubric
A satisfactory submission preserves the lesson boundary, uses inspectable evidence, distinguishes observation from inference, states uncertainty/non-claims, and completes the changed-context transfer independently.
For application, diagnosis, decision, and transfer items, a brand/tool name or visual result alone is insufficient. Evidence must address the fields required by the lesson artifact.
Decision scenario
Where evidence is incomplete, UNKNOWN or a conditional decision is preferable to unsupported certainty.
References & freshness
Case studies
Lesson media & slides
Teaching files (download)