How chikashishirozu/calender017 works
Project type and purpose
• This is a single-repository, monolithic PHP web application (“calender017”) that provides user registration, login, calendar display/editing, password reset, and reminder functionality.
• It supports two data stores: a SQLite file (calendar.db / new_calendar.db) and a MySQL/MariaDB server.
File structure
• Top level scripts (index.php, home.php, login.php, register.php, reset_password.php, logout.php) act as “controllers + views.”
• Utility/connectors:
• db.php (SQLite connector)
• mysql_db.php (MySQL/MariaDB connector)
• api.php (AJAX/JSON endpoints)
• remind_user.php (reminder/cron job script)
• myuser01.php, myuser02.php, myuser03.php (data‐seeding / user setup)
• Static assets: login.html, register.html, script.js, current-time018.js
• Database files: calendar.db, new_calendar.db plus external MariaDB server accessed via mysql_db.php
Extract insights from the README
• Runs under built-in PHP server or Apache+PHP-FPM
• Requires PHP 8.3 plus extensions, and either SQLite3 or MySQL/MariaDB
• Provides instructions for Windows and Linux/Apache deployments
Main components
a. Client (Web Browser)
• Renders HTML pages
• Executes script.js and current-time018.js for dynamic behavior
• Sends HTTP(S) requests to PHP endpoints (login.php, api.php, etc.)
b. Web Server / Application Layer
• PHP interpreter (built-in server or Apache + mod_php/php-fpm)
• Entry-point scripts grouped by function:
– Authentication: login.php, register.php, logout.php, reset_password.php
– Calendar UI & API: index.php, home.php, api.php
– Background: remind_user.php (cron/CLI)
• Shared libraries: db.php, mysql_db.php for data-access abstraction
c. Data Stores
• SQLite (calendar.db or new_calendar.db) – flat-file DB
• MySQL / MariaDB – server-based relational DB
d. Optional: Cron/CLI Scheduler
• Executes remind_user.php and myuser0X.php scripts
e. External Dependencies
• PHP runtime and extensions
• Web server (Apache/httpd)
• Network for LAN/Internet access
Relationships and interactions
• Browser → HTTP request → Web Server / PHP script
• PHP script → calls db.php or mysql_db.php → executes SQL query → returns data → PHP script formats HTML or JSON → response to Browser
• remind_user.php (scheduled by cron or CLI) → reads DB → sends reminder emails or notifications
• myuser0X.php → CLI-driven user setup → writes to DB
Architectural patterns and design principles
• Monolithic three-tier architecture (Presentation, Application, Data)
• PHP scripts double as controllers and views (no formal MVC framework)
• Data-access abstraction via two connector modules (db.php, mysql_db.php) to support multiple back ends
Detailing components
• Authentication flow: login.html → login.php → mysql_db.php/db.php → DB → session → home.php
• Calendar API flow: index.php/home.php (UI) + script.js → api.php → DB → JSON → UI update
• Registration flow: register.html → register.php → DB → confirmation
• Password reset: reset_password.php → DB → email link
• Reminder job: remind_user.php (cron) → DB → email notifications