How ailtonmds/agrostock works
AgroStock is a web-based warehouse inventory system. Staff sign in, manage products, categories and lots, then record stock receipts or issues; barcode scans can help identify products during those stock operations. The backend serves PHP endpoints, checks sessions, and persists inventory and movement data in MySQL/MariaDB. Dashboard, alerts and reports provide operational visibility, while user administration controls access. The README documents frontend-to-API and barcode behavior; sampled backend files show database queries and shared session/configuration dependencies. Other frontend wiring is described but was not sampled.
Main entry points: api.js API client · verificar_sessao.php Session validation · conexao.php PDO connection · database.sql MySQL/MariaDB
Components 19
Web interface
- Inventory screens
frontend/pages - API client
frontend/assets/js/api.js - Barcode input
frontend/assets/js/scan-to-input.js - Login screens
frontend/assets/js/login.js
Inventory operations
- Product endpoints
backend/produtos - Category endpoints
backend/categorias - Lot endpoints
backend/lotes - Stock operations
backend/estoque - Barcode lookup
backend/produtos/buscar_por_codigo.php
Monitoring and reports
- Dashboard data
backend/dashboard.php - Stock and expiry alerts
backend/alertas - Inventory reports
backend/relatorios
Access and configuration
- Authentication endpoints
backend/auth - Session validation
backend/auth/verificar_sessao.php - Backend configuration
backend/config/config.php - User administration
backend/usuarios
Data storage
- PDO connection
backend/config/conexao.php - MySQL/MariaDB
database/database.sql
Other components
- Warehouse staff
Connections 44
- Warehouse staff → Inventory screens: uses
README.md - Inventory screens → API client: requests through
README.md - API client → Authentication endpoints: calls API
README.md - API client → Product endpoints: calls API
README.md - API client → Category endpoints: calls API
README.md - API client → Lot endpoints: calls API
README.md - API client → Stock operations: calls API
README.md - API client → Dashboard data: calls API
README.md - API client → Stock and expiry alerts: calls API
README.md - API client → Inventory reports: calls API
README.md - API client → User administration: calls API
README.md - Inventory screens → Barcode input: uses on stock screens
README.md - Barcode input → Barcode lookup: triggers lookup
README.md - Inventory screens → Login screens: includes login
README.md - Authentication endpoints → Session validation: validates protected access
- Session validation → PDO connection: queries users
backend/auth/verificar_sessao.php - Session validation → Backend configuration: loads settings
backend/auth/verificar_sessao.php - Authentication endpoints → PDO connection: loads PDO
backend/auth/login.php - Authentication endpoints → Backend configuration: loads settings
backend/auth/login.php - Product endpoints → Session validation: checks session
backend/produtos/excluir.php - Lot endpoints → Session validation: checks session
backend/lotes/editar.php - Stock operations → Session validation: checks session
backend/estoque/movimentacoes.php - Dashboard data → Session validation: checks session
backend/dashboard.php - Stock and expiry alerts → Session validation: checks session
backend/alertas/validade.php - Inventory reports → Session validation: checks session
backend/relatorios/estoque.php - User administration → Session validation: checks session
backend/usuarios/editar.php - Product endpoints → PDO connection: queries via PDO
backend/produtos/excluir.php - Lot endpoints → PDO connection: updates via PDO
backend/lotes/editar.php - Stock operations → PDO connection: queries via PDO
backend/estoque/movimentacoes.php - Dashboard data → PDO connection: queries via PDO
backend/dashboard.php - Stock and expiry alerts → PDO connection: queries via PDO
backend/alertas/validade.php - Inventory reports → PDO connection: queries via PDO
backend/relatorios/estoque.php - User administration → PDO connection: updates via PDO
backend/usuarios/editar.php - Barcode lookup → Session validation: checks session
backend/produtos/buscar_por_codigo.php - Barcode lookup → PDO connection: queries via PDO
backend/produtos/buscar_por_codigo.php - PDO connection → MySQL/MariaDB: connects to
backend/config/conexao.php - Product endpoints → MySQL/MariaDB: reads and writes
backend/produtos/excluir.php - Lot endpoints → MySQL/MariaDB: reads and writes
backend/lotes/editar.php - Stock operations → MySQL/MariaDB: reads movement data
backend/estoque/movimentacoes.php - Dashboard data → MySQL/MariaDB: aggregates inventory
backend/dashboard.php - Stock and expiry alerts → MySQL/MariaDB: reads lot expiry
backend/alertas/validade.php - Inventory reports → MySQL/MariaDB: reads stock data
backend/relatorios/estoque.php - User administration → MySQL/MariaDB: reads and writes
backend/usuarios/editar.php - Barcode lookup → MySQL/MariaDB: searches product codes
backend/produtos/buscar_por_codigo.php