Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danielpose1996-stack/ruedadeproyectos/llms.txt

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

Overview

The RuedaPro UNIPAZ database consists of five core tables that manage user profiles, projects, evaluations, and their relationships. All tables use UUID primary keys and leverage Supabase’s built-in authentication system.

perfiles (User Profiles)

The perfiles table stores user profile information for all system users including administrators, evaluators (docentes), and students (estudiantes).

Purpose

  • Stores user account information and role assignments
  • Links to Supabase Auth users via UUID
  • Manages user metadata including names and optional avatar URLs

Schema

id
uuid
required
Primary key. References auth.users.id from Supabase authentication system.
nombre
text
required
Full name of the user (e.g., “Carlos Martínez”, “Ana López”)
rol
text
required
User role in the system. Valid values: admin, docente, estudiante
avatar_url
text
Optional URL to user’s avatar image stored in Supabase Storage
created_at
timestamp
Timestamp when the profile was created. Auto-generated on insert.

Example Query

-- Fetch all docente profiles
SELECT id, nombre, rol, created_at
FROM perfiles
WHERE rol = 'docente'
ORDER BY created_at DESC;

Usage in Code

From adminDashboardView.js:277-280:
const { data, error } = await supabaseClient
    .from('perfiles')
    .select('*')
    .order('created_at', { ascending: false });
From adminDashboardView.js:620-624:
const { data: docentes, error: errDoc } = await supabaseClient
    .from('perfiles')
    .select('id, nombre')
    .eq('rol', 'docente')
    .order('nombre');

Data Types Summary

TypeDescriptionExample
uuidUniversally unique identifier123e4567-e89b-12d3-a456-426614174000
textVariable-length character string"Sistema IoT para Invernaderos"
integerWhole number2026, 1, 2
numericDecimal number4.5, 3.8
jsonbBinary JSON data[{"criterioIndex": 1, "puntaje": 4.5}]
timestampDate and time with timezone2026-03-10 14:30:00+00

Common Query Patterns

Fetch Projects with Nested Data

// Fetch project with all related entities
const { data, error } = await supabaseClient
    .from('proyectos')
    .select(`
        *,
        proyecto_evaluadores (
            perfiles (nombre)
        ),
        proyecto_estudiantes (
            perfiles (nombre)
        ),
        evaluaciones (
            puntaje_final,
            observaciones,
            perfiles (nombre)
        )
    `)
    .eq('id', projectId)
    .single();

Calculate Average Evaluation Score

// Calculate average score from multiple evaluations
const avgScore = evaluaciones.reduce((acc, curr) => 
    acc + parseFloat(curr.puntaje_final || 0), 0
) / evaluaciones.length;

Filter Projects by Period and Status

const { data, error } = await supabaseClient
    .from('proyectos')
    .select('*')
    .eq('estado', 'Evaluado')
    .eq('anio', 2026)
    .eq('semestre', 1)
    .eq('categoria', 'Desarrollo');

Best Practices

Use Transactions for Multi-Table Operations

When creating projects with evaluator/student assignments, ensure all inserts succeed or fail together to maintain data integrity.

Validate Foreign Keys

Always verify that referenced UUIDs exist before inserting into junction tables to avoid orphaned records.

Index Foreign Keys

Ensure foreign key columns are indexed for optimal JOIN performance, especially on proyecto_id and evaluador_id.

Use Cascading Deletes Carefully

When deleting projects or users, consider the impact on related records in junction tables and evaluations.