How eftimovdaniel/klinicka_bolnica works
This is a Macedonian hospital web application with patient, clinician, and administrator workflows, plus a conversational AI assistant. Users reach backend APIs through the web frontend; the backend serves hospital information, appointments, clinical actions, administration, and AI chat, with MySQL as persistent storage. The AI layer normalizes and classifies questions, dispatches intents, and implements domain-specific responses and actions. The tree and source index establish broad capabilities, but the supplied excerpts do not show all frontend-to-API or route-to-AI wiring; those connections are omitted where unverified.
Main entry points: main.py Application entry · database.py Database access · handlers.py Intent dispatch · zavrshi_pregled.py Complete examination
Components 25
Web client
- Hospital website
frontend/script.js - AI chat UI
frontend/ai_chat.js - Session UI
frontend/session.js
Backend API
- Application entry
backend/main.py - Patient API
backend/routers/pacienti.py - Doctor API
backend/routers/lekari.py - Appointments API
backend/routers/termini.py - Administration API
backend/routers/admin.py - AI chat API
backend/routers/ai_chat.py
AI assistant
- Intent dispatch
backend/ai/_kernel/handlers.py - Intent detection
backend/ai/_kernel/intent_detector.py - Text normalization
backend/ai/_kernel/transliteracija.py - AI provider client
backend/ai/_kernel/groq_client.py
Clinical workflows
- Doctor discovery
backend/ai/opsto/lekari_oddel.py - Slot availability
backend/ai/pacient/slobodni_termini.py - Appointment booking
backend/ai/pacient/zakazi_termin.py - Patient appointments
backend/ai/pacient/moi_pregledi.py - Complete examination
backend/ai/lekar/zavrshi_pregled.py - Job applications
backend/ai/pacient/apliciraj_za_rabota.py
Data and security
- Database access
backend/database.py - Hospital database
- Chat persistence
backend/ai_chat_store.py - Session authentication
backend/session_auth.py - Request security
backend/bezbednost/zastiten_slob.py
Other components
- Hospital user
Connections 23
- Hospital user → Hospital website: uses
- Hospital user → AI chat UI: asks
- Hospital website → Application entry: requests
- AI chat UI → AI chat API: sends chat
- Session UI → Session authentication: uses session
- Application entry → Patient API: registers
backend/main.py - Application entry → Doctor API: registers
backend/main.py - Application entry → Appointments API: registers
backend/main.py - Application entry → Administration API: registers
backend/main.py - Application entry → AI chat API: registers
backend/main.py - Application entry → Request security: configures
backend/main.py - Application entry → Session authentication: imports
backend/main.py - Application entry → Database access: imports
backend/main.py - Database access → Hospital database: connects
backend/database.py - Intent dispatch → Intent detection: uses fallback
backend/ai/_kernel/handlers.py - Intent dispatch → Text normalization: normalizes fallback
backend/ai/_kernel/handlers.py - Intent dispatch → Doctor discovery: dispatches fallback
backend/ai/_kernel/handlers.py - Doctor discovery → Slot availability: uses booking context
backend/ai/opsto/lekari_oddel.py - Slot availability → Database access: queries
backend/ai/pacient/slobodni_termini.py - Complete examination → Database access: updates
backend/ai/lekar/zavrshi_pregled.py - Complete examination → AI provider client: extracts details
backend/ai/_kernel/groq_helpers.py - Job applications → Database access: reads and writes
backend/ai/pacient/apliciraj_za_rabota.py - Chat persistence → Database access: uses
backend/ai_chat_store.py