How jhonyalex/pigmeagmao works
A. Project Type & Purpose:
• This is a client-side web application designed for generating and managing structured data for a GMAO (Gestión de Mantenimiento Asistido por Ordenador) system. Its main goal is to enable users to create, edit, and export data related to equipment, maintenance plans, and preventive maintenance schedules—ready to be imported into another system (Value Keep GMAO).
• The project is built using vanilla HTML5, CSS3, and JavaScript, utilizing the browser’s localStorage for persistence.
B. File Structure Analysis:
• The file tree is very simple, consisting of:
• README.md (documentation and user/instructions)
• index.html (the main web page that contains the markup)
• script.js (the JavaScript file where the logic for managing data, localStorage operations, event handling, and tabbed interfaces reside)
• style.css (the styling for the UI components)
• The absence of separate backend or complex directory structure indicates a single-page front-end application.
• The README reveals that the application supports various tabs (Equipamientos, Planes de Mantenimiento, Preventivos, Exportación) and interactions among these components.
User Interface (Frontend)
• index.html: Hosts the structure and layout.
• style.css: Styles UI elements with attention to usability in a tabbed interface (e.g., form inputs for equipment creation, plan configuration, preventivos, and data export screens).
Application Logic (Business Logic)
• script.js: Coordinates the interaction between UI elements and data handling.
• Event listeners for form submissions and button clicks.
• Handling tab switching that correlates with the different operations (creating equipment, adding maintenance plans, generating preventive maintenance, etc.).
• Data validations and transformation functions (e.g., formatting task durations, generating IDs, connecting equipment with respective plans and tasks).
Data Persistence
• localStorage: Used for storing all user-entered data such as Equipamientos, Planes, Tareas, Preventivos, and even for JSON export/import operations.
• Data export components: Functionality that enables data to be copied as CSV or exported as JSON backup.
Data Workflow and Interactions
• Input/Creation Phase: Users create equipment and maintenance plans.
• Data Association: Maintenance plans are linked to specific equipment, and preventive data is generated based on plan selections.
• Export/Backup: The application then provides options to export data for import into Value Keep GMAO.
D. Architectural Patterns & Design Principles:
• MVC-like separation (although simplistic) with a clear UI (View) layer (index.html and style.css) and the logic layer (script.js).
• Modular handling of separate functionalities (each tab in the UI acting as a self-contained module with data input, modification, or export).
• Emphasis on data flow: From user input, through business logic handling, to persistence in localStorage, then to output/export.
Clear, distinct blocks for each main component
• User Interface: A block labeled “UI – index.html & style.css”, which represents the layout, forms, and interactive areas.
• Application Logic: A block for “script.js – Business Logic” detailing functions such as event handling, data processing, and interactions between different parts of the UI.
• Data Persistence: A block labeled “localStorage” to indicate where data is stored persistently; also include the export functionality.
• Data Models: Clearly illustrate entities like “Equipamientos”, “Planes de Mantenimiento”, “Tareas”, “Preventivos” as internal components or modules within the application logic.
Additional Elements to Consider
• Notes on how advanced features (like “Relaciones visuales” and “Ordenamiento de tablas”) are implemented.
• All main blocks/components with clear, succinct labels.
• Green for business logic.
• Orange for data persistence/export.
• Modularity: Although the project is simple, detail each “pestaña” as a separate module with its own process flow and connections.