A full-stack, production-grade Question Answering Chatbot built using Gemini API, Python Flask, and Bootstrap. This app mimics the ChatGPT-style UI by rendering structured Markdown responses from Gemini, including code blocks, headers, and lists.
Image
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, Bootstrap 5, Vanilla JS |
| Backend | Python, Flask |
| AI/LLM | Google Gemini Pro (via google-generativeai) |
| API Key Mgmt | python-dotenv |
| Markdown Rendering | markdown Python library |
- β ChatGPT-style Markdown rendering (code blocks, headings, lists)
- β
Gemini-powered accurate responses using
gemini-pro - β Clean Bootstrap UI with responsive design
- β JavaScript-powered asynchronous chat (no page reload)
- β Error-handling for broken requests
- β Easily extensible to include login, memory, tools, etc.
gemini_chatbot/
βββ app.py # Flask backend
βββ .env # API keys (not shared)
βββ requirements.txt # Dependencies
βββ templates/
β βββ index.html # Frontend UI
βββ static/
β βββ style.css # Optional custom styles
git clone https://github.com/<your-username>/gemini-chatbot.git cd gemini-chatbot
GEMINI_API_KEY=your_gemini_api_key_here
π Keep this file private and never share your API key publicly.
pip install -r requirements.txt
If you donβt have requirements.txt, manually install:
pip install flask google-generativeai markdown python-dotenv
python app.py
Then visit: http://127.0.0.1:5000
| Prompt | Response Style |
|---|---|
Give for loop code in Python |
Code + explanation |
What is a dictionary in Python? |
Bullet points + example |
Write HTML code for a login form |
Rendered code block |
Explain AI in 3 bullet points |
Structured Markdown |
You can easily extend this app into:
- π User authentication system
- π¬ Persistent chat history (local DB / SQLite)
- π§ LangChain or Agentic AI integration
- π§Ύ Export conversation to PDF or Markdown
- π Deploy on Render, Vercel, or Railway
- π² Mobile-responsive design
| Platform | Status |
|---|---|
| Render.com | β Easy Flask deploy |
| Railway.app | β One-click deploy |
| Heroku (legacy) | |
| Docker | β Production-ready container |
This project is licensed under the MIT License. Feel free to fork, modify, and use in commercial or educational projects. β
π Developed by Md Emon Hasan π§ Email: iconicemon01@gmail.com πΌ GitHub: Md-Emon-Hasan π± WhatsApp: +8801834363533