Nuxt + PostgreSQL

Nuxt, the full-stack Vue framework, with PostgreSQL behind its Nitro server routes: SSR pages and API endpoints in one TypeScript project.

  • NuxtNuxt
  • Vue.jsVue.js
  • PostgreSQLPostgreSQL
  • Node.jsNode.js
  • TypeScriptTypeScript
Learning curve
Moderate
Status
Actively developed
Reviewed
November 2026
Best for
  • Vue teams that need SSR or prerendering for SEO
  • Content sites and storefronts with a relational catalog
  • Full-stack apps that keep pages and API routes in one repository
  • Projects that may deploy to Node servers, serverless or edge platforms via Nitro presets
Not ideal for
  • Realtime multiplayer or WebSocket-heavy app

Overview

Nuxt adds file-based routing, server-side rendering and a Nitro server to Vue, with API endpoints living in server/api next to the pages. PostgreSQL sits behind those server routes, usually through Drizzle, Prisma or postgres.js, while pages load data with useFetch or useAsyncData. It is the default choice for Vue teams that need SEO-friendly pages and their own backend in one codebase.

What's inside

Vue's templates and Composition API are approachable. The learning effort is in Nuxt's conventions (SSR data fetching, auto-imports, Nitro server routes) and in choosing and wiring the database layer yourself.

  • Nuxt

    Nuxt

    Frontend

    Builds the interface people see and use

    Learning: Moderate

    Status: Active

  • Vue.js

    Vue.js

    Frontend

    Builds the interface people see and use

    Learning: Easy

    Status: Active

  • PostgreSQL

    PostgreSQL

    Database

    Stores and queries the data

    Learning: Moderate

    Status: Active

  • Node.js

    Node.js

    Runtime

    Runs the code on the server or device

    Learning: Easy

    Status: Active

  • TypeScript

    TypeScript

    Language

    The language the code is written in

    Learning: Moderate

    Status: Active

How it works

On the first request Nitro renders the Vue page on the server and calls its own server/api handlers in-process; those handlers query PostgreSQL, and the result is serialized into the page payload so the browser hydrates without refetching.

  1. 1.

    Frontend to frontend

    Nuxt matches the URL to a page in the pages directory and starts server-rendering the Vue component tree with its layouts.

  2. 2.

    Frontend to runtime

    useFetch('/api/orders') in the page calls the matching server/api handler directly during SSR, without an extra HTTP round-trip, inside the Nitro server on Node.js.

  3. 3.

    Runtime to database

    The h3 event handler validates input (for example readValidatedBody with Zod) and queries PostgreSQL through a pooled client or ORM shared from server/utils.

  4. 4.

    Database to frontend

    Results are serialized into the Nuxt payload alongside the HTML; the browser hydrates from that payload, and later client-side navigations call the same /api route over HTTP.

Strengths and drawbacks

Strengths

  • Server routes next to pages

    Files in server/api become endpoints, and useFetch and $fetch infer response types from them, so frontend and backend share types without a separate API project or code generation.

  • Deploy-anywhere Nitro output

    Nitro presets build the same app for a Node server, Vercel, Netlify, Cloudflare and other targets, so changing hosts is mostly a build setting rather than a rewrite.

  • Per-route rendering rules

    routeRules let one app prerender marketing pages, cache catalog pages with stale-while-revalidate, and server-render account pages, without splitting into separate projects.

  • Conventions that remove boilerplate

    File-based routing, auto-imported components and composables, and official modules such as Nuxt Image and Nuxt Content cover common needs with little setup.

Drawbacks

  • No built-in data layer

    Nuxt ships no ORM, migrations or connection handling. Teams choose Drizzle, Prisma or a raw driver and must share one pool themselves, especially on serverless presets where each instance opens its own PostgreSQL connections.

  • Auto-imports at scale

    Auto-imported composables and components make it harder to see where code comes from in large projects, and naming collisions or implicit dependencies surface during refactors. Some teams disable parts of auto-import.

  • Hydration and payload pitfalls

    Values that differ between server and client (dates, random IDs, browser-only APIs) cause hydration mismatches, and large useFetch results bloat the serialized payload unless trimmed with pick or transform.

  • Major-version migrations

    Nuxt 2 to 3 was effectively a rewrite, and Nuxt 4 changed the default directory layout and some data-fetching defaults. Module compatibility needs checking before each upgrade.

Scores

Editorial ratings out of 10, comparable across every stack in the guide. They are judgement, not benchmarks. How we score

Speed of building
8.4 out of 10, catalog average 7.7

How quickly a team ships features

Ease of learning
7.7 out of 10, catalog average 7.2

Higher means easier to pick up

Scalability
7.2 out of 10, catalog average 7.6

How far it grows before a redesign

Performance
7.6 out of 10, catalog average 7.5

Speed of the running application

Maintainability
7.0 out of 10, catalog average 7.2

How well the codebase ages

Ecosystem
7.0 out of 10, catalog average 8.2

Libraries, hosting, docs and hiring

Flexibility
7.8 out of 10, catalog average 7.4

How many kinds of product it suits

How it scales

Nitro servers are stateless and scale horizontally; PostgreSQL connection management and SSR CPU cost are the usual limits, eased by per-route caching.

Starting outMVP and first users
nuxt build with the node-server preset on one VPS or container, or a Vercel/Netlify deployment, with a managed PostgreSQL instance.
GrowingReal traffic, a few engineers
Several Nitro instances behind a load balancer, PgBouncer or a provider pooler, and routeRules prerendering or SWR-caching read-heavy pages.
LargeHeavy traffic or data
Redis-backed Nitro storage for caching and sessions, PostgreSQL read replicas for catalog queries, and background jobs in a separate worker process.
EnterpriseMany teams and regions
Nuxt as the web tier in front of dedicated domain services, multi-region CDN caching, and PostgreSQL scaled with replicas or partitioning.

Where it fits

Common projects, from best fit to worst.

  • E-commerce storefront

    Server-rendered product pages cached with routeRules, backed by relational catalog and order tables in PostgreSQL.

    Great fit

  • Content site with a member area

    Nuxt Content or a headless CMS for public pages, plus server routes and PostgreSQL for accounts, forms and saved data.

    Good fit

  • Realtime multiplayer or WebSocket-heavy app

    Nitro has experimental WebSocket support, but long-lived connections and fan-out are easier to operate in a dedicated realtime service.

    Workable

Alternatives

Similar stacks, and when you would choose them instead.

Sources

Reviewed on November 19, 2026 against the documentation below. Found something out of date? Suggest a correction. Read our methodology.

Stacks that share technologies with Nuxt + PostgreSQL.