How dust-tt/dust works
• Frontend Clients:
• The “front” directory (a Next.js/React application) which likely powers the primary web user dashboard.
• The “extension” directory, which appears to contain code for a browser extension (e.g., Chrome extension).
• “sparkle” – a UI component library and design system that provides reusable building blocks.
• “viz” – for visualization purposes.
• Backend Services:
• “core”: A Rust-based core API and service layer handling business logic, migrations, and internal processing.
• “connectors”: A large, TypeScript-based module managing integrations with third-party systems (e.g., Google Drive, Slack, Notion, etc.). This module includes admin scripts, migrations, temporal workflows, and API routing.
• “sdks”: Provides client libraries (JavaScript SDK) to help third parties interact with the Dust platform.
• Asynchronous and Job Processing:
• Temporal jobs appear in both the “alerting”, “connectors”, “core”, and even in “front/temporal” directories. These represent background workflows (activities, signals, workers, workflows) for tasks like data synchronization, file processing, and scheduled clean-ups.
• Infrastructure & DevOps:
• Dockerfiles (in “dockerfiles” and in the root) and GitHub workflows (under “.github”) show how the system is built, tested, and deployed.
• Migration scripts (present in “connectors/migrations”, “core/bin/migrations”, “front/migrations”, and “migrations/db”) indicate a structured approach toward managing the database schema.
• External Integrations:
• The connectors and OAuth directories within “core” and “connectors” illustrate integrations with external APIs and authentication providers.
• The project mentions various providers (e.g., Slack, Notion, GitHub, Google Drive) and includes specific modules or temporal jobs for each.
Relationships and Interactions
• Data Flow between Frontend and Backend:
• The “front” application communicates with the backend core API (exposed via Next.js API routes and REST endpoints).
• The “extension” likely communicates with backend services either via secure API calls or through a dedicated messaging layer.
• Internal Communication among Backend Modules:
• The “core” service (in Rust) likely provides the foundation for business logic and interacts with the connectors to trigger integrations.
• The “connectors” service (in TypeScript) interacts with external APIs and triggers asynchronous tasks via Temporal workflows.
• Asynchronous Processing:
• CI/CD and Deployment:
• GitHub workflows automate the build, lint, test, and deploy steps for each module, and Dockerfiles suggest that containerization is used for deployment.
• Data and Storage:
• Although not explicitly listed, the multiple database migration scripts (SQL files) suggest a centralized persistent data store (likely relational, such as PostgreSQL) that all backend modules interact with. Also, caching (e.g., Redis) might be included in the “core” and “connectors” libraries.
Architectural Patterns and Design Principles
• Modular/Monorepo Organization:
• Separate directories for each functional area (core, connectors, front, extension, sparkle, etc.) show a modular approach.
• Microservices / Service Separation:
• Backends are divided into distinct services (core business services in Rust, connectors in TypeScript) with a clear separation of concerns.
• Event-Driven / Asynchronous Workflow:
• The Temporal integration signifies an event-driven design for background tasks and inter-service coordination.
• API Gateway / Aggregation:
• The Next.js “front” application likely acts as a composition layer or API gateway to aggregate data from various services.
• Containerization and CI/CD:
• Use of Dockerfiles and GitHub Actions indicates deployment automation along with consistent environments for development and production.