UniSierra Eats is intentionally minimal in its configuration — there are no environment variable files, build pipelines, or external services to wire up. All runtime settings live directly inDocumentation 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.
server.js, and the SQLite database is a single file created by init_db.js. This page explains every configuration point and how the pieces connect.
Project Directory Structure
After cloning the repository and runningnode init_db.js, the project layout looks like this:
unisierra_eats.db does not exist in the repository — it is generated the first time you run node init_db.js. If you delete it, re-running init_db.js will recreate it with fresh seed data.
Server Configuration
All server settings are defined at the top ofserver.js. There are three key configuration points:
Port
Database Path
The SQLite connection is opened with a path relative to the project root:./unisierra_eats.db is resolved relative to the directory from which you run node server.js. To use a different file location, update this string — for example, './data/unisierra_eats.db' — making sure the target directory exists before starting the server.
Static File Serving
The server uses
__dirname as the static root, which means the entire project directory is served as public static files. All HTML pages in public/ and admin/ are accessible directly at their file paths — for example, http://localhost:3000/public/menu.html and http://localhost:3000/admin/panel_admin.html — with no separate web server or proxy required.JSON Middleware
Content-Type: application/json header and makes the parsed object available at req.body. All POST and PUT API endpoints expect JSON-formatted request bodies.
Full Server Bootstrap Sequence
Putting it all together, here is howserver.js initializes on startup:
Database Initialization and Foreign Keys
Theinit_db.js script runs all CREATE TABLE statements inside a db.serialize() block to guarantee sequential execution. The first statement it runs is:
Resenas row that references a non-existent usuario_id or producto_id.
The four tables created by the script and their relationships are:
Resenas table also enforces a check constraint on the calificacion column to ensure ratings are always between 1 and 5:
estado column (defaulting to 'activa') that powers the moderation workflow: students can report a review (setting it to 'reportada'), and administrators can approve it (resetting it to 'activa') or delete it permanently from the admin panel.
Default Seed Data
Runningnode init_db.js populates the database with the following initial records using INSERT OR IGNORE, so re-running the script never duplicates data.
Roles seeded:
id | nombre |
|---|---|
1 | Administrador |
2 | Estudiante |
| Field | Value |
|---|---|
correo | admin@unisierra.edu.mx |
password | admin123 |
rol_id | 1 |
comidas, bebidas, snacks, sanas) so the menu is populated immediately after initialization.