<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ehueriken Samuel obuse on Medium]]></title>
        <description><![CDATA[Stories by Ehueriken Samuel obuse on Medium]]></description>
        <link>https://medium.com/@ehuerikenbaba?source=rss-b288c65ac9d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jru0yr-HBVGy69HFVsDxVQ.jpeg</url>
            <title>Stories by Ehueriken Samuel obuse on Medium</title>
            <link>https://medium.com/@ehuerikenbaba?source=rss-b288c65ac9d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:13:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ehuerikenbaba/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Take Home React Router Dom]]></title>
            <link>https://medium.com/@ehuerikenbaba/take-home-react-router-dom-2f8f900f10b0?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f8f900f10b0</guid>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Mon, 23 Jun 2025 20:44:20 GMT</pubDate>
            <atom:updated>2025-06-23T20:44:20.641Z</atom:updated>
            <content:encoded><![CDATA[<p>Create a multi-page personal portfolio website using React Router’s createBrowserRouter to demonstrate your understanding of client-side routing, navigation, and route management.</p><h3>Learning Objectives</h3><p>By completing this assignment, you will:</p><ul><li>Implement createBrowserRouter for navigation</li><li>Create nested routes and layouts</li><li>Handle route parameters and query strings</li><li>Implement error boundaries and 404 pages</li><li>Use programmatic navigation</li><li>Apply route protection concepts</li></ul><h3>Project Requirements</h3><h3>1. Application Structure</h3><p>Create a React application with the following pages/routes:</p><p><strong>Main Routes:</strong></p><ul><li>/ - Home/Landing page</li><li>/about - About me page</li><li>/projects - Projects listing page</li><li>/projects/:id - Individual project detail page</li><li>/contact - Contact form page</li><li>/blog - Blog posts listing (optional)</li><li>/blog/:slug - Individual blog post (optional)</li></ul><p><strong>Special Routes:</strong></p><ul><li>/admin - Protected admin dashboard (simulate login)</li><li>* - 404 Error page for undefined routes</li></ul><h3>2. Technical Requirements</h3><h4>Router Setup</h4><ul><li>Use createBrowserRouter from React Router v6</li><li>Implement a root layout component with shared navigation</li><li>Create nested routes where appropriate</li></ul><h4>Navigation Features</h4><ul><li><strong>Header Navigation</strong>: Persistent navigation bar with active link styling</li><li><strong>Breadcrumbs</strong>: Show current page location (except on home page)</li><li><strong>Back Button</strong>: Programmatic navigation on project detail pages</li><li><strong>Search Functionality</strong>: Filter projects using URL query parameters</li></ul><h4>Route Features</h4><ul><li><strong>Dynamic Routes</strong>: Project detail pages using route parameters</li><li><strong>Protected Routes</strong>: Admin area requiring “authentication”</li><li><strong>Query Parameters</strong>: Search/filter functionality for projects</li><li><strong>Error Handling</strong>: Custom 404 page and error boundaries</li></ul><h3>3. Page Content Requirements</h3><h4>Home Page (/)</h4><ul><li>Welcome section with your name and title</li><li>Brief introduction</li><li>Navigation to other sections</li><li>Featured projects (links to project details)</li></ul><h4>About Page (/about)</h4><ul><li>Personal information</li><li>Skills/technologies</li><li>Education/experience timeline</li><li>Profile image</li></ul><h4>Projects Page (/projects)</h4><ul><li>List of projects with:</li><li>Project thumbnails</li><li>Brief descriptions</li><li>Technology tags</li><li>Links to detail pages</li><li>Search/filter functionality using URL queries</li><li>Sort options (by date, technology, etc.)</li></ul><h4>Project Detail Page (/projects/:id)</h4><ul><li>Full project information including:</li><li>Screenshots/images</li><li>Detailed description</li><li>Technologies used</li><li>Live demo and GitHub links (can be placeholder)</li><li>Back to projects button</li></ul><h4>Contact Page (/contact)</h4><ul><li>Contact form with validation</li><li>Social media links</li><li>Contact information</li></ul><h4>404 Error Page</h4><ul><li>Custom error message</li><li>Navigation back to home</li><li>List of available pages</li></ul><h3>4. Data Structure</h3><p>Create mock data for at least 5 projects with the following structure:</p><pre>const projects = [<br>  {<br>    id: 1,<br>    title: &quot;Project Name&quot;,<br>    description: &quot;Brief description&quot;,<br>    longDescription: &quot;Detailed description&quot;,<br>    technologies: [&quot;React&quot;, &quot;CSS&quot;, &quot;JavaScript&quot;],<br>    image: &quot;project-image-url&quot;,<br>    liveUrl: &quot;demo-url&quot;,<br>    githubUrl: &quot;github-url&quot;,<br>    date: &quot;2024-01-15&quot;<br>  }<br>  // ... more projects<br>];</pre><h3>5. Styling Requirements</h3><ul><li>Responsive design (mobile-first approach)</li><li>Consistent color scheme and typography</li><li>Active navigation states</li><li>Loading states for route transitions</li><li>Smooth transitions between pages</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f8f900f10b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Fundamentals: Building Your First App with Vite]]></title>
            <link>https://medium.com/@ehuerikenbaba/react-fundamentals-building-your-first-app-with-vite-1925d7a4204c?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1925d7a4204c</guid>
            <category><![CDATA[json-web-token]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[jsx-in-react]]></category>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 15:28:47 GMT</pubDate>
            <atom:updated>2025-04-07T15:28:47.460Z</atom:updated>
            <content:encoded><![CDATA[<p>React has transformed the way we build web applications, offering a component-based architecture that makes creating interactive UIs more intuitive and maintainable. If you’re just starting your journey with React, this guide will walk you through the core concepts and show you how to build a simple but functional application using Vite, a modern frontend build tool.</p><h3>What is React?</h3><p>React is a JavaScript library for building user interfaces, particularly single-page applications. Created by Facebook (now Meta), it has become one of the most popular frontend libraries, with a thriving ecosystem and community.</p><p>At its core, React is built around a few key principles:</p><ol><li><strong>Component-Based Architecture</strong>: Everything in React is a component — reusable, self-contained pieces of code that return markup.</li><li><strong>Declarative Approach</strong>: You describe how your UI should look based on the current state, and React handles the DOM updates.</li><li><strong>Virtual DOM</strong>: React maintains a lightweight representation of the real DOM in memory, which allows it to update only what’s necessary.</li></ol><h3>Why Vite?</h3><p>Vite (French for “quick”) is a build tool that significantly improves the development experience for modern web projects. Unlike older bundlers like webpack, Vite leverages native ES modules to offer:</p><ul><li>Lightning-fast server start times</li><li>Instant hot module replacement (HMR)</li><li>Out-of-the-box support for TypeScript, JSX, and CSS</li><li>Optimized production builds</li></ul><h3>Setting Up Your First React Project with Vite</h3><p>Let’s get started by creating a new React project using Vite. Make sure you have Node.js installed (version 14.18+ or 16+), then open your terminal and run:</p><pre>npm create vite@latest my-react-app -- --template react<br>cd my-react-app<br>npm install<br>npm run dev</pre><p>This creates a new React project, installs the dependencies, and starts the development server. You should now see your app running at <a href="http://localhost:5173.">http://localhost:5173.</a></p><h3>Understanding the Project Structure</h3><p>After creating your project, you’ll see a directory structure like this:</p><pre>my-react-app/<br>├── node_modules/<br>├── public/<br>├── src/<br>│   ├── assets/<br>│   ├── App.css<br>│   ├── App.jsx<br>│   ├── index.css<br>│   └── main.jsx<br>├── .gitignore<br>├── index.html<br>├── package.json<br>├── vite.config.js<br>└── README.md</pre><p>Here’s what each key file/directory does:</p><ul><li>src/: Contains your application source code</li><li>src/main.jsx: The entry point of your application</li><li>src/App.jsx: The main component of your application</li><li>public/: Contains static assets that won&#39;t be processed by Vite</li><li>index.html: The HTML template for your application</li><li>vite.config.js: Configuration for Vite</li></ul><h3>Core React Concepts</h3><p>Before we start building, let’s understand some fundamental React concepts:</p><h3>1. Components</h3><p>Components are the building blocks of a React application. A component is a JavaScript function or class that optionally accepts inputs (props) and returns React elements describing what should appear on the screen.</p><pre>// A functional component<br>function Greeting(props) {<br>  return &lt;h1&gt;Hello, {props.name}!&lt;/h1&gt;;<br>}</pre><h3>2. JSX</h3><p>JSX is a syntax extension for JavaScript that looks similar to HTML but allows you to write JavaScript within your markup:</p><pre>const element = &lt;h1&gt;Hello, {name}!&lt;/h1&gt;;</pre><h3>3. Props</h3><p>Props (short for properties) are how components receive data from their parent:</p><pre>// Parent component<br>function App() {<br>  return &lt;Greeting name=&quot;World&quot; /&gt;;<br>}</pre><pre>// Child component<br>function Greeting(props) {<br>  return &lt;h1&gt;Hello, {props.name}!&lt;/h1&gt;;<br>}</pre><h3>4. State</h3><p>State allows components to create and manage their own data. Unlike props, state can be changed:</p><pre>import { useState } from &#39;react&#39;;</pre><pre>function Counter() {<br>  const [count, setCount] = useState(0);<br>  <br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;You clicked {count} times&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;<br>        Click me<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Building a Simple Todo App</h3><p>Now, let’s build a simple todo application to demonstrate these concepts in action. Our app will:</p><ol><li>Display a list of todos</li><li>Allow adding new todos</li><li>Mark todos as complete</li><li>Delete todos</li></ol><h3>Step 1: Clean Up the Starter Code</h3><p>First, let’s clean up App.jsx:</p><pre>import { useState } from &#39;react&#39;<br>import &#39;./App.css&#39;</pre><pre>function App() {<br>  return (<br>    &lt;div className=&quot;app&quot;&gt;<br>      &lt;h1&gt;My Todo App&lt;/h1&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><pre>export default App</pre><p>And simplify App.css:</p><pre>.app {<br>  max-width: 500px;<br>  margin: 0 auto;<br>  padding: 20px;<br>}</pre><pre>.todo-item {<br>  display: flex;<br>  align-items: center;<br>  padding: 10px;<br>  margin: 5px 0;<br>  background-color: #f8f9fa;<br>  border-radius: 4px;<br>}</pre><pre>.todo-item.completed {<br>  text-decoration: line-through;<br>  opacity: 0.7;<br>}</pre><pre>.todo-item button {<br>  margin-left: auto;<br>  background-color: #dc3545;<br>  color: white;<br>  border: none;<br>  border-radius: 4px;<br>  padding: 5px 10px;<br>  cursor: pointer;<br>}</pre><pre>form {<br>  display: flex;<br>  margin: 20px 0;<br>}</pre><pre>input {<br>  flex-grow: 1;<br>  padding: 10px;<br>  border: 1px solid #ced4da;<br>  border-radius: 4px 0 0 4px;<br>}</pre><pre>form button {<br>  background-color: #007bff;<br>  color: white;<br>  border: none;<br>  padding: 10px 15px;<br>  border-radius: 0 4px 4px 0;<br>  cursor: pointer;<br>}</pre><pre>.todo-checkbox {<br>  margin-right: 10px;<br>}</pre><h3>Step 2: Create a TodoItem Component</h3><p>Create a new file src/TodoItem.jsx:</p><pre>function TodoItem({ todo, onToggle, onDelete }) {<br>  return (<br>    &lt;div className={`todo-item ${todo.completed ? &#39;completed&#39; : &#39;&#39;}`}&gt;<br>      &lt;input<br>        type=&quot;checkbox&quot;<br>        className=&quot;todo-checkbox&quot;<br>        checked={todo.completed}<br>        onChange={() =&gt; onToggle(todo.id)}<br>      /&gt;<br>      &lt;span&gt;{todo.text}&lt;/span&gt;<br>      &lt;button onClick={() =&gt; onDelete(todo.id)}&gt;Delete&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export default TodoItem;</pre><h3>Step 3: Create a TodoForm Component</h3><p>Create another file src/TodoForm.jsx:</p><pre>import { useState } from &#39;react&#39;;</pre><pre>function TodoForm({ onAdd }) {<br>  const [text, setText] = useState(&#39;&#39;);</pre><pre>  const handleSubmit = (e) =&gt; {<br>    e.preventDefault();<br>    if (text.trim()) {<br>      onAdd(text);<br>      setText(&#39;&#39;);<br>    }<br>  };</pre><pre>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;input<br>        type=&quot;text&quot;<br>        value={text}<br>        onChange={(e) =&gt; setText(e.target.value)}<br>        placeholder=&quot;Add a new todo...&quot;<br>      /&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Add&lt;/button&gt;<br>    &lt;/form&gt;<br>  );<br>}</pre><pre>export default TodoForm;</pre><h3>Step 4: Update the App Component</h3><p>Now, let’s modify App.jsx to use our components and manage the todo state:</p><pre>import { useState } from &#39;react&#39;;<br>import TodoItem from &#39;./TodoItem&#39;;<br>import TodoForm from &#39;./TodoForm&#39;;<br>import &#39;./App.css&#39;;</pre><pre>function App() {<br>  const [todos, setTodos] = useState([<br>    { id: 1, text: &#39;Learn React&#39;, completed: false },<br>    { id: 2, text: &#39;Build a todo app&#39;, completed: false }<br>  ]);</pre><pre>  // Add a new todo<br>  const addTodo = (text) =&gt; {<br>    const newTodo = {<br>      id: Date.now(),<br>      text,<br>      completed: false<br>    };<br>    setTodos([...todos, newTodo]);<br>  };</pre><pre>  // Toggle todo completion status<br>  const toggleTodo = (id) =&gt; {<br>    setTodos(<br>      todos.map(todo =&gt; <br>        todo.id === id ? { ...todo, completed: !todo.completed } : todo<br>      )<br>    );<br>  };</pre><pre>  // Delete a todo<br>  const deleteTodo = (id) =&gt; {<br>    setTodos(todos.filter(todo =&gt; todo.id !== id));<br>  };</pre><pre>  return (<br>    &lt;div className=&quot;app&quot;&gt;<br>      &lt;h1&gt;My Todo App&lt;/h1&gt;<br>      &lt;TodoForm onAdd={addTodo} /&gt;<br>      &lt;div className=&quot;todo-list&quot;&gt;<br>        {todos.length === 0 ? (<br>          &lt;p&gt;No todos yet! Add one above.&lt;/p&gt;<br>        ) : (<br>          todos.map(todo =&gt; (<br>            &lt;TodoItem<br>              key={todo.id}<br>              todo={todo}<br>              onToggle={toggleTodo}<br>              onDelete={deleteTodo}<br>            /&gt;<br>          ))<br>        )}<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export default App;</pre><h3>Understanding the Code</h3><p>Let’s break down what’s happening in our app:</p><ol><li><strong>State Management</strong>: We’re using the useState hook to manage our todos. The initial state is an array with two example todos.</li><li><strong>Components</strong>: We’ve created two reusable components:</li></ol><ul><li>TodoItem: Displays a single todo with a checkbox and delete button</li><li>TodoForm: Handles the form for adding new todos</li></ul><ol><li><strong>Data Flow</strong>:</li></ol><ul><li>Data flows down through props (from App to TodoItem and TodoForm)</li><li>Events flow up through function calls (like onToggle, onDelete, onAdd)</li></ul><ol><li><strong>Event Handling</strong>: We’re using functions to handle various events:</li></ol><ul><li>Adding a new todo when the form is submitted</li><li>Toggling a todo’s completion status when the checkbox is clicked</li><li>Deleting a todo when the delete button is clicked</li></ul><ol><li><strong>Conditional Rendering</strong>: We display a message when there are no todos.</li><li><strong>List Rendering</strong>: We use the map function to render a list of TodoItem components from our todos array.</li></ol><h3>Key React Patterns in Our App</h3><p>Our simple app demonstrates several important React patterns:</p><h3>Lifting State Up</h3><p>Notice how the todo state lives in the parent App component, not in individual TodoItem components. This pattern, called &quot;lifting state up,&quot; makes it easier to share state between components and keep our data in sync.</p><h3>Controlled Components</h3><p>In the TodoForm, the input is a &quot;controlled component&quot; because its value is controlled by React state. This gives us fine-grained control over the form&#39;s behavior.</p><h3>Immutable Updates</h3><p>When updating state, we never modify the existing state directly. Instead, we create new objects/arrays with the updated values:</p><pre>// Good: Creating a new array with updated todo<br>setTodos(<br>  todos.map(todo =&gt; <br>    todo.id === id ? { ...todo, completed: !todo.completed } : todo<br>  )<br>);</pre><pre>// Bad: Modifying state directly<br>// todos[index].completed = !todos[index].completed;<br>// setTodos(todos);</pre><h3>Building and Deploying</h3><p>When you’re ready to deploy your app, run:</p><pre>npm run build</pre><p>Vite will create an optimized production build in the dist directory, which you can deploy to any static hosting service like Netlify, Vercel, GitHub Pages, or Amazon S3.</p><h3>Next Steps</h3><p>Now that you have a basic understanding of React and have built a simple app, here are some ways to expand your knowledge:</p><ol><li><strong>Add Features</strong>: Try adding features like editing todos, filtering by completion status, or saving todos to local storage.</li><li><strong>Learn React Router</strong>: For multi-page applications, React Router is essential.</li><li><strong>State Management</strong>: For larger apps, explore state management solutions like Redux or the Context API.</li><li><strong>Styling Solutions</strong>: Experiment with CSS-in-JS libraries like styled-components or utility-first frameworks like Tailwind CSS.</li><li><strong>API Integration</strong>: Connect your app to a backend by learning how to make API calls with fetch or libraries like Axios.</li></ol><h3>Conclusion</h3><p>React has revolutionized how we build web applications by focusing on component-based architecture and declarative programming. When combined with modern build tools like Vite, it provides an excellent developer experience for creating fast, interactive, and maintainable UIs.</p><p>The todo app we built is simple, but it demonstrates the core principles that power even the most complex React applications. By understanding these fundamentals, you’re well on your way to becoming proficient in React development.</p><p>Remember that React’s ecosystem is vast and ever-evolving. The journey doesn’t end here — it’s just beginning. Happy coding!</p><p><em>Do you have questions about React or want to see more tutorials like this? Let me know in the comments below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1925d7a4204c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Fundamentals: A Beginner’s Guide to the Web’s Essential Language]]></title>
            <link>https://medium.com/@ehuerikenbaba/javascript-fundamentals-a-beginners-guide-to-the-web-s-essential-language-79d3274d5904?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/79d3274d5904</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Sat, 05 Apr 2025 08:29:17 GMT</pubDate>
            <atom:updated>2025-04-05T08:29:17.032Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digital landscape, JavaScript stands as the backbone of modern web development. Whether you’re clicking a button, filling out a form, or watching animations unfold on a webpage, JavaScript is likely working behind the scenes. For aspiring developers, mastering JavaScript fundamentals isn’t just beneficial — it’s essential. This guide will walk you through the core concepts you need to begin your JavaScript journey.</p><h3>What is JavaScript?</h3><p>JavaScript is a high-level, interpreted programming language that enables interactive web pages. Created in 1995 by Brendan Eich while at Netscape, it was originally designed to add dynamic functionality to static HTML pages. Today, JavaScript has evolved far beyond its initial purpose:</p><ul><li>It runs in browsers (client-side)</li><li>Powers server applications through Node.js</li><li>Builds mobile applications with frameworks like React Native</li><li>Creates desktop applications via Electron</li></ul><p>Despite sharing a name with Java, the two languages are fundamentally different in design and purpose.</p><h3>Setting Up Your JavaScript Environment</h3><p>The beauty of JavaScript is its accessibility. To start coding, you only need:</p><ol><li>A text editor (VS Code, Sublime Text, or even Notepad)</li><li>A web browser</li></ol><p>To create your first JavaScript program:</p><ol><li>Create an HTML file:</li></ol><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;My First JavaScript&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h1&gt;Hello, World!&lt;/h1&gt;<br>    <br>    &lt;script&gt;<br>        // Your JavaScript code will go here<br>    &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><ol><li>Alternatively, link to an external JavaScript file:</li></ol><pre>&lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;</pre><h3>Variables and Data Types</h3><p>Variables are containers for storing data values. In modern JavaScript, we declare variables using:</p><pre>// let - for values that can change<br>let age = 25;</pre><pre>// const - for values that won&#39;t change<br>const name = &quot;Sarah&quot;;</pre><pre>// var - older way to declare variables (avoid if possible)<br>var job = &quot;Developer&quot;;</pre><p>JavaScript has several primary data types:</p><pre>// String - text<br>let greeting = &quot;Hello, world!&quot;;</pre><pre>// Number - integers and floating-point numbers<br>let count = 42;<br>let price = 19.99;</pre><pre>// Boolean - true or false<br>let isActive = true;</pre><pre>// Undefined - declared but no value assigned<br>let future;</pre><pre>// Null - intentional absence of value<br>let empty = null;</pre><pre>// Symbol - unique identifiers<br>let uniqueId = Symbol(&quot;id&quot;);</pre><pre>// BigInt - large integers<br>let hugeNumber = 9007199254740991n;</pre><pre>// Object - collections of properties<br>let person = {<br>    firstName: &quot;John&quot;,<br>    lastName: &quot;Doe&quot;,<br>    age: 30<br>};</pre><pre>// Array - ordered collections (technically objects)<br>let colors = [&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;];</pre><p>You can check a variable’s type using the typeof operator:</p><pre>console.log(typeof greeting); // &quot;string&quot;<br>console.log(typeof count); // &quot;number&quot;</pre><h3>Operators</h3><p>JavaScript provides various operators for performing operations:</p><h3>Arithmetic Operators</h3><pre>let a = 10;<br>let b = 3;</pre><pre>console.log(a + b); // Addition: 13<br>console.log(a - b); // Subtraction: 7<br>console.log(a * b); // Multiplication: 30<br>console.log(a / b); // Division: 3.33...<br>console.log(a % b); // Modulus (remainder): 1<br>console.log(a ** b); // Exponentiation: 1000</pre><h3>Comparison Operators</h3><pre>console.log(a &gt; b); // true<br>console.log(a &lt; b); // false<br>console.log(a &gt;= b); // true<br>console.log(a &lt;= b); // false<br>console.log(a === b); // false (strict equality - checks value and type)<br>console.log(a !== b); // true (strict inequality)<br>console.log(a == &quot;10&quot;); // true (loose equality - converts types)</pre><h3>Logical Operators</h3><pre>let isLogged = true;<br>let hasPermission = false;</pre><pre>console.log(isLogged &amp;&amp; hasPermission); // AND: false<br>console.log(isLogged || hasPermission); // OR: true<br>console.log(!isLogged); // NOT: false</pre><h3>Control Flow</h3><h3>Conditional Statements</h3><pre>let temperature = 22;</pre><pre>// if-else statement<br>if (temperature &gt; 30) {<br>    console.log(&quot;It&#39;s hot outside!&quot;);<br>} else if (temperature &gt; 20) {<br>    console.log(&quot;It&#39;s a nice day!&quot;);<br>} else {<br>    console.log(&quot;It&#39;s cold outside!&quot;);<br>}</pre><pre>// Switch statement<br>let day = &quot;Monday&quot;;</pre><pre>switch (day) {<br>    case &quot;Monday&quot;:<br>        console.log(&quot;Start of the work week&quot;);<br>        break;<br>    case &quot;Friday&quot;:<br>        console.log(&quot;End of the work week&quot;);<br>        break;<br>    default:<br>        console.log(&quot;It&#39;s a regular day&quot;);<br>}</pre><pre>// Ternary operator<br>let age = 20;<br>let message = age &gt;= 18 ? &quot;You can vote&quot; : &quot;Too young to vote&quot;;</pre><h3>Loops</h3><pre>// For loop<br>for (let i = 0; i &lt; 5; i++) {<br>    console.log(`Iteration ${i}`);<br>}</pre><pre>// While loop<br>let count = 0;<br>while (count &lt; 5) {<br>    console.log(`Count: ${count}`);<br>    count++;<br>}</pre><pre>// Do-while loop (executes at least once)<br>let i = 0;<br>do {<br>    console.log(`Do-while count: ${i}`);<br>    i++;<br>} while (i &lt; 5);</pre><pre>// For...of loop (iterating over arrays)<br>const fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;];<br>for (const fruit of fruits) {<br>    console.log(fruit);<br>}</pre><pre>// For...in loop (iterating over object properties)<br>const person = { name: &quot;John&quot;, age: 30, job: &quot;Developer&quot; };<br>for (const key in person) {<br>    console.log(`${key}: ${person[key]}`);<br>}</pre><h3>Functions</h3><p>Functions are reusable blocks of code that perform specific tasks.</p><pre>// Function declaration<br>function greet(name) {<br>    return `Hello, ${name}!`;<br>}</pre><pre>console.log(greet(&quot;Alice&quot;)); // &quot;Hello, Alice!&quot;</pre><pre>// Function expression<br>const multiply = function(a, b) {<br>    return a * b;<br>};</pre><pre>console.log(multiply(4, 5)); // 20</pre><pre>// Arrow function (ES6+)<br>const add = (a, b) =&gt; a + b;</pre><pre>console.log(add(3, 7)); // 10</pre><pre>// Default parameters<br>function welcome(name = &quot;Guest&quot;) {<br>    return `Welcome, ${name}!`;<br>}</pre><pre>console.log(welcome()); // &quot;Welcome, Guest!&quot;<br>console.log(welcome(&quot;David&quot;)); // &quot;Welcome, David!&quot;</pre><h3>Arrays</h3><p>Arrays store ordered collections of items:</p><pre>// Creating arrays<br>let fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;orange&quot;];</pre><pre>// Accessing elements (zero-indexed)<br>console.log(fruits[0]); // &quot;apple&quot;</pre><pre>// Array length<br>console.log(fruits.length); // 3</pre><pre>// Adding elements<br>fruits.push(&quot;grape&quot;); // Adds to end<br>fruits.unshift(&quot;kiwi&quot;); // Adds to beginning</pre><pre>// Removing elements<br>fruits.pop(); // Removes from end<br>fruits.shift(); // Removes from beginning</pre><pre>// Finding elements<br>console.log(fruits.indexOf(&quot;banana&quot;)); // 1<br>console.log(fruits.includes(&quot;orange&quot;)); // true</pre><pre>// Common array methods<br>let numbers = [1, 2, 3, 4, 5];</pre><pre>// map - creates new array by transforming elements<br>let doubled = numbers.map(num =&gt; num * 2); // [2, 4, 6, 8, 10]</pre><pre>// filter - creates new array with elements that pass a test<br>let evens = numbers.filter(num =&gt; num % 2 === 0); // [2, 4]</pre><pre>// reduce - reduces array to a single value<br>let sum = numbers.reduce((total, num) =&gt; total + num, 0); // 15</pre><pre>// forEach - executes function on each element<br>numbers.forEach(num =&gt; console.log(num));</pre><h3>Objects</h3><p>Objects store collections of related data and functionality:</p><pre>// Creating objects<br>const person = {<br>    firstName: &quot;John&quot;,<br>    lastName: &quot;Doe&quot;,<br>    age: 30,<br>    isEmployed: true,<br>    <br>    // Object method<br>    greet: function() {<br>        return `Hello, my name is ${this.firstName} ${this.lastName}`;<br>    },<br>    <br>    // Shorthand method (ES6+)<br>    introduce() {<br>        return `I am ${this.age} years old`;<br>    }<br>};</pre><pre>// Accessing properties<br>console.log(person.firstName); // &quot;John&quot;<br>console.log(person[&quot;lastName&quot;]); // &quot;Doe&quot;</pre><pre>// Modifying properties<br>person.age = 31;<br>person[&quot;isEmployed&quot;] = false;</pre><pre>// Adding new properties<br>person.hobbies = [&quot;reading&quot;, &quot;hiking&quot;, &quot;coding&quot;];</pre><pre>// Calling methods<br>console.log(person.greet()); // &quot;Hello, my name is John Doe&quot;</pre><h3>Events and DOM Manipulation</h3><p>JavaScript interacts with HTML through the Document Object Model (DOM):</p><pre>// Selecting elements<br>const heading = document.getElementById(&quot;main-heading&quot;);<br>const paragraphs = document.querySelectorAll(&quot;p&quot;);<br>const button = document.querySelector(&quot;.btn&quot;);</pre><pre>// Modifying content<br>heading.textContent = &quot;Updated Heading&quot;;<br>heading.innerHTML = &quot;&lt;span&gt;New&lt;/span&gt; Heading&quot;;</pre><pre>// Changing styles<br>heading.style.color = &quot;blue&quot;;<br>heading.style.fontSize = &quot;24px&quot;;</pre><pre>// Adding classes<br>heading.classList.add(&quot;highlight&quot;);<br>heading.classList.remove(&quot;old-class&quot;);<br>heading.classList.toggle(&quot;visible&quot;);</pre><pre>// Event handling<br>button.addEventListener(&quot;click&quot;, function() {<br>    alert(&quot;Button was clicked!&quot;);<br>});</pre><pre>// Creating elements<br>const newParagraph = document.createElement(&quot;p&quot;);<br>newParagraph.textContent = &quot;This is a new paragraph.&quot;;<br>document.body.appendChild(newParagraph);</pre><h3>Error Handling</h3><p>Handling errors gracefully is crucial for robust applications:</p><pre>try {<br>    // Code that might throw an error<br>    let result = someUndefinedFunction();<br>} catch (error) {<br>    // Handle the error<br>    console.error(&quot;An error occurred:&quot;, error.message);<br>} finally {<br>    // Always executed, regardless of error<br>    console.log(&quot;This always runs&quot;);<br>}</pre><pre>// Throwing custom errors<br>function divide(a, b) {<br>    if (b === 0) {<br>        throw new Error(&quot;Division by zero is not allowed&quot;);<br>    }<br>    return a / b;<br>}</pre><h3>Asynchronous JavaScript</h3><p>JavaScript handles asynchronous operations using callbacks, promises, and async/await:</p><pre>// Callback example<br>setTimeout(function() {<br>    console.log(&quot;This runs after 2 seconds&quot;);<br>}, 2000);</pre><pre>// Promise example<br>const fetchData = new Promise((resolve, reject) =&gt; {<br>    // Simulating an API call<br>    setTimeout(() =&gt; {<br>        const success = true;<br>        if (success) {<br>            resolve(&quot;Data received&quot;);<br>        } else {<br>            reject(&quot;Error fetching data&quot;);<br>        }<br>    }, 1500);<br>});</pre><pre>fetchData<br>    .then(data =&gt; console.log(data))<br>    .catch(error =&gt; console.error(error));</pre><pre>// Async/await (modern approach)<br>async function getData() {<br>    try {<br>        const result = await fetchData;<br>        console.log(result);<br>    } catch (error) {<br>        console.error(error);<br>    }<br>}</pre><pre>getData();</pre><h3>Conclusion</h3><p>JavaScript’s versatility and ubiquity make it an essential skill for any web developer. This guide covered the fundamentals to get you started, but JavaScript’s ecosystem is vast and constantly evolving. As you continue your journey, explore modern frameworks like React, Vue, or Angular, and server-side JavaScript with Node.js.</p><p>Remember that programming is learned by doing. Create small projects, solve coding challenges, and build interactive applications to reinforce these concepts. The more you practice, the more these fundamentals will become second nature.</p><p>The web development community is welcoming and supportive. Don’t hesitate to ask questions on platforms like Stack Overflow, W3Schools, or dev.to when you encounter challenges.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79d3274d5904" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ES6: The JavaScript Revolution That Changed Modern Web Development]]></title>
            <link>https://medium.com/@ehuerikenbaba/es6-the-javascript-revolution-that-changed-modern-web-development-256de24cee06?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/256de24cee06</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 10:47:05 GMT</pubDate>
            <atom:updated>2025-04-02T10:47:05.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1m-3OkP8DppbJ6ke_kkfkA.jpeg" /><figcaption>jav</figcaption></figure><p>JavaScript has come a long way since its creation in 1995. One of the most significant milestones in its evolution was the release of ECMAScript 2015, commonly known as ES6. This update introduced a wealth of new features and syntax improvements that revolutionized how developers write JavaScript code. Even though several ECMAScript versions have been released since then, ES6 remains a landmark update that fundamentally transformed the language.</p><p>In this article, we’ll explore the key features of ES6 and how they’ve improved JavaScript development.</p><h3>A Brief History</h3><p>Before diving into the features, it’s worth understanding the context. ECMAScript is the official name of the JavaScript language specification. After ES5 was standardized in 2009, it took six years until the next major release in 2015 (hence the name ES6 or ES2015). This long gap allowed for the accumulation of significant improvements and new features that addressed many of JavaScript’s longstanding limitations.</p><h3>Key Features of ES6</h3><h3>1. Let and Const Declarations</h3><p>Prior to ES6, var was the only way to declare variables in JavaScript, which came with scoping issues that often confused developers. ES6 introduced two new variable declaration keywords:</p><pre>// Block-scoped variables<br>let name = &#39;John&#39;;<br>name = &#39;Jane&#39;; // Can be reassigned</pre><pre>// Block-scoped constants<br>const PI = 3.14159;<br>PI = 3.14; // Error: Assignment to constant variable</pre><p>let allows you to declare variables that are limited to the scope of a block statement or expression, while const creates block-scoped variables whose values cannot be reassigned.</p><h3>2. Arrow Functions</h3><p>Arrow functions provide a more concise syntax for writing function expressions:</p><pre>// ES5<br>var add = function(a, b) {<br>  return a + b;<br>};</pre><pre>// ES6<br>const add = (a, b) =&gt; a + b;</pre><p>Beyond their concise syntax, arrow functions have one crucial difference from regular functions: they don’t bind their own this value, instead inheriting it from the enclosing scope. This behavior solves a common pain point in JavaScript where developers needed to use workarounds like var self = this.</p><h3>3. Template Literals</h3><p>ES6 introduced template literals, which provide an elegant way to create strings with embedded expressions:</p><pre>const name = &#39;World&#39;;</pre><pre>// ES5<br>console.log(&#39;Hello &#39; + name + &#39;!&#39;);</pre><pre>// ES6<br>console.log(`Hello ${name}!`);</pre><p>Template literals also support multi-line strings without escape characters:</p><pre>const message = `This is a<br>multi-line<br>string`;</pre><h3>4. Destructuring Assignment</h3><p>Destructuring allows us to extract data from arrays or objects into separate variables with a concise syntax:</p><pre>// Array destructuring<br>const [first, second] = [1, 2];<br>console.log(first); // 1</pre><pre>// Object destructuring<br>const person = { name: &#39;John&#39;, age: 30 };<br>const { name, age } = person;<br>console.log(name); // &#39;John&#39;</pre><p>This feature is particularly useful when working with complex data structures or when you only need specific properties from an object.</p><h3>5. Default Parameters</h3><p>ES6 allows function parameters to have default values:</p><pre>// ES5<br>function greet(name) {<br>  name = name || &#39;Anonymous&#39;;<br>  return &#39;Hello, &#39; + name;<br>}</pre><pre>// ES6<br>function greet(name = &#39;Anonymous&#39;) {<br>  return `Hello, ${name}`;<br>}</pre><p>Default parameters simplify function definitions and make the code more readable by eliminating boilerplate parameter checking.</p><h3>6. Rest and Spread Operators</h3><p>The rest parameter syntax (...) allows you to represent an indefinite number of arguments as an array:</p><pre>function sum(...numbers) {<br>  return numbers.reduce((total, num) =&gt; total + num, 0);<br>}</pre><pre>console.log(sum(1, 2, 3, 4)); // 10</pre><p>The spread operator, which uses the same syntax, allows an iterable (like an array) to be expanded in places where zero or more arguments or elements are expected:</p><pre>const arr1 = [1, 2, 3];<br>const arr2 = [...arr1, 4, 5]; // [1, 2, 3, 4, 5]</pre><pre>const obj1 = { a: 1, b: 2 };<br>const obj2 = { ...obj1, c: 3 }; // { a: 1, b: 2, c: 3 }</pre><h3>7. Classes</h3><p>ES6 introduced a cleaner, more familiar syntax for creating constructor functions and dealing with inheritance:</p><pre>class Person {<br>  constructor(name) {<br>    this.name = name;<br>  }<br>  <br>  greet() {<br>    return `Hello, my name is ${this.name}`;<br>  }<br>}</pre><pre>class Employee extends Person {<br>  constructor(name, title) {<br>    super(name);<br>    this.title = title;<br>  }<br>  <br>  work() {<br>    return `${this.name} is working as a ${this.title}`;<br>  }<br>}</pre><p>Although JavaScript remains prototype-based, this class syntax provides a more intuitive way to work with objects and inheritance patterns.</p><h3>8. Promises</h3><p>ES6 standardized Promises, providing a cleaner way to handle asynchronous operations:</p><pre>function fetchData(url) {<br>  return new Promise((resolve, reject) =&gt; {<br>    fetch(url)<br>      .then(response =&gt; response.json())<br>      .then(data =&gt; resolve(data))<br>      .catch(error =&gt; reject(error));<br>  });<br>}</pre><pre>fetchData(&#39;https://api.example.com/data&#39;)<br>  .then(data =&gt; console.log(data))<br>  .catch(error =&gt; console.error(error));</pre><p>Promises help avoid “callback hell” and provide a more structured approach to handling async operations, with dedicated methods for success (.then()) and error (.catch()) scenarios.</p><h3>9. Modules</h3><p>ES6 introduced a standardized module system for JavaScript:</p><pre>// math.js<br>export function add(a, b) {<br>  return a + b;<br>}</pre><pre>export const PI = 3.14159;</pre><pre>// app.js<br>import { add, PI } from &#39;./math.js&#39;;<br>console.log(add(2, 3)); // 5<br>console.log(PI); // 3.14159</pre><p>The module system allows for better organization of code, encapsulation of functionality, and explicit declaration of dependencies.</p><h3>10. Map and Set Collections</h3><p>ES6 added new data structures to JavaScript:</p><pre>// Map: key-value pairs where keys can be any type<br>const userRoles = new Map();<br>userRoles.set(&#39;John&#39;, &#39;admin&#39;);<br>userRoles.set(&#39;Jane&#39;, &#39;editor&#39;);<br>console.log(userRoles.get(&#39;John&#39;)); // &#39;admin&#39;</pre><pre>// Set: collection of unique values<br>const uniqueNumbers = new Set([1, 2, 3, 3, 4]);<br>console.log([...uniqueNumbers]); // [1, 2, 3, 4]</pre><p>These collections provide more powerful alternatives to objects and arrays for specific use cases.</p><h3>Impact on Modern JavaScript Development</h3><p>ES6 features have become so integral to JavaScript development that it’s hard to imagine coding without them. They’ve influenced:</p><h3>1. Framework Development</h3><p>Modern frameworks like React, Vue, and Angular heavily utilize ES6 features. React components often use arrow functions, destructuring, and class syntax. Here’s a simple React component using ES6 features:</p><pre>import React, { useState } from &#39;react&#39;;</pre><pre>const Counter = () =&gt; {<br>  const [count, setCount] = useState(0);<br>  <br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;Count: {count}&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Increment&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><pre>export default Counter;</pre><h3>2. Improved Code Organization</h3><p>ES6 modules have transformed how we structure JavaScript applications, allowing for more maintainable and organized codebases with clear dependencies.</p><h3>3. Enhanced Async Programming</h3><p>The Promise API led to even more advanced patterns like async/await (introduced in ES2017), revolutionizing asynchronous JavaScript programming.</p><h3>4. More Expressive Code</h3><p>Features like template literals, destructuring, and arrow functions allow developers to write more concise and readable code, improving productivity and reducing bugs.</p><h3>Transitioning to ES6</h3><p>Despite its benefits, ES6 wasn’t immediately available in all browsers. The JavaScript community adapted by using transpilers like Babel, which convert ES6 code to equivalent ES5 code that runs in older browsers. This approach allowed developers to use modern features without sacrificing compatibility.</p><p>Today, most modern browsers support ES6 features natively, but transpilers remain an essential part of many build systems to ensure cross-browser compatibility.</p><h3>Conclusion</h3><p>ES6 represents a watershed moment in JavaScript’s history. By addressing many of the language’s shortcomings and introducing powerful new features, it set the stage for JavaScript’s continued growth and evolution. Even as newer ECMAScript versions keep advancing the language, the foundations laid by ES6 continue to shape how we write JavaScript today.</p><p>Whether you’re a seasoned JavaScript developer or just getting started, mastering ES6 features is essential for writing modern, efficient, and maintainable code. The improvements introduced in ES6 have not only made JavaScript more powerful but also more pleasant to work with, contributing to its dominant position in web development today.</p><p>What ES6 feature has had the biggest impact on your coding style? Let me know in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=256de24cee06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Bootstrap: A Beginner’s Guide]]></title>
            <link>https://medium.com/@ehuerikenbaba/understanding-bootstrap-a-beginners-guide-53f8b5347ad4?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/53f8b5347ad4</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[css-grid]]></category>
            <category><![CDATA[bootstrap]]></category>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 13:02:59 GMT</pubDate>
            <atom:updated>2025-03-30T13:02:59.269Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DP-mPsojg-Xd8Q5kwTRVog.jpeg" /><figcaption>image of bootstap</figcaption></figure><p>Bootstrap is one of the most popular front-end frameworks that helps developers build responsive, mobile-first websites quickly and efficiently. If you’re new to web development, learning Bootstrap can significantly speed up your workflow and help you create professional-looking websites with minimal effort.</p><p>Let me walk you through the basics of Bootstrap, explaining its core concepts and showing you practical examples.</p><h3>What is Bootstrap?</h3><p>Bootstrap is a free, open-source CSS framework for responsive, mobile-first front-end web development. It contains HTML, CSS, and JavaScript-based design templates for typography, forms, buttons, navigation, and other interface components.</p><h3>Getting Started with Bootstrap</h3><p>There are several ways to include Bootstrap in your project:</p><h3>1. Using CDN (Content Delivery Network)</h3><p>The simplest way to include Bootstrap is by using a CDN:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Bootstrap Example&lt;/title&gt;<br>  <br>  &lt;!-- Bootstrap CSS --&gt;<br>  &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- Your content here --&gt;<br>  <br>  &lt;!-- Bootstrap Bundle with Popper --&gt;<br>  &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>2. Download Bootstrap</h3><p>You can also download Bootstrap files directly from the official website and include them in your project.</p><h3>Key Bootstrap Concepts</h3><h3>1. Grid System</h3><p>Bootstrap’s grid system is based on a 12-column layout and is one of its most powerful features.</p><pre>&lt;div class=&quot;container&quot;&gt;<br>  &lt;div class=&quot;row&quot;&gt;<br>    &lt;div class=&quot;col-sm-6 col-md-4&quot;&gt;Column 1&lt;/div&gt;<br>    &lt;div class=&quot;col-sm-6 col-md-4&quot;&gt;Column 2&lt;/div&gt;<br>    &lt;div class=&quot;col-sm-12 col-md-4&quot;&gt;Column 3&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Breaking this down:</p><ul><li>container creates a centered, responsive container</li><li>row creates a horizontal group of columns</li><li>Column classes specify how many of the 12 columns to use, with responsive breakpoints:</li><li>col-sm-6: Takes 6 columns (half the width) on small screens and up</li><li>col-md-4: Takes 4 columns (one-third width) on medium screens and up</li></ul><h3>2. Responsive Breakpoints</h3><p>Bootstrap defines several breakpoints:</p><ul><li>Extra small (xs): &lt;576px</li><li>Small (sm): ≥576px</li><li>Medium (md): ≥768px</li><li>Large (lg): ≥992px</li><li>Extra large (xl): ≥1200px</li><li>Extra extra large (xxl): ≥1400px</li></ul><h3>3. Components</h3><p>Bootstrap provides numerous pre-styled components ready to use:</p><h4>Navigation Bar</h4><pre>&lt;nav class=&quot;navbar navbar-expand-lg navbar-light bg-light&quot;&gt;<br>  &lt;div class=&quot;container-fluid&quot;&gt;<br>    &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;Brand&lt;/a&gt;<br>    &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarNav&quot;&gt;<br>      &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;<br>    &lt;/button&gt;<br>    &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarNav&quot;&gt;<br>      &lt;ul class=&quot;navbar-nav&quot;&gt;<br>        &lt;li class=&quot;nav-item&quot;&gt;<br>          &lt;a class=&quot;nav-link active&quot; href=&quot;#&quot;&gt;Home&lt;/a&gt;<br>        &lt;/li&gt;<br>        &lt;li class=&quot;nav-item&quot;&gt;<br>          &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;About&lt;/a&gt;<br>        &lt;/li&gt;<br>        &lt;li class=&quot;nav-item&quot;&gt;<br>          &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Services&lt;/a&gt;<br>        &lt;/li&gt;<br>        &lt;li class=&quot;nav-item&quot;&gt;<br>          &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Contact&lt;/a&gt;<br>        &lt;/li&gt;<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/nav&gt;</pre><h4>Cards</h4><pre>&lt;div class=&quot;card&quot; style=&quot;width: 18rem;&quot;&gt;<br>  &lt;img src=&quot;image.jpg&quot; class=&quot;card-img-top&quot; alt=&quot;...&quot;&gt;<br>  &lt;div class=&quot;card-body&quot;&gt;<br>    &lt;h5 class=&quot;card-title&quot;&gt;Card title&lt;/h5&gt;<br>    &lt;p class=&quot;card-text&quot;&gt;Some quick example text.&lt;/p&gt;<br>    &lt;a href=&quot;#&quot; class=&quot;btn btn-primary&quot;&gt;Go somewhere&lt;/a&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h3>4. Utility Classes</h3><p>Bootstrap provides numerous utility classes for quick styling:</p><h4>Spacing</h4><ul><li>m-* for margin</li><li>p-* for padding</li><li>With directions: t (top), b (bottom), s (start), e (end), x (horizontal), y (vertical)</li><li>With sizes: 0–5</li></ul><p>Example: class=&quot;mt-3 mb-5 p-2&quot; (margin-top 3, margin-bottom 5, padding 2)</p><h4>Colors</h4><p>Bootstrap includes a predefined color system:</p><ul><li>text-primary, text-secondary, text-success, etc.</li><li>bg-primary, bg-secondary, bg-success, etc.</li></ul><h4>Display</h4><p>Control when elements should be hidden or displayed:</p><ul><li>d-none, d-block, d-flex</li><li>With breakpoints: d-md-none, d-lg-block</li></ul><h3>Practical Example</h3><p>Let’s build a simple responsive page with Bootstrap:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Bootstrap Example&lt;/title&gt;<br>  &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- Navigation --&gt;<br>  &lt;nav class=&quot;navbar navbar-expand-lg navbar-dark bg-dark&quot;&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>      &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;BootstrapDemo&lt;/a&gt;<br>      &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarNav&quot;&gt;<br>        &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;<br>      &lt;/button&gt;<br>      &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarNav&quot;&gt;<br>        &lt;ul class=&quot;navbar-nav ms-auto&quot;&gt;<br>          &lt;li class=&quot;nav-item&quot;&gt;<br>            &lt;a class=&quot;nav-link active&quot; href=&quot;#&quot;&gt;Home&lt;/a&gt;<br>          &lt;/li&gt;<br>          &lt;li class=&quot;nav-item&quot;&gt;<br>            &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;About&lt;/a&gt;<br>          &lt;/li&gt;<br>          &lt;li class=&quot;nav-item&quot;&gt;<br>            &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Services&lt;/a&gt;<br>          &lt;/li&gt;<br>          &lt;li class=&quot;nav-item&quot;&gt;<br>            &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Contact&lt;/a&gt;<br>          &lt;/li&gt;<br>        &lt;/ul&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/nav&gt;</pre><pre>  &lt;!-- Hero Section --&gt;<br>  &lt;div class=&quot;bg-primary text-white py-5&quot;&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>      &lt;div class=&quot;row&quot;&gt;<br>        &lt;div class=&quot;col-md-8&quot;&gt;<br>          &lt;h1&gt;Welcome to Bootstrap&lt;/h1&gt;<br>          &lt;p class=&quot;lead&quot;&gt;A powerful, responsive front-end framework for faster and easier web development.&lt;/p&gt;<br>          &lt;a href=&quot;#&quot; class=&quot;btn btn-light&quot;&gt;Learn More&lt;/a&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;</pre><pre>  &lt;!-- Card Section --&gt;<br>  &lt;div class=&quot;container py-5&quot;&gt;<br>    &lt;h2 class=&quot;mb-4&quot;&gt;Our Services&lt;/h2&gt;<br>    &lt;div class=&quot;row&quot;&gt;<br>      &lt;div class=&quot;col-md-4 mb-4&quot;&gt;<br>        &lt;div class=&quot;card h-100&quot;&gt;<br>          &lt;div class=&quot;card-body&quot;&gt;<br>            &lt;h5 class=&quot;card-title&quot;&gt;Web Design&lt;/h5&gt;<br>            &lt;p class=&quot;card-text&quot;&gt;Professional and responsive web design services.&lt;/p&gt;<br>            &lt;a href=&quot;#&quot; class=&quot;btn btn-outline-primary&quot;&gt;Details&lt;/a&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;col-md-4 mb-4&quot;&gt;<br>        &lt;div class=&quot;card h-100&quot;&gt;<br>          &lt;div class=&quot;card-body&quot;&gt;<br>            &lt;h5 class=&quot;card-title&quot;&gt;Development&lt;/h5&gt;<br>            &lt;p class=&quot;card-text&quot;&gt;Full-stack development using modern technologies.&lt;/p&gt;<br>            &lt;a href=&quot;#&quot; class=&quot;btn btn-outline-primary&quot;&gt;Details&lt;/a&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;col-md-4 mb-4&quot;&gt;<br>        &lt;div class=&quot;card h-100&quot;&gt;<br>          &lt;div class=&quot;card-body&quot;&gt;<br>            &lt;h5 class=&quot;card-title&quot;&gt;SEO&lt;/h5&gt;<br>            &lt;p class=&quot;card-text&quot;&gt;Search engine optimization to improve visibility.&lt;/p&gt;<br>            &lt;a href=&quot;#&quot; class=&quot;btn btn-outline-primary&quot;&gt;Details&lt;/a&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;</pre><pre>  &lt;!-- Footer --&gt;<br>  &lt;footer class=&quot;bg-dark text-white py-4&quot;&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>      &lt;div class=&quot;row&quot;&gt;<br>        &lt;div class=&quot;col-md-6&quot;&gt;<br>          &lt;p&gt;© 2025 BootstrapDemo. All rights reserved.&lt;/p&gt;<br>        &lt;/div&gt;<br>        &lt;div class=&quot;col-md-6 text-md-end&quot;&gt;<br>          &lt;a href=&quot;#&quot; class=&quot;text-white me-2&quot;&gt;Privacy Policy&lt;/a&gt;<br>          &lt;a href=&quot;#&quot; class=&quot;text-white&quot;&gt;Terms of Service&lt;/a&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/footer&gt;</pre><pre>  &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Tips for Beginners</h3><ol><li><strong>Start with the Documentation</strong>: Bootstrap has excellent documentation with examples</li><li><strong>Use the Grid System</strong>: Master the 12-column grid for responsive layouts</li><li><strong>Learn the Utility Classes</strong>: They can save you from writing a lot of custom CSS</li><li><strong>Customize Bootstrap</strong>: Use the official customizer to create a unique look</li><li><strong>Stay Updated</strong>: Bootstrap regularly releases updates with new features</li></ol><h3>Common Mistakes to Avoid</h3><ol><li><strong>Overriding Too Much</strong>: Avoid excessive custom CSS that fights against Bootstrap</li><li><strong>Ignoring Mobile-First Approach</strong>: Always design for mobile first, then expand</li><li><strong>Loading Unnecessary Components</strong>: Use the customizer to include only what you need</li><li><strong>Forgetting About Performance</strong>: Large frameworks can slow down your site</li><li><strong>Not Using the Built-in JavaScript Components Properly</strong>: Read the docs for proper initialization</li></ol><h3>Conclusion</h3><p>Bootstrap significantly speeds up development by providing a comprehensive set of responsive components and utility classes. For beginners, it offers a great way to create professional-looking websites without having to master CSS from scratch.</p><p>As you become more comfortable with Bootstrap, you can start customizing it to match your specific design needs or even integrate it with other tools and frameworks for more complex projects.</p><p>Remember that the best way to learn Bootstrap is through practice — try rebuilding existing websites or creating your own projects to gain hands-on experience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53f8b5347ad4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Flexbox: A beginner’s Guide]]></title>
            <link>https://medium.com/@ehuerikenbaba/understanding-flexbox-a-beginners-guide-91410872639f?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/91410872639f</guid>
            <category><![CDATA[css-flexbox]]></category>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 09:11:52 GMT</pubDate>
            <atom:updated>2025-03-29T09:11:52.012Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="css flexbox image" src="https://cdn-images-1.medium.com/max/1024/1*ytwnvY9suOvUNnr5C6YrrA.jpeg" /></figure><p>Flexbox is one of the most powerful and useful features in modern CSS, allowing you to create flexible and responsive layouts with minimal effort. If you’re just starting your web development journey, mastering flexbox will significantly improve your ability to create clean, adaptive layouts.</p><h3>Flexbox is one of the most powerful and useful features in modern CSS, allowing you to create flexible and responsive layouts with minimal effort. If you’re just starting your web development journey, mastering flexbox will significantly improve your ability to create clean, adaptive layouts.</h3><p>Let me walk you through the basics of flexbox, explaining its core concepts and showing you practical examples.</p><h3>What is Flexbox?</h3><p>Flexbox (Flexible Box Layout) is a CSS layout model designed to make it easier to design flexible responsive layouts without using floats or positioning. It provides a more efficient way to lay out, align, and distribute space among items in a container, even when their size is unknown or dynamic.</p><h3>Getting Started with Flexbox</h3><p>To start using flexbox, you need to designate a container element as a flex container by setting the display property to flex:</p><pre>.container {<br>  display: flex;<br>}</pre><p>Once you’ve done this, all direct children of that container become “flex items” automatically.</p><h3>Main Concepts</h3><h3>1. Flex Container and Flex Items</h3><ul><li><strong>Flex Container</strong>: The parent element with display: flex</li><li><strong>Flex Items</strong>: The direct children of the flex container</li></ul><h3>2. Main Axis and Cross Axis</h3><p>Flexbox operates on two axes:</p><ul><li><strong>Main Axis</strong>: The primary axis along which flex items are placed (horizontally by default)</li><li><strong>Cross Axis</strong>: The axis perpendicular to the main axis</li></ul><h3>3. Key Flex Container Properties</h3><h4>flex-direction</h4><p>This property establishes the main axis:</p><pre>.container {<br>  display: flex;<br>  flex-direction: row; /* default: left to right */<br>  /* Other options: column, row-reverse, column-reverse */<br>}</pre><h4>justify-content</h4><p>Controls alignment along the main axis:</p><pre>.container {<br>  display: flex;<br>  justify-content: center;<br>  /* Other options: flex-start, flex-end, space-between, space-around, space-evenly */<br>}</pre><h4>align-items</h4><p>Controls alignment along the cross axis:</p><pre>.container {<br>  display: flex;<br>  align-items: center;<br>  /* Other options: flex-start, flex-end, stretch, baseline */<br>}</pre><h4>flex-wrap</h4><p>Determines whether items should wrap to new lines:</p><pre>.container {<br>  display: flex;<br>  flex-wrap: wrap;<br>  /* Other options: nowrap (default), wrap-reverse */<br>}</pre><h3>4. Key Flex Item Properties</h3><h4>flex-grow</h4><p>Determines how much an item can grow relative to other items:</p><pre>.item {<br>  flex-grow: 1; /* Default is 0 (no growing) */<br>}</pre><h4>flex-shrink</h4><p>Determines how much an item can shrink relative to others:</p><pre>.item {<br>  flex-shrink: 1; /* Default is 1 (can shrink) */<br>}</pre><h4>flex-basis</h4><p>Sets the initial main size of an item:</p><pre>.item {<br>  flex-basis: 200px; /* Default is auto */<br>}</pre><h4>flex (shorthand)</h4><p>Combines the above three properties:</p><pre>.item {<br>  flex: 1 1 auto; /* grow shrink basis */<br>}</pre><h3>Practical Example</h3><p>Let’s create a simple navbar with flexbox:</p><pre>&lt;nav class=&quot;navbar&quot;&gt;<br>  &lt;div class=&quot;logo&quot;&gt;Brand&lt;/div&gt;<br>  &lt;ul class=&quot;menu&quot;&gt;<br>    &lt;li&gt;Home&lt;/li&gt;<br>    &lt;li&gt;About&lt;/li&gt;<br>    &lt;li&gt;Services&lt;/li&gt;<br>    &lt;li&gt;Contact&lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/nav&gt;</pre><pre>.navbar {<br>  display: flex;<br>  justify-content: space-between;<br>  align-items: center;<br>  padding: 1rem;<br>  background-color: #f8f9fa;<br>}</pre><pre>.menu {<br>  display: flex;<br>  list-style: none;<br>  gap: 20px;<br>}</pre><p>This creates a navbar with the logo on the left and menu items evenly spaced on the right, all vertically centered.</p><h3>Common Flexbox Patterns</h3><h3>1. Centering an Element</h3><pre>.container {<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>  height: 100vh; /* Makes container full height */<br>}</pre><h3>2. Card Layout</h3><pre>.card-container {<br>  display: flex;<br>  flex-wrap: wrap;<br>  gap: 20px;<br>}</pre><pre>.card {<br>  flex: 0 1 300px; /* Don&#39;t grow, can shrink, basis 300px */<br>}</pre><h3>3. Holy Grail Layout (Header, Footer, Sidebar, Main Content)</h3><pre>.layout {<br>  display: flex;<br>  flex-direction: column;<br>  min-height: 100vh;<br>}</pre><pre>header, footer {<br>  flex-shrink: 0;<br>}</pre><pre>.content {<br>  display: flex;<br>  flex: 1;<br>}</pre><pre>main {<br>  flex: 1;<br>}</pre><pre>aside {<br>  flex: 0 0 200px; /* Don&#39;t grow, don&#39;t shrink, width 200px */<br>}</pre><h3>Tips for Beginners</h3><ol><li><strong>Start Simple</strong>: Begin with basic flex containers and gradually add complexity</li><li><strong>Use the Dev Tools</strong>: Browser developer tools can help you visualize flexbox layouts</li><li><strong>Practice Consistently</strong>: Build small components using flexbox to reinforce your knowledge</li><li><strong>Learn the Shorthand</strong>: The flex shorthand property can make your CSS more concise</li><li><strong>Remember the Axes</strong>: Keep track of which axis you’re working with (main vs. cross)</li></ol><h3>Common Mistakes to Avoid</h3><ol><li><strong>Forgetting Parent-Child Relationship</strong>: Only direct children of a flex container become flex items</li><li><strong>Neglecting the Default Values</strong>: Be aware of the default values for flex properties</li><li><strong>Overcomplicating</strong>: Don’t use flexbox for everything; sometimes grid or simple layouts work better</li><li><strong>Not Testing Responsively</strong>: Always test your flexbox layouts at different screen sizes</li></ol><h3>Conclusion</h3><p>Flexbox has revolutionized how we approach CSS layouts. Once you understand its core concepts, you’ll find yourself reaching for it constantly. As a beginner, take time to experiment with the different properties and see how they interact. Before long, you’ll be creating complex, responsive layouts with ease.</p><p>Remember that practice is key — try to rebuild existing website layouts using flexbox to sharpen your skills!</p><p>Would you like me to expand on any particular aspect of flexbox?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91410872639f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GIT take Home and HTML take home]]></title>
            <link>https://medium.com/@ehuerikenbaba/git-take-home-and-html-take-home-23800872d184?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/23800872d184</guid>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Tue, 11 Mar 2025 12:10:22 GMT</pubDate>
            <atom:updated>2025-03-11T12:10:22.483Z</atom:updated>
            <content:encoded><![CDATA[<h3>Objective</h3><p>Now that you have learned the basics of Git workflow, try running through it a couple of times on your own (see instructions).</p><p>At<em> this checkpoint, you are </em>asked<em> to take screenshots for each step in the instructions section, then push these screenshots to the GitHub repository.</em></p><h3>Instructions</h3><ol><li>Create a folder called learn_git.</li><li>Cd (change directory) into the learn_git folder.</li><li>Create a file called third.txt.</li><li>Initialize an empty git repository.</li><li>Add third.txt to the staging area.</li><li>Commit with the message “adding third.txt”.</li><li>Check out your commit with git log.</li><li>Create another file called fourth.txt.</li><li>Add fourth.txt to the staging area.</li><li>Commit with the message “adding fourth.txt”</li><li>Remove the third.txt file.</li><li>Add this change to the staging area. (Using the command “git add . “</li><li>Commit with the message “removing third.txt”.</li><li>Check out your commits using git log.</li><li>Change your global settings to core.pager=cat — you can read more about that here.</li><li>Write the appropriate command to list all the global configurations for git on your machine.</li><li>You can type git config — global to find out how to do this.</li></ol><p>HTML take home will be out on Sunday … Happy coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23800872d184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML: A Comprehensive Guide for F.5 Lab Students]]></title>
            <link>https://medium.com/@ehuerikenbaba/html-a-comprehensive-guide-for-f-5-lab-students-1ad2c21fc525?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ad2c21fc525</guid>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 13:19:01 GMT</pubDate>
            <atom:updated>2025-03-09T13:19:01.737Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to HTML</h3><p>HTML (HyperText Markup Language) is the standard markup language used to create web pages. It defines the structure and content of a webpage using a series of elements or tags that tell the web browser how to display the content.</p><h3>How HTML Works</h3><p>HTML works by using tags to mark up different parts of content. Each HTML tag typically comes in pairs:</p><ul><li>An opening tag: &lt;tagname&gt;</li><li>A closing tag: &lt;/tagname&gt;</li></ul><p>The content goes between these tags. Together, the opening tag, content, and closing tag form an HTML element.</p><pre>&lt;tagname&gt;Content goes here&lt;/tagname&gt;</pre><p>Some tags are self-closing and don’t need a closing tag, like the image tag: &lt;img src=&quot;image.jpg&quot; alt=&quot;description&quot; /&gt;</p><h3>Basic Structure of an HTML Document</h3><p>Every HTML document follows a standard structure:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;Page Title&lt;/title&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;!-- Content goes here --&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><ul><li>&lt;!DOCTYPE html&gt;: Declares the document type and HTML version</li><li>&lt;html&gt;: The root element of an HTML page</li><li>&lt;head&gt;: Contains meta-information about the document</li><li>&lt;title&gt;: Specifies the title of the document (shown in browser tab)</li><li>&lt;meta&gt;: Provides metadata about the HTML document</li><li>&lt;body&gt;: Contains the visible page content</li></ul><h3>Essential HTML Tags</h3><h3>Text Elements</h3><h4>Headings</h4><p>HTML provides six levels of headings, from &lt;h1&gt; (most important) to &lt;h6&gt; (least important).</p><pre>&lt;h1&gt;This is a Heading 1&lt;/h1&gt;<br>&lt;h2&gt;This is a Heading 2&lt;/h2&gt;<br>&lt;h3&gt;This is a Heading 3&lt;/h3&gt;<br>&lt;h4&gt;This is a Heading 4&lt;/h4&gt;<br>&lt;h5&gt;This is a Heading 5&lt;/h5&gt;<br>&lt;h6&gt;This is a Heading 6&lt;/h6&gt;</pre><h4>Paragraphs</h4><p>The &lt;p&gt; tag defines a paragraph.</p><pre>&lt;p&gt;This is a paragraph of text. HTML will automatically wrap the text to fit the screen size.&lt;/p&gt;</pre><h4>Text Formatting</h4><pre>&lt;strong&gt;Bold text&lt;/strong&gt; or &lt;b&gt;Bold text&lt;/b&gt;<br>&lt;em&gt;Italic text&lt;/em&gt; or &lt;i&gt;Italic text&lt;/i&gt;<br>&lt;u&gt;Underlined text&lt;/u&gt;<br>&lt;mark&gt;Highlighted text&lt;/mark&gt;<br>&lt;del&gt;Strikethrough text&lt;/del&gt;<br>&lt;small&gt;Smaller text&lt;/small&gt;<br>&lt;sup&gt;Superscript&lt;/sup&gt;<br>&lt;sub&gt;Subscript&lt;/sub&gt;</pre><h4>Line Break and Horizontal Rule</h4><pre>&lt;p&gt;This is a line&lt;br&gt;with a break.&lt;/p&gt;<br>&lt;hr&gt; &lt;!-- Creates a horizontal line --&gt;</pre><h3>Lists</h3><h4>Unordered Lists</h4><pre>&lt;ul&gt;<br>    &lt;li&gt;Item 1&lt;/li&gt;<br>    &lt;li&gt;Item 2&lt;/li&gt;<br>    &lt;li&gt;Item 3&lt;/li&gt;<br>&lt;/ul&gt;</pre><h4>Ordered Lists</h4><pre>&lt;ol&gt;<br>    &lt;li&gt;First item&lt;/li&gt;<br>    &lt;li&gt;Second item&lt;/li&gt;<br>    &lt;li&gt;Third item&lt;/li&gt;<br>&lt;/ol&gt;</pre><h4>Definition Lists</h4><pre>&lt;dl&gt;<br>    &lt;dt&gt;Term&lt;/dt&gt;<br>    &lt;dd&gt;Definition of the term&lt;/dd&gt;<br>    &lt;dt&gt;Another term&lt;/dt&gt;<br>    &lt;dd&gt;Definition of another term&lt;/dd&gt;<br>&lt;/dl&gt;</pre><h3>Links</h3><p>The &lt;a&gt; (anchor) tag creates hyperlinks.</p><pre>&lt;a href=&quot;https://www.example.com&quot;&gt;Visit Example&lt;/a&gt;<br>&lt;a href=&quot;about.html&quot;&gt;About Us&lt;/a&gt;<br>&lt;a href=&quot;mailto:contact@example.com&quot;&gt;Email Us&lt;/a&gt;<br>&lt;a href=&quot;tel:+1234567890&quot;&gt;Call Us&lt;/a&gt;</pre><h3>Images</h3><pre>&lt;img src=&quot;image.jpg&quot; alt=&quot;Description of image&quot;&gt;<br>&lt;img src=&quot;https://example.com/image.jpg&quot; alt=&quot;Description&quot; width=&quot;300&quot; height=&quot;200&quot;&gt;</pre><h3>Tables</h3><pre>&lt;table border=&quot;1&quot;&gt;<br>    &lt;thead&gt;<br>        &lt;tr&gt;<br>            &lt;th&gt;Header 1&lt;/th&gt;<br>            &lt;th&gt;Header 2&lt;/th&gt;<br>        &lt;/tr&gt;<br>    &lt;/thead&gt;<br>    &lt;tbody&gt;<br>        &lt;tr&gt;<br>            &lt;td&gt;Row 1, Cell 1&lt;/td&gt;<br>            &lt;td&gt;Row 1, Cell 2&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>            &lt;td&gt;Row 2, Cell 1&lt;/td&gt;<br>            &lt;td&gt;Row 2, Cell 2&lt;/td&gt;<br>        &lt;/tr&gt;<br>    &lt;/tbody&gt;<br>&lt;/table&gt;</pre><h3>Forms</h3><pre>&lt;form action=&quot;/submit-form&quot; method=&quot;post&quot;&gt;<br>    &lt;label for=&quot;name&quot;&gt;Name:&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot; required&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label for=&quot;email&quot;&gt;Email:&lt;/label&gt;<br>    &lt;input type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; required&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label for=&quot;password&quot;&gt;Password:&lt;/label&gt;<br>    &lt;input type=&quot;password&quot; id=&quot;password&quot; name=&quot;password&quot; required&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label&gt;Gender:&lt;/label&gt;<br>    &lt;input type=&quot;radio&quot; id=&quot;male&quot; name=&quot;gender&quot; value=&quot;male&quot;&gt;<br>    &lt;label for=&quot;male&quot;&gt;Male&lt;/label&gt;<br>    &lt;input type=&quot;radio&quot; id=&quot;female&quot; name=&quot;gender&quot; value=&quot;female&quot;&gt;<br>    &lt;label for=&quot;female&quot;&gt;Female&lt;/label&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label&gt;Interests:&lt;/label&gt;<br>    &lt;input type=&quot;checkbox&quot; id=&quot;coding&quot; name=&quot;interests&quot; value=&quot;coding&quot;&gt;<br>    &lt;label for=&quot;coding&quot;&gt;Coding&lt;/label&gt;<br>    &lt;input type=&quot;checkbox&quot; id=&quot;reading&quot; name=&quot;interests&quot; value=&quot;reading&quot;&gt;<br>    &lt;label for=&quot;reading&quot;&gt;Reading&lt;/label&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label for=&quot;country&quot;&gt;Country:&lt;/label&gt;<br>    &lt;select id=&quot;country&quot; name=&quot;country&quot;&gt;<br>        &lt;option value=&quot;usa&quot;&gt;USA&lt;/option&gt;<br>        &lt;option value=&quot;canada&quot;&gt;Canada&lt;/option&gt;<br>        &lt;option value=&quot;uk&quot;&gt;UK&lt;/option&gt;<br>    &lt;/select&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;label for=&quot;message&quot;&gt;Message:&lt;/label&gt;&lt;br&gt;<br>    &lt;textarea id=&quot;message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;<br>    <br>    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;<br>    &lt;input type=&quot;reset&quot; value=&quot;Reset&quot;&gt;<br>&lt;/form&gt;</pre><h3>Semantic Elements</h3><p>HTML5 introduced semantic elements that clearly describe their meaning to both the browser and the developer.</p><pre>&lt;header&gt;<br>    &lt;h1&gt;Website Title&lt;/h1&gt;<br>    &lt;nav&gt;<br>        &lt;ul&gt;<br>            &lt;li&gt;&lt;a href=&quot;#home&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br>            &lt;li&gt;&lt;a href=&quot;#about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;<br>            &lt;li&gt;&lt;a href=&quot;#contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/nav&gt;<br>&lt;/header&gt;</pre><pre>&lt;main&gt;<br>    &lt;section id=&quot;home&quot;&gt;<br>        &lt;h2&gt;Home&lt;/h2&gt;<br>        &lt;p&gt;Welcome to our website!&lt;/p&gt;<br>    &lt;/section&gt;<br>    <br>    &lt;section id=&quot;about&quot;&gt;<br>        &lt;h2&gt;About Us&lt;/h2&gt;<br>        &lt;p&gt;Information about our company.&lt;/p&gt;<br>    &lt;/section&gt;<br>    <br>    &lt;article&gt;<br>        &lt;h2&gt;Latest News&lt;/h2&gt;<br>        &lt;p&gt;Content of the news article...&lt;/p&gt;<br>    &lt;/article&gt;<br>    <br>    &lt;aside&gt;<br>        &lt;h3&gt;Related Links&lt;/h3&gt;<br>        &lt;ul&gt;<br>            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 1&lt;/a&gt;&lt;/li&gt;<br>            &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 2&lt;/a&gt;&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/aside&gt;<br>&lt;/main&gt;</pre><pre>&lt;footer&gt;<br>    &lt;p&gt;&amp;copy; 2025 My Website. All rights reserved.&lt;/p&gt;<br>&lt;/footer&gt;</pre><h3>Divs and Spans</h3><p>These are non-semantic elements used for styling and grouping content.</p><pre>&lt;div class=&quot;container&quot;&gt;<br>    &lt;p&gt;This paragraph is inside a div. &lt;span class=&quot;highlight&quot;&gt;This text is highlighted&lt;/span&gt; using a span.&lt;/p&gt;<br>&lt;/div&gt;</pre><h3>Media Elements</h3><pre>&lt;!-- Audio --&gt;<br>&lt;audio controls&gt;<br>    &lt;source src=&quot;audio.mp3&quot; type=&quot;audio/mpeg&quot;&gt;<br>    Your browser does not support the audio element.<br>&lt;/audio&gt;</pre><pre>&lt;!-- Video --&gt;<br>&lt;video width=&quot;320&quot; height=&quot;240&quot; controls&gt;<br>    &lt;source src=&quot;video.mp4&quot; type=&quot;video/mp4&quot;&gt;<br>    Your browser does not support the video tag.<br>&lt;/video&gt;</pre><pre>&lt;!-- Embedding YouTube videos --&gt;<br>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/VIDEO_ID&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;</pre><h3>Comments</h3><pre>&lt;!-- This is an HTML comment - it won&#39;t be visible on the webpage --&gt;</pre><h3>Common Attributes</h3><p>Many HTML elements share common attributes:</p><ul><li>id: Specifies a unique id for an element</li><li>class: Specifies one or more class names for an element</li><li>style: Specifies inline CSS style for an element</li><li>title: Specifies extra information about an element (displayed as a tooltip)</li><li>lang: Specifies the language of the element&#39;s content</li><li>data-*: Used to store custom data attributes</li></ul><p>Example:</p><pre>&lt;p id=&quot;intro&quot; class=&quot;important highlight&quot; style=&quot;color: blue;&quot; title=&quot;Introduction paragraph&quot;&gt;<br>    This is a paragraph with several attributes.<br>&lt;/p&gt;</pre><h3>HTML Special Characters</h3><p>Some characters are reserved in HTML and need to be represented as character entities:</p><ul><li>&amp;lt; for &lt;</li><li>&amp;gt; for &gt;</li><li>&amp;amp; for &amp;</li><li>&amp;quot; for &quot;</li><li>&amp;apos; for &#39;</li><li>&amp;nbsp; for non-breaking space</li></ul><h3>Best Practices for Writing HTML</h3><ol><li><strong>Always use lowercase tag names</strong>: HTML is not case-sensitive, but lowercase is easier to read and is the convention.</li><li><strong>Always close your tags</strong>: Even though some tags can work without being closed in HTML5, it’s good practice to close all tags.</li><li><strong>Use semantic HTML</strong>: Use the right tags for the right purpose (e.g., &lt;header&gt;, &lt;nav&gt;, &lt;section&gt;, &lt;article&gt;, &lt;footer&gt;).</li><li><strong>Use alternative text for images</strong>: Always include the alt attribute for accessibility.</li><li><strong>Keep your code organized</strong>: Use proper indentation and spacing.</li><li><strong>Validate your HTML</strong>: Use tools like the W3C HTML validator to check for errors.</li><li><strong>Separate structure (HTML) from presentation (CSS)</strong>: Avoid using inline styles or deprecated presentation attributes.</li><li><strong>Make your site accessible</strong>: Follow WAI-ARIA guidelines for accessibility.</li></ol><h3>Conclusion</h3><p>HTML is the foundation of every website. By understanding these basic tags and principles, students can build well-structured web pages and continue learning more advanced concepts like CSS for styling and JavaScript for interactivity.</p><p>With practice, HTML becomes intuitive, and students can create increasingly complex and attractive web pages that work across different browsers and devices.</p><h3>Exercise Ideas for Students</h3><ol><li>Create a simple personal profile page with headings, paragraphs, lists, and an image.</li><li>Build a table showing class schedules or sports statistics.</li><li>Design a contact form with various input types.</li><li>Create a semantic webpage structure for a blog or news site.</li><li>Experiment with embedding different types of media (videos, audio, maps).</li></ol><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ad2c21fc525" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Development Fundamentals: A Guide for F.5 Lab Students]]></title>
            <link>https://medium.com/@ehuerikenbaba/web-development-fundamentals-a-guide-for-f-5-lab-students-01df01005cec?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/01df01005cec</guid>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 07:59:33 GMT</pubDate>
            <atom:updated>2025-03-08T07:59:33.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVEm6yienJZwSjfb09w_QQ.jpeg" /></figure><p>Welcome to the exciting world of web development! Whether you’re just starting your journey or looking to solidify your understanding of core concepts, this guide will walk you through the essential elements that make up modern web development. Let’s dive in!</p><h3>Understanding the Web: The Basics</h3><h3>The Internet vs. the Web</h3><p>Many people use these terms interchangeably, but they’re actually different:</p><ul><li><strong>The Internet</strong> is the global network infrastructure of connected computers and servers — think of it as the roads and highways that connect cities.</li><li><strong>The Web</strong> is just one service that runs on the internet (along with email, messaging, etc.) — like the vehicles that travel on those roads.</li></ul><p>When you access a website, you’re using the Web, which is built on top of the Internet’s infrastructure.</p><h3>Web Architecture</h3><p>At its core, the web operates on a client-server model:</p><ol><li><strong>Clients</strong> (your web browsers like Chrome or Firefox) request information</li><li><strong>Servers</strong> (computers running specialized software) respond to those requests</li><li>Information travels back and forth using standardized protocols</li></ol><p>This architecture allows for the seamless exchange of information that powers every website you visit.</p><h3>Building Blocks of the Web</h3><h3>HTML: The Structure</h3><p>HTML (Hypertext Markup Language) provides the skeleton of every webpage. It uses tags to define elements like:</p><ul><li>Headings (&lt;h1&gt;, &lt;h2&gt;, etc.)</li><li>Paragraphs (&lt;p&gt;)</li><li>Lists (&lt;ul&gt;, &lt;ol&gt;)</li><li>Links (&lt;a&gt;)</li><li>Images (&lt;img&gt;)</li></ul><p>These elements give structure to your content and help browsers understand how to display your page.</p><h3>CSS: The Style</h3><p>While HTML defines the structure, CSS (Cascading Style Sheets) determines how that structure looks:</p><ul><li>Colors, fonts, and text sizes</li><li>Layout and positioning</li><li>Animations and transitions</li><li>Responsive design for different screen sizes</li></ul><p>CSS transforms plain HTML into visually appealing websites that engage users.</p><h3>JavaScript: The Behavior</h3><p>JavaScript adds interactivity to your websites:</p><ul><li>Responding to user actions (clicks, scrolls, etc.)</li><li>Updating content dynamically without reloading the page</li><li>Validating forms and handling user input</li><li>Creating complex animations and effects</li></ul><p>JavaScript turns static pages into dynamic applications that respond to user interactions.</p><h3>Behind the Scenes: How the Web Works</h3><h3>Internet Protocols</h3><p>The web relies on several protocols to function:</p><ul><li><strong>HTTP/HTTPS</strong>: The protocol for transferring web pages (HTTPS is the secure version)</li><li><strong>TCP/IP</strong>: The foundational protocols that facilitate data transmission across the internet</li><li><strong>DNS</strong>: The system that translates human-readable domain names (like google.com) to IP addresses (like 172.217.164.174)</li></ul><p>Understanding these protocols helps you grasp how information flows between clients and servers.</p><h3>Servers and APIs</h3><p>Servers are computers that host websites and respond to client requests. They can:</p><ul><li>Store and serve web pages</li><li>Process form submissions</li><li>Connect to databases to retrieve or store data</li></ul><p>APIs (Application Programming Interfaces) allow different software systems to communicate with each other, enabling features like:</p><ul><li>Displaying weather data from a third-party service</li><li>Integrating payment processing</li><li>Sharing content to social media platforms</li></ul><h3>Databases</h3><p>Websites need to store and organize data, which is where databases come in:</p><ul><li><strong>SQL databases</strong> (like MySQL, PostgreSQL) use structured tables with relationships</li><li><strong>NoSQL databases</strong> (like MongoDB, Firebase) offer more flexibility for unstructured data</li></ul><p>Databases perform CRUD operations (Create, Read, Update, Delete) to manage your application’s data.</p><h3>The Development Process</h3><h3>Setting Up Your Development Environment</h3><p>Every developer needs a proper workspace:</p><ul><li><strong>Code editors</strong>: Programs like VS Code, Sublime Text, or Atom that make writing code easier</li><li><strong>Browser developer tools</strong>: Built-in tools for debugging and testing your code</li><li><strong>Local development servers</strong>: Software that mimics a web server on your computer</li></ul><p>The right tools significantly improve your development workflow and productivity.</p><h3>Version Control with Git and GitHub</h3><p>Version control is essential for tracking changes and collaborating with others:</p><ul><li><strong>Git</strong> is a tool that tracks changes to your code over time</li><li><strong>GitHub</strong> is a platform that hosts Git repositories and adds collaboration features</li></ul><p>Basic Git commands you’ll use daily:</p><ul><li>git init: Start tracking a new project</li><li>git add: Stage changes for commit</li><li>git commit: Save a snapshot of your changes</li><li>git push: Upload changes to a remote repository</li><li>git pull: Download changes from a remote repository</li></ul><p>Learning Git is crucial for working on team projects and maintaining a history of your code.</p><h3>Web Development Approaches</h3><h3>Frontend Development</h3><p>Frontend developers work on what users see and interact with:</p><ul><li>Implementing designs with HTML and CSS</li><li>Creating interactive elements with JavaScript</li><li>Optimizing for performance and accessibility</li><li>Testing across different browsers and devices</li></ul><p>Frontend frameworks like React, Vue, and Angular help build complex user interfaces efficiently.</p><h3>Backend Development</h3><p>Backend developers focus on the server side:</p><ul><li>Building server logic with languages like Node.js, Python, PHP, or Ruby</li><li>Managing databases and data storage</li><li>Implementing security measures</li><li>Handling user authentication and authorization</li></ul><p>Backend frameworks like Express, Django, or Rails provide structure and common functionality.</p><h3>Full-Stack Development</h3><p>Full-stack developers work on both frontend and backend, understanding the entire web stack from user interface to database.</p><h3>Content Management Systems</h3><p>For many websites, a CMS (Content Management System) simplifies development:</p><ul><li><strong>WordPress</strong>: Powers over 40% of websites on the internet</li><li><strong>Drupal</strong>: Offers robust features for complex sites</li><li><strong>Joomla</strong>: Provides a middle ground between WordPress and Drupal</li></ul><p>CMSs allow non-technical users to update content without knowing how to code.</p><h3>Advanced Topics to Explore</h3><p>As you progress in your web development journey, you’ll encounter more advanced concepts:</p><ul><li><strong>Responsive design</strong>: Making websites adapt to different screen sizes</li><li><strong>Progressive Web Apps (PWAs)</strong>: Creating app-like experiences on the web</li><li><strong>Web accessibility</strong>: Ensuring websites are usable by everyone, including people with disabilities</li><li><strong>Performance optimization</strong>: Making websites load faster and run smoother</li><li><strong>Security best practices</strong>: Protecting websites from common vulnerabilities</li></ul><h3>Conclusion</h3><p>Web development is a vast and ever-evolving field. The fundamentals covered in this guide provide a solid foundation, but the learning never stops. As you build projects and solve problems, you’ll deepen your understanding and develop your own approaches and preferences.</p><p>Remember that every expert was once a beginner. Keep coding, keep learning, and enjoy the journey of becoming a web developer!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01df01005cec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Basic React E-commerce Site: A Step-by-Step Tutorial]]></title>
            <link>https://medium.com/@ehuerikenbaba/building-a-basic-react-e-commerce-site-a-step-by-step-tutorial-985ff1987f8b?source=rss-b288c65ac9d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/985ff1987f8b</guid>
            <dc:creator><![CDATA[Ehueriken Samuel obuse]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 10:03:31 GMT</pubDate>
            <atom:updated>2025-02-06T10:03:31.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ugt__-gx9r59uy9hg9e-QQ.png" /></figure><p>In this tutorial, we’ll build a basic e-commerce site using React and fetch data from the FakeStore API. We’ll focus on core functionality and clear code explanations.</p><h3>Project Setup</h3><ol><li>First, create a new React project:</li></ol><pre>npm create vite@latest basic-ecommerce -- --template react<br>cd basic-ecommerce<br>npm install</pre><ol><li>Install necessary dependencies:</li></ol><pre>npm install axios react-router-dom</pre><p>2. Let’s create our project structure:</p><pre>mkdir src/components src/pages src/context</pre><h3>Step 1: Create Product Context</h3><p>Create src/context/ProductContext.jsx:</p><pre>import { createContext, useState, useEffect } from &#39;react&#39;;<br>import axios from &#39;axios&#39;;<br><br>// Create a context for products<br>export const ProductContext = createContext();<br><br>export function ProductProvider({ children }) {<br>  // State to store products<br>  const [products, setProducts] = useState([]);<br>  // State to track loading status<br>  const [loading, setLoading] = useState(true);<br>  // State to store any error messages<br>  const [error, setError] = useState(null);<br><br>  // Fetch products when component mounts<br>  useEffect(() =&gt; {<br>    const fetchProducts = async () =&gt; {<br>      try {<br>        // Make API call to FakeStore API<br>        const response = await axios.get(&#39;https://fakestoreapi.com/products&#39;);<br>        setProducts(response.data);<br>        setLoading(false);<br>      } catch (err) {<br>        setError(&#39;Failed to fetch products&#39;);<br>        setLoading(false);<br>      }<br>    };<br><br>    fetchProducts();<br>  }, []);<br><br>  return (<br>    &lt;ProductContext.Provider value={{ products, loading, error }}&gt;<br>      {children}<br>    &lt;/ProductContext.Provider&gt;<br>  );<br>}</pre><h3>Step 2: Create Product Card Component</h3><p>Create src/components/ProductCard.jsx:</p><pre>import { useState } from &#39;react&#39;;<br><br>function ProductCard({ product }) {<br>  // State to manage product quantity<br>  const [quantity, setQuantity] = useState(1);<br><br>  return (<br>    &lt;div className=&quot;product-card&quot;&gt;<br>      {/* Product Image */}<br>      &lt;img <br>        src={product.image} <br>        alt={product.title} <br>        style={{ width: &#39;200px&#39;, height: &#39;200px&#39;, objectFit: &#39;contain&#39; }} <br>      /&gt;<br>      <br>      {/* Product Details */}<br>      &lt;div className=&quot;product-info&quot;&gt;<br>        &lt;h3&gt;{product.title}&lt;/h3&gt;<br>        &lt;p&gt;{product.description.substring(0, 100)}...&lt;/p&gt;<br>        &lt;p className=&quot;price&quot;&gt;${product.price}&lt;/p&gt;<br><br>        {/* Quantity Controls */}<br>        &lt;div className=&quot;quantity-controls&quot;&gt;<br>          &lt;button <br>            onClick={() =&gt; setQuantity(prev =&gt; Math.max(1, prev - 1))}<br>            disabled={quantity === 1}<br>          &gt;<br>            -<br>          &lt;/button&gt;<br>          &lt;span&gt;{quantity}&lt;/span&gt;<br>          &lt;button <br>            onClick={() =&gt; setQuantity(prev =&gt; prev + 1)}<br>          &gt;<br>            +<br>          &lt;/button&gt;<br>        &lt;/div&gt;<br><br>        {/* Add to Cart Button */}<br>        &lt;button className=&quot;add-to-cart&quot;&gt;<br>          Add to Cart<br>        &lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default ProductCard;</pre><h3>Step 3: Create Home Page</h3><p>Create src/pages/HomePage.jsx:</p><pre>import { useContext } from &#39;react&#39;;<br>import { ProductContext } from &#39;../context/ProductContext&#39;;<br>import ProductCard from &#39;../components/ProductCard&#39;;<br><br>function HomePage() {<br>  // Get products data from context<br>  const { products, loading, error } = useContext(ProductContext);<br><br>  // Show loading state<br>  if (loading) {<br>    return &lt;div&gt;Loading products...&lt;/div&gt;;<br>  }<br><br>  // Show error state<br>  if (error) {<br>    return &lt;div&gt;{error}&lt;/div&gt;;<br>  }<br><br>  return (<br>    &lt;div className=&quot;homepage&quot;&gt;<br>      &lt;h1&gt;Our Products&lt;/h1&gt;<br>      <br>      {/* Product Grid */}<br>      &lt;div className=&quot;product-grid&quot;&gt;<br>        {products.map(product =&gt; (<br>          &lt;ProductCard key={product.id} product={product} /&gt;<br>        ))}<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default HomePage;</pre><h3>Step 4: Create Navigation Component</h3><p>Create src/components/Navbar.jsx:</p><pre>function Navbar() {<br>  return (<br>    &lt;nav className=&quot;navbar&quot;&gt;<br>      &lt;div className=&quot;nav-brand&quot;&gt;<br>        &lt;h1&gt;Simple Shop&lt;/h1&gt;<br>      &lt;/div&gt;<br>      <br>      {/* Navigation Links */}<br>      &lt;div className=&quot;nav-links&quot;&gt;<br>        &lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;<br>        &lt;a href=&quot;/cart&quot;&gt;Cart (0)&lt;/a&gt;<br>      &lt;/div&gt;<br>    &lt;/nav&gt;<br>  );<br>}<br><br>export default Navbar;</pre><h3>Step 5: Update App.jsx</h3><p>Update src/App.jsx:</p><pre>import { ProductProvider } from &#39;./context/ProductContext&#39;;<br>import Navbar from &#39;./components/Navbar&#39;;<br>import HomePage from &#39;./pages/HomePage&#39;;<br>import &#39;./App.css&#39;;<br><br>function App() {<br>  return (<br>    &lt;ProductProvider&gt;<br>      &lt;div className=&quot;app&quot;&gt;<br>        &lt;Navbar /&gt;<br>        &lt;HomePage /&gt;<br>      &lt;/div&gt;<br>    &lt;/ProductProvider&gt;<br>  );<br>}<br><br>export default App;</pre><h3>Step 6: Add Basic Styling</h3><p>Create src/App.css:</p><pre>/* Basic Reset */<br>* {<br>  margin: 0;<br>  padding: 0;<br>  box-sizing: border-box;<br>}<br><br>/* Navbar Styles */<br>.navbar {<br>  background-color: #333;<br>  color: white;<br>  padding: 1rem;<br>  display: flex;<br>  justify-content: space-between;<br>  align-items: center;<br>}<br><br>.nav-links a {<br>  color: white;<br>  text-decoration: none;<br>  margin-left: 1rem;<br>}<br><br>/* Product Grid */<br>.product-grid {<br>  display: grid;<br>  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));<br>  gap: 2rem;<br>  padding: 2rem;<br>}<br><br>/* Product Card */<br>.product-card {<br>  border: 1px solid #ddd;<br>  padding: 1rem;<br>  border-radius: 8px;<br>  display: flex;<br>  flex-direction: column;<br>  align-items: center;<br>}<br><br>.product-info {<br>  margin-top: 1rem;<br>  text-align: center;<br>}<br><br>.price {<br>  font-size: 1.2rem;<br>  font-weight: bold;<br>  color: #2c5282;<br>  margin: 0.5rem 0;<br>}<br><br>/* Buttons */<br>.quantity-controls {<br>  display: flex;<br>  gap: 1rem;<br>  align-items: center;<br>  margin: 1rem 0;<br>}<br><br>.quantity-controls button {<br>  padding: 0.5rem 1rem;<br>  border: 1px solid #ddd;<br>  background: white;<br>  cursor: pointer;<br>}<br><br>.add-to-cart {<br>  background-color: #2c5282;<br>  color: white;<br>  border: none;<br>  padding: 0.5rem 1rem;<br>  border-radius: 4px;<br>  cursor: pointer;<br>}<br><br>.add-to-cart:hover {<br>  background-color: #2b6cb0;<br>}</pre><h3>Step 7: Start the Development Server</h3><p>Run the application:</p><pre>npm run dev</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=985ff1987f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>