How vijaysingdobhal/news-portal works
Project Type and Purpose
• This is a monolithic full-stack web application: a PHP/MySQL-powered “News Portal” with two main user surfaces (public site and admin panel) and a shared backend.
• Purpose: Serve dynamic news pages, enable user interactions (registration, commenting, search), and provide an admin dashboard for CRUD management of content and users.
File Structure Analysis
• Top-level directories:
• news_portal/ — root of PHP app
• news_portal/admin/ — admin panel scripts, assets, plugins
• news_portal/assets/ — public CSS, JS, images, fonts
• news_portal/js/, news_portal/css/ — site-wide JS/CSS
• news_portal/flip/ — flip-book library and styles
• news_portal/database/ — raw SQL dumps
• Key config and includes:
• config.php — database connection, global constants
• / (within admin) — header/footer/session logic
• Public vs. Admin separation:
• Public pages (index.php, category.php, article.php, search.php, comment handlers)
• Admin pages (dashboard.php, add_*.php, edit_*.php, delete_*.php, user management)
• Plugins & external libs:
• WYSIWYG (Cazary), CKEditor, jQuery, Morris charts, flipbook (turn.js), nicEdit
• No microservices—everything runs under one PHP/Apache (or similar) server.
README Insights
• Stack: HTML5, CSS3, JavaScript (client), PHP (server), MySQL (data)
• Features: Responsive design, session-based auth, SEO URLs, search/filter, commenting, social-share hooks.
• Folder structure described matches file tree: assets/, includes/, admin/, core pages.
a. Main components
• Clients (Web Browser on Desktop/Mobile)
• Load Balancer (optional in larger deployment)
• Web Server (Apache/Nginx) with PHP-FPM
• Application Layer (News Portal PHP code)
– Public Module
– Admin Module
– Shared Libraries & Plugins
• Database Server (MySQL)
• File Storage (Local disk or CDN for assets/images/uploads)
• External Services (Social Media APIs for sharing)
b. Relationships & Interactions
• Browser → HTTP(S) → Web Server
• Web Server → PHP interpreter → loads appropriate module (public or admin)
• PHP code → SQL queries → MySQL → returns data
• PHP code → read/write → file system (uploads, images, flip pages)
• PHP code → include → static assets served or forwarded to CDN
• PHP code (comment-handler) → push data → MySQL; → return JSON/html response to client
• Social Share buttons → call external social APIs
c. Architectural Patterns & Principles
• Layered architecture: Presentation (HTML/CSS/JS), Application (PHP scripts), Data (MySQL)
• Modular separation: Public vs Admin modules share common includes/plugins
• Reusable components: header/footer includes, config, session management
• Progressive enhancement: fall back to legacy flipbook support
d. Key Technologies & Libraries
• PHP (vanilla, no framework)
• MySQL
• jQuery, CKEditor, nicEdit, Cazary WYSIWYG, Morris.js charts
• turn.js flipbook