Skip to content

UI approach

Introduction

Choosing a UI approach decides who renders pages and where the code lives—backend templates, an integrated full-stack app, or a separate frontend over APIs—and that choice locks in project layout and deployment.

Pick the category first

Your project Best fit Examples
Internal systems / admin pages; you do not want two projects Server-side rendering (backend renders pages) Django templates, Razor Pages / Blazor, Askama, templ
One team owns both UI and APIs; pages need to be indexed by search engines Full-stack framework (UI built into the framework) Next.js full-stack, Nuxt full-stack (TypeScript)
Content-first; being found by search engines matters Separate frontend (content / SSR) Astro, Next.js, Nuxt
Logged-in systems with rich interaction Separate frontend (SPA) React + Vite, Vue 3 + Vite
WeChat mini programs / mobile apps Separate frontend (cross-platform) uni-app

How frontend and backend work together

  1. Server-side rendering / full-stack frameworks: no separate frontend project; deploy and permissions are simplest, and UI and APIs share one codebase. The trade-off is that reusing the API for an app or mini program later means extracting it. When the architecture diagram picks this path, the “frontend” folder no longer appears.
  2. Decoupled frontend and backend (recommended for most multi-client projects): the frontend is its own project; the backend only serves APIs; both talk over HTTP. Adding a mini program or app later does not require backend changes.
  3. When decoupling, do three things: enable CORS on the backend and allow only your own frontend origins; use OpenAPI docs as the shared contract; for how login state is kept, see JWT and sessions.

Component comparison

Astro

Open sourceOpsLow

Designed for content-driven websites: pages ship almost no scripts by default, so they open fastest. This site is built with it.

Best forPersonal sites, portfolios, blogs, documentation sites, product introduction pages.

Avoid whenAdmin back offices where most pages are forms, tables and real-time data.

Pros

By default it almost only emits HTML, so pages load quickly

Interactive parts can embed React or Vue

Docs, blogs, and showcase pages work out of the box

Cons

Complex state and live refresh are not its strength

A logged-in admin back office feels awkward to build

Components and learning material are fewer than on the React side

Official docs ↗

Next.js (React)

Open sourceOpsMedium

An all-in-one React-based frontend framework, currently the most widely used; it supports both server-side rendering and interactive apps.

Best forPublic-facing websites that must be indexed by search engines and also be highly interactive, such as e-commerce and SaaS.

Avoid whenInternal-only admin back offices that need no search indexing (an SPA is simpler).

Pros

The largest ecosystem, so docs and hiring are the easiest

It can render on the server and still keep rich interaction

Routing, image optimization, and similar features are built in

Cons

Server components and caching are many concepts, and they change a lot

Hosting it yourself is more work than hosting it on Vercel

If you also write APIs here, you end up with a second backend

Official docs ↗

React + Vite

Open sourceOpsLow

A browser-only React app (SPA): pages are assembled in the browser, with fast builds and a simple structure.

Best forApps used after login: SaaS consoles, internal tools.

Avoid whenPublic pages that need to be indexed by search engines.

Pros

Simple structure without the complexity of server-side rendering

Vite builds and hot updates are very fast

Direct access to React's huge ecosystem

Cons

The first screen depends on JavaScript, which is bad for search-engine indexing

Routing, data fetching and state management must be chosen and assembled yourself

Blank-screen time on first load is longer than with server-side rendering

Official docs ↗

Nuxt (Vue)

Open sourceOpsMedium

The all-in-one framework of the Vue ecosystem, essentially the Vue version of Next.js.

Best forTeams that know Vue and need a public-facing website that must be searchable.

Avoid whenNobody on the team knows Vue, or you only build internal back offices.

Pros

Vue 3 is easy to pick up, with plenty of Chinese-language resources

Auto-routing and auto-imports with clear conventions make it fast to write

Supports server-side rendering, serving search engines too

Cons

Smaller ecosystem and hiring pool than React / Next.js

Many automated "conventions" make troubleshooting harder when something breaks

Version upgrades require following migration notes

Official docs ↗

Vue 3 + Vite

Open sourceOpsLow

A browser-only Vue app that is the easiest to pick up and one of the most common choices for admin back offices in China.

Best forInternal management systems, admin consoles.

Avoid whenPublic websites that need search-engine indexing (consider Nuxt).

Pros

Gentle learning curve with rich Chinese resources and community

Mature admin component libraries such as Element Plus and Ant Design Vue provide ready-made tables and forms

Fast builds and a simple structure

Cons

The first screen relies on JavaScript, unsuitable for pages that must be indexed by search engines

Routing (Vue Router), state (Pinia) and so on must be assembled yourself

Smaller ecosystem than React internationally

Official docs ↗

SvelteKit

Open sourceOpsMedium

One of the most concise frontend frameworks, compiling to small bundles that run fast.

Best forSmall teams that value performance and simplicity and accept the cost of a smaller ecosystem.

Avoid whenYou need to hire many frontend developers quickly, or rely on many ready-made component libraries.

Pros

Little code and good readability

Small output and good performance

Complete full-stack capabilities (routing, server-side rendering)

Cons

Ecosystem and hiring pool are clearly smaller than React / Vue

After team turnover, successors may be unfamiliar with it

Fewer mature admin component libraries to choose from

Official docs ↗

Blazor

Official frameworkOpen sourceOpsMedium

Build web UIs in C# without learning JavaScript; frontend and backend share one language and data model.

Best forInternal systems, teams that only know C# and do not want to learn a frontend stack.

Avoid whenWebsites facing large public audiences, or where first-screen speed is paramount.

