Skip to content

Conversation

@syed-mujtaba-stack
Copy link

This PR upgrades the existing Chat Application into a secure, scalable AI-Powered Todo Chatbot by refactoring the core architecture, fixing security flaws, and adding major new features including task management and AI chat support.

🔧 Architecture Refactor (Security & Stability)
❌ Previous Issues

Client connected directly to MySQL, exposing DB credentials.

Required a local database installation on every client machine.

Tight coupling between UI and persistence logic.

✅ Improvements

Implemented a Thin Client / Server-centric architecture.

Moved all database logic to the server via db_manager.py.

Replaced MySQL with SQLite (chatbot.db) for zero-config portability.

Added a secure AUTH handshake protocol between Client and Server.

This significantly improves security, deployment simplicity, and maintainability.

✨ New Features
📝 Todo List Management

Added a dedicated Todo List tab in the GUI.

Users can:

Add tasks

List tasks

Mark tasks as completed

Tasks are persisted server-side and survive restarts.

🤖 AI Chat Integration

Added an AI Bot users can chat with.

Introduced AIHandler abstraction for LLM routing.

Ready for Gemini / OpenAI API keys via environment variables.

Falls back to Echo Mode when no API key is provided.

🧹 Code Quality & Testing

Refactored Server.py to cleanly handle multiple command types.

Simplified and stabilized threading logic in Client.py.

Added verification and regression tests:

test_architecture.py – Auth & client/server separation

test_todos.py – Todo CRUD logic

test_ai.py – AI bot response handling

Added .env.example and improved .gitignore.

✅ Verification Checklist

Server runs without external dependencies

Client authenticates using server-side auth

Todos persist across restarts

AI Bot responds correctly

@syed-mujtaba-stack
Copy link
Author

Hi 👋
This PR introduces a full architecture refactor along with Todo and AI chat features.
Happy to make changes or improvements based on feedback. Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant