Skip to content

Build Basic AI Tutor / Q&A Chatbot#11

Open
NiteshBadgujar wants to merge 3 commits intoGDGC-MET:mainfrom
NiteshBadgujar:EdutechAssistant-NiteshBadgujar
Open

Build Basic AI Tutor / Q&A Chatbot#11
NiteshBadgujar wants to merge 3 commits intoGDGC-MET:mainfrom
NiteshBadgujar:EdutechAssistant-NiteshBadgujar

Conversation

@NiteshBadgujar
Copy link

@NiteshBadgujar NiteshBadgujar commented Oct 9, 2025

🧠 Pull Request: Build Basic AI Tutor / Q&A Chatbot

🔢 Related Issue

Closes #2Build Basic AI Tutor / Q&A Chatbot


📋 Summary

This PR adds the initial implementation of the AI Tutor / Question-Answer Bot as described in Issue #1.
The chatbot allows users to ask subject-based questions (e.g., Math, Biology) and get AI-generated explanations.
All relevant documentation and setup guides are now included inside the /docs folder for contributors and reviewers.


🧩 Core Features Implemented

  • ✅ Created a chat interface (input box + message list)
  • ✅ Integrated a backend proxy for secure API communication
  • ✅ Added a subject filter dropdown (Math, Biology, etc.)
  • ✅ Displayed AI responses dynamically in the chat window
  • ✅ Implemented loading & error handling states

🔒 Security & Environment Setup

  • Added .env.example file for API key configuration
  • Updated .gitignore to exclude .env and local configs
  • Added mock mode (USE_MOCK=true) for contributors or CI to test without secrets
  • Backend proxy (/api/ask) handles all external LLM calls securely — no keys exposed in frontend

⚙️ How to Run Locally

  1. Clone the repo and switch to this branch:
    git checkout feature/ai-tutor-bot

Copy .env.example to .env

bash
Copy code
cp .env.example .env
Add your API key inside .env (or set USE_MOCK=true to use mock responses).

Run the app:

bash
Copy code
npm install
npm run dev
Open http://localhost:3000 and test the chat interface.

💡 Tech Stack
Frontend: React / Next.js

Backend: Node.js + Express

AI Provider: OpenAI or Hugging Face API (through backend proxy)

🚀 Future Enhancements (Planned)
🔉 Voice input (speech-to-text)

💾 Save recent Q&A history

📚 Multi-subject support with dynamic models

🧱 Folder Structure (Simplified)
pgsql
Copy code
/frontend
├── components/
│ ├── ChatBox.jsx
│ └── Message.jsx
├── pages/
│ └── index.jsx
└── .env.example

/backend
├── server.js
└── package.json
🤝 Contribution Notes
If you’re contributing:

Fork the repository

Create a branch — feature/ai-tutor-bot

Commit your updates

Push and open a PR to main

Mention this issue in your PR description

✅ Checklist
Chat interface functional

Backend API integrated securely

Mock testing enabled

.env not committed

Documentation updated

screencapture-localhost-5174-2025-10-09-15_09_34

…messaging features

- Added main App component with gradient background and ChatContainer integration.
- Created ChatContainer component to manage chat UI and state.
- Developed ChatInput component with quick suggestions and message sending functionality.
- Implemented ChatMessage component for displaying individual messages with animations.
- Built ChatWindow component to show messages and loading indicators.
- Added SubjectSelector for selecting subjects with chip-style buttons.
- Integrated AI service for handling chat responses and error management.
- Established custom hooks for managing chat state and interactions.
- Designed responsive styles using Tailwind CSS for a modern UI.
- Included SVG assets and CSS for branding and visual effects.
- Set up TypeScript types for messages, subjects, and API requests.
…I Tutor

- Introduced PROJECT_OVERVIEW.md for project architecture and metrics.
- Created README.md as a documentation index for easy navigation.
- Added TESTING_GUIDE.md detailing backend, frontend, and performance tests.
- Updated server environment configuration to integrate Google Gemini API.
- Refactored aiService.js to utilize Google Gemini for AI responses.
- Enhanced .gitignore for better security and organization.
- Improved ChatMessage component with memoization for performance.
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.

Build Basic AI Tutor / Q&A Chatbot

2 participants