How labhansh2/prorev works
Main Components
• Client Interface: Represented by client.py and the distributed Windows executable versions (found in the “dist” directory) that provide a user-friendly way to input credentials (integration token, page name) and trigger notifications.
• Backend Service / Core Engine: main.py serves as the entry point when running the service locally or hosting it in the cloud.
• Prorev Package (Business Logic Layer): This is the heart of the project and includes:
• prorev/Notion.py: Contains logic to interact with the Notion API.
• prorev/data.py: Manages the data models or interactions with the database (data.db held in /data and duplicate in /dist/data).
• prorev/rev_model.py: Likely implements the gapped revision or spaced repetition logic.
• prorev/notification.py: Manages the scheduling and triggering of notifications.
• prorev/log_config.py: Sets up logging configuration for the application.
• __init__.py: Marks the package.
• Database and Data Storage: The data folder (and its duplicate in “dist/data”) contains the data.db file used for storage.
• Logs: A directory dedicated to storing logfile.log for tracking and debugging.
• Additional Assets: The img folder includes visual assets (for the README, e.g., learning curves/descriptions) and might also be used by the client interface to render a user interface or presentation elements.
Relationships and Data Flow
• User Input Flow: In the client desktop app or via the script on the cloud, users provide their API token and page name. This input is then passed to the main engine (main.py) which interacts with the Notion API.
• Business Logic Layer: main.py calls functions from the prorev package modules (such as Notion.py, notification.py, and rev_model.py) to process the integration, fetch or update data, and plan revisions.
• Data Persistence: All interactions that result in data updates are saved in the data.db file, ensuring that user data (and possibly revision schedules) are persistent.
• Notifications: Once the data is processed and the reading plan is generated, the notification module schedules and issues notifications. Logging throughout this process is handled by the log_config module, with logs stored in the logs directory.
• Packaging and Distribution: The “dist” folder duplicates essential files for distribution, including compiled executables for the client app (main.exe and prorev.exe), making the project accessible without needing to run the scripts directly.
Architectural Patterns or Design Principles
• Separation of Concerns: Different modules handle API interactions, business logic, notification scheduling, and logging.
• Modular Design: The prorev package divides functionality into clearly defined modules, making it easier to maintain and extend.
• Dual Deployment Modes: The architecture supports both a desktop client (for local usage) and a cloud-deployed service.