evgip/w3a

A custom modular PHP MVC forum matching the HMVC pattern.

Maintainers

Package info

github.com/evgip/w3a

Type:project

pkg:composer/evgip/w3a

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v0.1.0-alpha 2026-06-18 02:15 UTC

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.

PHP Version MySQL License

W3A home

W3A admin

W3A setting

πŸš€ 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

  1. Create a MySQL database:
CREATE DATABASE w3a CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  1. Import the schema:
mysql -u your_username -p w3a < db/schema.sql
  1. 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

πŸ“ 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 profiles
  • stories - News stories (URL or text)
  • comments - Threaded comments
  • votes - Upvotes/downvotes
  • sessions - Active user sessions
  • audit_logs - Administrative activity log
  • domains - Banned domains list
  • flags - Complaint log

See db/schema.sql for complete schema.

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

⭐ If you find this project useful, please consider giving it a star on GitHub!