Welcome to Muebles Roble
Muebles Roble is a production management system designed specifically for the furniture manufacturing industry. Built with Flask and following modern architectural patterns, it provides complete control over the production workflow from raw materials to finished products.This system is an academic project focused on transformation industry processes, enabling full traceability from raw materials to finished goods.
What is Muebles Roble?
Muebles Roble (Oak Furniture) is a web-based application that helps furniture manufacturers manage their entire production process. The system tracks:- Raw Material Inventory - Wood types and supplies
- Finished Product Inventory - Tables, chairs, closets, and more
- Product Catalogs - Wood types, colors, user roles, and units of measure
- Production Processes - Complete production workflow tracking
- Inventory Control - Full traceability and audit trails
Core Capabilities
Catalog Management
Manage wood types (Pine, Cedar, Oak), colors (Natural, White, Black), user roles, and units of measure with complete CRUD operations.
Inventory Tracking
Track raw materials and finished products with real-time inventory updates and audit trails.
Production Control
Monitor the production process from raw materials to finished goods with full traceability.
Audit & Compliance
Comprehensive audit trails tracking who created, updated, or deleted each record and when.
Technology Stack
Muebles Roble is built on modern, proven technologies:- Python 3.10.11 - Core programming language
- Flask 3.1.2 - Lightweight web framework
- Flask-SQLAlchemy - ORM for database operations
- Flask-WTF - Form handling with CSRF protection
- Flask-Migrate - Database migration management
- Jinja2 - Template engine for HTML rendering
- MySQL - Relational database
- PyMySQL - MySQL database connector
The system uses a layered MVC architecture with clear separation between presentation, business logic, and data access layers.
Architecture Overview
The application follows a layered MVC (Model-View-Controller) architecture:Layer Responsibilities
| Layer | Files | Responsibility |
|---|---|---|
| Presentation | routes.py + templates/ | Handles HTTP requests, form validation, and renders HTML views |
| Business Logic | services.py | Contains business rules, validations, and operation orchestration |
| Data Access | models/*.py | Defines entities and their mapping to database tables |
| Configuration | config.py, extensions.py | Environment configuration, database connection, Flask extensions |
Module Organization
The application organizes functionality into domain modules:Request Flow
Here’s how a typical request flows through the system:User Submits Form
The user fills out a form in the browser (e.g., creating a new color) and submits it.
Route Receives Request
The
routes.py file receives the HTTP request and validates the form using WTForms with CSRF protection.Service Processes Logic
The route calls the appropriate service method (e.g.,
ColorService.create()), which applies business rules and validations.Model Interacts with Database
The service uses SQLAlchemy models to create/update database records with proper transaction handling.
Key Features
🔒 Security Built-In
- CSRF Protection - All forms protected with Flask-WTF tokens
- SQL Injection Prevention - SQLAlchemy ORM parameterized queries
- Environment Variables - Sensitive data stored in
.envfiles - Production Safety - Enforced SECRET_KEY in production environments
📊 Audit Trail
Every record includes comprehensive audit fields:♻️ Soft Deletes
The system uses logical deletion instead of physical deletion:- Records are marked as inactive (
active = False) - Deletion timestamp and user are recorded
- Data is preserved for audit and recovery purposes
✅ Validation Layers
- Client-side - HTML5 form validation
- Form-level - WTForms validators
- Business-level - Service layer validation
- Database-level - Constraints and unique indexes
Error Handling
The system uses a hierarchical exception system:Design Principles
Separation of Concerns
Separation of Concerns
Each layer has a single, well-defined responsibility. Routes handle HTTP, services handle business logic, and models handle data persistence.
Loose Coupling
Loose Coupling
Layers communicate through well-defined interfaces. Services don’t know about HTTP, and routes don’t contain business logic.
High Cohesion
High Cohesion
Related functionality is grouped together in modules. All color-related code lives in the
colors/ module.DRY (Don't Repeat Yourself)
DRY (Don't Repeat Yourself)
Common functionality is extracted into reusable services and utilities to avoid code duplication.
Fail Fast
Fail Fast
Validation happens early in the request lifecycle with clear, actionable error messages.
Who Should Use This System?
Muebles Roble is ideal for:- Small to medium furniture manufacturers looking to digitize their production tracking
- Academic projects studying transformation industry processes
- Developers learning Flask, SQLAlchemy, and layered architecture patterns
- Carpentry workshops needing inventory and production management
Next Steps
Key Features
Explore the complete feature set and capabilities
Installation
Get the system up and running in minutes
Configuration
Configure database and environment variables
First Steps
Create your first catalog entries and explore the system