How drdroidlab/playbooks works
Main Components
• Frontend Client: Represented by the “web” folder. This React/Vite based web interface is used to configure PlayBooks, view alerts, and interact with the system.
• Backend/API Layer: The central orchestration is provided by multiple Django apps (such as “accounts”, “playbooks”, “management”, “media”, “connectors”, “executor”, “engines”, etc.). Each module manages distinct aspects:
– Accounts and Authentication: Handles admin, user management, sessions, and API security.
– Playbooks: Manages the creation, storage, and execution of investigation documents.
– Connectors: Provides integrations with 15+ external observability tools and servers.
– Executor and Engines: Manages execution of tasks, command running, and query processing.
• Communication Layer (Protos): The “protos” directory shows that there is a well-defined contract (using Protocol Buffers) for internal and possibly external communication between microservices.
• Data Storage Layer: Implicit from the migration files and PostgreSQL helm chart, a relational database is used for persisting all the application data.
• Docker / Deployment: Dockerfiles, docker-compose, Helm charts, and associated scripts indicate containerized deployment and orchestration of services.
• External Integrations: Represent external observability tools, APIs, and servers (like CloudWatch, Grafana, elastic search, etc.) that are connected via the connectors subsystem.
• Workflows: The workflow components (under executor/workflows) provide support for task scheduling, event handling, and notification routing.
Relationships and Interactions
• The frontend (web client) communicates with the backend API through REST endpoints (or potentially via GraphQL) to manage playbook configurations, authenticate users, and request execution of investigations.
• The backend “playbooks” module and “executor” module work together to translate PlayBook definitions into a series of actions.
• The “connectors” module interacts with external systems: once a PlayBook is executed, connector assets and managers send commands or queries to external services.
• Communication between internal services is tightly controlled via defined Protocol Buffers interfaces (protos directory), indicating a microservice or modular internal architecture.
• A messaging or task queue (celery, as seen in the Helm charts for celery beat/worker) is used for asynchronous task execution in the executor subsystem.
Architectural Patterns
• Modular / Domain Driven Design: Each Django app (accounts, connectors, executor, playbooks, etc.) abstracts a separate domain.
• Layered Architecture: There’s a clear separation between the presentation layer (frontend), service layer (backend APIs and business logic), integration layer (connectors and engines), and persistence layer (database).
• Containerized Deployment: Docker and Helm charts denote container-based deployment with orchestration.
• Event-driven / Asynchronous Processing: Use of celery workers for managing background tasks.
• Use of Protobuf for inter-service communications further emphasizes clear interface definitions between components.
Relevant Technologies & Frameworks
• Python/Django for the backend with multiple dedicated apps.
• React and Vite for the frontend web client.
• Docker Compose & Kubernetes (via Helm charts) for container orchestration.
• Celery for asynchronous job processing.
• Protocol Buffers (protos) for data contracts.
• Database systems such as PostgreSQL (as indicated by the Helm chart).
• Integration with observability tools (like CloudWatch, Grafana, etc.) via custom connector code.
Final Advice
• Use layering (similar to OSI models) to separate concerns – this helps in understanding data flow from user interactions to backend execution and external integrations.