How kiwicom/starpicker works
Main Components
• Configuration Module – Represented by config.py. This module reads environment variables (e.g., SLACK_WEBHOOK_URL, REDIS_URL, API keys, and other settings).
• Collectors Module – Found in collectors.py. This component is in charge of communicating with external feedback sources such as trustpilot.com, Facebook, and Twitter.
• Reviews/Processing Module – Provided by reviews.py. This module likely handles the processing and possible formatting of the collected feedback.
• Runner/Execution Module – The run.py file serves as the entry point, orchestrating the periodic checks and managing the workflow.
• External Services – Indicate integrations for:
• Slack via SLACK_WEBHOOK_URL,
• Redis via REDIS_URL,
• Trustpilot, Facebook, and Twitter APIs using their respective API keys and tokens.
Relationships and Interactions
• The configuration reading process from config.py,
• The feedback retrieval process via collectors.py (which branches into separate collectors for each supported source).
• Once data is fetched, the Reviews module (reviews.py) processes or formats the feedback.
• Finally, the processed results trigger an outbound communication to Slack.
• Also, indicate that Redis is used as a caching or state management layer, perhaps to store the last checked state or deduplicate repeated notifications.
Architectural Patterns and Design Principles
• The design follows a modular approach where different responsibilities are separated into their respective files – a clear separation of concerns.
• There is a loosely coupled interaction between the data collection, review processing, and posting modules.
• Emphasis on an event or periodic scheduler pattern (in run.py) that handles the timely invocation of the collectors.
• External API integrations are abstracted inside the collectors, ensuring that the core logic remains modular and extensible.
Important Technologies and Frameworks
• Python is the primary language.
• Environment variable management is used for configuration.
• Integration with external services: Slack, Redis, and several external APIs for collecting feedback.
• Dockerfile and setup.py indicate deployment and packaging strategies.