Trợ lý lập trình thông minh với AI, hỗ trợ chat văn bản và giọng nói (tiếng Việt)
- 🎙️ Chat bằng giọng nói: Hỗ trợ nhận diện giọng nói tiếng Việt với Whisper
- 💬 Chat văn bản: Giao diện hiện đại, hỗ trợ Markdown
- 🔐 Xác thực đa dạng: Đăng nhập bằng Email/Password hoặc Google OAuth
- 💾 Lưu lịch sử: Quản lý nhiều cuộc hội thoại
- 🎨 Giao diện đẹp mắt: Dark theme, responsive
- 🚀 Hiệu năng cao: Sử dụng connection pool, async processing
- Flask - Web framework
- OpenAI GPT-4 - AI model chính
- Faster-Whisper - Speech-to-text (tiếng Việt)
- MySQL - Database
- Google OAuth 2.0 - Xác thực
- Vanilla JavaScript - Không framework
- Marked.js - Markdown rendering
- Font Awesome - Icons
- CSS3 - Styling hiện đại
git clone https://github.com/SilverFledgling/CodeMate-AI.git
cd CodeMate-AI# Backend
cd backend
pip install -r requirements.txt# Đăng nhập MySQL
mysql -u root -p
# Chạy script tạo database
mysql -u root -p < backend/database.sqlTạo file .env trong thư mục backend/:
cp .env.example .envChỉnh sửa file .env với thông tin của bạn:
OPENAI_API_KEY=your_openai_api_key_here
DB_PORT=3306
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=codemate_db
SECRET_KEY=your_secret_key_here
GOOGLE_CLIENT_ID=your_google_client_id_hereLấy API Keys:
- OpenAI API Key: https://platform.openai.com/api-keys
- Google Client ID: https://console.cloud.google.com/apis/credentials
# Trong thư mục backend/
python nlp_main.pyTruy cập: http://localhost:5000
CodeMate-AI/
│
├── backend/
│ ├── nlp_main.py # Flask server chính
│ ├── database.py # Database operations
│ ├── database.sql # Database schema
│ ├── requirements.txt # Python dependencies
│ └── .env # Config (không commit)
│
├── frontend/
│ ├── index.html # Trang chat chính
│ ├── login.html # Trang đăng nhập
│ ├── script.js # JavaScript logic
│ └── style.css # Styling
│
├── images/
│ ├── CodeMate_AI.png # Logo/favicon
│ ├── login-page.png # Screenshot login
│ └── main-interface.png # Screenshot main
│
├── .gitignore
├── .env.example
└── README.md
- ✅ Mật khẩu được hash bằng bcrypt
- ✅ Session-based authentication
- ✅ CORS được cấu hình chặt chẽ
- ✅ Google OAuth 2.0 token verification
- ✅ SQL injection protection với parameterized queries
# Windows
waitress-serve --port=5000 nlp_main:app
# Linux
gunicorn -w 4 -b 0.0.0.0:5000 nlp_main:app# Kiểm tra MySQL đang chạy
# Windows
net start MySQL80
# Linux
sudo systemctl start mysql# Model sẽ tự động tải lần đầu chạy
# Nếu lỗi, xóa cache và thử lại:
rm -rf ~/.cache/huggingface- Dark/Light mode toggle
- Export chat history
- File upload support
- Voice output (TTS)
- Multi-language support
- Code execution sandbox
Đức Quý Nguyễn
- GitHub: @SilverFledgling
- Email: ducnguyenptit2310@gmail.com
MIT License - xem file LICENSE để biết thêm chi tiết.
- OpenAI GPT-4 API
- Faster-Whisper (Systran)
- Google Identity Services
- Font Awesome Icons
⭐ Nếu project hữu ích, hãy cho mình một star nhé!


