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
In Scope: 6 fully linked HTML pages, responsive CSS layout, interactive chatbot simulation, frontend form validation, UI animations.
Out of Scope: Backend database integration, real Natural Language Processing (NLP) API connections, user authentication, actual email sending.
2. System Architecture
The project follows a standard Separation of Concerns (SoC) architecture typical of modern frontend development.
Presentation Layer (HTML): Semantic markup structuring the UI into reusable components (Navbar, Footer, Cards).
Styling Layer (CSS): CSS Custom Properties (Variables) for theming, Flexbox/Grid for layout algorithms.
Logic Layer (JavaScript): Modular Vanilla JS handling DOM events, state changes, and algorithmic logic (chatbot responses).
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.
UIManager: Controls global UI states. Listens for clicks on the hamburger element to toggle the mobile menu.
ChatbotEngine: Manages the state of the demo chat. Listens to 'click' and 'keypress' events. Instantiates MessageEntity concepts by appending divs to the DOM based on string-matching logic.
FormHandler: Intercepts the default HTML form submission, checks for empty strings, triggers browser alerts, and resets the DOM state if successful.
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.
Color Palette: Primary (#0f172a), Secondary (#2563eb), Accent (#06b6d4).
Typography: System font stack for fast loading. Line height set to 1.6 for accessibility.
Responsive Breakpoint: Single breakpoint at 768px to collapse navigation and stack grids.
7. Testing & Quality Assurance
Cross-Browser: Tested on Chrome, Firefox, Safari, and Edge.
Functional: Verified empty input handling, case insensitivity in chatbot, and form clearing mechanisms.
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.