548d88fb2993d1ecb70c28898d0e9c0a449319a9
🤖 PY_ChatBot
A modular, secure, and extensible web-based chatbot platform built with Flask. Features include user authentication, session management, multi-database support, and a modern responsive UI.
📋 Table of Contents
- Features
- Demo
- Installation
- Configuration
- Usage
- Project Structure
- Docker Setup
- Contributing
- Troubleshooting
- License
✨ Features
-
User Authentication
- Registration, login, logout, and password change
- Email validation and strong password requirements
- Secure session cookies with configurable lifetime
-
Multi-Database Support
- Abstracted database layer
- Thread-safe SQLite implementation
- Ready for PostgreSQL/MySQL integration
-
Modern UI/UX
- Responsive templates: login, register, dashboard, profile, change password, 404
- Gradient backgrounds, animations, and hover effects
- Flash messages for real-time feedback
-
Security
- SHA-512 password hashing
- Decorators for route protection (
@login_required,@logout_required) - CSRF-ready and input validation utilities
-
Developer-Friendly
- Well-organized code:
config,database,frontend,models,services,utils - Comprehensive logging and error handlers
- Environment-based configuration
- Well-organized code:
🖥 Demo
Screenshots and live demo links can be added here.
🛠 Installation
Prerequisites
- Python 3.8+
- Git
Local Setup
-
Clone the repo
git clone https://github.com/florianuhlig/PY_ChatBot.git cd PY_ChatBot git checkout Development -
Create virtual environment
python -m venv .venv source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows -
Install dependencies
pip install -r requirements.txt -
Configure environment
Copy
.env.exampleto.envand adjust values:cp .env.example .env -
Run the app
python main.pyOpen your browser to
http://localhost:8080.
⚙️ Configuration
Edit .env for:
DB_TYPE(e.g.,sqlite,postgresql,mysql)SQLITE_PATH(path to SQLite file)FLASK_SECRET_KEYFLASK_DEBUG,FLASK_HOST,FLASK_PORT- Session and password policy variables
🚀 Usage
- Register:
/register - Login:
/login - Dashboard:
/dashboard(protected) - Profile:
/profile(protected) - Change Password:
/change-password(protected) - Logout:
/logout
📁 Project Structure
PY_ChatBot/
├── config/ # App configuration loader
│ └── database.py
├── database/ # DB abstraction and implementations
│ ├── interface.py
│ ├── sqlite_db.py
│ └── flask_integration.py
├── frontend/ # Flask application and templates
│ ├── app.py
│ └── templates/
│ ├── login.html
│ ├── register.html
│ ├── dashboard.html
│ ├── profile.html
│ ├── change_password.html
│ └── 404.html
├── models/ # Data models (if any)
├── services/ # Business logic: user and auth services
├── utils/ # Utility functions and decorators
├── .env.example # Environment variable template
├── Dockerfile # Container setup
├── docker-compose.yml # Orchestration
├── docker-entrypoint.sh # Init script
├── main.py # Entry point
└── requirements.txt # Python dependencies
Description
Languages
HTML
55.4%
Python
40.7%
Dockerfile
2%
Shell
1.9%