bitbee/php-modular-dashboard
Composer 安装命令:
composer create-project bitbee/php-modular-dashboard
包简介
A lightweight PHP session dashboard that helps you wrap existing PHP classes as modules with a UI, routing, authentication, and fine-grained permissions — without adopting a full framework.
README 文档
README
A lightweight PHP session dashboard that helps you wrap existing PHP classes as modules with a UI, routing, authentication, and fine-grained module -> method permissions — without adopting a full framework.
Who is this for?
- I have a few PHP scripts/classes and want a secure UI — Turn your existing PHP classes into authenticated web pages with minimal boilerplate.
- I want a LAN dashboard for home automation / internal tools — Build modular control panels with permission-based access.
- I want modular pages controlled by permissions — Register arbitrary PHP classes as modules and expose selected methods to specific users.
Modules are registered via config/modules.registry.json and access is controlled exclusively by module+method permissions stored per user in config/users.conf.php.
Features
- Authentication: login, logout, password reset, rate limiting, CSRF protection
- Permission model: explicit
module -> method[]permissions (no implicit “admin bypass”) - Module system: register arbitrary PHP classes/modules and expose selected methods
- Guest mode:
__guest__user can be granted specific read-only permissions - Translations: English + German
Requirements
- PHP 8.1+
- Write permissions for
logs/,data/, andconfig/
Module-specific requirements live in each module’s README (see modules/*/README.md).
Available modules
Modules are published separately. See each module's repository for documentation:
- Browse available modules: https://github.com/bitbee?q=php-dashboard-module-
- Or check
modules/*/README.mdin your installation
Quick start (local)
cp config/config.local.php.example config/config.local.php cp config/users.conf.php.example config/users.conf.php composer install --no-interaction chmod +x setup-permissions.sh ./setup-permissions.sh php -S localhost:8080 -t public
Open http://localhost:8080.
Development workflow
Developing from inside a running installation
Yes, you can develop directly in your running installation! This is the recommended workflow:
- Code changes (PHP files, templates, etc.) → committed to git
- Secrets/data (users.conf.php, config.local.php, *.sqlite, etc.) → gitignored, stay local
- You develop locally with real data, commit code, and sync code to production
- Production also has its own secrets/data (also gitignored)
The .gitignore is configured to exclude all secrets/data files, so you can safely develop with real user data while keeping code in version control.
How permissions work
Each user has explicit permissions:
'permissions' => [ 'MyModule' => ['index', 'view'], 'AdminUsers' => ['index', 'create', 'edit', 'delete'], ]
- Navigation shows only modules/methods granted to the current user.
- Access enforcement is centralized: requests are routed through
public/index.php→src/Http/Kernel.php→src/Routing/ModuleDispatcher.php, which blocks any unauthorized module/method call.
Default route
- If a user has
default_module, the app tries to route there only if the user has permission. - Otherwise, it routes to the first accessible module/method.
- If a user has no accessible routes, a generic 403 page is shown.
Registering modules
Modules are registered in config/modules.registry.json (or via the “Manage Modules” UI). The registry defines:\n\n- which module key maps to which PHP file/class\n- which methods are exposed/routable\n- which methods are hidden from navigation\n\nPermissions then decide what each user can execute.
Project layout (high level)
public/ entrypoint (thin front controller)
config/ local settings, users, module registry, translations
src/ core runtime (auth, routing, rendering)
modules/ module implementations
templates/ shared UI templates
Production deployment (nginx + php-fpm)
Web root MUST be public/
For OSS/public deployments, only public/ is intended to be web-accessible. Everything else (especially config/ and log/state data) must be outside the web root.
If you deploy by pointing nginx root to <project>/public, the rest of the repository is not directly reachable by HTTP.
Example nginx server block (minimal):
server { listen 443 ssl; server_name example.local; root /var/www/dashboard_session/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php8.2-fpm.sock; } }
PHP-FPM session GC (avoid “logged out after ~1h”)
This app uses PHP sessions. If your server’s session garbage collection deletes session files quickly (e.g. session.gc_maxlifetime=3600), users will be asked to log in again once the session expires.
Recommended starting values for a small self-hosted dashboard:
session.gc_maxlifetime: 21600 (6h) or 43200 (12h)session.gc_probability: 1session.gc_divisor: 100 (1% chance per request)
On nginx/php-fpm you can set these either in php.ini or per pool (recommended). Example (pool config, e.g. /etc/php/8.2/fpm/pool.d/www.conf):
php_admin_value[session.gc_maxlifetime] = 21600 php_admin_value[session.gc_probability] = 1 php_admin_value[session.gc_divisor] = 100
Also ensure session.save_path points to a directory where the php-fpm user can read/write, and that the OS cleanup policy does not delete sessions earlier than your gc_maxlifetime.
Security notes (important for OSS)
Module upload is dangerous (RCE)
The AdminModules UI can optionally upload PHP files. This is remote code execution by design and must be disabled in production unless you fully trust all admins and the environment.
- Default: disabled
- Enable explicitly in
config/config.local.php:
return [ 'security' => [ 'module_uploads_enabled' => true, ], ];
Preferred installation method for modules: clone/copy them into modules/ (or use git submodules), then register them via config/modules.registry.json or the UI.
Security headers
The front controller (public/index.php) sets baseline security headers (CSP, frame-ancestors, nosniff, etc.). If you add third-party scripts, remote images, or iframe embeddings, you may need to adjust the CSP accordingly.
Installing modules
Option 1: Git submodules (recommended for development)
Modules are published as separate git repositories. Add them as submodules:
git submodule add https://github.com/bitbee/php-dashboard-module-<name> modules/<name> # Example: # git submodule add https://github.com/bitbee/php-dashboard-module-example modules/example
Then register them via config/modules.registry.json or the AdminModules UI.
Option 2: Composer / Packagist
Modules are also available as Composer packages:
composer require bitbee/php-dashboard-module-<name> # Example: # composer require bitbee/php-dashboard-module-example
After installation, modules are available in vendor/bitbee/php-dashboard-module-*/. You can either:
- Symlink them into
modules/:ln -s ../../vendor/bitbee/php-dashboard-module-<name> modules/<name> - Or adjust your autoloader to find modules in
vendor/
Option 3: Manual copy/clone
Clone or copy module directories directly into modules/.
Developing with submodules
You can develop modules directly inside your running deployment when using git submodules:
- Edit module code in
modules/<name>/ - Commit changes in the module repo:
cd modules/<module-name> git add . git commit -m "Add feature X" git push
- Update submodule pointer in the core repo:
cd /path/to/core git add modules/<module-name> git commit -m "Update <module-name> module"
This workflow lets you iterate quickly while keeping module repos independent.
Publishing structure (core vs modules)
- Core repo:
bitbee/php-modular-dashboard(this repository)- Contains
public/,src/,templates/, and minimal built-in admin modules.
- Contains
- Module repos (separate, published under
bitbee/php-dashboard-module-*):- Each module is published as its own repository
- Browse available modules: https://github.com/bitbee?q=php-dashboard-module-
Each module repo ships its own README.md and LICENSE, and the core repo keeps the module registry format stable so users can mix-and-match modules.
bitbee/php-modular-dashboard 适用场景与选型建议
bitbee/php-modular-dashboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「php」 「ui」 「Authentication」 「session」 「modular」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bitbee/php-modular-dashboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bitbee/php-modular-dashboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bitbee/php-modular-dashboard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
Email Toolkit Plugin for CakePHP
A list of dangerous usernames
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 4
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-24