Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Minogar28/DIRECTORIO_UDC/llms.txt

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

The Directorio UDC backend is a Node.js REST API planned on Express 5 (^5.2.1). When implemented, it will serve JSON data to the React 19 + Vite frontend and act as the authoritative source for advisor listings and advisory space availability information across the UDC campus. All communication between the frontend and backend is designed to occur over HTTP using a standard JSON envelope, making it straightforward to integrate additional clients in the future.
The backend server entry point (index.js) is not yet committed to the repository. The API surface described here represents the intended design for the advisory space locator feature. Endpoint behaviour and response shapes may evolve as implementation progresses.

Base URL

When implemented, the server entry point will be index.js (as declared in the backend package.json) and should listen on a configurable port. Use the following base URLs depending on your environment:
EnvironmentBase URL
Developmenthttp://localhost:3000
ProductionConfigured via the PORT environment variable

Authentication

The planned implementation does not require authentication. Directorio UDC is designed as an internal university intranet tool, so all endpoints will be publicly accessible within the campus network. Future versions may introduce session-based authentication to support role-based access control — for example, distinguishing between student users (read-only) and faculty/admin users who can update availability and space assignments.

CORS Policy

The backend declares the cors npm package (^2.8.6) as a dependency. When you implement the server, cross-origin resource sharing should be configured at the Express application level using the cors middleware.
  • Development: allow all origins to simplify local development with the Vite dev server (which runs on a different port).
  • Production: restrict the origin option to the exact URL of the deployed frontend to prevent unauthorized cross-origin requests.
const cors = require('cors')

// Development: allow all origins
app.use(cors())

// Production: restrict to frontend domain
app.use(cors({ origin: 'https://your-frontend-domain.com' }))

Response Format

All planned API endpoints should return JSON. Successful responses will carry an HTTP 2xx status code and wrap their payload in a consistent envelope so client code can handle responses uniformly. Success response:
{
  "success": true,
  "data": { ... }
}
Error response:
{
  "success": false,
  "error": "Resource not found"
}
The success flag lets consumers branch on a single boolean rather than inspecting the HTTP status code in every handler, while the error string provides a human-readable description suitable for display or logging.

Error Codes

The API should follow standard HTTP semantics. The table below lists the status codes you are most likely to encounter:
StatusMeaning
200OK — Request succeeded
201Created — Resource was created
400Bad Request — Invalid or missing parameters
404Not Found — Resource does not exist
500Internal Server Error — Unexpected server-side error

API Endpoints

Browse all planned endpoints with request/response details.

Build docs developers (and LLMs) love