Module 5

Building a Complete Website Project

From planning to implementation - creating a fully functional website with AI assistance

5.1 Project Planning and Structure

Defining Your Website Goals

Start by clearly understanding what you want to achieve:

Primary Goals
  • Problem Solving: What specific problem will your website solve for visitors?
  • Target Audience: Who exactly are you building this for? Be specific!
  • Call to Action: What one main thing do you want visitors to do?
  • Success Metrics: How will you know if your website is working?
User-Centered Approach

Think from your visitors' perspective with these questions:

  • "What's in it for me?" (Visitor's main question)
  • "How does this make my life better/easier?"
  • "Why should I trust this website/company?"
  • "Can I find what I need quickly?"

Real example: A photography portfolio website might have these goals:

  1. Showcase best work to potential clients
  2. Make booking a session as easy as possible
  3. Establish professional credibility with testimonials
  4. Collect leads through a contact form
AI Tip: Ask AI: "What should be the main goals for a [your business type] website?" to get customized suggestions!

Creating a File Structure

Organize your project for easy management:

my-website/
├── index.html         # Homepage
├── about.html         # About page
├── contact.html       # Contact page
├── assets/
│   ├── css/           # Stylesheets
│   │   └── style.css
│   │
│   ├── js/            # JavaScript files
│   │   └── main.js
│   │
│   ├── images/        # Image files
│   └── fonts/         # Custom fonts
└── components/        # Reusable HTML parts
    ├── header.html
    └── footer.html
Beginner-Friendly Structure Tips:
  • Keep it simple at first - you can always reorganize later
  • Group similar files together (all images in one place)
  • Use clear, descriptive names (profile-photo.jpg, not img1.jpg)
  • Separate content from code when possible

AI structure prompt: "Create a simple file structure for a 5-page personal portfolio website. Include places for HTML, CSS, JavaScript, images, and project files."

Setting Up a Git Repository

Track changes and protect your work:

# First-time setup (in your project folder)
git init
git add .
git commit -m "Initial project setup"

# Connect to GitHub (after creating a repository there)
git remote add origin https://github.com/username/project-name.git
git push -u origin main
Beginner Tip: Try GitHub Desktop or GitKraken for a visual, beginner-friendly way to use Git without memorizing commands!

Planning Website Pages

Map out your website's structure and connections:

Home
About
Services
Portfolio
Contact
Service 1
Service 2
Essential Pages to Include:
  • Home: Make a great first impression and guide visitors
  • About: Build trust by telling your story
  • Services/Products: What you offer (with details)
  • Contact: Make it easy to reach you
  • FAQ/Help: Answer common questions

AI sitemap prompt: "Create a sitemap for a beginner yoga teacher's website. Include all essential pages and any specialized pages that would help attract new students."

Creating a Simple Design System

Even small projects need consistent design:

Color Palette
Primary
Success
Accent
Dark
Typography

Headings: Inter Bold

Body text: Inter Regular - Easy to read and works well on all devices. Keep it simple!

Basic Components
Buttons:
Cards:
Card Title

Simple card example with consistent padding and styling.

AI design system prompt: "Create a simple design system for my personal website. I'm a photographer who loves minimalist design. Include colors, typography, and basic component styles."

Simple Wireframing

Sketch your layout before writing code:

HEADER / NAVIGATION
HERO SECTION
(Main Headline + Call-to-Action)
FEATURE 1
FEATURE 2
FEATURE 3

A simple homepage wireframe showing basic layout

Wireframing for Beginners:
  • Just use paper and pencil - No fancy tools needed!
  • Focus on layout, not colors or images
  • Start with mobile layout - It's easier to expand than shrink
  • Label each section with its purpose
  • Create a simple user flow - Where do you want visitors to click?
AI Wireframing: Ask AI to "draw" wireframes using text or ASCII art, or to describe layouts in detail that you can easily sketch yourself!

Key Takeaways

  • Plan before coding - Clear goals save time later
  • Organization matters - Good file structure makes development easier
  • Use Git from the start - Even for small projects
  • Think about user journeys - How will people use your site?
  • Start simple - You can always add complexity later
  • Design systems help - Even a basic one keeps your site consistent

5.2 Building Core Components

Modular Component Architecture

Think of your website as a set of building blocks that fit together:

Header
Navigation Menu
Hero Section
Feature 1
Feature 2
Feature 3
Contact Form
Footer
Why Build This Way?
  • Reusability: Create a component once, use it everywhere
  • Consistency: Your site looks and feels the same throughout
  • Efficiency: Faster development and easier updates
  • Teamwork: Different people can work on different components
  • Maintenance: Fix one component, fix it everywhere
Beginner Tip: Even without a framework like React, you can still think in components by organizing your HTML into smaller, reusable sections.

Building the Navigation System

A good navigation system guides visitors through your site:

Ask AI: "Create a responsive Bootstrap 5 navigation bar with logo, main links (Home, About, Services, Contact), where Services has a dropdown, and it collapses to a hamburger menu on mobile."

Creating an Effective Hero Section

Your hero section is your website's first impression:

<!-- Hero Section with Bootstrap -->
<section class="hero bg-primary text-white py-5">
  <div class="container">
    <div class="row align-items-center">
      <div class="col-lg-6">
        <h1 class="display-4 fw-bold">Your Powerful Headline</h1>
        <p class="lead">A supporting message that explains your value 
          proposition in simple terms.</p>
        <div class="d-flex gap-3 mt-4">
          <a href="#" class="btn btn-light btn-lg">Primary Action</a>
          <a href="#" class="btn btn-outline-light btn-lg">Learn More</a>
        </div>
      </div>
      <div class="col-lg-6 d-none d-lg-block">
        <img src="hero-image.jpg" alt="Hero visual" class="img-fluid rounded shadow">
      </div>
    </div>
  </div>
</section>
Hero Section Test: Show someone your hero section for 5 seconds, then ask them what your website does and who it's for. If they can't answer clearly, your hero needs improvement.

Feature Cards & Content Sections

Feature cards help organize and highlight your content:

Feature One

Brief description of this amazing feature.

Feature Two

Brief description of this amazing feature.

Feature Three

Brief description of this amazing feature.

Feature Card Design Tips:
  • Focus on benefits: Explain how features help the user
  • Use icons: Visual cues make features more memorable
  • Keep text brief: Most visitors scan rather than read
  • Consistent styling: Same size cards, similar text length
  • Add subtle animations: Consider hover effects for interaction
<!-- Feature Card Component -->
<div class="card h-100 shadow-sm hover-lift">
  <!-- Card Image -->
  <img src="feature-image.jpg" class="card-img-top" alt="Feature">
  
  <!-- Card Body -->
  <div class="card-body">
    <!-- Icon (optional) -->
    <div class="icon-box bg-primary text-white rounded-circle mb-3">
      <i class="fas fa-star"></i>
    </div>
    
    <!-- Title and Description -->
    <h5 class="card-title">Feature Title</h5>
    <p class="card-text">A brief description of this feature and how 
      it benefits the user.</p>
    
    <!-- Card Link/Button -->
    <a href="#" class="btn btn-outline-primary mt-2">Learn More</a>
  </div>
</div>

Ask AI: "Create a feature cards section with 3 cards showcasing benefits of my design services. Each card should have an icon, heading, brief description, and subtle hover effect."

Building Contact Forms

Forms allow visitors to interact with your website:

<!-- Contact Form with Validation -->
<form class="needs-validation" novalidate>
  <!-- Name Field -->
  <div class="mb-3">
    <label for="name" class="form-label">Your Name</label>
    <input type="text" 
           class="form-control" 
           id="name"
           placeholder="John Doe"
           required>
    <div class="invalid-feedback">
      Please enter your name
    </div>
  </div>
  
  <!-- Email Field -->
  <div class="mb-3">
    <label for="email" class="form-label">Email Address</label>
    <input type="email" 
           class="form-control" 
           id="email"
           placeholder="name@example.com"
           required>
    <div class="invalid-feedback">
      Please enter a valid email address
    </div>
  </div>
  
  <!-- Message Field -->
  <div class="mb-3">
    <label for="message" class="form-label">Message</label>
    <textarea class="form-control" 
              id="message" 
              rows="4"
              placeholder="Your message here..."
              required></textarea>
    <div class="invalid-feedback">
      Please enter your message
    </div>
  </div>
  
  <!-- Terms Checkbox -->
  <div class="mb-3 form-check">
    <input type="checkbox" 
           class="form-check-input" 
           id="terms"
           required>
    <label class="form-check-label" for="terms">
      I agree to the <a href="#">terms and conditions</a>
    </label>
    <div class="invalid-feedback">
      You must agree to the terms before submitting
    </div>
  </div>
  
  <!-- Submit Button -->
  <button type="submit" class="btn btn-primary">
    <i class="fas fa-paper-plane me-2"></i>Send Message
  </button>
</form>
Important Note: The HTML above is just the form structure. You'll need backend code or a form service (like Formspree, Netlify Forms, etc.) to actually process form submissions.

Key Takeaways

  • Think in components: Build websites as a collection of reusable parts
  • Navigation matters: Clear menus help visitors find what they need
  • First impressions count: Your hero section should instantly communicate value
  • Feature cards organize: Present information in scannable, visually appealing chunks
  • Forms need care: Design forms that are easy to complete and validate properly
  • Ask AI for help: Use AI to generate starting code for any component

5.3 Responsive Design Implementation

Mobile-First Strategy

Design for small screens, then expand:

Mobile Layout
Tablet Layout
Desktop Layout
Why Mobile-First Works:
  • Most web traffic is now mobile
  • Forces you to prioritize content
  • Leads to faster-loading sites
  • Simplified designs work better
  • Easier to add complexity than remove it
Implementation Steps:
  1. Design mobile layouts first
  2. Test on actual mobile devices
  3. Add tablet layouts (if needed)
  4. Finally, enhance for desktop
  5. Test across all sizes
Before/After: Mobile-First Transformation
❌ Desktop-First Approach
(Starting with all features)
Full Navigation
Hero + Animation
Sidebar
Main Content
Features (3 columns)
Footer (Multiple columns)
Now try to simplify for mobile
Problems: Complex layout breaks, features don't fit, difficult decisions about what to remove
VS
✅ Mobile-First Approach
(Starting with essentials)
Hamburger Menu
Key Message
Main Content
Key Features (Stacked)
Simple Footer
Now enhance for desktop
Benefits: Core content already works, easy to expand layout, progressive enhancement

AI mobile-first prompt: "Create a mobile-first navigation component that collapses into a hamburger menu on small screens and shows horizontal links on larger screens."

Flexible Grid Systems

Creating layouts that adapt to screen size:

How Bootstrap Grid Responds
Phone (xs)
col-12
col-12
col-12
Tablet (md)
col-md-6
col-md-6
col-md-6
col-md-6
Desktop (lg)
col-lg-4
col-lg-4
col-lg-4
<!-- Responsive Grid Example -->
<div class="container">
  <div class="row">
    <!-- Full width on mobile, half width on tablets, 
         third width on desktop -->
    <div class="col-12 col-md-6 col-lg-4 mb-4">
      <div class="card">
        <img src="image1.jpg" class="card-img-top" alt="...">
        <div class="card-body">
          <h5 class="card-title">Feature One</h5>
          <p class="card-text">Some quick example text.</p>
        </div>
      </div>
    </div>
    
    <!-- Same pattern for other cards -->
    <div class="col-12 col-md-6 col-lg-4 mb-4">
      <!-- Card content -->
    </div>
    
    <div class="col-12 col-md-6 col-lg-4 mb-4">
      <!-- Card content -->
    </div>
  </div>
</div>

This Bootstrap grid example shows:

  • Cards take full width (col-12) on phones
  • Two cards per row (col-md-6) on tablets
  • Three cards per row (col-lg-4) on desktops
  • Margin at bottom (mb-4) for spacing
Grid Tip: You can always ask AI to explain how a grid system works or to provide the right column classes for specific layout requirements.

Responsive Images and Media

Making visual content adapt to any screen:

How Responsive Images Work
small.jpg
500px wide
Mobile uses small image
medium.jpg
1000px wide
Tablet uses medium image
large.jpg
1500px wide
Desktop uses large image
Bandwidth savings: Users only download the image size they need!
<!-- Basic Responsive Image -->
<img src="image.jpg" class="img-fluid" alt="Description">

<!-- Advanced Responsive Image with srcset -->
<img srcset="small.jpg 500w,
             medium.jpg 1000w,
             large.jpg 1500w"
     sizes="(max-width: 600px) 500px,
            (max-width: 1200px) 1000px,
            1500px"
     src="fallback.jpg" 
     alt="Description">
Responsive Media Best Practices:
  • Always use responsive image classes
  • Optimize image file sizes
  • Use appropriate image formats
  • Consider different image crops for mobile
  • Don't forget alt text for accessibility

AI responsive media prompt: "Create HTML for a responsive image gallery with 6 images that displays in 1 column on mobile, 2 columns on tablets, and 3 columns on desktop."

Responsive Typography

Making text readable on every device:

Fluid Typography Visualization
Mobile
Heading Text
Body text that's easy to read on small screens.
Tablet
Heading Text
Body text that gradually increases in size as screens get wider.
Desktop
Heading Text
Body text that's optimally sized for comfortable reading on larger screens.
Fluid Typography: Text size scales smoothly between screen sizes using clamp(min, preferred, max)
/* Responsive Typography with CSS */
html {
  font-size: 16px;
}

h1 {
  /* Fluid typography that scales with viewport */
  font-size: clamp(2rem, 5vw, 3.5rem);
}

p {
  font-size: 1rem;   /* Base size */
  line-height: 1.5;  /* Good for readability */
  max-width: 70ch;   /* Optimal line length */
}

@media (min-width: 768px) {
  html {
    font-size: 18px;  /* Larger base size on bigger screens */
  }
}
Typography Considerations:
  • Use relative units (rem, em) instead of pixels
  • Set comfortable line spacing (line-height)
  • Limit line length for readability
  • Consider increasing base font size on larger screens
  • Test readability on actual devices

AI typography prompt: "Create CSS for responsive typography with a scale that works well from mobile to desktop, including headings and body text with optimal readability."

Touch-Friendly Interfaces

Designing for fingers, not just mouse pointers:

❌ Poor Touch Design
Too small touch targets
✅ Good Touch Design
Minimum 44x44px target size
Touch-Friendly Best Practices:
  • Minimum size: Make touch targets at least 44×44 pixels
  • Spacing: Leave enough space between interactive elements
  • Gestures: Use familiar touch gestures (swipe, pinch, tap)
  • Feedback: Provide visual feedback for touch interactions
  • Testing: Test with actual fingers, not just mouse clicks
/* Touch-friendly button example */
.touch-button {
  min-width: 44px;   /* Minimum width for touchable element */
  min-height: 44px;  /* Minimum height for touchable element */
  padding: 12px 16px;
  margin: 8px;       /* Space between buttons */
}

/* Visual feedback on touch */
.touch-button:active {
  transform: scale(0.98);  /* Slight size reduction */
  background-color: #e9ecef; /* Background change */
}

Testing Across Devices

Ensuring your responsive design works everywhere:

Browser Tools

Free built-in options:

  • Chrome DevTools Device Emulation
  • Firefox Responsive Design Mode
  • Edge Developer Tools
Great for quick checks during development
Real Device Testing

Always test on actual devices:

  • Your own phone and tablet
  • Friends' and family devices
  • Older devices if possible
Catches real-world issues emulators miss
Online Testing Tools

Expanded device coverage:

  • BrowserStack
  • Responsively App
  • LambdaTest
Some have free tiers for basic testing
What to Check
  • Navigation usability
  • Content readability
  • Touch target sizes
  • Form functionality
  • Image rendering
Test in portrait AND landscape modes
Testing Tip: Start with your most common user device first (check your analytics). Then test the extremes - very small and very large screens - to find edge cases.

Key Takeaways

  • Start mobile-first: Design for small screens first, then expand for larger devices
  • Use fluid layouts: Let content adapt naturally to different screen sizes
  • Optimize media: Send appropriately-sized images to each device
  • Make typography readable: Scale font sizes fluidly across devices
  • Design for touch: Ensure interactive elements work well with fingers
  • Test thoroughly: Check on real devices whenever possible
  • Consider performance: Mobile users may have slower connections

5.4 Final Touches and Polish

Performance Optimization

Making your website fast and responsive:

Image Optimization:
  • Compress all images
  • Use modern formats (WebP)
  • Lazy load off-screen images
  • Provide appropriate sizes
  • Consider content delivery networks
Code Optimization:
  • Minimize HTTP requests
  • Compress and minify CSS/JS
  • Use async/defer for scripts
  • Enable browser caching
  • Remove unused code
<!-- Lazy loading images -->
<img src="image.jpg" alt="Description" loading="lazy">

<!-- Async script loading -->
<script src="script.js" async></script>
Performance Tip: You can ask AI for techniques to make your specific website faster. For example: "How can I optimize the performance of my image-heavy portfolio website?"

Pre-Launch Checklist

Essential checks before going live:

Functionality:
Responsiveness:

AI checklist prompt: "Create a comprehensive pre-launch checklist for a small business website, including functionality, content, SEO, and technical aspects."

Accessibility Refinements

Making your site usable by everyone:

Before/After: Accessibility Improvements
❌ Inaccessible
Missing Alt Text:
<img src="logo.png">
Poor Contrast:
This text is hard to read
Not Keyboard Accessible:
<div onclick="...">Click</div>
Click
✅ Accessible
Descriptive Alt Text:
<img src="logo.png" alt="Company Logo">
Good Contrast:
This text is easy to read
Keyboard Accessible:
<button type="button">Click</button>
Keyboard navigation: Ensure all interactive elements can be accessed and operated using only a keyboard.
Screen reader compatibility: Test with screen readers and ensure all content is properly announced.
Color contrast: Ensure text has sufficient contrast against backgrounds (use contrast checkers).
Focus indicators: Make sure it's visually clear which element has keyboard focus.
Text resizing: Ensure the site remains usable when text is enlarged up to 200%.

Animation and Interaction

Adding polish with subtle animations:

Animation Examples
Hover Effect
Hover over me!
Pulse Effect
Subtle attention-getter
Fade In
I appear gradually!
/* Simple hover animation */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Pulse animation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pulse-element {
  animation: pulse 1.5s infinite;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.fade-in.visible {
  opacity: 1;
}

/* Respecting user preferences */
@media (prefers-reduced-motion: reduce) {
  /* Disable animations for users who prefer reduced motion */
  .card, .pulse-element, .fade-in {
    transition: none !important;
    animation: none !important;
  }
}
Animation Best Practices:
  • Purpose first: Only add animations that enhance usability or communication
  • Keep it subtle: Small movements are often more effective than large ones
  • Timing matters: Fast for UI feedback (0.1-0.2s), medium for transitions (0.3-0.5s)
  • Be inclusive: Always include reduced-motion alternatives
  • Performance: Animate only transform and opacity properties when possible

AI animation prompt: "Create subtle CSS animations for a card component that activates on hover and another animation for elements that fade in when scrolled into view."

Animation Caution: Honor user preferences for reduced motion with the prefers-reduced-motion media query. About 3% of users have vestibular disorders that can make animations disorienting or nauseating.

Key Takeaways

  • Optimize performance for faster loading times
  • Use a comprehensive pre-launch checklist
  • Ensure your website is accessible to all users
  • Add subtle animations to enhance user experience
  • Test thoroughly across devices and browsers

Module 5 Summary

What We've Learned

Project Planning and Structure

Setting clear goals, creating sitemaps, defining style guides, and wireframing layouts.

Building Core Components

Creating modular components, navigation systems, hero sections, and interactive forms.

Responsive Design Implementation

Using mobile-first strategies, flexible grids, responsive images, and adaptive typography.

Final Touches and Polish

Optimizing performance, conducting pre-launch checks, ensuring accessibility, and adding subtle animations.

Using AI Throughout the Process

  • Planning: Generate sitemaps, wireframes, and style guide recommendations
  • Component Building: Create customized, accessible component code
  • Responsive Design: Help implement mobile-first approaches and grid systems
  • Polish: Suggest optimizations, test accessibility, and create animations
  • Problem Solving: Debug issues and suggest improvements for existing code

Next Steps

Now that you've learned how to build a complete website, it's time to prepare for deployment:

  • Practice building a small personal project using these techniques
  • Learn about hosting options for your websites
  • Explore more advanced functionality like contact forms and dynamic content
  • Join Module 6 to learn about deploying your website with Cloudflare Pages
Module 5 Navigation