Botica Nova Salud is a three-tier web application. The React frontend communicates exclusively with a REST API built on Express.js, and that API layer delegates all data operations to MySQL stored procedures. No ad-hoc SQL queries are issued from application code — every database interaction goes through a named stored procedure.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/15aozzz/Lab-Nova-Salud/llms.txt
Use this file to discover all available pages before exploring further.
Request flow
Every user action follows the same path through the system:User interaction
The React frontend (served by Vite) renders a page and captures user input — a login form, a product search, a sale registration, and so on.
HTTP request
The frontend calls the Express REST API over HTTP using Axios. Protected routes include an
Authorization: Bearer <token> header with the JWT obtained at login.Authentication check
The Express middleware verifies the JWT before the request reaches the route handler. Unauthenticated requests are rejected with
401.Stored procedure call
The route handler calls a MySQL stored procedure via the
mysql2 connection pool. The backend never constructs raw SQL strings against application tables.Database execution
MySQL executes the stored procedure. Triggers on
Detalle_Ventas enforce stock validation and deduction automatically within the same transaction.Tech stack
| Layer | Technology |
|---|---|
| Frontend | React 19 + Vite 8 + Tailwind CSS v4 |
| HTTP client | Axios |
| Charts | Recharts |
| Icons | Lucide React |
| Backend | Node.js + Express 5 |
| Authentication | JWT (jsonwebtoken) + SHA-256 password hashing |
| Database | MySQL 8 — stored procedures + triggers |
The MySQL connection pool is configured with
multipleStatements: true. This is required because some stored procedures (notably sp_get_venta_detalle) return more than one result set in a single call.All endpoints call stored procedures
The backend contains no direct SQL queries against application tables. Every route handler issues aCALL sp_name(...) statement. This means:
- Business logic lives in the database layer, not in application code.
- The API surface is thin: validate input, call the procedure, return the result.
- Triggers inside MySQL handle side-effects (stock validation and deduction) automatically — the API does not orchestrate those steps manually.
Project directory structure
Explore further
Database design
Stored procedures, triggers, and the MySQL connection configuration.
Authentication
How to obtain and use a JWT token to call protected API endpoints.