Comunidades Vecinos provides a community-scoped document repository where ADMINs can upload PDF files — meeting minutes, bylaws, insurance policies, contractor quotes — that all residents of the community can view and download. Files are stored directly on the server filesystem, and the database holds the metadata (name, description, upload date, and filename).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.
Supported Files
PDF only
The backend validates the
Content-Type of every uploaded file. Only application/pdf is accepted. Any other MIME type returns 400 Bad Request with the message “Solo se permiten PDF”.15 MB maximum
The Spring multipart configuration sets a hard limit of 15 MB per file (
spring.servlet.multipart.max-file-size=15MB). Uploads exceeding this limit are rejected by the framework before reaching the controller.The Documento Entity
| Field | Column | Type | Description |
|---|---|---|---|
id | id_documento | Long (auto) | Primary key |
comunidad | id_comunidad (FK) | Comunidad | The community this document belongs to |
nombre | nombre | String | Human-readable display name |
descripcion | descripcion | String | Optional description or summary |
fecha | fecha | LocalDateTime | Upload timestamp (set by the database default; updatable) |
documento | documento | String | Stored filename on disk (used to construct the download URL) |
File Storage
Files are saved to the directory configured by theapp.upload.dir property. The default value is:
documento field in the database stores only the filename (e.g., acta_junio_2025.pdf). The frontend constructs the full URL by prepending the VITE_URL_DOCUMENTS environment variable, which should point to the same directory via an HTTP-accessible path.
Uploading a Document
Documents are uploaded asmultipart/form-data. The @ModelAttribute Documento receives the metadata fields (nombre, descripcion) and the @RequestParam("archivo") receives the binary file.
SUPER_ADMIN Cross-Community Upload
ASUPER_ADMIN user can upload a document to any community by providing the optional idComunidadManual query parameter. When this parameter is present and the caller is SUPER_ADMIN, the backend uses it instead of the community ID extracted from the JWT.
Listing Documents
USER, ADMIN, and SUPER_ADMIN. The backend scopes the result to the caller’s community (from the JWT). SUPER_ADMIN can override with ?idComunidadManual={id} to list documents for a specific community.
Updating Document Metadata
Only the metadata (nombre and descripcion) can be updated after upload. The file itself cannot be replaced; upload a new document and delete the old one instead.
ModifDocumento DTO. Returns the updated Documento object or 404 if the ID is not found.
Deleting a Document
200 OK with "eliminado" on success, or 404 if the document ID does not exist.
Access Control Summary
| Action | USER | ADMIN | SUPER_ADMIN |
|---|---|---|---|
| List documents | ✅ | ✅ | ✅ |
| Download / view document | ✅ | ✅ | ✅ |
| Upload document | — | ✅ | ✅ |
| Upload to any community | — | — | ✅ |
| Update document metadata | — | ✅ | ✅ |
| Delete document | — | ✅ | ✅ |