Skip to content
jessebuffingtonPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

RTFM — Documentation Platform

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.

Features

  • 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+K shortcut (includes proxied markdown after crawl)
  • Server-rendered — Fast PHP pages, minimal JavaScript on the public site
  • Apache-ready — .htaccess routing included
  • Zero Composer — No package manager required; Markdown parsing is vendored in lib/

Requirements

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

Quick Start

Docker (recommended)

docker compose up -d

Open http://localhost:8080 and sign in with admin@rtfm.local / password.

Manual install

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

For detailed steps on every platform, see INSTALL.md or browse /docs/getting-started/installation after install.

External documentation

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.

Project Structure

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

Permissions

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.

Third-Party Code

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.

API Endpoints

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)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages