How zack2141/proyecto-bootcamp-energia-sostenible works
Project Type and Purpose
• This is a purely front-end, multi-page web application built with vanilla HTML, CSS and JavaScript.
• Its goal is to present sustainable energy data via interactive pages: a calculator, several chart dashboards, a feedback form and a landing page.
File-Structure Analysis
• Top-level modules (each a self-contained “page”):
• Inicio (landing page)
• Calculadora (energy calculator)
• Dashboard (data visualizations)
• Feedback (user input form)
• Navegador (client-side router/navigation)
• Dashboard sub-modules: Grafico_area, Grafico_barra, Grafico_linea, Grafico_torta, Tabla, Documentacion loader.
• Recursos holds static assets: images + CSV data under Recursos/documentacion.
• No server-side code: served as static files from a web server (e.g., Nginx, Apache, GitHub Pages).
Key Components
a. Client Browser (User Agent)
b. Static File Server (serving .html, .css, .js, CSV, images)
c. Presentation Layer (HTML + CSS per module)
d. Controller Layer (JavaScript modules):
• Navegador.js (page navigation)
• Dashboard_Controlador.js + carga_documentos.js (data loading)
• Each graph’s .js file (view logic)
e. Data Layer (CSV files in Recursos/documentacion)
f. Assets Store (images under Recursos/Imagenes_*)
Component Relationships and Data Flow
• User opens Browser → HTTP GET to Static File Server → receives HTML/CSS/JS for chosen page.
• Navegador.js intercepts link clicks, loads appropriate HTML/JS.
• On Dashboard pages, Dashboard_Controlador.js and carga_documentos.js issue AJAX/fetch requests to CSV files → raw data returned → graph modules render charts.
• Feedback.js handles form input, could send data via client API or localStorage (if extended).
• Calculadora.js reads user input, computes results in-browser, updates DOM.
Architectural Patterns & Design Principles
• Client-side MVC (rough):
• Model = CSV/data loader
• View = HTML/CSS templates + chart canvases
• Controller = individual .js scripts per page/module
• Modular folder structure: each page view and its assets (styles + scripts) in its own directory.
• Static asset separation: images, data, CSS divided by module for maintainability.