An AI-powered chatbot designed to support individuals on their journey to quit smoking. Built with Flask and sentiment analysis to provide personalized emotional support, practical advice, and motivation.
QuitBit combines a Flask web backend with a pre-trained ML sentiment model and rule-based context detection to deliver real-time, emotionally supportive responses for users on their smoke-free journey.
- 🤖 AI-Powered Support - Uses Hugging Face sentiment analysis to understand user emotions
- 💬 Context-Aware Conversations - Smart responses tailored to smoking cessation challenges
- 💪 Motivational System - Dynamic encouragement and health benefit facts
- 📊 Progress Tracking - Real-time statistics on money saved, cigarettes avoided, and smoke-free time
- 🎯 Quick Actions - One-tap responses for common situations like cravings and stress
- 📱 Responsive Design - Beautiful, mobile-friendly interface with dark/light mode
- 🔒 Privacy Focused - All processing happens locally; no data stored permanently
- Python 3.8 or higher
- pip (Python package manager)
- Clone the repository
git clone https://github.com/Pavi-NP/QuitBit.git
cd QuitBit- Install dependencies
pip install -r requirements.txt- Run the application
python app.py- Open your browser and navigate to
http://localhost:5001
QuitBit/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── templates/ # Web interface templates
│ └── index.html # Main chat interface
└── static/ # Static assets
└── style.css # CSS styling with Tailwind
- Backend: Flask (Python web framework)
- AI/ML: Hugging Face Transformers for sentiment analysis
- Frontend: HTML5, Tailwind CSS, JavaScript
- Styling: Custom CSS with responsive design
- Security: GitHub secret scanning protection
-
User Input: Users share their feelings, challenges, or successes
-
Sentiment Analysis: AI model analyzes emotional tone of messages
-
Context Matching: Identifies smoking-related keywords and contexts
-
Personalized Response: Generates supportive, context-aware responses
-
Progress Tracking: Updates real-time statistics on quitting benefits
- Share feelings: "I'm having strong cravings today"
- Celebrate wins: "I stayed smoke-free for 3 days!"
- Seek advice: "How do I handle stress without smoking?"
- Get motivation: "Tell me why quitting is worth it"
- 24/7 emotional support during quitting journey
- Evidence-based coping strategies
- Motivational health facts and progress tracking
- Non-judgmental, always available companion
- Clean, modular Flask architecture
- Easy to extend with new features
- Modern responsive UI components
- Comprehensive error handling
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main chat interface |
/chat |
POST | Send message and get AI response |
/motivation |
GET | Get random motivational fact |
/health |
GET | Health check endpoint |
python app.pyFor production deployment, consider using:
- WSGI Server: Gunicorn or uWSGI
- Platform: Heroku, AWS Elastic Beanstalk, or DigitalOcean
- Reverse Proxy: Nginx
Example with Gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5001 app:appWe welcome contributions! Please feel free to submit pull requests for:
- New features and improvements
- Bug fixes
- Documentation enhancements
- UI/UX improvements
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Contact the maintainers
- Hugging Face for the sentiment analysis model
- Tailwind CSS for the beautiful UI components
- Flask community for the excellent web framework
- All contributors and users who help improve QuitBit
Made with ❤️ to help people live healthier, smoke-free lives
⭐ Star this repo if you find it helpful!