This guide walks you through cloning the repository, wiring up the required services, starting the development server, and making your first authenticated request — all in under 5 minutes. By the end you will have a live Kantuta POS API running onDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:3000 with the interactive Swagger UI available at /api.
Prerequisites
Before you begin, make sure the following are installed and accessible on your machine:- Node.js v22+ — the version used by the project’s type definitions (
@types/node ^22) - PostgreSQL — any recent version; you’ll need a database created and credentials handy
- Redis — running locally on the default port
6379, or accessible via a remote URL - npm — bundled with Node.js; no alternative package manager configuration is needed
Steps
Clone the repository and install dependencies
Clone the project from GitHub and install all Node.js packages:
npm install resolves every dependency declared in package.json, including NestJS 11 core packages, TypeORM, Baileys, AI SDKs, and all dev tooling.Create your .env file
Create a
.env file in the project root. You can use .env.example as a starting point if it exists, or create the file from scratch with at minimum the variables below:The database schema is applied automatically on startup because
synchronize: true is set in the TypeORM configuration. You do not need to run migrations manually in development.Start the development server
Launch the API in watch mode so it recompiles on every file change:You should see NestJS bootstrap output followed by a line confirming the server is listening:The server binds to
0.0.0.0 on the port defined by PORT (default 3000). The Swagger UI is immediately available at:Make your first login request
The A successful response looks like:Copy the
POST /auth/login endpoint is public (no bearer token required). Send your credentials to receive a JWT access token and a refresh token:access_token — you’ll pass it as a bearer token on every subsequent protected request.Available npm Scripts
| Script | Command | Description |
|---|---|---|
| Development | npm run start:dev | Start with hot-reload (file watch) |
| Build | npm run build | Compile TypeScript to dist/ |
| Production | npm run start:prod | Run the compiled build with node dist/main |
| Unit tests | npm run test | Run Jest unit test suites |
| E2E tests | npm run test:e2e | Run end-to-end tests via test/jest-e2e.json config |
| Coverage | npm run test:cov | Run tests and generate a coverage report |