How maq4/desafioamigosecreto works
Project Type and Purpose
• This is a single‐page, front-end–only web application (no backend or database).
File Structure Analysis
• index.html: the single HTML entry point (UI skeleton and container elements).
• style.css: presentation layer for styling the form, list, and result.
• README.md: describes features and technologies.
Key Components
a. User (browser)
b. Presentation Layer
• index.html (DOM structure)
• style.css (styles)
c. Logic Layer
• app.js (event handlers, list management, validation, random selection)
d. Assets Store
Relationships and Data Flow
• User → Browser UI (index.html + style.css)
• Browser UI → JavaScript Event Handlers (app.js)
• “Add Name” click: input value → app.js → in-memory array → DOM update
• app.js reads from/writes to the DOM; reads static assets if needed.
Architectural Patterns and Principles
• Single‐Page Application (SPA) pattern in a minimal form.
• Separation of concerns:
• HTML for structure
• CSS for style
• JS for behavior
• Event‐driven design: UI events trigger JS logic which updates the UI.
– HTML (structure)
– CSS (styles)
– JS (logic)
– User → HTML: “Enter name, click buttons”
– HTML → JS: “onClick events”
– JS → DOM: “update list, display result”
6. “In-memory array stores names—no persistence layer.”
– Blue for UI (HTML/CSS)
– Orange for Logic (JS)
– Gray for Static Assets