This guide walks you from a fresh checkout to a running Monitor API server with a verified authenticated request. By the end you will have the server listening on port 3000, a JWT token in hand, and a successful response fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sheeplettuce/Monitor/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/expedientes.
Prerequisites
Make sure the following are installed and running before you begin:
Verify your versions:Create an empty PostgreSQL database for Monitor before continuing:
| Requirement | Minimum Version | Notes |
|---|---|---|
| Node.js | 18 | LTS recommended |
| pnpm | 11.5 | Enforced by devEngines in package.json |
| PostgreSQL | 14+ | Must be accessible from your machine |
Clone and Install
Clone the repository and install dependencies with pnpm:pnpm will install all runtime and dev dependencies declared in
package.json, including Express 5, Prisma, bonjour-service, jsonwebtoken, and multer.Configure Environment
Create a Replace
.env file at the project root with the following content. All variables are loaded at startup via dotenv/config.user, password, and monitor with your actual PostgreSQL credentials and database name. See Configuration for a full description of every variable.Next, apply the Prisma schema to your database to create all tables:During initial development you can also use
pnpm prisma db push to sync the schema without creating a migration history. Use migrate deploy for production and CI environments.Start the Server
Run the development server with hot-reload via Before binding to port 3000, the server runs The server binds to
tsx watch:seedAseguradoras() to upsert the three built-in insurers (AXA, HDI, Qualitas) into the database. Once that completes, you will see output similar to the following in your terminal:0.0.0.0:3000 and advertises itself on the local network via mDNS. Status checks run immediately at startup and repeat every five minutes.Authenticate
Obtain a JWT token by posting credentials to A successful response returns the token and basic user information:Copy the
/api/auth/login:token value — you will pass it as a Bearer token in all subsequent requests. Tokens expire after 8 hours.The
rol field will be one of Administrador, Operador, or Técnico. Different roles have access to different routes. Refer to Authentication & Roles for the full permission matrix.Make Your First API Call
Use the token from the previous step to fetch the list of expedientes:The response returns an array of expediente objects, each identified by its You’re all set. Explore the rest of the API with the same Bearer token.
no_siniestro claim number and including vehicle details, current estado, assigned personnel, and related document flags.A successful response looks like:Build for Production
When you’re ready to deploy, compile the TypeScript source to JavaScript and run the compiled output directly with Node:pnpm build invokes tsc, which outputs ES2022 JavaScript modules to dist/ per the settings in tsconfig.json. pnpm start then runs node dist/server.js — no tsx or TypeScript tooling required at runtime.
Make sure your production environment has DATABASE_URL and JWT_SECRET set before running pnpm start. See Configuration for all available options.