The Goods Inventory backend is a Flask application that auto-creates the MySQL database, imports inventory data from Excel files, and exposes a REST API for both the public interface and admin panel.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/Goods-Inventory/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
You need Python ≥ 3.9, pip, and a running MySQL server before continuing.
Install dependencies
Navigate to theserver-flask directory and install all required packages:
| Package | Version | Purpose |
|---|---|---|
| Flask | 3.1.1 | Web framework |
| Flask-SQLAlchemy | 3.1.1 | ORM |
| Flask-JWT-Extended | 4.7.1 | JWT authentication |
| Flask-CORS | 6.0.1 | Cross-origin requests |
| PyMySQL | 1.1.2 | MySQL driver |
| pandas | 2.3.2 | Excel file parsing |
| xlrd | 2.0.2 | .xls file support |
| python-dotenv | 1.2.1 | Environment variable loading |
Environment variables
Create a.env file inside the server-flask directory with the following content:
server-flask/.env
MySQL username used to connect to your MySQL server.
MySQL password for the specified user.
Hostname or IP address of the MySQL server.
Name of the database to create and use. The server creates it automatically if it does not exist.
Secret string used to sign JWT tokens. Use a long, random value and keep it private.
Lifetime of issued JWT access tokens, expressed in whole days.
Starting the server
From theserver-flask directory, run:
http://127.0.0.1:5000. On the first run, it performs the following steps automatically:
- Creates the
inventario_cstidatabase if it does not already exist. - Calls
db.create_all()to create all SQLAlchemy model tables. - Imports inventory data from
app/data/areas.xlsandapp/data/articulos.xls.