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: ausuario 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
menu — navigation menu entries
Full schema source
server/database/schema.ts