- Category: IT Graduation Project (Đồ án Công nghệ Thông tin) - Healthcare & Appointment Management System.
- Frontend Environment: Pure HTML/CSS/Vanilla JS. Served via VS Code Live Server (
http://localhost:5500). - Backend Environment: PHP (REST APIs). Runs on XAMPP / Apache (
http://localhost/DO_AN/src/). - Database: MySQL. Managed via PhpMyAdmin (
http://localhost/phpmyadmin). - Local LLM Stack: AI Chatbot & Specialty Recommendation (
api/patient/ai-suggest-specialty.php).- Runner: Ollama (Port
11434) & AnythingLLM (Port3001). - Models:
qwen2.5:3b,qwen3:4b. - AnythingLLM Workspace:
test
- Runner: Ollama (Port
- External Services:
- Transactional Mail: Brevo API (SMTP/API integration for registrations, OTPs, reminders, and payment notifications).
- Cloud Media Storage: Cloudinary (secure image uploads for doctor avatars and user profiles).
- Payment Gateway: VNPAY.
- Production Deployment (Tested):
- Domain:
domainex.id.vn - Hosting: 123host Free Shared Hosting.
- Domain:
src/
├── index.html # Landing & entrypoint
├── *.html # Module-specific frontend views (Admin, Doctor, Patient dashboards)
├── assets/ # CSS stylesheets & client-side JS logic
├── components/ # Reusable HTML snippets (headers, footers, sidebars)
├── config/ # Core system configurations
│ ├── app-env.php # Global app environment & constants
│ ├── db-config.php / db.php # Database connection & credentials
│ ├── mail.php / mail-notifications.php # SMTP/Brevo config
│ ├── cloudinary.php # Cloudinary API settings
│ └── cors.php # CORS headers for API safety
├── api/ # Backend REST APIs (group-based routing)
│ ├── auth/ # Login, registration, OTP, password resets
│ ├── patient/ # Patient actions (booking, AI triage, medical records)
│ ├── doctor/ # Medical records update, queue management, leaves
│ ├── admin/ # CRUDs, statistics dashboards, configs, file exports
│ └── payment/ # VNPAY return handler
├── includes/ # Core helper utilities & transaction event handlers
│ ├── send-mail.php # Brevo SMTP wrapper
│ ├── cloudinary-upload.php # Cloudinary SDK wrapper
│ └── schedule-management.php # Appointment slot generators
├── cron/ # Background schedulers
│ ├── auto-cancel-expired-appointments.php
│ └── send-appointment-reminders.php
└── database/ # SQL migrations & seeds
├── db.sql # Primary schema and seed data
├── db_thuoc.sql # Medicine/pharmaceutical seed data
└── db_host.sql # Production-specific host database
- Patient (Bệnh nhân): Authenticates (OTP, email), books appointment slots, views personal medical records/history, receives Brevo email notices/reminders, asks AI for medical specialty recommendations.
- Doctor (Bác sĩ): Manages today's queue, updates diagnoses, prescribes medicine (linked to stock), submits leave requests.
- Administrator (Quản trị viên): Manages departments, doctor schedules, patient accounts, pharmaceutical stock, generates interactive PDF/Excel/CSV reports.
- Start MySQL in XAMPP.
- Access PhpMyAdmin -> Create a database (e.g.
eden_health). - Import
database/db.sqlanddatabase/db_thuoc.sqlto populate initial schemas, master lists, and sample datasets.
- Place project inside
C:\xampp\htdocs\DO_AN\src. - Ensure PHP version is
8.xor compatible with modern MySQLi. - Configure SMTP/Brevo credentials and Cloudinary credentials in
config/files.
- Open the workspace in VS Code.
- Launch
index.htmlvia Live Server (defaults tohttp://localhost:5500). - Ensure CORS in
config/cors.phpallows requests from port5500.
- Ollama: Install Ollama, fetch models:
ollama run qwen2.5:3b ollama run qwen3:4b
- AnythingLLM: Setup AnythingLLM on port
3001with workspacetest. - The PHP backend makes HTTP POST requests to
http://localhost:3001viaapi/patient/ai-suggest-specialty.phpusing the AnythingLLM API Key.
- API Payloads: Strictly
application/jsonfor requests & responses. - State Management: Session-based PHP authentication (
config/session.php). - AI Recommendation Flow:
- Patient enters description of symptoms.
- Frontend POSTs payload to
api/patient/ai-suggest-specialty.php. - API fetches available Specialties from DB to append to prompt.
- API routes request to Local LLM (AnythingLLM API on port 3001).
- JSON formatted specialties, confidence ratings, and reasoning are returned to the client.
- Stock Management: Medicine inventory is atomically updated when a Doctor completes a prescription record (
includes/medicine-stock.php).