How klept0/ms-rewards-farmer works
Main Components
• Main Entry Point: Highlight main.py as the central script that initializes and orchestrates the execution.
• Authentication & Account Management: Emphasize the management of credentials from the accounts file (accounts.json) and any related login functionality (src/login.py).
• Functionality Modules: Show several functional components from the src/ directory such as:
• src/account.py
• src/activities.py (for modeling various daily actions)
• src/dailySet.py, src/punchCards.py, src/morePromotions.py, src/readToEarn.py, src/searches.py (each representing a distinct reward or search operation)
• src/browser.py (could serve as the abstraction layer over Selenium)
• src/utils.py and src/constants.py (supporting utilities and configurations)
• Configuration & Environment Setup: Include config.yaml and accounts.json (the user’s credentials file) as configuration data components.
• Tests: Represent the test suite (in the test folder) to indicate verification of system behavior.
• External Dependencies: Add a node for external resources (e.g., Selenium, Chrome browser, and third-party libraries as specified in requirements.txt) plus the Windows Task Scheduler XML generation (via generate_task_xml.py).
Relationships and Data/Control Flow
• From the Browser Controller, branch out to the different functionality modules (searches, daily set, punch cards, promotions, read-to-earn) as separate operations. Each module “calls” the automation layer.
• Integrate the Authentication & Account Management module (src/login.py and src/account.py) which feeds credentials and login state into the Browser Controller.
• Link the Logging and Notification component to every module that requires error and activity reporting.
• For Windows users, illustrate that generate_task_xml.py provides a scheduling configuration which, when imported into Task Scheduler, triggers main.py periodically.
Architectural Patterns & Design Principles
• Modularity: Demonstrate the separation of concerns by grouping functionality (e.g., searches, promotions, login) into separate modules within src/.
• Configuration Driven: Mark the configuration files as central to the application’s behavior.
• External Service Integration: Indicate integration with external tools (Chrome/ChromeDriver, Selenium, Apprise notifications, and Windows Task Scheduler).
• Testability: Represent the tests directory as supporting continuous integration practices.