Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Distribuidos-Org/ms-alumnos/llms.txt

Use this file to discover all available pages before exploring further.

ms-alumnos is a NestJS microservice that owns the full lifecycle of university student records in a distributed system. Rather than exposing an HTTP API directly, it listens exclusively for NATS message patterns — keeping it decoupled from clients and easy to scale or replace independently. Every concern related to students (creation, retrieval, updates, deactivation, and authentication) is handled here, while the rest of your platform communicates with it through lightweight, typed messages over NATS.

What ms-alumnos does

  • Full CRUD over NATS — Create, read, update, and soft-delete student records by responding to typed NATS message patterns, with no HTTP surface exposed.
  • Paginated list queries — Returns student lists with pagination metadata so API gateways and consumers can page through large datasets efficiently.
  • bcrypt password hashing — Student passwords are hashed with bcrypt before persistence; plaintext passwords never reach the database.
  • Request validation — A global ValidationPipe (backed by class-validator) enforces payload shape on every incoming message and rejects unknown fields.
  • Structured error handling — A global MicroserviceExceptionFilter catches domain exceptions and serialises them into consistent NATS error responses that upstream services can reliably interpret.
  • Environment-level seeding — The service is designed to work alongside a Docker Compose–managed PostgreSQL instance, making local bootstrapping and CI seeding straightforward.

How it fits in your architecture

ms-alumnos is one domain service in a microservices mesh. It never speaks directly to HTTP clients — instead, an API Gateway sits in front of the system, translates incoming REST calls into NATS messages, and forwards them to the appropriate microservice.
ms-alumnos pairs with the client-gateway, which exposes a REST/HTTP interface to external clients and relays requests to this service via NATS. The gateway is the only component that should send messages to ms-alumnos in production.
This separation means:
  • No direct database access from clients — all writes and reads flow through validated NATS messages.
  • Independent deployability — you can restart, redeploy, or scale ms-alumnos without touching the gateway or any other service.
  • Technology agnosticism for consumers — any service that can publish a NATS message can interact with ms-alumnos, regardless of its own language or framework.

Technology stack

TechnologyRole in ms-alumnos
NestJS (^11)Application framework — provides dependency injection, module system, lifecycle hooks, and the microservice transport abstraction.
TypeORM (^0.3)ORM layer — maps Alumno entities to PostgreSQL tables and handles migrations, relations, and repository patterns.
PostgreSQL (via pg ^8)Primary data store — holds all student records in a relational schema managed through TypeORM.
NATS (nats ^2)Transport layer — all inter-service communication happens over NATS subjects using the request/reply pattern.
class-validator / class-transformerDTO validation — decorators on DTO classes enforce field types, presence, and format before any business logic runs.
bcrypt (^5)Password security — student passwords are hashed before being persisted and compared on authentication.
Joi (^17)Environment validation — the envs.ts config module uses a Joi schema to assert that all required variables are present and correctly typed at startup, failing fast before the service boots.

Explore further

Quickstart

Run ms-alumnos locally in under 5 minutes with Docker Compose and NATS.

Configuration

Full reference for every environment variable the service accepts.

Architecture overview

Understand how ms-alumnos fits into the broader distributed system.

Create alumno message

Detailed reference for the create_alumno NATS message pattern.

Build docs developers (and LLMs) love