How tuanduy35399/chat_bot_maivang-backend works
This is a Django REST backend for a Vietnamese mai-tree disease chatbot. Users can browse a disease guide, manage accounts, and create chat histories; chat requests are sent to an external AI service, while image-chat requests first send the uploaded image to a YOLO service and then send detections to the AI service. The README also describes image uploads as illustrative rather than AI recognition, which differs from the sampled backend implementation. Relationships below follow sampled calls, indexed references, and documented capabilities; unsampled URL wiring and other details are omitted where not evidenced.
Main entry points: history/views.py Chat and history API · settings.py Django configuration · urls.py API routing · user/views.py Account endpoints
Components 16
API and identity
- API routing
backend/urls.py - Account endpoints
user/views.py - Account serialization
user/serializers.py - User accounts
user/models.py
Disease guide
- Disease endpoints
diseases/views.py - Disease serialization
diseases/serializers.py - Disease catalog
diseases/models.py
Chat and diagnosis
- Chat and history API
history/views.py - Chat serialization
history/serializers.py - Chat records
history/models.py
Runtime and storage
- Django configuration
backend/settings.py - Application database
Other components
- API user
- Text AI service
- YOLO service
- Image AI service
Connections 22
- API user → API routing: sends requests
- API routing → Account endpoints: routes to
- API routing → Disease endpoints: routes to
- API routing → Chat and history API: routes to
- Account endpoints → Account serialization: serializes with
user/views.py - Account endpoints → User accounts: queries
user/views.py - Account serialization → User accounts: serializes
user/serializers.py - Disease endpoints → Disease serialization: serializes with
diseases/views.py - Disease endpoints → Disease catalog: queries
diseases/views.py - Disease serialization → Disease catalog: serializes
diseases/serializers.py - Chat and history API → Chat serialization: validates with
history/views.py - Chat and history API → Chat records: reads and writes
history/views.py - Chat and history API → Text AI service: posts chat
history/views.py - Chat and history API → YOLO service: posts image
history/views.py - Chat and history API → Image AI service: posts detections
history/views.py - Django configuration → Application database: configures
backend/settings.py - Django configuration → Text AI service: sets endpoint
backend/settings.py - Django configuration → YOLO service: sets endpoint
backend/settings.py - Django configuration → Image AI service: sets endpoint
backend/settings.py - User accounts → Application database: persists records
- Disease catalog → Application database: persists records
- Chat records → Application database: persists records