Search by

drago-ex / project

accgit

The basis for new projects on Drago Extension.

Package info

github.com/drago-ex/project

Language:JavaScript

Type:project

pkg:composer/drago-ex/project

Statistics

Installs: 158

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v2.3.0 2026-10-18 05:34 UTC
No longer found in upstream repository

README

Base project skeleton for Drago Extension applications.

PHP version Coding Style

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/Core contains shared infrastructure and application services.
  • app/Presentation contains presenters, templates and feature modules.
  • app/Presentation/Accessory contains 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-disable attribute 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:

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:

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.

Useful Development Tools