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 is a static web application that requires minimal server infrastructure. The application consists of HTML, CSS, and JavaScript files that connect to a Supabase backend for authentication and data management.Prerequisites
Before deploying RuedaPro UNIPAZ, ensure you have:- A web server or static hosting service (Netlify, Vercel, GitHub Pages, Apache, Nginx, etc.)
- A Supabase account (free tier supported)
- Git installed locally (for cloning the repository)
- Basic knowledge of web hosting and DNS configuration
Repository Structure
The application follows a clean, modular architecture:Installation Steps
Configure Supabase
Set up your Supabase project and obtain the required credentials. See the Supabase Configuration page for detailed instructions.You’ll need:
- Supabase project URL
- Supabase anon (public) key
Update Configuration File
Edit
js/config.js and replace the placeholder values with your Supabase credentials:js/config.js
Set Up Database Schema
Run the SQL scripts in your Supabase SQL Editor to create the required tables and security policies:
- Create the database tables (perfiles, proyectos, evaluaciones, proyecto_evaluadores, proyecto_estudiantes)
- Run the RLS security hardening script:
sql/rls_security_hardening.sql
Deploy to Hosting Service
Choose one of the following deployment options:Configure your web server to serve the application:
Option A: Netlify
Option B: Vercel
Option C: GitHub Pages
- Push your repository to GitHub
- Go to Settings > Pages
- Select the branch and root directory
- Save and wait for deployment
Option D: Traditional Web Server (Apache/Nginx)
Copy all files to your web server’s document root:nginx.conf
Create Initial Admin User
After deployment, you need to create your first admin user through Supabase:
- Go to your Supabase project dashboard
- Navigate to Authentication > Users
- Click Add User > Create new user
- Fill in the user details:
- Email:
admin@unipaz.edu(or your admin email) - Password: Create a secure password
- Auto Confirm User: ✓ Enabled
- Email:
- After creating the user, click on the user to edit
- Scroll to User Metadata and add:
- Save changes
https://your-domain.com/#/login-adminThe
rol field in user metadata controls access permissions. Valid values are: admin, docente, estudianteVerify Deployment
Test your deployment:
- Visit your deployed site URL
- Navigate to the admin login page
- Log in with your admin credentials
- Verify that you can access the admin dashboard
- Test creating a docente (teacher) and estudiante (student) user
- Check that the public ranking page displays correctly
Environment Variables (Optional)
For production deployments, consider using environment variables instead of hardcoding credentials:js/config.js
- Netlify: Site settings > Environment variables
- Vercel: Project settings > Environment Variables
- GitHub Pages: Use GitHub Secrets and a build action
Configuration Files
config.js
The main configuration file located atjs/config.js handles:
- Supabase client initialization
- XSS sanitization helper function
- Global application constants
Key Security Features
The application includes built-in XSS protection:Troubleshooting
Application Shows “Supabase Not Initialized”
Cause: The Supabase client failed to initialize. Solution:- Verify that
config.jsis loaded before other scripts - Check that the Supabase CDN is accessible:
https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2 - Ensure your
SUPABASE_URLandSUPABASE_ANON_KEYare correct - Check browser console for network errors
Login Fails with “Authentication Failed”
Cause: User doesn’t exist or credentials are incorrect. Solution:- Verify the user exists in Supabase Authentication panel
- Check that the user has the correct
rolin user metadata - Ensure the user’s email is confirmed
- Verify RLS policies are properly configured
Users Can’t Access Their Dashboard
Cause: Role mismatch between login portal and user metadata. Solution:- Admin users must log in through
/login-admin - Docente users must log in through
/login-docente - Estudiante users must log in through
/login-estudiante - Verify the
rolfield in user metadata matches the login portal used
Database Queries Fail
Cause: RLS policies are blocking legitimate queries. Solution:- Run the
sql/rls_security_hardening.sqlscript - Verify that authenticated users have read access to required tables
- Check Supabase logs for policy violation errors
- See Security Best Practices for proper RLS configuration
Static Assets Not Loading
Cause: Incorrect paths or CORS issues. Solution:- Ensure all paths in
index.htmlare relative - Check that CSS and JS files are in the correct directories
- Verify web server is configured to serve static files
- Check browser console for 404 errors
Public Ranking Page Shows No Data
Cause: No projects have been evaluated yet or RLS policies are too restrictive. Solution:- Create test projects and mark them as “Evaluado” status
- Verify the RLS policy
"Public read evaluated evaluaciones"is active - Check that students are properly associated with projects via
proyecto_estudiantestable
Next Steps
Supabase Configuration
Set up database tables, authentication, and API keys
Security Best Practices
Learn about RLS policies and securing your deployment