A simple, responsive chatbot application built with Flask, SQLite, and the Gemini API. This application features user authentication, chat functionality, and admin controls.
Clone the repository:
git clone https://github.com/soroushmb/gemini-chatbot.git
cd gemini-chatbot
Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install the required packages:
pip install flask google-generativeai werkzeug python-dotenv
Set up environment variables by creating a .env
file:
# Copy the example .env file
cp .env.example .env
# Edit the .env file with your actual values
# Replace the placeholder values with your actual API keys and secrets
Initialize the database:
flask init-db
Run the application:
flask run
Open your browser and navigate to http://127.0.0.1:5000/
gemini_chatbot/
├── app.py # Main Flask application
├── schema.sql # Database schema
├── .env # Environment variables (create from .env.example)
├── .env.example # Example environment variables file
├── static/
│ ├── css/
│ │ └── style.css # Custom CSS (not used with Tailwind)
│ └── images/
│ ├── mind1.svg # Random mind logos
│ ├── mind2.svg
│ └── mind3.svg
└── templates/
├── admin/
│ ├── dashboard.html # Admin dashboard
│ ├── user_chats.html # User chat history
│ └── users.html # User management
├── auth/
│ ├── login.html # Login page
│ └── register.html # Registration page
├── base.html # Base template
├── chat.html # Chat interface
└── profile.html # User profile
.env
file and never committed to version control.MIT