Base project skeleton for Drago Extension applications.
- PHP >= 8.3, < 9
- Nette Framework
- Composer
- Docker
- Node.js
- Bootstrap
- Naja
composer create-project drago-ex/projectBasic package for applications where Bootstrap, Vite, Docker and Naja are already prepared.
You can find all commands in package.json like running Docker or Vite.
app/Corecontains shared infrastructure and application services.app/Presentationcontains presenters, templates and feature modules.app/Presentation/Accessorycontains reusable presentation helpers and Latte widgets.local/holds the Neon configuration of this environment that stays out of git, e.g. the database connection inlocal/db.neon.
-
ErrorsHandler - Handles Naja AJAX errors by displaying user-friendly alert messages based on HTTP status codes. Shows a dismissible Bootstrap alert in the page element with ID
snippet--message. -
HyperlinkDisable - Temporarily disables links with the
data-link-disableattribute during Naja requests to prevent multiple clicks. Re-enables the links once the request is complete. -
Spinner - Displays a full-page spinner during active Naja AJAX requests. Shows the spinner when a request starts and hides it once all requests are complete.
assets/core/base.js registers only ErrorsHandler; register the others where you use them, e.g.
registerNajaExtensions(HyperlinkDisable, Spinner) in an entry point (Spinner also needs naja/spinner.scss).
Expand the base package with these ready-to-use modules:
- Docker Setup
- Database Layer
- User Management
- Authentication
- Permissions (ACL)
- Backend Admin
- Backend UI
- Application Settings
Each extension documents its required project configuration and post-installation steps in its own README. To install the complete project stack at once, use a preset, which applies the required setup automatically:
- drago-ex/project-preset: the complete stack without permissions,
- drago-ex/project-preset-permission: adds permissions to it (the administration menu by privileges, write buttons, roles from the database).
Extensions are not libraries you call from your code. Each one contains only the essential base of one feature, and Project Tools copies its files into your project, where they become your own code. Every project is different, so adapt the copied files to its needs.
A later composer update does not overwrite files that already exist in the project, so your changes are never lost.
This also means that a fix released in an extension does not reach your copies automatically: compare the package
files with your project and take over the changes you want. See
The Idea Behind Drago Packages for details.
After installing extensions, run the migrations and the commands of the installed packages (e.g. the permission providers):
php vendor/bin/migration db:migrate --packages
php vendor/bin/drago-commandsInside Docker, run them as the web user (docker compose exec -u www-data server php vendor/bin/...).
What the tools did is in .drago-project/, shown by vendor/bin/drago-report.