Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Renzo717/Aula-Virtual-Universidad-Radiolocucion/llms.txt

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

Every subject (materia) in NuestraVoz includes a built-in discussion forum. Forums encourage async communication between students and teachers around specific course content. Threads can be tagged to organise topics, replies can be nested, and any user can like a thread with a single tap. The five most-used tags per subject are automatically surfaced as trending topics in the sidebar.

Forum Structure

Forums follow a two-level hierarchy: hilos (threads) at the top level and respuestas (replies) underneath each thread. Replies support a parent_id field for nested, threaded discussions.

Hilos (Threads)

Top-level discussion posts. Each hilo belongs to one materia and can carry an array of free-form text tags.

Respuestas (Replies)

Responses to a thread. Set parent_id to another reply’s UUID to create a nested sub-thread.

Threads (Hilos)

Listing Threads

GET /api/foro/:materiaId/hilos
The response array includes the autor profile (nombre, apellido, avatar_url, rol) plus two computed counters:
materiaId
string
required
UUID of the subject whose forum you want to browse.
interface ForoHilo {
  id: string;
  materia_id: string;
  autor_id: string;
  titulo: string;
  contenido: string;
  tags: string[];
  created_at: string;
  autor?: {
    nombre: string;
    apellido: string;
    avatar_url: string | null;
    rol: string;
  };
  respuestas_count: number;   // total replies in this thread
  reacciones_count: number;   // total likes on this thread
}
Threads are ordered by created_at descending — newest first.

Creating a Thread

Any authenticated user (student, teacher, admin, preceptor) can open a new thread.
POST /api/foro/:materiaId/hilos

{
  "titulo": "Consulta sobre el TP de géneros radiales",
  "contenido": "Hola, tenía una duda sobre el formato esperado para el informe. ¿Tiene que tener introducción y cierre explícitos?",
  "tags": ["tp2", "generos", "consulta"]
}
titulo
string
required
Thread headline. Minimum 2 characters.
contenido
string
required
Body of the thread. Minimum 2 characters.
tags
string[]
Optional array of free-form tag strings. Used to calculate trending topics.

Editing and Deleting Threads

Only the original author can edit or delete their own thread. The server verifies autor_id === req.user.id before allowing the operation. No role override exists — admins and teachers cannot edit or delete another user’s thread.
PATCH /api/foro/hilos/:hiloId

{
  "titulo": "Actualización: consulta sobre el TP",
  "contenido": "... updated content ...",
  "tags": ["tp2", "generos"]
}
Deleting a thread (DELETE /api/foro/hilos/:hiloId) also cascades and removes all replies and reactions belonging to that thread. This action cannot be undone.

Replies (Respuestas)

Listing Replies

GET /api/foro/hilos/:hiloId/respuestas
Replies are returned ordered by created_at ascending (oldest first), so the conversation reads chronologically. Each reply includes the author’s full profile and a parent_id for threading:
interface ForoRespuesta {
  id: string;
  hilo_id: string;
  autor_id: string;
  contenido: string;
  parent_id: string | null;   // null = direct reply to thread
  created_at: string;
  autor?: {
    nombre: string;
    apellido: string;
    avatar_url: string | null;
    rol: string;
  };
}

Posting a Reply

POST /api/foro/hilos/:hiloId/respuestas

{
  "contenido": "Sí, el informe debe tener introducción, desarrollo y cierre. Revisá el material de la Clase 3.",
  "parent_id": "uuid-of-another-reply"   // optional, omit for top-level reply
}
contenido
string
required
Text of the reply. Minimum 1 character.
parent_id
string
UUID of another reply to nest this response beneath. Omit for a direct reply to the thread.

Editing and Deleting Replies

Like threads, only the original author can edit or delete their own replies. The server checks autor_id === req.user.id and returns 403 Sin permisos for any other user.
PATCH /api/foro/respuestas/:respuestaId

{
  "contenido": "Actualizá el texto de la respuesta aquí."
}

Reactions (Likes)

Any authenticated user can like a thread. The endpoint uses an upsert — calling it a second time for the same user and thread does not create a duplicate reaction.
POST /api/foro/hilos/:hiloId/reacciones
No request body is required. The reaction is recorded as { hilo_id, user_id }. The reacciones_count on the thread list endpoint reflects the current total.
Reactions are currently limited to a single “like” per user per thread. There is no endpoint to remove a reaction.
The trending topics sidebar panel is powered by a lightweight tag-frequency query:
GET /api/foro/:materiaId/temas
Response:
{
  "data": [
    { "tag": "tp2",      "count": 12 },
    { "tag": "generos",  "count": 9  },
    { "tag": "consulta", "count": 7  },
    { "tag": "parcial",  "count": 4  },
    { "tag": "horario",  "count": 2  }
  ]
}
The endpoint scans all thread tags arrays for the given materia, counts each tag’s frequency, sorts descending, and returns the top 5. This data refreshes every time the forum tab is loaded.

Permissions Summary

ActionEstudianteDocenteAdminPreceptor
Read threads and replies
Create a thread
Edit / delete own thread
Edit / delete others’ threads
Post a reply
Edit / delete own reply
Edit / delete others’ replies
Like a thread
View trending topics
In the classroom UI, teacher replies are visually distinguished with a coloured left border and a role badge, so students can instantly identify authoritative responses from the docente.

Forum API Reference

MethodPathDescription
GET/api/foro/:materiaId/hilosList all threads with counts
POST/api/foro/:materiaId/hilosCreate a new thread
PATCH/api/foro/hilos/:hiloIdEdit own thread
DELETE/api/foro/hilos/:hiloIdDelete own thread (cascades replies + reactions)
GET/api/foro/hilos/:hiloId/respuestasList replies for a thread
POST/api/foro/hilos/:hiloId/respuestasPost a reply
PATCH/api/foro/respuestas/:respuestaIdEdit own reply
DELETE/api/foro/respuestas/:respuestaIdDelete own reply
POST/api/foro/hilos/:hiloId/reaccionesLike a thread
GET/api/foro/:materiaId/temasTop-5 trending tags

Build docs developers (and LLMs) love