This guide walks you through cloning the monorepo, starting the NestJS API, registering your organization as a tenant, authenticating, and creating your first employee record. By the end you will have a live access token and a confirmed multi-tenant workspace ready for contracts, digital files, and alerts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Glemynart/SaaS/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites before you begin:
- PostgreSQL ≥ 16 running and accessible (see the Docker Compose tip below for a one-command local setup).
- Node.js ≥ 20 installed on your machine.
pnpminstalled globally (npm install -g pnpm).- Redis running locally or via Docker if you plan to use BullMQ job queues (optional for the quickstart steps below).
Clone the repo and install dependencies
Clone the repository and install all workspace packages with a single Open Once your
pnpm install from the monorepo root. Then copy the environment template to create your local .env file..env and verify the values for your environment. The defaults from .env.example are:.env is configured, run the Prisma migrations to initialize the database schema:Start the API
Start the NestJS API in development mode using the You should see NestJS bootstrap output ending with:The API will be available at
api workspace filter. The server listens on the port defined by the PORT variable — 4000 by default.http://localhost:4000. CORS is pre-configured to allow requests from http://localhost:3000 (the Next.js frontend). To run the frontend in parallel, open a second terminal and run:Register your organization
Every workspace in La Oficina Nítida is a tenant — a fully isolated organization. Registration creates both the tenant record and the first A successful response returns the newly created tenant and admin user:
ADMIN user in a single atomic transaction.Registration is rate-limited to 3 requests per minute per IP. The
nit must be unique across the platform — attempting to register the same NIT twice returns 409 Conflict.Log in and get your access token
Use the A successful login returns a short-lived access token and a long-lived refresh token:The
tenantNit (not the tenant name) together with your email and password to authenticate. Login is multi-tenant aware — the same email address can exist in different tenants without conflict.accessToken expires in 15 minutes. Use POST /auth/refresh with the refreshToken (valid for 7 days) to obtain a new pair without re-entering credentials. Login is rate-limited to 5 requests per minute per IP.Save the accessToken — you will use it as the Authorization: Bearer header in all subsequent requests.Create your first employee
With a valid access token, create an employee record. The Colombian name model requires The
primerNombre and primerApellido as mandatory fields; segundoNombre and segundoApellido are optional. The document type must be one of the official TipoDocIdentidad enum values: CC, CE, TI, PA, NIT, PEP, or PPT.tenantId is never sent in the request body — it is always extracted from the JWT automatically. This guarantees that an employee can only ever be created within the authenticated tenant’s workspace.To assign the employee to a branch, include the optional
sedeId field with the UUID of an existing Sede record. Sede management is available at GET /sedes once you have created at least one branch for your tenant.