Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuseAR27/Unisierra-eats/llms.txt

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

UniSierra Eats is a full-stack web application built for Universidad de la Sierra that gives students a digital window into their campus cafeteria — browse the menu, read and write reviews, explore products by category, and manage their own profile, all from a single platform running on a lightweight Node.js server.

Architecture Overview

UniSierra Eats follows a monolithic, single-server architecture where the Express backend and the vanilla HTML/CSS/JS frontend are served from the same Node.js process on port 3000.
LayerTechnologyRole
RuntimeNode.js (v18+)JavaScript execution environment
Web frameworkExpress ^5.2.1HTTP routing and middleware
DatabaseSQLite via sqlite3 ^6.0.1Persistent data storage in a local .db file
FrontendVanilla HTML, CSS, JavaScriptUI served as static files from __dirname
The server uses app.use(express.static(__dirname)) to serve the entire project directory as static files, so every HTML page in public/ and admin/ is accessible directly through the browser without a separate build step or static file host.

User Roles

The platform has two roles stored in the Roles table and referenced by rol_id on each user record:
Rolerol_idAccess
Administrator1Admin panel — inventory management, review moderation, usage reports
Student2Student-facing pages — menu, product search, reviews, profile, settings
When a user loads index.html, a short JavaScript snippet reads localStorage and redirects them to the correct interface based on their role.

Main Application Areas

Student-facing pages (served from public/)
  • index.html — landing page and login/registration
  • menu.html — full cafeteria menu with category filtering
  • busqueda.html — product search
  • detalle_producto.html — product detail with ratings and reviews
  • escribir_resena.html — review submission form
  • perfil.html — user profile and review history
  • configuracion.html — account settings (update name, password, delete account)
Admin panel (served from admin/)
  • panel_admin.html — product inventory (create, edit, delete)
  • moderacion.html — review moderation queue for reported reviews
  • reportes.html — platform usage reports

Session Management

UniSierra Eats stores session state entirely in the browser using localStorage. After a successful login, the server returns a user object that the frontend persists under the key unisierra_sesion.
// Written to localStorage on successful login
{
  "id": 1,
  "nombre": "Admin Principal",
  "correo": "admin@unisierra.edu.mx",
  "rol_id": 1
}
The entry-point index.html reads this key and redirects accordingly:
const sesion = JSON.parse(localStorage.getItem('unisierra_sesion'));

if (sesion && sesion.id_rol === 1) {
    window.location.replace("admin/panel_admin.html");
} else {
    window.location.replace("public/index.html");
}
There is no server-side session or cookie — all protected actions depend on the client sending the correct id values in API requests.

Institutional Email Restriction

Registration — both student and admin — is restricted to @unisierra.edu.mx institutional email addresses. Any attempt to register with a personal or external email returns a 400 error: "Solo se permite el registro con correos institucionales (@unisierra.edu.mx)." This check is enforced server-side in the /api/registro and /api/admin/registro routes.

Explore the Docs

Quickstart

Clone the repo, initialize the database, and run the server locally in five minutes.

Authentication

How login, registration, and role-based redirection work end-to-end.

Product Catalog

Browse, filter, and manage cafeteria products and their average ratings.

API Overview

Full reference for the REST endpoints covering products, users, and reviews.

Build docs developers (and LLMs) love