drago-ex / project
The basis for new projects on Drago Extension.
Package info
Language:JavaScript
Type:project
pkg:composer/drago-ex/project
No longer found in upstream repository
Requires
- php: >=8.3 <9
- drago-ex/bootstrap: ^2.0
- drago-ex/project-docker: ^2.0
- drago-ex/project-front: ^2.0
- latte/latte: ^3.1
- nette/assets: ^1.0
- nette/robot-loader: ^4.1
- tracy/tracy: ^2.11
Requires (Dev)
- drago-ex/project-tools: ^2.0
- phpstan/phpstan-nette: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Base project skeleton for Drago Extension applications.
Requirements
- PHP >= 8.3, < 9
- Nette Framework
- Composer
- Docker
- Node.js
- Bootstrap
- Naja
Installation
composer create-project drago-ex/project
Basic information
Basic 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.
Application structure
app/Corecontains shared infrastructure and application services.app/Presentationcontains presenters, templates and feature modules.app/Presentation/Accessorycontains reusable presentation helpers and Latte widgets.
Basic Naja scripts
-
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).
Available Extensions
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).
How extensions work
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.
Package Setup
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-commands
Inside 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.