chatbot-lambda β€” Estructura de Proyecto

A continuaciΓ³n se muestra de manera literal la estructura del proyecto chatbot-lambda. Puedes copiar directamente este Γ‘rbol para usarlo como referencia al crear directorios y archivos.

Estructura (literal)

πŸ“ chatbot-lambda/
β”œβ”€β”€ πŸ“„ pyproject.toml                # Dependencias (Poetry)
β”œβ”€β”€ πŸ“„ template.yaml                 # AWS SAM Template
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ main/
β”‚   β”‚   β”œβ”€β”€ πŸ“ python/
β”‚   β”‚   β”‚   └── πŸ“ chatbot/
β”‚   β”‚   β”‚       β”œβ”€β”€ 🏒 domain/
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ πŸ‘€ model/
β”‚   β”‚   β”‚       β”‚   β”‚   └── message.py             # Entity: Message, Response
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ βš™οΈ service/
β”‚   β”‚   β”‚       β”‚   β”‚   └── conversation_rules.py  # Business rules
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ πŸ“’ event/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ base_event.py
β”‚   β”‚   β”‚       β”‚   β”‚   └── user_message_event.py
β”‚   β”‚   β”‚       β”‚   └── ✍️ command/handlers/
β”‚   β”‚   β”‚       β”‚       └── chatbot_command_handler.py
β”‚   β”‚   β”‚       β”œβ”€β”€ 🧩 application/
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ πŸ“© command/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ send_message_command.py
β”‚   β”‚   β”‚       β”‚   β”‚   └── command_handler.py
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ ❓ query/
β”‚   β”‚   β”‚       β”‚   β”‚   └── get_conversation_query.py
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ ➑️ port/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ input/
β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   └── chatbot_usecase.py
β”‚   β”‚   β”‚       β”‚   β”‚   └── output/
β”‚   β”‚   β”‚       β”‚   β”‚       β”œβ”€β”€ message_repository_port.py
β”‚   β”‚   β”‚       β”‚   β”‚       └── event_publisher_port.py
β”‚   β”‚   β”‚       β”‚   └── βœ… service/
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ command/
β”‚   β”‚   β”‚       β”‚       β”‚   └── send_message_service.py
β”‚   β”‚   β”‚       β”‚       └── query/
β”‚   β”‚   β”‚       β”‚           └── get_conversation_service.py
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ”Œ adapter/
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ 🌐 rest/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ chatbot_controller.py
β”‚   β”‚   β”‚       β”‚   β”‚   └── health_controller.py
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ πŸ’Ύ persistence/
β”‚   β”‚   β”‚       β”‚   β”‚   └── message_repository_adapter.py
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Ξ» lambda/
β”‚   β”‚   β”‚       β”‚   β”‚   └── lambda_handler.py
β”‚   β”‚   β”‚       β”‚   └── πŸ’¬ events/
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ sns_event_publisher_adapter.py
β”‚   β”‚   β”‚       β”‚       └── sqs_event_listener.py
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ’‰ config/
β”‚   β”‚   β”‚       β”‚   └── app_config.py
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ—οΈ infrastructure/
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ exception_handler.py
β”‚   β”‚   β”‚       β”‚   └── metrics_collector.py
β”‚   β”‚   β”‚       └── πŸš€ main.py                      # FastAPI entrypoint
β”‚   β”‚   └── πŸ“ resources/
β”‚   β”‚       β”œβ”€β”€ βš™οΈ config.yml
β”‚   β”‚       └── πŸ“‚ static/
β”‚   β”‚           └── index.html                      # UI del chatbot
β”‚   └── πŸ§ͺ test/
β”‚       └── test_send_message_service.py
└── πŸ“ build/
    └── chatbot-lambda.zip
Nota: Los Γ­conos y comentarios (por ejemplo "Entity: Message, Response") son parte de la visualizaciΓ³n para facilitar la creaciΓ³n de archivos y no son obligatorios en los nombres de ficheros. Puedes crear los archivos tal como aparecen (p. ej. message.py, conversation_rules.py, etc.).