Skip to content

marko-php/markotalk

Repository files navigation

██      ██   ██████   ██████    ██   ██   ██████   ██████   ██████   ██       ██   ██
████  ████  ██    ██  ██   ██   ██  ██   ██    ██    ██    ██    ██  ██       ██  ██
██ ████ ██  ████████  ██████    █████    ██    ██    ██    ████████  ██       █████
██  ██  ██  ██    ██  ██   ██   ██  ██   ██    ██    ██    ██    ██  ██       ██  ██
██      ██  ██    ██  ██    ██  ██   ██   ██████     ██    ██    ██  ███████  ██   ██

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.

PHP 8.5+ License: MIT Active Development


Features

  • 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

Quick Start

Prerequisites

  • PHP 8.5+
  • Composer 2.x
  • Node.js (for Tailwind CSS)
  • Docker (for PostgreSQL)

Setup

# 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 .env

Update .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 up

Note: marko up starts PHP with PHP_CLI_SERVER_WORKERS=4 by 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.

Tech Stack

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

Project Structure

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

Commands

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

Status

MarkoTalk is in active development alongside the Marko framework. It serves as both a real application and a reference implementation for Marko's module system.

Learn More

Credits

Created by Mark Shust

License

MarkoTalk is open-source software licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors