Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GuillermoNavarro/Proyecto_comunidades/llms.txt

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

Comunidades Vecinos is built around a strict multi-tenant model. Every resource in the platform — users, fees, receipts, financial movements, documents, and announcements — belongs to exactly one community (Comunidad). This isolation is enforced at the API level through the community ID that is embedded in each authenticated user’s JWT token; requests never need to pass a community identifier in the body because the backend extracts it from the token automatically.

The Comunidad Entity

The comunidades table stores the core identity information for each residential community:
FieldColumnTypeDescription
idid_comunidadLong (auto)Primary key
nombrenombreStringDisplay name of the community
direcciondireccionStringStreet address
ciudadciudadStringCity
codPostalcod_postalStringPostal code

API Endpoints

All community endpoints live under /api/comunidades. Only SUPER_ADMIN users can create or modify communities. ADMIN users can read their own community via GET /api/comunidades/{id}.
GET /api/comunidades
Authorization: Bearer <super_admin_token>
Returns the full list of Comunidad objects. Restricted to SUPER_ADMIN.
[
  {
    "id": 1,
    "nombre": "Comunidad Los Pinos",
    "direccion": "Calle de los Pinos, 12",
    "ciudad": "Madrid",
    "codPostal": "28001"
  },
  {
    "id": 2,
    "nombre": "Residencial El Olivo",
    "direccion": "Avenida del Olivo, 45",
    "ciudad": "Sevilla",
    "codPostal": "41001"
  }
]

Multi-Tenant Isolation

JWT-embedded community ID

When a user logs in, the JWT issued by the backend contains both the user’s ID and their community ID as custom claims. Every subsequent request that requires community-scoped data reads these claims directly from the token — no idComunidad body field is required or accepted in most endpoints.

ADMIN community scope

An ADMIN user can only read and manage the single community they belong to. Attempting to access another community’s resources returns 403 Forbidden. Only SUPER_ADMIN can cross community boundaries.

Cascading ownership

All child resources — Usuario, Cuota, Recibo, Movimiento, Documento, and Publicacion — carry a mandatory foreign key to their parent Comunidad. There are no shared or global records below the community level.

Active-user count

The GET /api/comunidades/activos endpoint returns the ActivoComunidad DTO, which includes a usuarios field showing the number of active residents (those with estado = true). This is used by the SUPER_ADMIN dashboard to monitor community size at a glance.
Community deletion is not yet implemented in the current version. No DELETE /api/comunidades endpoint exists in the backend; communities cannot be removed through the API.

Build docs developers (and LLMs) love