How naiymu/konnichiwa works
Main Components
• Client/Browser: This is the front-end seen by users (HTML, CSS, JavaScript). The assets (images, screenshots, font files, CSS) and the externally downloaded libraries (jQuery, FontAwesome, Simple HTML DOM) are part of this layer.
• Web Server & PHP Engine:
• Apache serves as the front-facing web server.
• PHP (and optionally PHP-FPM with FastCGI) runs the PHP scripts (index.php, add.php, search.php, etc.).
• A collection of PHP scripts located in various parts of the project (both in the root and in the scripts directory) act as controllers, helpers, and utilities.
• Database Layer:
• MySQL is used as the backend database.
• The SQL dump (help/create.sql) and the accompanying database schema (help/schema-details.pdf, help/schema.svg) provide schema details.
• File System & External Resources:
• The “holy directory” (which must be symlinked as “images”) stores doujinshi images—in practice, the storage for media and associated metadata.
• External libraries downloaded locally (jQuery in scripts, FontAwesome in assets) integrate into the app.
Out Relationships and Interactions
• Client requests are routed to the Web Server (Apache).
• Apache routes static file requests (CSS, JS, images) and dynamic requests (PHP pages).
• PHP scripts (controllers in both the root and inside the “scripts” folder) handle business logic and access:
• The MySQL database for tracking manga data, authors, tags, bookmarks, etc.
• The file system to read from (and sometimes write to) the doujinshi directories.
• Some PHP scripts (such as those inside the “scripts/modification” folder) modify the database by processing structured JSON data.
• External libraries are included via local file links (as enforced by the readme’s “no CDN” approach) and embedded into the HTML output.
Architectural Patterns / Design Principles
• Although not strictly following MVC, the project separates concerns between:
• Presentation layer (HTML, CSS, JavaScript in assets and scripts for client behavior);
• Application logic (PHP files like index.php, add.php, and various helper scripts);
• Data layer (MySQL along with SQL scripts for table setup).
• There is an emphasis on file-based configuration (like login.php and directory.php) that tie the server’s file system with the database and business logic.
• The project also enables manual actions (like manually using add.php or refresh_db.php) which indicates a design favoring administrative simplicity over fully automated processes.
Incorporate Relevant Technologies
• Apache Web Server and PHP/PHP-FPM (for processing PHP requests).
• MySQL as the relational database.
• JavaScript libraries such as jQuery and custom scripts (like add.js, download.js) to power client-side interactivity.
Summary
• Clients (Web Browsers) → HTTP Requests
• Apache (and optional PHP-FPM) → Processes requests; serves PHP pages, static assets.
• PHP Scripts: Core business logic (located in the main directory and scripts folder) that perform functions such as adding, editing, listing, and searching manga/doujinshi entries.
• MySQL Database: Stores metadata (information about pages, authors, tags, bookmarks, etc.) configured using provided SQL schema.
• File System: The repository for doujinshi images, linked via the “images” symlink to the actual “holy directory.”
• External Libraries/Assets: jQuery, FontAwesome, Simple HTML DOM, along with other assets like CSS and images.