Skip to main content

Documentation 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.

Inventario SUD reads configuration from a .env.local file in the project root. This file is never committed to version control (it is listed in .gitignore), so you must create it on every machine where you run the app. Copy .env.example to .env.local and fill in each variable described below.
DATABASE_URL must point to a PostgreSQL database with the pgvector extension enabled. The biometric authentication feature stores 1 024-dimension face vectors using the vector column type, which requires pgvector. Neon enables this extension by default on new databases, but verify it is active before running the app.

Database

DATABASE_URL
string
required
The connection string for your Neon PostgreSQL database. Copy it from the Neon console under Connection Details. It takes the form:
postgresql://<user>:<password>@<host>.neon.tech/<dbname>?sslmode=require

Authentication

NEXTAUTH_URL
string
required
The fully-qualified base URL of your application. During local development this is http://localhost:3000. In production, set it to your public domain (e.g., https://inventario.example.com).
NEXTAUTH_SECRET
string
required
A random secret used by NextAuth to sign session tokens and cookies. Generate a secure value with:
openssl rand -base64 32

Email (password reset)

Inventario SUD uses Nodemailer to send PIN-based password reset emails. All four variables below are required for the password reset flow to work.
SMTP_HOST
string
required
Hostname of your SMTP server. For Gmail use smtp.gmail.com.
SMTP_PORT
number
default:"587"
required
SMTP port. Use 587 for STARTTLS (recommended) or 465 for SSL.
SMTP_USER
string
required
The email address used to authenticate with the SMTP server and appears as the sender on outgoing messages.
SMTP_PASS
string
required
The password or app-specific password for the SMTP account. For Gmail, generate an App Password rather than using your main account password.

Complete example

.env.local
# Database
DATABASE_URL="postgresql://user:[email protected]/inventario?sslmode=require"

# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="replace-with-a-random-secret"

# Email (password reset)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_USER="[email protected]"
SMTP_PASS="your-app-password"

Seed the first user

After setting your environment variables, run the seed script to create an initial user in the database:
npm run db:seed
Edit scripts/add-user.ts to set the email address, password, and role before running this command. You can run it again after changing those values to add additional users.
To create multiple users without editing the script each time, pass the values as environment variables or extend the script to accept command-line arguments.

Build docs developers (and LLMs) love