How akshay-gurav-31/chatbot-helath works
Project type and purpose
• This is a monolithic full-stack web application built with Flask (Python) serving a single-page UI.
• Purpose: AI-powered health assistant that supports chat, image uploads, speech input, theming, session-based memory, and multi-language script detection.
File structure
Top-level:
• app.py – Flask app entry point, defines routes, session handling, file uploads, and Gemini API calls
• script_detector.py – Language/script detection logic (e.g., Hindi vs Marathi, Devanagari vs Roman)
• test_script_detection.py – Unit tests for the detection module
• requirements.txt – Python dependencies (Flask, Gemini client, etc.)
• .env – Environment variable (GEMINI_API_KEY)
Directories:
• templates/index.html – Jinja2 HTML template for the chat UI
• static/app.js – Vanilla JS: chat UI logic, Web Speech API integration, markdown rendering, theme toggle
• static/style.css – CSS with variables for dark/light modes
• __pycache__ – Compiled Python bytecode
README for additional insights
• Backend: Flask sessions (UUID-based chat IDs), in-memory file handling, CSRF protection
• AI: Google Gemini 2.0 Flash via REST
• Frontend: Single-page chat interface, image attachments, voice input, markdown support, responsive design
• No persistent database—state lives in Flask session