Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Edfermachado/proyectoSistemas/llms.txt

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

The UniEvents superadmin portal is the global command center for the entire platform. From /admin you can monitor real-time counts of universities, tenants (faculties), users, events, and physical spaces, as well as navigate to every major management section. Access is strictly limited to accounts with the superadmin role — any other role is automatically redirected to the login page.

Logging In as Superadmin

Navigate to /admin/login and enter your superadmin email address and password. The form calls the loginSuperAdmin server action, which looks up an account whose role is exactly superadmin, verifies the password with bcrypt, and — on success — writes an HTTP-only session cookie that expires after 7 days. You are then redirected to /admin.
POST /admin/login   (form submission via loginSuperAdmin server action)
The JWT payload stored in the cookie contains userId, role, tenantId, email, and expiresAt. The token is signed with HS256 and the JWT_SECRET environment variable.
Only accounts with role = "superadmin" can access the /admin portal. All other roles — including tenant_admin, event_manager, access_control, and user — are redirected to /admin/login if they attempt to reach any /admin/** route.

Admin Portal Sections

The dashboard home page (/admin) displays five live metric cards (Universities, Faculties, Users, Active Events, Physical Spaces) and a quick-links grid. Each section of the portal is described below.

Universities

Create, search, edit, and delete top-level university institutions. Each university can own multiple faculty tenants.

Tenants / Faculties

Manage faculty or student-organization tenants. Tenants are linked to a university and a category, and own their own spaces and events.

Users

Browse all users across every role. Create new admins (superadmin, tenant_admin) and search by email, role, or faculty.

Categories

Define the taxonomy used to classify faculties — e.g., “Ingeniería”, “Deportes”, “Medicina”. Each category carries a Material Symbols icon name.

Events Audit

Global read-only monitoring of all events across every tenant. Inspect status, dates, and managing staff.

Metrics

Strategic intelligence dashboard: total universities, tenants, events, users, attendees (broken down by type), and B2B sponsorship requests.

Settings

Set global system parameters such as the platform support email address.

Cleanup

Danger-zone maintenance tool for removing test data while respecting foreign-key hierarchy.

Global Metrics

The Metrics page (/admin/metrics) aggregates platform-wide data in real time by querying the database directly. The following figures are displayed:
MetricDescription
Total UniversitiesCount of all rows in the universities table
Total Faculties (Tenants)Count of all rows in the tenants table
Total Events PublishedCount of all rows in the events table
Total Attendees (Tickets)Total entries generated, with a breakdown into estudiante and foraneo attendee types
Total UsersCount of all rows in the users table
Total B2B RequestsCount of rows in the event_requests table (sponsorship, academic support, press coverage, transmission rights)
The page also shows a Commercial System Status panel reflecting the state of the B2C booking engine, the B2B sponsorship request pipeline, and a pending Stripe payment gateway integration.
The metrics page enforces its own session guard — if the session is missing or the role is not superadmin, the page immediately redirects to /admin/login.

System Settings

The Settings page (/admin/settings) allows the superadmin to configure global platform parameters stored in the system_settings table (key/value pairs). Currently, the only configurable setting is:
KeyDescription
support_emailThe primary contact email shown to universities and faculties when they request onboarding or support. Defaults to admin@unievents.com if not set.
Submit the form to upsert this value — if the key already exists it is updated; otherwise a new row is inserted. The page is revalidated immediately after saving.

Cleanup (Database Maintenance)

The Cleanup page (/admin/cleanup) provides a destructive maintenance tool for removing test or orphaned data. It calls POST /api/admin/cleanup, which is guarded by the superadmin session check. Four cleanup modes are available:
ModeWhat is deleted
attendeesScan logs and attendees only (events are kept)
eventsEvent requests, events, attendees, and scan logs
allEverything above plus physical spaces and all non-superadmin users
seedFull reset — everything above plus tenants, universities, and categories
Deletion always follows a bottom-up foreign-key order to prevent constraint violations. To confirm the operation, the admin must type LIMPIAR in the confirmation field before the button becomes active.
Cleanup operations are irreversible. The seed mode wipes the entire platform data except for the superadmin account. Use only in development or pre-launch environments.

Build docs developers (and LLMs) love