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
RuedaPro UNIPAZ implements a robust authentication system using Supabase Auth, providing secure access control for three distinct user roles: administrators, teachers (docentes), and students (estudiantes). The system ensures that each user type has access only to their designated features and data.Authentication Architecture
Supabase Integration
The platform uses Supabase as its authentication backend:config.js
- JWT-based session management
- Secure password authentication
- User metadata storage
- Built-in security features
Role-Based Access Control
User Roles
The system supports three primary roles:Admin
Full system access for user and project management
Docente
Teacher/evaluator role for assessing student projects
Estudiante
Student role for viewing projects and results
Role Storage
Roles are stored in the user’s JWT metadata during account creation:auth.js:65-72
Login Flow
Authentication Process
The login process follows these steps:User Submits Credentials
User enters email and password on their role-specific login page (admin, docente, or estudiante)
Supabase Authentication
Credentials are validated against Supabase Auth using
signInWithPassword()auth.js:49-52
Role Verification
The system verifies that the user’s assigned role matches the login portal they’re using
auth.js:75-95
Role Enforcement
Session Management
Session Restoration
When a user returns to the platform, their session is automatically restored:auth.js:4-29
- Checks for an existing Supabase session
- Restores user profile data from JWT metadata
- Fetches additional profile information (like avatars) from the database
- Updates the UI to reflect the logged-in state
Logout Process
auth.js:98-106
- Supabase authentication session
- Local user and profile objects
- UI state (header, navigation)
User Metadata Storage
Profile Structure
User profiles contain:| Field | Type | Description |
|---|---|---|
id | UUID | Unique user identifier (from Supabase Auth) |
nombre | String | Full name of the user |
rol | String | User role (admin, docente, or estudiante) |
avatar_url | String | Optional profile picture URL |
Database Integration
While roles are stored in JWT metadata, additional profile information is stored in theperfiles table:
- Primary authentication data: Stored in Supabase Auth (email, password, role)
- Extended profile data: Stored in
perfilesdatabase table (avatar, additional info) - Role assignment: Managed by admin users through the user management interface
Security Features
XSS Protection
The platform includes HTML sanitization to prevent XSS attacks:config.js:11-19
Security Best Practices
Password Requirements
Password Requirements
- Minimum 8 characters required
- Managed through Supabase Auth policies
- Can be reset through admin user management
Session Security
Session Security
- JWT tokens with automatic expiration
- Secure HTTPS-only transmission
- Server-side validation through Supabase
Role Isolation
Role Isolation
- Role verification on every sensitive action
- Database-level Row Level Security (RLS) policies
- UI-level access control based on user role
Error Handling
Authentication Errors
The system provides clear error messages for common authentication failures:- Invalid credentials: “Autenticación fallida: Credenciales incorrectas o cuentas inexistentes.”
- Role mismatch: “No tienes permiso de ‘[role]’. Tu rol asignado es: ‘[actual_role]’.”
- Network errors: “El cliente Supabase no está inicializado. Posible fallo de red.”
Related Features
User Management
Learn how admins create and manage user accounts
Project Management
Understand how role-based access controls project operations