- version.php: 1.5.0 → 1.6.0 + changelog for media browser, editor, theme management, content move/rename, /-media/ prefix - README.md/README.en.md: complete rewrite with current project structure, config format, admin features, CodeMirror, themes, quick start - guide/nl.codepress.md, guide/en.codepress.md: comprehensive update matching all current admin routes, features, and project layout - TODO.md: compiled from docs/TODO.md with completed/future items
218 lines
7.7 KiB
Markdown
218 lines
7.7 KiB
Markdown
# CodePress CMS
|
|
|
|
**[🇳🇱 Nederlands](#) | [🇬🇧 English](README.en.md)**
|
|
|
|
Een lichtgewicht, file-based content management systeem gebouwd met PHP.
|
|
|
|
**Versie:** 1.5.0 | **Licentie:** AGPL v3 / Commercial
|
|
|
|
## ✨ Features
|
|
|
|
- 📝 **Multi-format Content** - Ondersteunt Markdown, PHP en HTML bestanden
|
|
- 🧭 **Dynamic Navigation** - Automatische menu generatie met dropdowns
|
|
- 🌍 **Multi-language** - Nederlands en Engels met automatische detectie
|
|
- 🔍 **Search Functionality** - Volledige tekst zoek door alle content
|
|
- 🧭 **Breadcrumb Navigation** - Intuïtieve navigatiepaden met sidebar toggle
|
|
- 🔗 **Auto-linking** - Automatische links tussen pagina's
|
|
- 📱 **Responsive Design** - Werkt perfect op alle apparaten
|
|
- ⚙️ **JSON Configuratie** - Eenvoudige configuratie via JSON
|
|
- 🎨 **Thema's** - Aanpasbare thema's met eigen kleuren en achtergronden
|
|
- 🔒 **Security** - Beveiligde content management (100/100 security score)
|
|
- 🛡️ **Admin Console** - Ingebouwd admin paneel met CodeMirror editor, media browser, themabeheer en plugin configuratie
|
|
|
|
## 🚀 Quick Start
|
|
|
|
```bash
|
|
php -S localhost:8080 -t public
|
|
```
|
|
Bezoek `http://localhost:8080` in je browser.
|
|
Admin paneel: `http://localhost:8080/admin.php` (login: `admin` / `admin`)
|
|
|
|
## 📁 Project Structuur
|
|
|
|
```
|
|
codepress/
|
|
├── cms/ # Core CMS engine
|
|
│ ├── core/
|
|
│ │ ├── class/
|
|
│ │ │ ├── CodePressCMS.php # Hoofd CMS class
|
|
│ │ │ ├── Logger.php # Logging systeem
|
|
│ │ │ ├── SimpleTemplate.php # Mustache-style template engine
|
|
│ │ │ ├── Cache.php
|
|
│ │ │ ├── AssetManager.php
|
|
│ │ │ ├── SearchEngine.php
|
|
│ │ │ ├── ContentSecurityPolicy.php
|
|
│ │ │ └── ...
|
|
│ │ ├── plugin/
|
|
│ │ │ ├── PluginManager.php # Plugin loader
|
|
│ │ │ └── CMSAPI.php # API voor plugins
|
|
│ │ ├── config.php # Config loader
|
|
│ │ └── index.php # Bootstrap (autoloader)
|
|
│ ├── lang/ # Taalbestanden (nl.php, en.php)
|
|
│ ├── templates/ # Mustache templates
|
|
│ │ ├── layout.mustache
|
|
│ │ ├── assets/ (header, navigation, footer)
|
|
│ │ ├── markdown_content.mustache
|
|
│ │ ├── php_content.mustache
|
|
│ │ └── html_content.mustache
|
|
│ └── router.php # PHP dev server router
|
|
├── admin/ # Admin paneel
|
|
│ ├── config/
|
|
│ │ ├── app.php # Admin configuratie
|
|
│ │ └── admin.json # Gebruikers & security
|
|
│ ├── src/
|
|
│ │ └── AdminAuth.php # Authenticatie (sessies, bcrypt, CSRF)
|
|
│ ├── templates/
|
|
│ │ ├── login.php
|
|
│ │ ├── layout.php
|
|
│ │ └── pages/ (dashboard, content, content-edit, content-new,
|
|
│ │ content-dir-form, content-move-form, config, plugins,
|
|
│ │ plugins-edit, plugins-new, plugin-config, theme, media, users)
|
|
│ └── storage/logs/
|
|
├── cli/test/ # CLI scripts & tests
|
|
├── plugins/ # CMS plugins (HTMLBlock, MQTTTracker)
|
|
├── public/ # Web root
|
|
│ ├── assets/
|
|
│ │ ├── css/ (Bootstrap, styles, editor.css)
|
|
│ │ ├── js/ (Bootstrap, app.js, editor-toolbar.js)
|
|
│ │ └── codemirror/ (CodeMirror editor + modes)
|
|
│ ├── index.php # Website entry point
|
|
│ ├── admin.php # Admin entry point + router
|
|
│ └── themes/ # Geuploade thema achtergronden
|
|
├── themes/ # Thema configuraties
|
|
│ ├── default/theme.json
|
|
│ └── test/theme.json
|
|
├── content/ # Content bestanden
|
|
├── guide/ # Handleidingen (nl/en)
|
|
├── docs/ # Documentatie
|
|
└── config.json # Site configuratie
|
|
```
|
|
|
|
## ⚙️ Configuratie
|
|
|
|
### Basis Configuratie (`config.json`)
|
|
|
|
```json
|
|
{
|
|
"site_title": "CodePress",
|
|
"content_dir": "content",
|
|
"templates_dir": "cms/templates",
|
|
"default_page": "index",
|
|
"active_theme": "default",
|
|
"language": {
|
|
"default": "nl",
|
|
"available": ["nl", "en"]
|
|
},
|
|
"seo": {
|
|
"description": "CodePress CMS - Lightweight file-based content management system",
|
|
"keywords": "cms, php, content management, file-based"
|
|
},
|
|
"author": {
|
|
"name": "E. Noorlander",
|
|
"website": "https://noorlander.info"
|
|
},
|
|
"features": {
|
|
"auto_link_pages": true,
|
|
"search_enabled": true,
|
|
"breadcrumbs_enabled": true
|
|
}
|
|
}
|
|
```
|
|
|
|
## 📝 Content Types
|
|
|
|
### Markdown (.md)
|
|
- Auto-linking tussen pagina's
|
|
- GitHub Flavored Markdown via `league/commonmark`
|
|
- Automatische titel extractie
|
|
- Multi-language met `nl.bestand.md` en `en.bestand.md`
|
|
|
|
### PHP (.php)
|
|
- Volledige PHP ondersteuning
|
|
- Dynamische content generatie
|
|
|
|
### HTML (.html)
|
|
- Statische HTML pagina's
|
|
- Bootstrap componenten
|
|
|
|
## 🛡️ Admin Console
|
|
|
|
CodePress bevat een ingebouwd admin paneel voor het beheren van je website.
|
|
|
|
**Toegang:** `/admin.php` | **Standaard login:** `admin` / `admin`
|
|
|
|
### Modules
|
|
- **Dashboard** - Overzicht met statistieken en snelle acties
|
|
- **Content** - Bestanden browsen, aanmaken, bewerken, hernoemen en verwijderen
|
|
- **CodeMirror Editor** - Syntax highlighting met toolbar (vet, cursief, kop, link, afbeelding, lijst, media)
|
|
- **Media Browser** - Uploaden en invoegen van afbeeldingen/video/audio met size prompt
|
|
- **Configuratie** - `config.json` bewerken met JSON-validatie
|
|
- **Thema's** - Thema aanmaken, activeren, bewerken, verwijderen met achtergrond upload
|
|
- **Plugins** - Overzicht, installeren, configureren en toggle
|
|
- **Gebruikers** - Gebruikers toevoegen, verwijderen en wachtwoorden wijzigen
|
|
|
|
### Beveiliging
|
|
- Session-based authenticatie met bcrypt password hashing
|
|
- CSRF-bescherming op alle formulieren
|
|
- Brute-force bescherming (5 pogingen, 15 min lockout)
|
|
- Path traversal bescherming via `realpath()` + prefix-check
|
|
- Session timeout (30 min)
|
|
- Security headers: CSP, X-Frame-Options, X-Content-Type-Options
|
|
|
|
> **Belangrijk:** Wijzig het standaard wachtwoord direct na installatie via Gebruikers.
|
|
|
|
## 🎨 Thema's
|
|
|
|
Thema's worden opgeslagen in `themes/naam/theme.json`:
|
|
|
|
```json
|
|
{
|
|
"name": "default",
|
|
"label": "Standard",
|
|
"header_color": "#0a369d",
|
|
"header_font_color": "#ffffff",
|
|
"navigation_color": "#2754b4",
|
|
"navigation_font_color": "#ffffff",
|
|
"sidebar_background": "#f8f9fa",
|
|
"sidebar_border": "#dee2e6",
|
|
"background_image": "/themes/default_bg.jpg"
|
|
}
|
|
```
|
|
|
|
## 🌍 Multi-language Support
|
|
|
|
- Bestandsnaam conventie: `nl.[pagina].md` en `en.[page].md`
|
|
- Taalprefix wordt automatisch verwijderd uit weergave
|
|
- URL: `/?page=test&lang=nl` of `/?page=test&lang=en`
|
|
- Automatische taal detector op basis van browser of config
|
|
|
|
## 🔧 Vereisten
|
|
|
|
- **PHP 8.1+**
|
|
- **Webserver** (Apache, Nginx, of PHP built-in server)
|
|
- **Composer** (voor `league/commonmark`)
|
|
|
|
## 🛠️ Installatie
|
|
|
|
```bash
|
|
git clone https://git.noorlander.info/E.Noorlander/CodePress.git
|
|
cd CodePress
|
|
composer install
|
|
php -S localhost:8080 -t public
|
|
```
|
|
|
|
## 📖 Documentatie
|
|
|
|
- **[Handleiding (NL)](guide/nl.codepress.md)**
|
|
- **[Guide (EN)](guide/en.codepress.md)**
|
|
- **[TODO](TODO.md)** - Openstaande verbeteringen
|
|
- **[AGENTS.md](AGENTS.md)** - Ontwikkelaar instructies
|
|
|
|
## 📄 Licentie
|
|
|
|
CodePress CMS is beschikbaar onder een **dual-license model**: AGPL v3 (open-source) of Commercial.
|
|
|
|
---
|
|
|
|
*Gebouwd door Edwin Noorlander*
|