How luisandovalu/challenge-amigo-secreto works
Project Type and Purpose
• This is a single‐page, client‐side web application (“Amigo Secreto” raffle) built with vanilla HTML, CSS and JavaScript.
• There is no backend service or database—everything runs in the browser.
File Structure Analysis
• index.html – entry point, loads style.css and app.js.
• style.css – contains all presentation styles.
• assets/ – static media (demo.gif) used for README or in‐page demonstrations.
• README.md – describes features, tech stack, and how to open index.html locally or via GitHub Pages.
Components
A. Static Web Host
– GitHub Pages or any static file server that serves index.html, style.css, assets and app.js.
B. Browser / Client
– Fetches static files.
– Renders UI, applies styles, executes app.js.
C. UI Layer
– HTML structure (forms, buttons, list container).
– CSS styling.
D. Logic Layer
– JavaScript module (app.js) handling:
• Participant management (add/remove).
• DOM manipulation for realtime updates.
E. User Interactions
– Events (clicks, form submissions).
Relationships and Data Flows
1. Browser requests index.html → static server responds.
2. index.html makes parallel requests for style.css, app.js.
3. Browser parses HTML/CSS, applies styles, then executes app.js.
4. User actions trigger JavaScript event handlers.
5. app.js updates the DOM directly—no external API calls.
Architectural Patterns and Design Principles
• Single‐page pattern: all logic lives in one JS file, manipulating the DOM in response to events.
• Separation of concerns:
– index.html holds structure,
– style.css holds presentation,
– app.js holds behavior.
• No external dependencies—zero build step, zero runtime services.