Skip to main content
Nuxt Secure is a universal Nuxt.js 4 application. The same codebase renders pages on both the server and the client. The Vue 3 frontend communicates exclusively with Nitro API routes running in the same process — there is no separate backend service.

Directory structure

Data flow

Every request moves through this chain:
The middleware runs on both the server (SSR) and the client (SPA navigation). useCookie is used instead of localStorage so token validation works in both environments.

Key files

nuxt.config.ts

nuxt.config.ts

Database schema

Drizzle ORM manages five tables in a Neon PostgreSQL database. The relationships are: a usuario belongs to one perfil; a permisos_perfil row ties a perfil to a modulo with five boolean action flags; a menu row ties a menu item to a modulo.

perfil — user profiles / roles

usuario — application users

modulo — application modules

permisos_perfil — permissions per profile per module

Full schema source

server/database/schema.ts