Skip to main content

Automated Contract Generation System

Generate employee contracts in seconds with powerful PDF generation, Excel processing, and document management capabilities.

Quick Start

Get up and running in minutes

1

Install dependencies

Clone the repository and install the required packages.
npm install
2

Configure environment

Copy the example environment file and configure your settings.
cp .env.example .env
Set the required environment variables:
.env
NODE_ENV=development
PORT=3000
CORS_ORIGINS=http://localhost:3000,http://localhost:5173
MAX_FILE_SIZE=10485760
MAX_EMPLOYEES=1000
3

Start the server

Launch the development server and start generating contracts.
npm run dev
The API will be available at http://localhost:3000/api
4

Generate your first contract

Make a request to preview a contract PDF.
curl -X POST http://localhost:3000/api/contracts/preview \
  -H "Content-Type: application/json" \
  -d '{
    "dni": "12345678",
    "name": "Juan",
    "lastNameFather": "Perez",
    "lastNameMother": "Garcia",
    "contractType": "PLANILLA",
    "position": "Developer",
    "salary": 3000,
    "entryDate": "2024-01-15",
    "endDate": "2025-01-15"
  }'
The response will be a PDF document that you can view in your browser.

Explore Features

Powerful tools for contract management

Contract Types

Support for Planilla, Subsidio, and Part Time contracts with automatic template selection.

PDF Generation

Generate professional PDF contracts using Puppeteer with custom templates.

Excel Processing

Upload and parse employee data from Excel files with comprehensive validation.

Bulk Processing

Generate multiple contracts at once and download them as a ZIP archive.

Data Validation

Comprehensive validation using Zod schemas to ensure data integrity.

Addendum Support

Process and generate addendum documents for contract modifications.

Ready to get started?

Follow our quickstart guide to set up Kontrak Backend and start generating contracts in minutes.

Get Started Now