Skip to main content

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.

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.

Prerequisites

You need Python ≥ 3.9, pip, and a running MySQL server before continuing.

Install dependencies

Navigate to the server-flask directory and install all required packages:
cd server-flask
pip install -r requirements.txt
The following key packages are installed:
PackageVersionPurpose
Flask3.1.1Web framework
Flask-SQLAlchemy3.1.1ORM
Flask-JWT-Extended4.7.1JWT authentication
Flask-CORS6.0.1Cross-origin requests
PyMySQL1.1.2MySQL driver
pandas2.3.2Excel file parsing
xlrd2.0.2.xls file support
python-dotenv1.2.1Environment variable loading

Environment variables

Create a .env file inside the server-flask directory with the following content:
server-flask/.env
NAME=root
PASSWORD=your_mysql_password
SERVER=localhost
DATABASE=inventario_csti
JWT_SECRET_KEY=change_this_to_a_long_random_string
JWT_EXPIRES_DAYS=1
NAME
string
default:"root"
MySQL username used to connect to your MySQL server.
PASSWORD
string
required
MySQL password for the specified user.
SERVER
string
default:"localhost"
Hostname or IP address of the MySQL server.
DATABASE
string
default:"inventario_csti"
Name of the database to create and use. The server creates it automatically if it does not exist.
JWT_SECRET_KEY
string
required
Secret string used to sign JWT tokens. Use a long, random value and keep it private.
JWT_EXPIRES_DAYS
integer
default:"1"
Lifetime of issued JWT access tokens, expressed in whole days.

Starting the server

From the server-flask directory, run:
python main.py
The server starts in debug mode at http://127.0.0.1:5000. On the first run, it performs the following steps automatically:
  1. Creates the inventario_csti database if it does not already exist.
  2. Calls db.create_all() to create all SQLAlchemy model tables.
  3. Imports inventory data from app/data/areas.xls and app/data/articulos.xls.
Debug mode must not be used in production. Set app.run(debug=False) in main.py, or serve the application with a production-grade WSGI server such as gunicorn.

Build docs developers (and LLMs) love