How win3zz/e-newspaper-cms works
Project Type and Purpose
• Type: A lightweight, single-server PHP-based CMS.
• Purpose: Allow website owners to upload daily newspaper PDFs and serve them to end-users, with a simple MD5-protected admin login.
Main Components
a. Client (Web Browser)
• End-user interface for downloading PDFs.
• Administrator interface for login and file upload.
b. Web Server (LAMP stack)
• Apache or Nginx + PHP.
• Serves static assets (HTML/CSS/JS) and executes PHP scripts.
c. PHP Application
• index.html (public front end listing PDFs).
• login.php (authenticates admin via MD5-hashed password).
• admin.php (CRUD interface to MySQL and file upload).
d. File Storage
• uploads/ directory on the server filesystem.
• Stores PDF files (e.g., win.pdf).
e. Database (MySQL)
• Single table epaper(id, name).
• Tracks metadata (filename, display name) for each upload.
Component Interactions
• Users → HTTP GET → Web Server → index.html → HTTP fetch CSS/JS → display list of PDFs (links to /uploads/*.pdf).
• Admin → HTTP GET login.php → submits credentials → login.php verifies against MD5 hash → on success, HTTP redirect → admin.php.
• Admin (on admin.php) → submits new PDF → admin.php writes file to uploads/ and inserts a record into epaper table.
• Web Server → PHP MySQLi/PDO extension → Create/Read operations on epaper table.
Architectural Patterns & Design Principles
• Monolithic architecture on a single server.
• Clear separation between static assets (CSS/JS) and dynamic scripts (PHP).
• Simple authentication layer using MD5 hashing (note: MD5 is deprecated in real production).
• File-based storage for large binary objects (PDFs), relational DB for metadata.