██ ██ ██████ ██████ ██ ██ ██████ ██████ ██████ ██ ██ ██
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ ████████ ██████ █████ ██ ██ ██ ████████ ██ █████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ███████ ██ ██
Real-time community chat built with Marko.
Dogfooding the Marko PHP Framework for its own developer community, showcasing plugins, preferences, events, and modules in a real application.
- Spaces — Organized chat channels with membership and permissions
- Real-time messaging — Server-Sent Events powered by PostgreSQL LISTEN/NOTIFY
- Markdown — Bold, italic, code blocks, and links in messages
- Reactions — Emoji reactions on messages
- Pinning — Pin important messages to the top
- Rate limiting — Configurable per-user message throttling
- Admin panel — User and space management
- PHP 8.5+
- Composer 2.x
- Node.js (for Tailwind CSS)
- Docker (for PostgreSQL)
# Clone the repository
git clone https://github.com/marko-php/markotalk.git
cd markotalk
# Start PostgreSQL
docker compose up -d
# Install dependencies
composer install
npm install
# Configure environment
cp .env.example .envUpdate .env with the database settings from compose.yaml:
APP_ENV=development
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=markotalk
DB_USERNAME=postgres
DB_PASSWORD=postgres
Run migrations and start the dev server:
# Run database migrations
php marko migrate
# Start the development server
marko upNote:
marko upstarts PHP withPHP_CLI_SERVER_WORKERS=4by default, which is required because MarkoTalk uses SSE for real-time messaging. Without multiple workers, the SSE connection blocks all other requests on the single-threaded PHP built-in server.
To promote a user to admin (for pinning messages, moderation, etc.):
docker compose exec db psql -U postgres markotalk -c \
"UPDATE users SET role = 'admin' WHERE username = 'myusername';"Visit http://localhost:8000 to get started.
| Layer | Technology |
|---|---|
| Framework | Marko PHP Framework |
| Database | PostgreSQL 17 |
| Templates | Latte 3.0 |
| Real-Time | SSE + PostgreSQL LISTEN/NOTIFY |
| Testing | Pest PHP |
| Styling | Tailwind CSS 4 |
| Client-Side | Vanilla JavaScript |
app/ # Application modules
├── admin/ # Admin panel
├── message/ # Messaging (send, edit, delete, reactions, SSE)
├── notification/ # User notifications
├── space/ # Spaces (channels, memberships)
└── user/ # Authentication, profiles, presence
config/ # PHP configuration files
database/migrations/ # Sequential migration files
public/ # Entry point, CSS, JS, storage
resources/views/ # Latte templates
# Run tests (parallel)
./vendor/bin/pest --parallel
# Run tests (sequential)
./vendor/bin/pest
# Lint check
./vendor/bin/phpcs --standard=phpcs.xml
# Lint fix
./vendor/bin/php-cs-fixer fix && ./vendor/bin/phpcbf
# Static analysis
./vendor/bin/rector processMarkoTalk is in active development alongside the Marko framework. It serves as both a real application and a reference implementation for Marko's module system.
- Marko Framework — Documentation and guides
- Build a Real-time Chat — Tutorial covering the architecture behind MarkoTalk
- marko-php/marko — Framework source code
Created by Mark Shust
MarkoTalk is open-source software licensed under the MIT License.