How flowerautomation/flower works
Main Components
• Core Abstraction/Protocol Layer:
• This includes components like “flower-common” (which contains shared configuration, credentials, macros, and other common code) and “flower-proto” (which defines the common protocols for messaging, repositories, teams, and trackers).
• Integration Implementations:
• Several separate modules exist for different integrations, including:
• flower-integration-default
• flower-integration-exchange
• flower-integration-github
• flower-integration-gitlab
• flower-integration-jira
• flower-integration-slack
• flower-integration-tfs
• These modules implement the protocols defined in the core layer (and often use the “checkouts” mechanism to include common dependencies and shared logic).
• Feature-Specific Libraries:
• flower-messaging (for messaging functions),
• flower-repository (for repository functions),
• flower-team (for team-related functionalities),
• flower-tracker (for task tracking functions),
• flower-utilities (for miscellaneous utilities).
• Build/Template Components:
• The “lein-template” directory shows that Flower provides a project template, which can be considered an optional layer for users setting up new applications using Flower.
Relationships and Data Flow
• Each integration module (such as flower-integration-github or flower-integration-jira) implements specific interfaces defined by the core. They might also interact with the higher-level service libraries (messaging, repository, tracker) which provide a simplified API for external consumers.
• The feature libraries (like flower-tracker) interact with the corresponding integration modules to perform operations such as accessing tasks, merging pull requests, or sending notifications. Data flows from an external consumer (for example, via the command-line interface or an Emacs package) to these core functionalities.
• Optionally, show the build and deployment part (e.g., project.clj and configuration resources), which are used for building and deploying Flower as both a library and an Emacs package.
Architectural Patterns and Design Principles
• Dependency Inversion: The integrations depend on the abstract protocols (in flower-proto) rather than a concrete implementation, which allows you to swap different systems with ease.
• Use of “checkouts”: Many integration modules include “checkouts” of common libraries (such as flower-common or flower-proto), which illustrates a dependency reuse strategy within the project.
• Layered Architecture: Clearly separate the core abstraction (protocol layer), the integration implementations, and the higher-level usage libraries (messaging, tracker, etc.).
Elements
• An annotation that the project uses Leiningen for building and that it adheres to a modular design with well-separated integration concerns.
Important Additional Notes
• Extensibility: Indicate that new integrations can be added due to the protocol-based design and modular structure.
• Adding metadata like key configuration paths (e.g., configuration files in flower-common/resources/config.edn) and mention the use of caching (as per the README’s note on implicit caching and cache clearing macros).