# CodePress CMS **[πŸ‡³πŸ‡± Nederlands](#) | [πŸ‡¬πŸ‡§ English](README.en.md)** Een lichtgewicht, file-based content management systeem gebouwd met PHP (β‰₯8.0). **Versie:** 2.5.0 | **Licentie:** AGPL v3 / Commercial ## ✨ Features - πŸ“ **Multi-format Content** - Markdown, PHP en HTML bestanden - 🧭 **Dynamic Navigation** - Automatische menu generatie - 🌍 **Multi-language** - NL/EN/DE/FR ondersteuning - πŸ” **Search** - Volledige tekst zoekfunctie - πŸ“± **Responsive** - Bootstrap 5 thema's - πŸ”’ **Security** - 100/100 pentest score - πŸ›‘οΈ **Admin Console** - CodeMirror editor, media beheer, thema's, plugins - πŸ‘₯ **Gebruikersrollen** - Admin, Content Beheerder, BI Beheerder, Site Admin - πŸ“Š **Analytics** - Bezoekersstatistieken met GeoIP - πŸ€– **BotGuard** - Bot/AI bescherming - πŸ“ˆ **Logging** - Uitgebreid logging systeem - πŸ”Œ **Plugin Systeem** - Sidebar plugins met eigen CSS/SCSS, Twig templates ## πŸš€ Quick Start ```bash # Installeer dependencies composer install # Start server met router voor schone URLs php -S localhost:8080 cms/router.php ``` **Website:** `http://localhost:8080` **Admin:** `http://localhost:8080/admin` (login: `admin` / `admin`) ## πŸ“š Handleidingen Zie **[guide/](guide/)** voor uitgebreide documentatie per rol: | Rol | Handleiding | |-----|-------------| | πŸ“ Redacteur | [Content Beheerder](guide/nl/content-beheerder.md) | | βš™οΈ Administrator | [Admin Beheerder](guide/nl/admin-beheerder.md) | | 🎨 Theme bouwer | [Theme Developer](guide/nl/theme-developer.md) | | πŸ’» Developer | [CodePress Developer](guide/nl/codepress-developer.md) | Elke handleiding heeft sub-onderdelen in aparte mappen met een zijbalknavigatie. ## πŸ‘₯ Gebruikersrollen | Rol | Permissies | |-----|-----------| | **Admin** | Volledige toegang (alles) | | **Content Beheerder** | Content beheer, handleiding | | **BI Beheerder** | Statistieken, logs, handleiding | | **Site Admin** | Thema, plugins, statistieken, logs, update, handleiding | ## πŸ“ Project Structuur ``` codepress/ β”œβ”€β”€ cms/ # Core CMS engine β”‚ β”œβ”€β”€ core/class/ # CMS classes (CodePressCMS, ThemeManager, etc.) β”‚ β”œβ”€β”€ core/plugin/ # Plugin systeem (PluginManager, CMSAPI) β”‚ β”œβ”€β”€ lang/ # Taalbestanden (nl.php, en.php) β”‚ └── router.php # PHP dev server router (schone URLs) β”œβ”€β”€ admin/ # Admin console β”‚ β”œβ”€β”€ config/ # Admin configuratie (admin.json) β”‚ β”œβ”€β”€ src/AdminAuth.php # Authenticatie, rollen, permissies β”‚ β”œβ”€β”€ storage/ # Logs, cache, geoip β”‚ └── theme/default/ # Admin thema β”‚ β”œβ”€β”€ assets/ # CSS, JS, fonts, codemirror β”‚ β”œβ”€β”€ views/ # Twig templates (layouts, pages) β”‚ └── theme.json # Admin thema configuratie β”œβ”€β”€ themes/ # Website thema's β”‚ β”œβ”€β”€ default/ # Standaard thema β”‚ β”‚ β”œβ”€β”€ theme.json # Layout mapping, kleuren β”‚ β”‚ β”œβ”€β”€ base.twig # Hoofd layout β”‚ β”‚ β”œβ”€β”€ *.twig # Layout templates β”‚ β”‚ β”œβ”€β”€ partials/ # Header, navigation, footer β”‚ β”‚ └── assets/ # SCSS, CSS, JS, img β”‚ └── demo/ # Demo thema β”œβ”€β”€ plugins/ # Plugins β”‚ β”œβ”€β”€ HTMLBlock/ # Voorbeeld sidebar plugin β”‚ └── Navigation/ # EssentiΓ«le navigatie plugin (beschermd) β”‚ β”œβ”€β”€ Navigation.php # Plugin code β”‚ β”œβ”€β”€ plugin.json # Plugin metadata β”‚ β”œβ”€β”€ assets/scss/ # Plugin SCSS bron β”‚ └── assets/css/ # Plugin CSS β”œβ”€β”€ content/ # Website content (.md, .php, .html) β”œβ”€β”€ public/ # Web root β”‚ β”œβ”€β”€ index.php # Website entry point β”‚ └── admin.php # Admin entry point + routing β”œβ”€β”€ guide/ # Handleidingen (nl/en) β”‚ β”œβ”€β”€ nl/ # Nederlandse handleidingen β”‚ └── en/ # Engelse handleidingen β”œβ”€β”€ cli/test/ # Test suites β”œβ”€β”€ var/ # Cache (twig) β”œβ”€β”€ config.json # Site configuratie β”œβ”€β”€ composer.json # PHP dependencies └── version.php # Versie informatie ``` ## βš™οΈ Configuratie ### config.json ```json { "site_title": "CodePress", "active_theme": "default", "default_page": "auto", "language": { "default": "nl", "available": ["nl", "en"] }, "enabled_plugins": ["HTMLBlock", "Navigation"], "features": { "search_enabled": true, "breadcrumbs_enabled": true }, "security": { "block_ai_bots": true, "rate_limit_enabled": true }, "analytics": { "enabled": true }, "logging": { "enabled": true } } ``` ## πŸ”§ Dependencies - **PHP β‰₯8.0** met extensies: json, mbstring - **Composer** packages: - twig/twig (templating) - scssphp/scssphp (SCSS compilatie) - league/commonmark (Markdown met HeadingPermalinks) - maxmind-db/reader (GeoIP) ## πŸ” Security - βœ… XSS preventie (htmlspecialchars) - βœ… CSRF tokens (admin formulieren) - βœ… Path traversal preventie (realpath checks) - βœ… Secure cookies (HttpOnly, SameSite) - βœ… Security headers (X-Frame-Options, CSP) - βœ… Bot/AI bescherming (BotGuard) - βœ… Rate limiting per IP - βœ… Role-based access control (RBAC) ## πŸ”Œ Plugins ### Plugin structuur ``` plugins/MijnPlugin/ β”œβ”€β”€ MijnPlugin.php # Plugin code (naam = pluginnaam) β”œβ”€β”€ plugin.json # Plugin metadata β”œβ”€β”€ assets/scss/ # Plugin SCSS bron └── assets/css/ # Plugin CSS (na compilatie) ``` ### EssentiΓ«le plugins De **Navigation** plugin is een essentiΓ«le plugin en kan niet worden gedeactiveerd, bewerkt of verwijderd. Deze plugin genereert automatisch de zijbalknavigatie voor handleidingen en content. ### Plugin CSS Plugin CSS wordt automatisch geladen na thema CSS, zodat thema's plugin styling kunnen overschrijven. ## πŸ“ Content Voorbeelden ### Markdown met frontmatter ```markdown --- layout: full_content plugins: HTMLBlock, Navigation --- # Pagina titel Content in Markdown formaat... ``` ### PHP content ```php getAllPages(); echo "

Mijn Pagina

"; echo "

Aantal pagina's: " . count($pages) . "

"; ``` ## πŸ§ͺ Testen ```bash # Penetration tests cli/test/pentest/security-test.sh # Accessibility tests (WCAG 2.1 AA) cli/test/accessibility.sh # Functionele tests cli/test/functional/*.sh ``` ## πŸ“ž Ondersteuning - **Documentatie:** [guide/](guide/) - **Issues:** Git repository - **Contact:** commercial@noorlander.info ## πŸ“„ Licentie **Dual-licensed:** - **AGPL v3** - Voor open-source projecten - **Commercial** - Voor propriΓ«tair gebruik Zie [LICENSE](LICENSE) voor details. --- **CodePress CMS** - Gebouwd door E.Noorlander / CodePress Development Team