Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/YonAnn99/Acrylitec/llms.txt

Use this file to discover all available pages before exploring further.

Acrylitec is a web-based business management system built with Django, purpose-built for acrylic laser-cutting shops. It replaces manual spreadsheets and paper workflows with a single, role-aware interface where staff can generate cost-accurate quotations, process point-of-sale orders, track material inventory, and monitor revenue — all without leaving the browser. Whether you run a small studio or a multi-operator workshop, Acrylitec gives every team member exactly the tools their role requires and nothing more.

Architecture Overview

The project follows standard Django conventions and is split into two top-level directories:
DirectoryResponsibility
core/Project bootstrap — settings.py, root urls.py, and wsgi.py. Also reads the DATABASE_URL environment variable to switch automatically between SQLite (development) and PostgreSQL (production).
gestion/The sole Django application — contains models.py, views.py, urls.py, the templates/gestion/ tree, and the static/ assets served by WhiteNoise.
All URL routing originates in core/urls.py and delegates entirely to gestion/urls.py. Static files are collected into staticfiles/ via WhiteNoise’s CompressedManifestStaticFilesStorage, and uploaded media (e.g. product photos) is written to the media/ directory at the project root.

Key Modules

Quotations

Build detailed quotes for custom laser-cut pieces. The pricing engine calculates cost from material thickness, piece area (cm²), profit margin, and per-minute laser time — or applies an optional fixed price set on the product.

POS Orders

Process multi-item cart orders directly at the counter. Each order creates a Ventas master record plus individual DetalleVenta line items, and automatically decrements material stock on save.

Clients

Maintain a searchable Clientes registry with name, phone, email, and address. New clients can also be created inline from the POS screen via an AJAX endpoint (/ajax/crear-cliente/).

Products

Catalog laser-cut product types in Productos, each with an optional fixed price, a default profit percentage, and a product photo. Products can be selected when building quotes or POS line items.

Materials

Track acrylic sheet inventory in Materiales — dimensions, current stock, and minimum stock threshold. The system flags low-stock materials and blocks deletion if the material is referenced by existing quotes or sales.

Pricing Configuration

Administrators can adjust the global laser tariff per minute and per-thickness cost factors via the TabuladorCostos table and the singleton ConfiguracionPrecios record — all from a single settings screen.

Dashboard

An admin-only view showing KPIs (monthly revenue, total sales, active orders, client count, quotes this month) alongside interactive revenue charts broken down by week, month, and year.

Role-based Access

Two roles — Administrator and Operator — gate access to sensitive views using Django’s @user_passes_test decorator. Admins see financial dashboards and pricing config; operators work only with quotations and orders.

Data Model Overview

Acrylitec’s database is composed of eight models defined in gestion/models.py:
ModelPurpose
ClientesCustomer directory — name, phone, email, address.
CotizacionesA single-product quotation linked to a Clientes, a Productos, and a Materiales record. Stores piece dimensions, thickness, laser minutes, and profit percentage; monto_total is computed automatically on save via calcular_monto().
MaterialesAcrylic sheet stock — sheet dimensions plus stock_actual / stock_minimo integers.
ProductosProduct catalog with optional precio_fijo. When a fixed price is present it takes priority in the pricing engine over the area-based calculation.
TabuladorCostosLook-up table mapping acrylic thickness (mm) to a factor_costo per m². One row per supported thickness.
VentasA sales order — either converted from a Cotizaciones record (legacy) or created directly from the POS cart. Tracks estatus (pendiente, en_produccion, pagada, entregada), deposit amount, and delivery date.
ConfiguracionPreciosA singleton record (always pk=1) that stores the configurable laser tariff per minute. Retrieved via the class method ConfiguracionPrecios.get_config().
DetalleVentaIndividual line items belonging to a Ventas order. Each row captures product, material, quantity, dimensions, laser minutes, and a pre-calculated subtotal.
The central pricing relationship flows as follows: Cotizaciones.calcular_monto() looks up the matching TabuladorCostos row by espesor_mm, multiplies the piece area by the cost factor, applies the profit margin, and adds laser cost from ConfiguracionPrecios. Productos.precio_fijo short-circuits this entire calculation when set.

Technology Stack

LayerTechnology
Web frameworkDjango 6.0.3
Database (dev)SQLite — created automatically at db.sqlite3 when DATABASE_URL is not set
Database (prod)PostgreSQL via dj-database-url 3.1.2 — configured by the DATABASE_URL environment variable on Railway
WSGI serverGunicorn 25.3.0
Static filesWhiteNoise 6.12.0 with CompressedManifestStaticFilesStorage
PDF generationReportLab 4.4.10 — used to render quote and order documents
Image handlingPillow 12.2.0
DeploymentRailway (acrylitec-production.up.railway.app)
Role-based access is enforced at the view level using Django’s built-in @user_passes_test decorator.
  • Administrators (superusers or members of the Administrador group) can access the financial dashboard (/dashboard/) and pricing configuration (/configuracion/), in addition to all operator views.
  • Operators (any other authenticated user) are redirected to the lista_cotizaciones view on login, and can access quotations and orders. Attempting to reach an admin-only URL redirects to /sin-permiso/.

Build docs developers (and LLMs) love