The SmartStock360 frontend is a single-page React application that serves as the visual interface for inventory management and AI-powered demand forecasting. It displays a product card with demo values, lets users trigger predictions against the Spring Boot backend, renders AI results (prediction label and recommendations), and shows a live inventory table sourced from MySQL through the REST API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JoseOlivares19/Proyecto-PC3-JavaScript-Avanzado/llms.txt
Use this file to discover all available pages before exploring further.
Tech Stack
React 19.2.7
Latest React with concurrent features and the new JSX transform.
Vite 8 + TypeScript 6
Lightning-fast dev server and HMR backed by strict TypeScript compilation.
Axios 1.18
Promise-based HTTP client used for all backend communication.
oxlint
Rust-based linter for fast, zero-config linting of the TypeScript source.
Prerequisites
Before running the frontend you need:- Node.js 18 or later — the Vite 8 build pipeline requires it
- npm — bundled with Node.js; no separate install needed
- A running instance of the SmartStock360 Spring Boot backend (or the deployed URL) reachable at the configured
API_URL
Setup
Install dependencies
Install all production and development dependencies declared in This pulls in React, ReactDOM, Axios, Vite, the React plugin, TypeScript, type definitions, and oxlint.
package.json:Start the development server
Launch the Vite dev server with hot module replacement:The application will be available at
http://localhost:5173. Vite proxies nothing by default — API calls go directly to the API_URL configured in src/services/api.ts.Available npm Scripts
| Script | Command | Purpose |
|---|---|---|
dev | vite | Start local dev server at localhost:5173 |
build | tsc -b && vite build | Type-check then bundle to dist/ |
lint | oxlint | Run the Rust-based linter across all source files |
preview | vite preview | Locally preview the production dist/ build |
Configuring the API Base URL
The API base URL is hardcoded insrc/services/api.ts. By default it points to the deployed production endpoint:
Vite Configuration
The project’svite.config.ts is minimal and intentional:
base: '/universidad/' setting means the production build expects to be served from the /universidad/ sub-path — matching the deployed URL at https://swifttask.tech/universidad/.