How fredzj/rijksoverheid-opendata works
Main Components
• Configurations – The “config” folder contains the db.ini file (holding database credentials).
• Database – The “database” directory provides SQL schema files that initialize tables needed by the application.
• Import Jobs – The “jobs” directory includes PHP scripts (importSchoolHolidays.php and importTravelAdvice.php) and supporting classes (like Database.php, SchoolHoliday.php, TravelAdvice.php, etc.). These scripts are designed to be executed via cron jobs, which periodically pull updated data and store it in the database.
• Web Dashboard – The “public” folder contains the web-accessible part of the project. Here, the rijksoverheid.php script and its associated dashboard classes/templates (like RijksoverheidDashboard.php and the relevant template) provide a user interface for viewing the data.
Relationships and Interactions
• Cron Job Triggering: The import scripts (from the “jobs” folder) are scheduled to run at regular intervals (e.g., via cron) as detailed in the README. These jobs read data from the government endpoints, process the data using various helper classes, and then store the results in the database.
• Data Flow: The import jobs send processed data to the database, and the web dashboard retrieves data from the database to display on the browser.
Architectural Patterns and Technologies
• Two-Tier / Multi-Tier Separation: Separate the backend processing (import jobs and database) from the frontend display (web dashboard).
• Scheduling and Asynchronous Processing: Emphasize the use of scheduled scripts (cron jobs) for importing data.
• Technology Stack: Label that the backend is built using PHP, that the persistence layer is MySQL/MariaDB, and that the web server used can be Apache or Nginx.
• Interaction Details: For example, the configuration file (db.ini) should be shown as feeding into both the import scripts and the public web classes, ensuring database connectivity is clearly depicted.