Pros

C# throughout, with models and validation rules shared between frontend and backend

It lives in the same solution as ASP.NET Core, so deployment is simple

A good fit for teams that do not want to maintain two stacks at once

Cons

Server mode depends on a long-lived connection and costs more server capacity as users grow

WebAssembly mode has a fairly large download on first load

Community components and hiring are narrower than the JavaScript ecosystem

Official docs ↗

Server-side templates (Razor Pages)

Built into the frameworkOpsLow

Pages are generated directly by ASP.NET Core and then sent to the browser; no separate frontend project is needed.

Best forSmall internal systems, simple admin pages, projects maintained by one person.

Avoid whenThe UI has complex interactions, or an app / mini-program is certain to come later.

Pros

No frontend project to set up; the simplest deployment

Pages are ready-made HTML, search-engine friendly

Light interactivity can be added with lightweight tools like htmx

Cons

Limited experience for complex interactions

Frontend and backend are coupled; adding an app or mini-program later means building a separate API

UI component reuse is less convenient than with a frontend framework

  • C# integrationRazor Pages

Official docs ↗

Server-side templates (Jinja2)

Built into the frameworkOpsLow

Pages are generated directly by FastAPI / Flask using Jinja2 templates; no separate frontend project is needed.

Best forSmall internal systems, simple admin pages, projects maintained by one person.

Avoid whenThe UI has complex interactions, or an app / mini-program is certain to come later.

Pros

No frontend project to set up; the simplest deployment

Pages are ready-made HTML, search-engine friendly

Light interactivity can be added with lightweight tools like htmx

Cons

Limited experience for complex interactions

Frontend and backend are coupled; adding an app or mini-program later means building a separate API

UI component reuse is less convenient than with a frontend framework

  • Python integrationJinja2

Official docs ↗

Server-side templates (Django templates)

Built into the frameworkOpsLow

Pages are generated directly by Django's built-in template system; no separate frontend project is needed.

Best forSmall internal systems, simple admin pages, projects maintained by one person.

Avoid whenThe UI has complex interactions, or an app / mini-program is certain to come later.

Pros

No frontend project to set up; the simplest deployment

Pages are ready-made HTML, search-engine friendly

Light interactivity can be added with lightweight tools like htmx

Cons

Limited experience for complex interactions

Frontend and backend are coupled; adding an app or mini-program later means building a separate API

UI component reuse is less convenient than with a frontend framework

  • Python integrationDjango templates

Official docs ↗

uni-app (mini-programs / apps)

Open sourceOpsLow

One codebase published to WeChat mini-programs, mobile apps and the web at the same time.

Best forProjects centered on WeChat mini-programs that also want an app.

Avoid whenWeb only, or very high requirements for native app experience.

Pros

One set of Vue code covers multiple platforms, saving effort

Well supported by China's mini-program ecosystem, with plenty of documentation

Can integrate directly with each mini-program platform's login and payment

Cons

Complex native capabilities and top-end performance are limited

Differences and compatibility issues between platforms take time to handle

Depends on rule changes at each mini-program platform, which you must keep up with

Official docs ↗

Server-side templates (Askama)

Built into the frameworkOpsLow

Pages are generated by Axum with Askama templates checked at compile time; no separate frontend project is needed.

Best forInternal systems, simple admin pages, projects maintained by small teams.

Avoid whenThe UI has complex interactions, or an app / mini-program is certain to come later.

Pros

No frontend project to set up; the simplest deployment

Templates are checked at compile time, so type mismatches fail the build

Auto-escaping is on by default, and pages are ready-made HTML, search-engine friendly

Cons

Limited experience for complex interactions

Frontend and backend are coupled; adding an app or mini-program later means building a separate API

UI component reuse is less convenient than with a frontend framework

  • Rust integrationaskama

Official docs ↗

Server-side templates (templ / html/template)

Built into the frameworkOpen sourceOpsLow

Pages are generated directly by the Go server using html/template or templ; no separate frontend project is needed.

Best forInternal tools, simple admin pages, projects maintained by one person.

Avoid whenThe UI has complex interactions, or an app / mini-program is certain to come later.

Pros

No frontend project to set up; a single binary is enough to deploy

Pages are ready-made HTML, search-engine friendly

Light interactivity can be added with lightweight tools like htmx

Cons

Limited experience for complex interactions

Frontend and backend are coupled; adding an app or mini-program later means building a separate API

Component ecosystem is far smaller than frontend frameworks

  • Go integrationhtml/template or a-h/templ

Official docs ↗

Built into the framework

Built into the frameworkOpsLow

The UI comes with the chosen full-stack framework; no separate frontend project is needed.

Best forOne team owning both the UI and the API.

Avoid whenThe backend must be shared by multiple clients.

Pros

Frontend and backend live in one project and share types and validation

You no longer maintain a separate frontend build and deploy

Routing and page rendering are handled by the framework

Cons

Reusing it later for an app means extracting a separate API

Business boundaries stay clear only if folder conventions are kept

A framework upgrade affects the frontend and the backend together

Checklist

  • The UI approach is explicit: server-side rendering, full-stack framework, or separate frontend
  • With a separate frontend, the backend allows only its own frontend origins (CORS), not *
  • With a separate frontend, both sides agree on APIs through OpenAPI docs; change the docs before changing the API
  • The browser does not store secrets; token storage follows security guidance; server-rendered templates keep default escaping
  • Public pages that must be indexed use a scheme that supports SSR or static output
  • Frontend dependencies are updated regularly and scanned for vulnerabilities