A fast, self-hosted documentation platform built with PHP 8.5 and vanilla JavaScript. Inspired by Dokly and Docusaurus, RTFM gives you multi-product doc trees, a built-in Markdown editor, role-based permissions, and native dark/light mode — all without the complexity of MediaWiki.
- Multi-product documentation — Separate doc trees per product/section
- External doc proxy — Pull markdown from a remote server or synced directory; RTFM fetches server-side and renders with full sidebar navigation
- Built-in Markdown editor — Toast UI Editor with WYSIWYG/Markdown modes, version history, and auto-save
- Permission system — Global and product-scoped roles (Super Admin, Admin, Editor, Viewer)
- Dark mode first — Native theme switching with localStorage persistence (defaults to dark)
- Full-text search — PostgreSQL-powered search with
Ctrl+Kshortcut (includes proxied markdown after crawl) - Server-rendered — Fast PHP pages, minimal JavaScript on the public site
- Apache-ready —
.htaccessrouting included - Zero Composer — No package manager required; Markdown parsing is vendored in
lib/
- PHP 8.2+ (8.5+ recommended)
- PostgreSQL 14+
- Apache 2.4+ with
mod_rewrite, or nginx + PHP-FPM
See INSTALL.md for the full installation guide: OS-specific steps (macOS, Linux, Windows), all PHP extensions, Docker, Apache/nginx configuration, production checklist, and troubleshooting.
docker compose up -dOpen http://localhost:8080 and sign in with admin@rtfm.local / password.
cp config.ini.example config.ini
# Edit config.ini with your database URL and credentials
createdb rtfm
psql -d rtfm -f database/schema.sql
psql -d rtfm -f database/seeds.sql
bash bin/fetch-frontend-deps.sh
php database/migrate-docs.php
# Point your web server DocumentRoot at public/, then visit /loginFor detailed steps on every platform, see INSTALL.md or browse /docs/getting-started/installation after install.
Products can pull markdown from outside the database — useful when docs live in another repo or on a separate VM that only the RTFM server can reach. In Admin → Products, enable Proxy external documentation and enter the external source path:
/var/www/html/database/external-docs-example
or an HTTP URL:
http://10.0.0.50:8080/docs
See External Documentation (also at /docs/user-guide/external-docs after install) for crawl workflow, link rewriting, search indexing, caching, and troubleshooting.
rtfm/
├── bootstrap.php # Autoloader (no Composer)
├── config.ini # Application configuration (copy from config.ini.example)
├── lib/Parsedown/ # Vendored Markdown parser
├── public/ # Web root (Apache DocumentRoot)
│ ├── index.php # Front controller
│ ├── .htaccess # URL rewriting
│ └── assets/ # CSS, JS
├── src/ # PHP application code
│ ├── Auth/ # Session & authentication
│ ├── Controllers/ # Request handlers
│ ├── Http/ # Router, Request, Response
│ ├── Middleware/ # Auth & CSRF middleware
│ ├── Models/ # Data models
│ └── Services/ # Markdown, Search, ExternalDocs proxy
├── templates/ # PHP view templates
├── routes/ # Route definitions
├── database/ # Schema & seed data
| Role | Permissions |
|---|---|
| Super Admin | Full system access |
| Admin | Manage docs, products, users |
| Editor | Create/edit/publish pages (product-scoped) |
| Viewer | View private documentation (product-scoped) |
Roles can be assigned globally or scoped to a specific product.
Backend (baked in):
- Parsedown 1.7.4 + Parsedown Extra 0.8.1 — vendored in
lib/Parsedown/
Frontend (self-hosted in public/external/, fetched at install — see bin/fetch-frontend-deps.sh):
- Bootstrap 5, jQuery, DataTables, Select2, Toast UI Editor, CodeMirror, Mermaid, Font Awesome, Inter & JetBrains Mono fonts
All other PHP and JavaScript is custom-built.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/search?q= |
Full-text search |
| GET | /api/search/index |
Search index for client-side fallback |
| GET | /api/products |
List products |
| POST | /api/products |
Create product (auth required) |
| POST | /api/users |
Create user (admin required) |
MIT