Inventario SUD reads its configuration from aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ChrisCore1/inventario_sud/llms.txt
Use this file to discover all available pages before exploring further.
.env.local file in the project root. This file is never committed to source control — create it manually before running the development server or deploying. The variables below are required for the application to start and for all features to function correctly.
Required variables
Neon PostgreSQL connection string. Must point to a database where the pgvector extension is enabled. Use the pooled connection string from the Neon dashboard for serverless and edge environments.
The canonical URL of your application. NextAuth uses this to construct callback URLs and CSRF tokens. In development, set this to
http://localhost:3000. In production, set it to your deployed domain.A random secret used to sign and encrypt NextAuth session tokens and cookies. Must be at least 32 bytes of entropy.
Email variables (password reset)
These variables configure the SMTP transport used byactions/reset-actions.ts to send six-digit PIN codes for password recovery. All four are required if you want to use the password reset feature.
Hostname of your SMTP server. Defaults to
smtp.gmail.com if not set.Port for the SMTP connection. Defaults to
587 (STARTTLS) if not set.SMTP authentication username — typically the sender email address. Also used as the
from address in outgoing reset emails.SMTP authentication password or app-specific password for the sender account.
Example .env.local
.env.local
Seed the database
After your environment variables are in place and the database schema has been applied, run the seed script to create the first user.scripts/add-user.ts via tsx. The script does the following:
Create the role if it does not exist
The script checks whether the role
Consejero already exists in the Rol table. If not, it inserts it.Check for a duplicate user
It queries the
Usuario table for an existing row with the hardcoded email. If one is found, the script exits without making changes.Hash the password
The plaintext password is hashed with
bcryptjs using 10 salt rounds before being stored.Insert the user
A new row is inserted into
Usuario with the following values:| Field | Value |
|---|---|
nombre_usuario | Juan |
email | [email protected] |
password_hash | bcrypt hash of 123 |
id_rol | ID of the Consejero role |
