Search by

drago-ex / project

accgit

The basis for new projects on Drago Extension.

Package info

github.com/drago-ex/project

Type:project

pkg:composer/drago-ex/project

Statistics

Installs: 59

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v3.2.0 2026-10-31 07:14 UTC

This package is auto-updated.

Last update: 2026-11-05 18:06:17 UTC


README

Base project for Nette applications with Drago Extension: Bootstrap, Naja, Vite and Docker prepared, extended by ready-made feature packages.

PHP version Coding Style

Requirements

  • PHP >= 8.3, < 9
  • Composer
  • Node.js
  • Docker

Installation

composer create-project drago-ex/project
npm install
npm run vite:build
npm run docker:dev

docker:dev starts the server on http://127.0.0.1:8080 and keeps copying your changes into the container. All commands (Docker, Vite) are in package.json.

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.
  • assets/ contains the entry points of Vite and the basic Naja extensions.
  • local/ holds the configuration of this environment that stays out of git, e.g. the database connection in local/db.neon.

Naja Extensions

  • ErrorsHandler shows an alert with the HTTP error of a failed request in the element snippet--message.
  • HyperlinkDisable disables links with data-link-disable while a request runs.
  • Spinner shows a full-page spinner while requests run (needs naja/spinner.scss).

assets/core/base.js registers ErrorsHandler; register the others where you use them, e.g. registerNajaExtensions(HyperlinkDisable, Spinner) in an entry point.

Feature Packages

Each package contains the base of one feature. Project Tools copies its files into the project on composer require, where they become your own code to adapt. A later composer update does not overwrite them; vendor/bin/drago-diff shows what changed in a package.

Infrastructure:

  • Docker Database: MariaDB in Docker and the connection.
  • Docker: the PHP server image (installed with the project).

Website and users:

  • Front: the front module (installed with the project).
  • Front UI: the website layout and home page.
  • User: the signed-in user in presenters and templates.
  • Authentication: sign-in, sign-up and password recovery.
  • Account: the user's own account settings.

Administration:

  • Backend: the administration module.
  • Backend UI: the administration layout and menu.
  • Settings: website name, description and other settings.
  • Permissions: users, roles and their permissions.

Content:

  • Blog: articles, categories and comments.
  • Static Pages: pages with their own URL and menu item.
  • Gallery: images for the content of articles and pages.
  • Commerce: e-shop administration.

Project Preset installs the website and the administration with all of them except commerce, with assets ready for all packages.

Package Setup

After installing packages with a database, run the migrations:

docker compose exec -u www-data server php bin/project-setup

It runs the migrations of the installed packages and of the project's migrations/ (only new ones on the next run). With project-auth and no administrator yet it asks for the administrator account, with project-settings and no website name yet for the name and the description of the website.

After every composer install and composer update, bin/project-assets writes the ## Assets sections of the installed packages into .drago-project/assets.md: the lines to add to assets/admin.js, admin.scss, front.js and front.scss.

Development Tools