System Documentation: AHBotAI Website

Version: 1.0 | Developer: Ali Husnain | Date: October 2023 | Stack: HTML, CSS, JS

1. Introduction

1.1 Project Overview

AHBotAI is a multi-page, responsive static website designed to showcase and provide a simulated experience of AI Chatbot services for businesses. The project focuses on clean UI/UX design, frontend interactivity, and modern web standards without relying on external frameworks or backend servers.

1.2 Purpose

The primary purpose of this system is to act as a digital portfolio and business landing page for AI chatbot solutions. It demonstrates frontend development capabilities, including DOM manipulation, event handling, and responsive design.

1.3 Scope

2. System Architecture

The project follows a standard Separation of Concerns (SoC) architecture typical of modern frontend development.

2.1 Directory Structure

project/
├── index.html          # Home / Landing Page
├── about.html          # Developer Profile & Mission
├── services.html       # Service Offerings
├── demo.html           # Interactive Chatbot UI
├── pricing.html        # Pricing Plans
├── contact.html        # Contact Form
├── css/
│   └── style.css       # Global stylesheet & design system
├── js/
│   └── script.js       # Global interactivity & logic
└── images/             # (Reserved for future assets)
    

3. Component Design (Class Diagram)

Since this is a Vanilla JavaScript application without traditional Object-Oriented backend classes, the system is modeled conceptually based on Controller Modules and DOM Entities. The UIManager handles generic view updates, while the ChatbotEngine and FormHandler encapsulate specific business logic.

classDiagram class UIManager { -HTMLElement hamburger -HTMLElement navLinks +initMobileMenu() void +toggleMenu() void +closeMenu() void } class ChatbotEngine { -HTMLElement chatInput -HTMLElement sendBtn -HTMLElement chatMessages +handleSendEvent() void -appendMessage(sender: String, text: String) void -evaluateInput(text: String) String } class FormHandler { -HTMLElement contactForm +handleSubmission(event: Event) void -validateFields() boolean -resetForm() void } class MessageEntity { +String sender +String content +display() void } UIManager --> ChatbotEngine : triggers init UIManager --> FormHandler : triggers init ChatbotEngine --> MessageEntity : creates

Class Descriptions:

4. Process Flow (Activity Diagrams)

4.1 Chatbot Interaction Flow

This diagram illustrates the logic executed when a user interacts with the demo chatbot on demo.html.

flowchart TD A[User loads demo.html] --> B[Bot displays welcome message] B --> C[User types message in input field] C --> D{User clicks Send OR Presses Enter?} D -- No --> C D -- Yes --> E{Is input string empty?} E -- Yes --> C E -- No --> F[Render User Message Bubble] F --> G[Trigger 800ms Timeout] G --> H[Convert input to lowercase] H --> I{Includes 'hello' or 'hi'?} I -- Yes --> J[Set botReply = Greeting String] I -- No --> K{Includes 'price' or 'pricing'?} K -- Yes --> L[Set botReply = Pricing Info String] K -- No --> M[Set botReply = Default Fallback String] J --> N[Render Bot Message Bubble] L --> N M --> N N --> O[Auto-scroll chat to bottom] O --> C

4.2 Contact Form Submission Flow

This diagram details the validation and submission simulation process on contact.html.

flowchart TD A[User fills out Name, Email, Message] --> B[User clicks Submit Button] B --> C[JS 'submit' Event Listener triggered] C --> D[Execute event.preventDefault] D --> E[Fetch values from DOM inputs] E --> F{Validate: Are all fields NOT empty?} F -- No False --> G[Trigger Alert: Please fill in all fields] G --> A F -- Yes True --> H[Trigger Alert: Message sent successfully!] H --> I[Execute contactForm.reset] I --> J[Form inputs cleared, process ends]

5. Page-by-Page Specifications

Page File Core Components Behavior
Home index.html Hero Section, Feature Cards, CTA Static display. Buttons route to demo/pricing.
About about.html Avatar, Bio, Skill Tags, Mission Flexbox layout shifts to column on mobile.
Services services.html 3 Service Cards CSS Hover effects (translateY applied).
Demo demo.html Chat Window, Input, Send Btn Dynamic JS DOM injection. Auto-scrolls.
Pricing pricing.html 3 Tier Cards, Badge Middle card scaled via CSS transform.
Contact contact.html Form (3 inputs), Submit Button JS intercepts submit, validates, alerts.

6. UI/UX Design System

The visual consistency is maintained through CSS Custom Properties defined in the :root selector.

7. Testing & Quality Assurance

  1. Cross-Browser: Tested on Chrome, Firefox, Safari, and Edge.
  2. Responsive: Simulated viewports (Mobile 375px, Tablet 768px, Desktop 1440px).
  3. Functional: Verified empty input handling, case insensitivity in chatbot, and form clearing mechanisms.
  4. Link Integrity: Audited all anchor tags to confirm zero 404 errors locally.

8. Limitations & Future Enhancements

Current Limitations: No persistent storage (chat history lost on refresh). No backend (contact form simulates action). Rigid chatbot logic (relies on basic string matching).

Future Enhancements: Integrate localStorage. Connect form to EmailJS or Node.js backend. Replace if/else chatbot with OpenAI API.