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.

Universities are the top-level organizational entities in UniEvents. Every faculty (tenant), its events, spaces, and staff ultimately belong to a university. Before you can create a faculty or assign tenant administrators, you need at least one university in the system. All university management is performed from the superadmin portal at /admin/universities.

What Is a University?

A university is the root of the multi-tenant hierarchy. It groups one or more faculty tenants, each of which manages its own spaces, events, and users. The database schema for a university is:
// src/db/schema.ts
export const universities = pgTable('universities', {
  id:          uuid('id').primaryKey().defaultRandom(),
  name:        varchar('name', { length: 255 }).notNull().unique(),
  slug:        varchar('slug',  { length: 300 }).unique(),
  description: text('description'),
  logoUrl:     varchar('logo_url', { length: 500 }),
  createdAt:   timestamp('created_at').defaultNow(),
});
FieldDetails
nameHuman-readable institution name. Must be unique across the platform.
slugURL-safe identifier auto-generated from the name via generateUniqueSlug. Never set manually.
descriptionOptional text description of the institution.
logoUrlOptional URL to the university’s logo image (stored externally or via Supabase Storage).

Creating a University

1

Open the Universities list

Navigate to /admin/universities. If no universities exist yet, an empty state is shown with an Add University button.
2

Click New University

Click the Nueva Universidad button in the top-right corner. This navigates to /admin/universities/new.
3

Fill in the form

Complete the required and optional fields:
  • Name (required, unique) — the official institution name.
  • Description (optional) — a short summary shown on the public university page.
  • Logo URL (optional) — a direct link to a logo image.
4

Submit

Submit the form. The system calls POST /api/universities, which auto-generates a unique slug from the name and inserts the record. The new university appears at the top of the list.

API — Create a University

POST /api/universities
Content-Type: application/json
{
  "name": "Universidad Central de Venezuela",
  "description": "La universidad más grande y antigua de Venezuela.",
  "logoUrl": "https://storage.example.com/logos/ucv.png"
}
Response 201 Created:
{
  "id": "a3f1c2d4-...",
  "name": "Universidad Central de Venezuela",
  "slug": "universidad-central-de-venezuela",
  "description": "La universidad más grande y antigua de Venezuela.",
  "logoUrl": "https://storage.example.com/logos/ucv.png",
  "createdAt": "2024-08-15T10:30:00.000Z"
}
The slug is derived automatically from the name using the shared generateUniqueSlug helper. If the slug already exists, a numeric suffix is appended (e.g., universidad-central-2). You should never pass slug in the request body.

Editing and Deleting a University

Editing

Navigate to /admin/universities/[id]/edit. Update any combination of name, description, or logoUrl and save the form. The PUT endpoint re-generates the slug if the name changes.
PUT /api/universities/{id}
Content-Type: application/json

{
  "description": "Updated description text."
}
Response 200 OK — returns the full updated university object.

Deleting

Click the delete icon (trash) next to any university row on /admin/universities. This calls:
DELETE /api/universities/{id}
A university cannot be deleted if it has faculty tenants associated with it. You must first delete or reassign all tenants belonging to that university. The API returns 400 with the message “No se pudo eliminar. Verifique que no tenga facultades asociadas.” in that case.

Viewing University Details

Opening /admin/universities/[id] shows the university record along with the list of faculty tenants linked to it via the universityId foreign key. From here you can navigate to individual tenant records.

All API Endpoints

GET    /api/universities           # List all universities (ordered by createdAt desc)
POST   /api/universities           # Create a new university
GET    /api/universities/{id}      # Get a single university by UUID
PUT    /api/universities/{id}      # Update name, description, or logoUrl
DELETE /api/universities/{id}      # Delete (fails if tenants exist)
GET /api/universities returns an array ordered by createdAt descending:
[
  {
    "id": "a3f1c2d4-...",
    "name": "Universidad Central de Venezuela",
    "slug": "universidad-central-de-venezuela",
    "description": "La universidad más grande y antigua de Venezuela.",
    "logoUrl": "https://storage.example.com/logos/ucv.png",
    "createdAt": "2024-08-15T10:30:00.000Z"
  }
]

Build docs developers (and LLMs) love