AI Chatbox
Aug. 2025 - Dec. 2025
AI Chatbox is a conversational platform that allows users to create accounts, manage chat sessions, and interact with an AI assistant in a clean and responsive interface. The system stores user messages in a structured database, supports multiple organized chat histories, and delivers contextual responses powered by an integrated AI model. With features like secure authentication, dynamic message rendering, session tracking, and a polished user experience, AI Chatbox provides an intuitive environment for users to hold ongoing, personalized conversations with an AI.
Languages Used:
- PHP(OOP+MVC), Javascript (OOP), Python (OOP), SQL, HTML, CSS
Frameworks/Technologies Used:
- AJAX, Langchain, Bootstrap, Gemini API
Key Features:
Signup & Login System with Email Verification Codes
-
Users register through a verification-code workflow.
Session variables track authenticated users, allowing secure movement between pages after login.
Object-Oriented Architecture
-
Built using a structured OOP design with abstract base classes to enforce consistent functionality across controllers and services.
-
Uses inheritance so controllers (e.g., HomeController, DashboardController) extend a shared base Controller class, keeping routing and data-handling logic uniform.
-
Separation of concerns through dedicated classes:
- Controllers handle page logic
- Views manage output and rendering
- Service classes (e.g., ContactMailService) handle specific operations such as sending mail
-
Relies on encapsulation to protect internal state—database access, validation, formatting, and mail logic are stored in dedicated classes rather than mixed into page code.
-
Uses extensions and overridden methods to allow individual pages (Home, Dashboard, Contact) to implement their own behavior while still following a shared structure from the parent classes.
-
Encourages clean, reusable code by organizing the project into clear layers (Controllers → Services → Views → Database).
MySQL-Backed User, Chat & Message Linking
-
Each user has multiple chats.
-
Each chat contains multiple messages.
-
All tables use foreign keys to maintain relational integrity.
This creates a clean, scalable structure for storing conversations.
AI-Driven Chatbox
-
Loads each user's previous messages from MySQL to rebuild the full conversation context.
-
Uses Python + LangChain to process the dialogue and generate the next AI response using a custom LangGraph workflow.
-
Maintains conversation continuity through a memory checkpoint system that keeps each chat thread consistent.
-
Each user can have multiple chats, and each chat stores multiple messages tied together with foreign keys.
-
AJAX sends messages to the Python backend and returns AI responses instantly for a smooth, real-time experience.
Responsive Frontend Interface
-
Built with HTML, CSS, and Bootstrap, ensuring a clean, modern, mobile-friendly layout across all screens.
-
Uses custom JavaScript to handle dynamic UI updates, form interactions, and smooth user experience.
-
AJAX powers real-time interactions—sending messages, loading chats, and updating content without refreshing the page.
-
Provides immediate visual feedback (e.g., loading indicators, message insertion, auto-scrolling) to make the interface feel fast and responsive.
-
Frontend sections are structured into clear page components (home, dashboard, chat, contact form) to maintain consistent design and user flow.