How sahvsergio/treehouse_full-stack_javascript_techdegree_unit1 works
Project type and purpose
• This is a small, single-page, static front-end application: a “Random Quote Generator.”
• It does not include a backend or database; all code and data live in the browser as HTML, CSS, and JavaScript.
• Purpose: on each button click, pick a random quote from an in-memory JS array and render it in the DOM.
File structure
• index.html: the entry point and UI skeleton.
• css/normalize.css + css/styles.css: reset and custom styling.
• js/script.js: application logic, event handlers, and quote data.
• No server-side code, build scripts, or external dependencies.
README
• Confirms it’s a learning project for basic JS syntax and data structures.
• No mention of REST APIs or backends.
• Core functionality: pick and display a new quote on demand.
a. Main components
• User’s Web Browser (Client)
• Static File Server (optional – e.g., GitHub Pages or local dev server)
• index.html (UI container)
• CSS Layer (normalize.css + styles.css)
• JS Logic Module (script.js)
• In-memory Quote Data Array
b. Relationships and interactions
1. Browser requests index.html (and CSS/JS assets) from the Static File Server.
2. Browser loads HTML → applies CSS → executes JS.
3. User clicks “New Quote” button in the UI.
4. JS event listener triggers:
– Picks random index from the Quote Data Array
– Updates the DOM (innerText/innerHTML of a quote container)
5. Browser re-renders updated quote on the page.
c. Architectural patterns/design principles
• Single-page, event-driven front-end.
• Clear separation of concerns:
• HTML as structure
• CSS for presentation
• JS for behavior & data
• Data kept in simple array (no persistence beyond page life).
d. Relevant technologies
• HTML5
• CSS3 (normalize + custom styles)
• Vanilla JavaScript (ES5/ES6)