evgip / w3a
A custom modular PHP MVC forum matching the HMVC pattern.
Requires
- php: >=8.0
- erusev/parsedown: ^1.8
- phpmailer/phpmailer: ^7.1.1
This package is auto-updated.
Last update: 2026-06-18 03:10:53 UTC
README
π·πΊ Π ΡΡΡΠΊΠΈΠΉ | π¬π§ English
A modern, lightweight news aggregator built with PHP 8.1+ and MySQL, inspired by Hacker News and Lobster. Features a modular HMVC architecture, real-time updates, and comprehensive moderation tools.
π Features
Core Functionality
- News Stories - Submit and browse news stories with URL or text content
- Comments - Threaded comment system with nested replies
- Voting System - Upvote/downvote stories and comments with real-time updates
- User Authentication - Secure registration, login, and session management
- User Profiles - Activity tracking, submitted stories, and comment history
Advanced Features
- Real-time Updates - AJAX-powered live updates for votes and comments
- Moderation Tools - Ban users, domains, and manage content
- Audit Logging - Comprehensive activity tracking for all administrative actions
- Rate Limiting - Protection against abuse with configurable limits
- CSRF Protection - Security tokens for all form submissions
- Soft Deletes - Recoverable content deletion
- Search - Full-text search across stories and comments
User Experience
- Responsive Design - Mobile-friendly interface
- Dark Mode - System-aware theme switching
- Keyboard Shortcuts - Power-user navigation
- Markdown Support - Rich text formatting in comments
π οΈ Technology Stack
| Component | Technology |
|---|---|
| Backend | PHP 8.1+ (no framework, custom HMVC) |
| Database | MySQL 8.0+ with PDO |
| Frontend | Vanilla JavaScript, CSS3 |
| Architecture | Modular HMVC pattern |
| Security | CSRF tokens, rate limiting, password hashing (bcrypt) |
| Server | Apache/Nginx with mod_rewrite |
π¦ Installation
Install the package through Composer.
Requirements
- PHP 8.1 or higher
- MySQL 8.0 or higher
- Apache/Nginx with URL rewriting enabled
- Composer (optional, for development)
Step 1: Clone Repository
git clone https://github.com/evgip/w3a.git
cd w3a
Step 2: Configure Database
- Create a MySQL database:
CREATE DATABASE w3a CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Import the schema:
mysql -u your_username -p w3a < db/schema.sql
- Update database credentials in
app/Config/config.phpp:
'database' => [ 'host' => 'MySQL-8.2', 'port' => '3306', 'dbname' => 'soc', 'username' => 'root', 'password' => '', 'charset' => 'utf8mb4', ]
Step 3: Configure Application
Edit app/Config/config.php:
'app' => [ 'name' => 'w3a', 'url' => 'http://soc.local', 'lang' => en',
Step 4: Set Permissions
chmod -R 755 storage/ chmod -R 755 public/
Step 5: Configure Web Server
Apache (.htaccess already included):
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L]
Nginx:
location / { try_files $uri $uri/ /index.php?$query_string; }
Step 6: Login information
- Admin: admin@example.com / password
- User: test@test.ru / password
π Project Structure
w3a/
βββ app/
β βββ Config/ # Configuration
β β βββ config.php # App settings
β βββ Core/ # Core framework classes
β β βββ Router.php # URL routing
β β βββ Controller.php # Base controller
β β βββ Model.php # Base model
β β βββ Database.php # PDO wrapper
β β βββ Auth.php # Authentication
β β βββ Session.php # Session management
β β βββ Request.php # HTTP request handling
β β βββ Response.php # HTTP responses
β β βββ View.php # Template rendering
β β βββ Audit.php # Audit logging
β β βββ Validator.php # Input validation
β β
β βββ Modules/ # Feature modules (HMVC)
β βββ Auth/ # Authentication module
β β βββ Controllers/
β β βββ Models/
β β βββ Views/
β β βββ routes.php
β βββ Stories/ # News stories module
β βββ Comments/ # Comments module
β βββ Votes/ # Voting system
β βββ Users/ # User profiles
β βββ Moderation/ # Moderation tools
β βββ Origins/ # Domain management
β βββ Api/ # REST API
βββ public/ # Public assets
β βββ index.php # Entry point
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
β βββ images/ # Images
β
βββ storage/ # Writable storage
β βββ logs/ # Application logs
β βββ cache/ # Cache files
β
βββ db/ # Database
β βββ schema.sql # Database schema
β
βββ README.md # This file
π Security Features
- Password Hashing - bcrypt with automatic salt
- CSRF Protection - Token validation on all forms
- SQL Injection Prevention - Prepared statements (PDO)
- XSS Protection - Output escaping with
htmlspecialchars() - Rate Limiting - Configurable per-action limits
- Session Security - HTTP-only cookies, regeneration
- Input Validation - Server-side validation for all inputs
π§ͺ Development
Debug Mode
Enable in app/Config/config.php:
'env' => 'development', // development ΠΈΠ»ΠΈ production
π Database Schema
Core Tables
users- User accounts and profilesstories- News stories (URL or text)comments- Threaded commentsvotes- Upvotes/downvotessessions- Active user sessionsaudit_logs- Administrative activity logdomains- Banned domains listflags- Complaint log
See db/schema.sql for complete schema.
π€ Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Inspired by the functionality of Hacker News and Lobster
- Speed and simplicity of the HLEB framework
- Built with vanilla PHP (no frameworks)
- Modular HMVC architecture
π§ Contact
- Author: Evg
- Repository: https://github.com/evgip/w3a
- Issues: https://github.com/evgip/w3a/issues
β If you find this project useful, please consider giving it a star on GitHub!


