Skip to content

gitgyana/ginger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ginger AI Chatbot

A responsive, animated AI chatbot powered by IBM Watson Assistant, built with Flask (Python), MongoDB, and a modern HTML/JS/CSS frontend.


Features

  • Natural conversation using IBM Watson Assistant through a web interface
  • Chat history storage per session using MongoDB
  • Animated background (Canvas stars effect)
  • Responsive, modern UI
  • One-click session reset (clear chat)
  • Easy deployment via Flask

Technologies Used

  • Python (Flask) — backend API
  • IBM Watson Assistant — AI-powered conversation
  • MongoDB — message history per session
  • HTML/CSS/JS — custom frontend interface and effects

Getting Started

Prerequisites

  • Python 3.7+
  • Pip
  • MongoDB Atlas or local MongoDB instance
  • IBM Cloud account with Watson Assistant setup

Installation

  1. Clone the repository
git clone https://github.com/gitgyana/ginger.git
cd ginger
  1. Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Create credentials.py Add your API keys and MongoDB URL:
api_key = "YOUR_IBM_WATSON_API_KEY"
assistant_id = "YOUR_IBM_WATSON_ASSISTANT_ID"
assistant_url = "YOUR_WATSON_ASSISTANT_URL"
mongodb_url = "YOUR_MONGODB_CONNECTION_STRING"
  1. Start MongoDB (if using local setup).
  2. Run the Flask app
python app.py

The app by default runs on http://0.0.0.0:5000. 7. Visit in Browser Open http://localhost:5000/ to interact with your chatbot.


Usage

  • Type a message in the chatbox and hit Send or press Enter.
  • Click the trash/reset icon to clear chat and start a new conversation session.
  • Each new session is also recorded in MongoDB for history.

File Structure

ginger-ai-chatbot/
│
├── app.py             # Flask backend & IBM Watson API
├── credentials.py     # Your secret credentials (not included here)
├── templates/
│   └── index.html     # Main HTML page
├── static/
│   ├── script.js      # Frontend JS (chat logic + canvas effect)
│   └── style.css      # Main Stylesheet
├── requirements.txt   # Python requirements
├── README.md

Customization

  • Chatbot Tone & Model: Adjust logic in app.py and your Watson Assistant instance as needed.
  • UI: Edit style.css and HTML structure for theming or layout changes.
  • Effects: The starfield in script.js can be tweaked or replaced.

FAQ

Q: "Oops! Something went wrong. ... IBM's enterprise servers..." appears. A: This appears when the backend Watson API fails or has expired. Double-check your API keys/limits and ensure your IBM Watson Assistant instance is active.

Q: How is MongoDB used? A: Each new Watson Assistant session gets its own collection in MongoDB, where user/assistant message pairs are stored.


Credits


Happy chatting! 🤖

Please remember to secure your API credentials! Never commit credentials.py or other secrets to public repositories.


About

Personalized AI Chatbot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published