The frontend is a React 18 single-page application built with Vite that provides the admin interface for Tienda de Perritos. It communicates with both the Ventas API and the Despachos API over HTTP, and is served as compiled static assets by NGINX inside Docker on port 80.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DevOpsDuoc/Evaluacion02_Devop_Innovatech/llms.txt
Use this file to discover all available pages before exploring further.
Ventas API
Sales microservice the frontend reads and writes via Axios
Despachos API
Dispatch microservice the frontend reads and writes via Axios
Overview
Port
80 (NGINX in Docker)Framework
React 18 + Vite 5
Styling
Tailwind CSS 3
Routing
React Router v6
Technology stack
The application is assembled from the following packages, as declared inpackage.json:
| Package | Version | Purpose |
|---|---|---|
react | ^18.2.0 | UI component framework |
react-dom | ^18.2.0 | DOM renderer |
react-router-dom | ^6.24.1 | Client-side routing |
axios | ^1.6.8 | HTTP client for API requests |
react-hook-form | ^7.52.1 | Form state management and validation |
sweetalert2 | ^11.11.0 | Modal dialogs and confirmation prompts |
react-icons | ^5.1.0 | Icon library |
tailwindcss | ^3.4.3 | Utility-first CSS framework |
vite | ^5.2.0 | Build tool and dev server |
Component structure
The application organises its UI into two groups undersrc/componentes/:
Environment variables
Two environment variables configure the API base URLs. Vite exposes only variables prefixed withVITE_ to the browser bundle.
| Variable | Example value | Description |
|---|---|---|
VITE_API_BASE_URL | http://backend:3001 | Base URL for the Ventas API |
VITE_API_DESPACHOS_URL | http://backend-despachos:3002 | Base URL for the Despachos API |
In Docker Compose, the values use the service hostnames (
backend, backend-despachos). For local development outside Docker, point these variables to http://localhost:3001 and http://localhost:3002 in a .env.local file.docker-compose.yml (frontend service)
Docker build
The frontend uses a two-stage build: Node compiles the assets, then NGINX serves the resultingdist/ folder.
Dockerfile
Builder stage
node:20-alpine installs exact dependency versions with npm ci, then runs vite build to compile TypeScript/JSX and bundle assets into dist/.