How marcelocperi/erp_colosal_quart works
Purpose and entry points
Colosal is a Python ERP/backoffice system spanning sales, purchasing, inventory, treasury, accounting, production, logistics, library, and external customer/supplier portals. The main web application is likely assembled in app.py, with WSGI deployment support in wsgi.py. A separate mobile/collection application is exposed through recoleccion_app.py; async/ASGI-oriented launch paths are present in run_hypercorn.py.
Application composition
The system is organized as domain route modules that render server-side templates and invoke shared services. Core application governance, authentication, authorization, enterprise administration, and cross-cutting routes reside in core/routes.py, core/decorators.py, and core/enterprise_admin.py. Blueprint-oriented assembly appears centralized in core/blueprint_factory.py, creating a boundary between application bootstrapping and domain modules.
Commercial and operational flows
Sales handles customers, quotations/budgets, orders, invoicing, returns, and customer account views through ventas/routes.py and ventas/presupuesto_service.py. Purchasing covers suppliers, sourcing/RFQ, purchase orders, receiving, importation, and subcontracting through compras/routes.py, compras/rfq_routes.py, and compras/importaciones_routes.py. These flows converge on shared order, receiving, quotation, and ERP master-data services such as services/order_service.py, services/receiving_service.py, and services/erp_master_service.py.
Inventory, logistics, and production
Inventory is a first-class operational subsystem for articles, warehouses, movements, transfers, serials, labels, and stock-taking, exposed from stock/routes.py; enrichment is separated into a processing pipeline under stock/enrichment/processor.py and strategy implementations in stock/enrichment/strategies.py. Field/mobile collection functions are isolated in recoleccion/routes.py. Production supports projects, engineering, BIM assets, document management, and costing through produccion/routes.py and services/industrial_costing_service.py.
Finance, accounting, and fiscal compliance
Treasury/cash, bank reconciliation, receipts, payment media, and tax configuration are exposed by fondos/routes.py and supported by services/finance_service.py, services/receipt_service.py, and services/cash_session_service.py. Accounting is divided into focused route areas—management, configuration, reporting, and audit—under contabilidad/routes/gestion.py, contabilidad/routes/reportes.py, and contabilidad/routes/auditoria.py. Fiscal integration and tax computation are service boundaries in services/afip_service.py, services/tax_engine.py, and services/iibb_service.py.
Security, multi-enterprise control, and audit
The system appears multi-enterprise/SaaS-aware, with enterprise models in models/enterprise.py, initialization in services/enterprise_init.py, and enterprise administrative controls in core/enterprise_admin.py. Role/permission enforcement and segregation-of-duties logic are explicit architectural concerns via services/sod_service.py, core/safety_logic.py, and services/audit_certification_service.py. Authentication sessions and security utilities are separated into services/session_service.py and core/security_utils.py.
Persistence, integrations, and operations
Persistence is database-centric, with shared access foundations in database.py, generated/domain models in models/auto_models.py, and repository abstraction in repositories/base_repository.py. The repository contains extensive schema evolution assets under migrations/, including portal buffering and tax/AFIP-related tables. External boundaries include AFIP fiscal services, BCRA data, georeferencing, email/WhatsApp, barcode/printing, vessel tracking, and AI chat, represented by services/afip_service.py, services/bcra_service.py, and services/ai_chat_routes.py. MariaDB is strongly indicated by migration and diagnostic naming, while Windows/Linux service installers support deployed operation.
Main entry points: blueprint_factory.py Blueprint Factory · database.py Persistence Layer · order_service.py Order & Receiving Services · routes.py Inventory
Components 21
Application Entry
- Web Application · Primary server-rendered ERP application.
app.py - WSGI Deployment
wsgi.py - ASGI Launch
run_hypercorn.py - Collection App
recoleccion_app.py
Domain Modules
- Sales · Customers, quotations, orders, invoicing, and returns.
ventas/routes.py - Purchasing · Supplier sourcing, purchase orders, receiving, and imports.
compras/routes.py - Inventory · Articles, warehouses, stock movements, transfers, and counts.
stock/routes.py - Stock Enrichment · Processes inventory enrichment through strategies.
stock/enrichment/processor.py - Field Collection
recoleccion/routes.py - Production · Projects, engineering, BIM, documents, and costing.
produccion/routes.py
Shared Services & Control
- Blueprint Factory · Registers domain route modules.
core/blueprint_factory.py - Core Governance · Shared routes, decorators, and enterprise administration.
core/routes.py - Order & Receiving Services
services/order_service.py - Enterprise Security · Enterprise initialization, sessions, segregation of duties, and audit certification.
services/enterprise_init.py
Finance & Compliance
- Treasury · Cash, banks, receipts, payment media, and taxes.
fondos/routes.py - Accounting · Management, reporting, configuration, and audit areas.
contabilidad/routes/gestion.py - Fiscal & Tax Services · AFIP integration and tax computation boundary.
services/afip_service.py
Data & External Systems
- Persistence Layer · Shared database access, models, and repository abstraction.
database.py - Domain Models
models/auto_models.py - Schema Migrations · Includes portal and fiscal schema changes.
- External Integrations · Fiscal, banking, messaging, geospatial, printing, tracking, and AI boundaries.
services/bcra_service.py
Connections 26
- WSGI Deployment → Web Application: serves
- ASGI Launch → Web Application: launches
- Web Application → Blueprint Factory: composes
- Collection App → Field Collection: exposes
- Blueprint Factory → Core Governance: registers
- Blueprint Factory → Sales: registers
- Blueprint Factory → Purchasing: registers
- Blueprint Factory → Inventory: registers
- Blueprint Factory → Production: registers
- Blueprint Factory → Treasury: registers
- Blueprint Factory → Accounting: registers
- Core Governance → Enterprise Security: enforces
- Sales → Order & Receiving Services: uses
- Purchasing → Order & Receiving Services: uses
- Inventory → Stock Enrichment: enriches stock through
- Production → Order & Receiving Services: uses ERP workflows
- Treasury → Fiscal & Tax Services: calculates and reports taxes
- Accounting → Fiscal & Tax Services: uses compliance services
- Fiscal & Tax Services → External Integrations: integrates with AFIP
- Enterprise Security → Persistence Layer: stores enterprise controls
- Order & Receiving Services → Persistence Layer: persists workflows
- Inventory → Persistence Layer: persists stock
- Treasury → Persistence Layer: persists financial records
- Accounting → Persistence Layer: persists ledger data
- Persistence Layer → Domain Models: maps
- Schema Migrations → Persistence Layer: evolves schema