Nuxt Secure uses Neon serverless PostgreSQL as its database and Drizzle ORM for schema management and queries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Israel-Perez/Nuxt-Secure/llms.txt
Use this file to discover all available pages before exploring further.
Setting up Neon
Create a Neon account
Go to neon.tech and sign up for a free account.
Create a new project
From the Neon dashboard, click New Project. Give it a name and choose a region closest to your deployment.
Copy the connection string
In the project dashboard, navigate to Connection Details. Copy the connection string. It has the format:
Drizzle configuration
drizzle.config.ts in the project root tells Drizzle Kit where to find the schema and how to connect to the database:
drizzle.config.ts
server/database/migrations/.
Pushing the schema
To create or update tables in your database to match the current schema, run:DATABASE_URL from your .env file via drizzle.config.ts.
drizzle-kit push directly applies your schema to the database without generating migration files. Use it for development. For production, consider using migration files instead (see below).Running migrations
If you prefer migration files overpush, generate them first:
server/database/migrations/.
Seeding initial data
Run the seed script to create the initial Super Administrador profile and defaultadmin user:
server/database/moduleSeed.ts for seeding module and menu records.
Database client
The database client is set up inserver/database/index.ts using @neondatabase/serverless and drizzle-orm/neon-http:
server/database/index.ts
db in any server route to run queries:
server/api/example.get.ts
Database schema overview
The schema is defined inserver/database/schema.ts and contains five tables:
| Table | Description |
|---|---|
perfil | User profiles (roles) with an administrator flag. |
usuario | User accounts. References perfil. Stores credentials, contact info, and profile photo URL. |
modulo | Application modules used for permission scoping. |
permisos_perfil | Per-profile permissions for each module (add, edit, view, delete, detail). |
menu | Menu entries linking to modules. |