Skip to content

alastria/isbe-poc-middleware-management

Repository files navigation

isbe-poc-middleware-managements# ISBE POC – Managements

Managements api made with Node.js + Express + TypeScript

🚀 Stack


⚙️ Scripts

pnpm dev          # Start dev server with tsx in watch mode (NODE_ENV=local)
pnpm build        # Compile TypeScript to ./dist
pnpm start        # Run compiled code from dist (NODE_ENV=production)
pnpm test         # Run all tests with Vitest
pnpm format       # Run Prettier on the whole repo

📌 Environment Variables

From the .env.example you must create -> .env and .env.production

  • NODE_ENV

Used only to decide which .env.* file to load.

Current logic:

If NODE_ENV=production → .env.production will be loaded

For any other value → .env will be loaded

Important: NODE_ENV does not control authentication or app behavior, it only determines which .env file is loaded.

📦 Docker

docker compose up -d

Creates the services: postgres and pgweb

📖 Swagger

The API is documented with OpenAPI 3 and served with Swagger UI.

Interactive UI: http://localhost:3000/swagger

Raw spec (JSON): http://localhost:3000/swagger.json

Source spec (YAML): src/docs/openapi.yaml

Using the 📖 Postman collection JSON file

Place and filename

The Postman collection is stored at: tests/ApiCallCollection/managements.json.

How to import

Open Postman, choose "Import" → "File", and select the JSON file from the path above.

Alternatively, copy the JSON content and use "Import" → "Raw text" in Postman.

Authentication

Most endpoints require a JWT in the Authorization header.

Example requests included

GET /health — public health check.

GET /api/managements — list managements (summary).

POST /api/managements — create management (JSON body example provided).

GET /api/managements/{id} — retrieve management details.

DELETE /api/managements/{id} — delete a management.

GET /api/managements/company/{companyId}/role/{role} — filtered listing by company and role.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors