PHPackages                             evgip/w3a - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. evgip/w3a

ActiveProject[Framework](/categories/framework)

evgip/w3a
=========

A custom modular PHP MVC forum matching the HMVC pattern.

v0.1.2(4w ago)311MITPHPPHP &gt;=8.0

Since Jun 23Pushed 1w agoCompare

[ Source](https://github.com/evgip/w3a)[ Packagist](https://packagist.org/packages/evgip/w3a)[ RSS](/packages/evgip-w3a/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (7)Dependencies (4)Versions (5)Used By (0)

🌐 W3A — News Aggregator in the Style of Hacker News and Lobsters
================================================================

[](#-w3a--news-aggregator-in-the-style-of-hacker-news-and-lobsters)

🇬🇧 English | 🇷🇺 [Русский](README.ru.md)

A modern, lightweight news aggregator built with **PHP 8.1+** and **MySQL**, inspired by [Hacker News](https://news.ycombinator.com) and [Lobste.rs](https://lobste.rs). Features modular HMVC architecture, custom DI container, event-driven system, RSS feeds, bookmarks, user muting, and comprehensive moderation tools.

[![W3A home](https://raw.githubusercontent.com/evgip/soc/main/public/github-home.png)](https://raw.githubusercontent.com/evgip/soc/main/public/github-home.png)

[![W3A admin](https://raw.githubusercontent.com/evgip/soc/main/public/github-admin.png)](https://raw.githubusercontent.com/evgip/soc/main/public/github-admin.png)

[![W3A setting](https://raw.githubusercontent.com/evgip/soc/main/public/github-setting.png)](https://raw.githubusercontent.com/evgip/soc/main/public/github-setting.png)

---

🚀 Features
----------

[](#-features)

### Core Functionality

[](#core-functionality)

- **Stories** — Submit news with URL or text content
- **Threaded Comments** — Nested comments with unlimited depth
- **Global Comments Feed** — `/comments` page showing all recent comments across the site (Lobsters-style)
- **User Comments** — `/user/{username}/comments` page showing all comments by a user
- **User Stories** — `/user/{username}/stories` page showing user's publication history
- **Voting System** — Upvote/downvote; downvoting requires minimum karma
- **Authentication** — Registration, login, "Remember me", email activation, password recovery
- **User Profiles** — Bio, avatar, karma, activity feed
- **Private Messages** — Direct messaging between users
- **Notifications** — Internal notifications for replies, story comments, mentions, moderator actions
- **Tag Wiki** — Wiki pages linked to tags with edit history and editing permissions
- **Edit Suggestions** — Users can suggest changes to stories (tags, title) that go through moderation

### Personalization &amp; Tracking

[](#personalization--tracking)

- **Read Ribbons** — Track read comments in each story; "+N new" badges in the feed
- **New Comment Highlighting** — Visual highlighting of unread comments in stories
- **Global Comment Tracking** — "↑ New comments ↓" divider on `/comments` page
- **Saved Stories (Bookmarks)** — Save stories to a personal "read later" list at `/saved`
- **User Muting** — Hide stories, comments, and notifications from muted users
- **Tag Filters** — Users can hide stories by uninteresting tags
- **Story Following** — Get notifications for new comments in followed stories
- **Notification Settings** — Granular control: email, internal notifications, by event type

### RSS Feeds

[](#rss-feeds)

- `/rss` — All new stories
- `/t/{tag}/rss` — Stories by specific tag
- `/u/{username}/rss` — Stories by user
- `/comments/rss` — All new comments
- Browser auto-discovery via ``

### Ranking &amp; Search

[](#ranking--search)

- **Hotness Algorithm** — Custom formula considering score, age, and tag weight modifier
- **Wilson Score Interval** — Statistically sound comment ranking by confidence
- **Tag System** — Stories are tagged; tags are organized into categories
- **Full-Text Search** — Search across stories and comments

### Moderation &amp; Trust

[](#moderation--trust)

- **Invitation System** — Can disable open registration; only users with sufficient karma can invite
- **Flag System** — Users can flag content (spam, abuse, duplicates, etc.); content auto-hidden at threshold
- **Domain Management** — Ban entire domains; stories from banned domains auto-rejected
- **User Bans** — Temporary or permanent bans with reason
- **IP Bans** — Block abusive IP addresses
- **Moderator Notes** — Private notes on user accounts, visible only to staff
- **Moderation Activity Log** — Daily statistics of moderator actions
- **Audit Log** — Complete trail of every administrative action
- **Public Moderation Log** — Transparency of moderator actions for all users

### Architecture &amp; Developer Experience

[](#architecture--developer-experience)

- **DI Container** — Lightweight dependency injection container
- **Event Dispatcher** — Observer pattern: `StoryCreated`, `CommentCreated`, `CommentUpdated`, `UserBanned`, `FlagResolved`, etc.
- **Middleware Pipeline** — HTTP middleware for auth, CSRF, rate limiting, security headers
- **Modular HMVC** — Each feature is a self-contained module (Controllers / Models / Views / Services / routes)
- **Service Providers** — Per-module service registration
- **Separation of Concerns** — Comments, bookmarks, muting, RSS, wiki — in separate modules

### Security

[](#security)

- **Password Hashing** — bcrypt with automatic salting
- **CSRF Protection** — Token verification on every state-changing form
- **SQL Injection Protection** — Prepared PDO statements everywhere
- **XSS Protection** — Output escaping via `htmlspecialchars()`
- **Rate Limiting** — Configurable limits per action and IP
- **Session Security** — HTTP-only cookies, session regeneration
- **Input Validation** — Server-side validation on every endpoint
- **Security Headers** — Strict-Transport-Security, X-Frame-Options, etc.
- **CAPTCHA** — Built-in CAPTCHA for sensitive actions
- **Firewall** — Request filtering and IP reputation checking

### User Experience

[](#user-experience)

- **Responsive Design** — Mobile-friendly interface
- **Light &amp; Dark Themes** — Auto-detection from system settings + manual toggle via `localStorage`
- **CSS Variables** — Unified theming system via `:root` and `[data-theme="dark"]`
- **Keyboard Shortcuts** — `C` to collapse comments and others
- **Markdown Support** — Text formatting in comments and stories (via Parsedown)
- **Comment Thread Collapsing** — With state persistence in `localStorage`
- **Markdown Toolbar** — Formatting buttons with live preview

---

🛠️ Tech Stack
-------------

[](#️-tech-stack)

ComponentTechnology**Backend**PHP 8.1+ (no framework, custom HMVC + DI)**Database**MySQL 8.0+ with PDO**Frontend**Vanilla JavaScript, CSS3 with CSS Variables**Architecture**Modular HMVC, Event Dispatcher, Service Provider**Email**PHPMailer 7.x**Markdown**Parsedown 1.8+**Security**CSRF tokens, rate limiting, bcrypt, CAPTCHA**Server**Apache / Nginx with URL rewriting---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer create-project evgip/w3a
```

### Requirements

[](#requirements)

- PHP 8.1 or higher
- MySQL 8.0 or higher
- Apache / Nginx with URL rewriting enabled
- Composer (optional, for development)

### Step 1 — Clone the Repository

[](#step-1--clone-the-repository)

```
git clone https://github.com/evgip/w3a.git
cd w3a
```

### Step 2 — Create Database

[](#step-2--create-database)

1. Create a MySQL database:

```
CREATE DATABASE w3a CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```

2. Import the schema:

```
mysql -u your_username -p w3a  ⚠️ Change these passwords immediately after first login.

---

📁 Project Structure
-------------------

[](#-project-structure)

```
w3a/
├── app/
│   ├── Config/
│   │   └── config.php              # Application settings
│   ├── Core/
│   │   ├── Container.php           # DI container
│   │   ├── Router.php              # URL routing
│   │   ├── Controller.php          # Base controller
│   │   ├── Model.php               # Base model
│   │   ├── Database.php            # PDO wrapper
│   │   ├── Session.php             # Session management
│   │   ├── Request.php             # HTTP request handling
│   │   ├── Security.php            # Security headers
│   │   ├── View.php                # Template rendering
│   │   ├── Validator.php           # Input validation
│   │   ├── Audit.php               # Audit log
│   │   ├── RateLimiter.php         # Rate limiting
│   │   ├── Captcha.php             # CAPTCHA generator
│   │   ├── Firewall.php            # Request firewall
│   │   ├── Logger.php              # Application logger
│   │   ├── Benchmark.php           # Performance measurement
│   │   ├── SvgChart.php            # SVG chart generator
│   │   ├── ModuleServiceProvider.php
│   │   ├── Events/                 # Event system
│   │   │   ├── Event.php
│   │   │   ├── EventDispatcher.php
│   │   │   ├── StoryCreated.php
│   │   │   ├── StoryDeleted.php
│   │   │   ├── CommentCreated.php
│   │   │   ├── CommentUpdated.php
│   │   │   ├── CommentDeleted.php
│   │   │   ├── CommentRestored.php
│   │   │   ├── UserBanned.php
│   │   │   ├── FlagResolved.php
│   │   │   └── ...
│   │   └── Middleware/             # HTTP middleware
│   │
│   ├── Providers/
│   │   └── EventServiceProvider.php
│   │
│   ├── Lang/                       # Localization files
│   │
│   ├── Modules/                    # Feature modules (HMVC)
│   │   ├── Admin/                  # Admin panel
│   │   ├── Auth/                   # Authentication
│   │   ├── Captcha/                # CAPTCHA generation
│   │   ├── Comments/               # Comments (global feed, CRUD)
│   │   ├── Common/                 # Shared views, base CSS
│   │   ├── Content/                # Markdown processor
│   │   ├── Errors/                 # Error handling
│   │   ├── Flags/                  # Content flags
│   │   ├── Invitations/            # Invitation system
│   │   ├── Mail/                   # Email sending
│   │   ├── Messages/               # Private messages
│   │   ├── Moderations/            # Moderation tools
│   │   ├── Muted/                  # User muting
│   │   ├── Notifications/          # User notifications
│   │   ├── Origins/                # Domain management
│   │   ├── Pages/                  # Static pages
│   │   ├── Rss/                    # RSS feeds
│   │   ├── Saved/                  # Bookmarks (saved stories)
│   │   ├── Search/                 # Full-text search
│   │   ├── Stories/                # Stories and feed
│   │   ├── Suggestions/            # Edit suggestions
│   │   ├── Tags/                   # Tags and categories
│   │   ├── Users/                  # User profiles and settings
│   │   ├── Votes/                  # Voting system
│   │   └── Wiki/                   # Tag wiki pages
│   │
│   └── helpers.php                 # Global helper functions
│
├── public/                         # Web root
│   ├── index.php                   # Entry point
│   ├── css/
│   ├── js/
│   └── images/
│
├── storage/                        # Writable storage
│   ├── logs/                       # Application logs
│   └── cache/                      # Cache files
│
├── db/
│   └── schema.sql                  # Database schema
│
├── composer.json
└── README.md

```

---

📊 Database Schema
-----------------

[](#-database-schema)

### Content

[](#content)

TableDescription`stories`Stories (URL or text), with hotness score`comments`Threaded comments with confidence score`votes`Polymorphic up/down votes`tags`Tag definitions with hotness modifier`taggings`Many-to-many relationship between stories and tags`categories`Tag categories`tag_filters`User tag exclusions`wiki_pages`Wiki pages linked to tags`wiki_revisions`Wiki page edit history`wiki_permissions`Wiki editing permissions by tag`suggestions`Story edit suggestions (tags, titles)### Users &amp; Authentication

[](#users--authentication)

TableDescription`users`User accounts (role: user / moderator / admin)`user_profiles`Bio, avatar`user_settings`Notification settings`user_bans`Temporary / permanent bans`banned_ips`IP blocks`password_resets`Password recovery tokens`email_activations`Email confirmation tokens`invitations`Invitation codes`invitation_requests`Public invitation requests### Social &amp; Personalization

[](#social--personalization)

TableDescription`conversations`Private message conversations`messages`Individual messages`user_notifications`Internal notifications`read_ribbons`Last read comment in a story`saved_stories`User bookmarks (saved stories)`muted_users`Muted/ignored users### Moderation

[](#moderation)

TableDescription`flags`Content flags (spam, abuse, etc.)`domains`Banned / allowed domains`mod_notes`Private moderator notes about users`mod_activity`Daily moderator action counts`audit_logs`Complete administrative action log### Infrastructure

[](#infrastructure)

TableDescription`sessions`Active user sessions`rate_limits`Rate limit countersFull schema with indexes and foreign keys — in `db/schema.sql`.

---

🗺️ URL Map
----------

[](#️-url-map)

### Public Pages

[](#public-pages)

URLDescription`/`Main story feed`/story/{id}`View story with comments`/comments`Global comments feed`/comments/rss`RSS of all new comments`/rss`RSS of all new stories`/t/{tag}`Stories with specific tag`/t/{tag}/rss`RSS of stories by tag`/t/{tag}/wiki`Wiki pages for tag`/t/{tag}/wiki/{slug}`Specific wiki page`/u/{username}`User profile`/u/{username}/stories`User's publications`/u/{username}/comments`User's comments`/u/{username}/rss`RSS of user's publications`/search`Full-text search`/tags`List of all tags`/stats`Site statistics### Authenticated Pages

[](#authenticated-pages)

URLDescription`/saved`User bookmarks`/muted`List of muted users`/notifications`Internal notifications`/messages`Private messages`/settings`Account settings`/tags/filters`User tag filters`/story/create`Create new story---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome!

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
---------

[](#-license)

This project is licensed under the **MIT License** — see the [LICENSE](LICENSE) file for details.

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Inspired by the functionality and design of **Hacker News** and **Lobste.rs**
- Speed and simplicity philosophy from [**HLEB**](https://github.com/phphleb/hleb) framework
- Built with pure PHP — no heavy frameworks
- Modular HMVC architecture with DI and events

📧 Contact
---------

[](#-contact)

- **Author**: Evgeny Konchik (Evg)
- **Repository**:
- **Bugs &amp; Suggestions**:

---

**⭐ If you find this project useful, please star it on GitHub!**

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance96

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

29d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6613623?v=4)[Evg](/maintainers/evgip)[@evgip](https://github.com/evgip)

---

Top Contributors

[![evgip](https://avatars.githubusercontent.com/u/6613623?v=4)](https://github.com/evgip "evgip (146 commits)")

---

Tags

aggregatorcommunitycssforumminimalphp

### Embed Badge

![Health badge](/badges/evgip-w3a/health.svg)

```
[![Health](https://phpackages.com/badges/evgip-w3a/health.svg)](https://phpackages.com/packages/evgip-w3a)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[getkirby/cms

The Kirby core

1.5k606.6k517](/packages/getkirby-cms)[jelix/jelix

Jelix PHP framework

84118.0k6](/packages/jelix-jelix)[doppar/framework

The Doppar Framework

4112.6k14](/packages/doppar-framework)[chameleon-system/chameleon-base

The Chameleon System core.

1028.7k6](/packages/chameleon-system-chameleon-base)[sproutcms/cms

Enterprise content management and framework

242.6k4](/packages/sproutcms-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
