How jasper33977296/itri-intent-based-smo works
Project type and purpose
• This is a Django-based, multi-app backend service implementing intent-based conversation, metadata, topic, and workflow management. It exposes RESTful APIs (via Django REST Framework) and Actor components for asynchronous or stateful operations. It is meant to run in Docker (see Dockerfile, docker-compose.yml), and likely uses a relational database plus optional message broker (given services/broker.py and ASGI routing).
File structure
• Top-level: Docker/Docker-Compose, manage.py, main/ (the Django project), requirements/, and a shell/ helper.
• main/ splits into:
• apps/: four Django apps (conversation_mgt, metadata_mgt, topic_mgt, workflow_mgt), each with subfolders: actors/, api/, models/, serializers/, services/, templates/, tests/.
• settings/: environment‐specific settings.
• routing.py & asgi.py: support for asynchronous actors or WebSockets.
• utils/: shared utility modules (API kits, logging, file/text helpers).
• Presence of actors/ in each app suggests a domain‐driven or actor pattern layered on top of Django, possibly communicating through an in‐process or external message bus.
• docker-compose.yml suggests at least two external services: a relational database (Postgres/MySQL) and optionally a message broker (RabbitMQ/Redis).
Extract README insights
• The README only contains the project name “ITRI-Intent-Based-SMO,” confirming an intent‐based conversation/workflow orchestration service.
Main components and interactions
a. Components
1. Client(s):
– Mobile/Web front end or third‐party consumers calling the REST API.
2. API Gateway / Load Balancer (optional Docker service).
3. Django Service:
– WSGI (REST API endpoints)
– ASGI (Actors/WebSockets, if used)
– main/apps/… apps: Conversation, Metadata, Topic, Workflow.
– Shared Utils (logging, APIKit, FileKit).
4. Actor Layer (in‐process or external broker):
– Each app’s actors/ modules (ConversationManager, TextManager, etc.).
– Possibly backed by a message broker (RabbitMQ/Redis).
5. Services Layer:
– Business logic in services/ and controllers.
6. Data Layer:
– Django ORM Models and Migrations.
– External Relational Database (PostgreSQL/MySQL).
7. External Services:
– Message Broker (if used).
– Optional cache/Redis for channels or caching.
b. Relationships & data flow
1. Client → API Gateway → Django REST endpoints (api/views).
2. Views call Serializers → Models → Database CRUD.
3. For complex operations, Views/Services dispatch tasks to Actors.
4. Actors execute domain logic, update Models via Services/ORM.
5. Optional inter‐actor messaging via Message Broker.
6. Responses flow back to client through Views.
c. Architectural patterns and design principles
– Modular Django apps: each bounded context (conversation, metadata, topic, workflow).
– Clear separation: API layer → Serializer → Service/Actor → Model → DB.
– Actor pattern for asynchronous or stateful workflows.
– Dockerized micro‐services style (each Django instance + separate DB/broker).
– Environment segregation via multiple settings files.
d. Key technologies, frameworks, libraries
– Python 3.x, Django, Django REST Framework.
– ASGI (for Actors/Websockets).
– Docker + docker-compose.
– Relational DB (Postgres/MySQL).
– Message broker (RabbitMQ or Redis).
– Python actor library (custom or third-party).
– Utilities: custom APIKit, FileKit, TextDecorator, logger.
• [ ] All core components (Clients, API, Actors, DB, Broker) are present.
• [ ] Each Django app is represented (conversation, metadata, topic, workflow).
• [ ] Key technologies (Docker, Django, REST, ASGI, DB, Broker) are annotated.
• [ ] Environment/deployment context (Docker Compose) is implied or shown.
• [ ] Include legends or notes for any custom patterns (e.g., Actor pattern).
• [ ] Maintain a balance of detail: not every file, but each major layer and interaction.