This guide walks you through getting StockManager running on your local machine, logging in with the default root account, adding your first product to the inventory, and recording a sale — all using the development server. By the end you’ll have a working instance and a clear picture of how the REST API maps to the UI workflows. For production setup, building the desktop executable, or configuring email notifications, see the Installation guide.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/InnoDev69/StockManager/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repository and install dependencies
Clone the StockManager repository and install its Python dependencies. The project requires Python 3.10 or newer.The
requirements.txt pins Flask 3.0, Waitress 2.1, PyWebView 6.1, Pillow, ReportLab, and python-barcode, among others. A virtual environment is strongly recommended to avoid conflicts with other Python projects on your machine.Create the .env file
StockManager reads configuration from a Generate a strong value with Python:Copy the output and paste it as the value of
.env file in the project root. At minimum you need a secret key for Flask session signing.FLASK_SECRET_KEY. Without this variable the app falls back to the insecure default "a", which is fine for a first test but must not be used beyond that.Start the development server
Run the dev server using Expected output:The SQLite database is created automatically at
run-dev.py. This calls app.run(host="127.0.0.1", port=5000, debug=True), which starts Flask’s built-in Werkzeug server with debug mode on. Debug mode enables the automatic reloader (the server restarts when you edit a Python file) and shows full tracebacks in the browser on errors../data/stock.db on this first launch. The init_db() routine creates all tables, applies any pending migrations, and inserts the default root user if none exists.run-dev.py uses Flask’s built-in development server. Do not use this mode for the desktop app experience or for production deployments. Use python main.py for the PyWebView desktop window instead (see Installation).Log in with the root account
Open A successful response:
http://127.0.0.1:5000 in your browser. You’ll be redirected to the login page. Sign in with the auto-created credentials:- Username:
root - Password:
root1234
Create your first product
Products can be created through the Inventory section of the UI (navigate to the sidebar after logging in) or via the REST API. Only users with the A successful response:The product is now visible in the inventory table. Because the initial quantity (100) is above the minimum threshold (10), no low-stock notification is triggered. A notification of type
Optional fields:
admin or root role can create products.success is still created for the acting user confirming the product was added.Required fields: barcode, name, quantity, min_quantity, priceOptional fields:
description, expiration_dateRegister a sale
Use Then register the sale using the product’s numeric ID:A successful response:The
POST /api/sales/bulk to record a sale. The endpoint accepts one or more items in a single transaction, deducts stock automatically, and generates a sale record with full line-item detail. Any authenticated user (vendor, admin, or root) can register sales.First, retrieve the product ID if you don’t already know it:payment_method field is a free-form string — common values used in the application are "Efectivo" (cash), "Tarjeta" (card), and "Transferencia" (bank transfer). After the sale, the product’s stock is decremented from 100 to 98, and a low-stock check runs to see if any product has dropped below its minimum threshold.