major update
This commit is contained in:
27
CLAUDE.md
27
CLAUDE.md
@@ -19,15 +19,12 @@ Multi-tenant admin application built on MintyPHP. Manages tenants, users, depart
|
||||
docker compose up --build -d
|
||||
# App: http://localhost:8080 | phpMyAdmin: http://localhost:8081
|
||||
|
||||
# Run PHPUnit tests
|
||||
docker compose exec php vendor/bin/phpunit --bootstrap vendor/autoload.php
|
||||
# Run PHPUnit tests (phpunit.xml configures bootstrap + testsuite)
|
||||
docker compose exec php vendor/bin/phpunit
|
||||
|
||||
# Run PHPStan (level 5)
|
||||
docker compose exec php vendor/bin/phpstan analyse -c phpstan.neon --no-progress
|
||||
|
||||
# Run ESLint
|
||||
npx eslint web/js
|
||||
|
||||
# Check unused Composer packages
|
||||
docker compose exec php vendor/bin/composer-unused
|
||||
```
|
||||
@@ -36,9 +33,11 @@ docker compose exec php vendor/bin/composer-unused
|
||||
|
||||
```
|
||||
lib/ # All backend PHP (namespace MintyPHP\)
|
||||
App/ # DI container + bootstrap (AppContainer, Container/Registrars/)
|
||||
Repository/ # SQL queries, prepared statements, filters/paging
|
||||
Service/ # Business logic, validation, orchestration
|
||||
Http/ # Auth guards, API auth, request helpers
|
||||
Input/ # Request input handling (RequestInput, FormErrors)
|
||||
Support/ # Crypto, flash, guard, search, helpers
|
||||
pages/ # Actions (controllers) — file-based routing
|
||||
pages/**/*.php # Action files (read input, check permissions, call services)
|
||||
@@ -52,11 +51,14 @@ web/ # Document root (entry point, CSS, JS, static assets)
|
||||
js/core/ # DOM utilities, Grid.js factory
|
||||
js/components/ # Reusable UI components
|
||||
css/ # Layered CSS (base → components → layout → pages)
|
||||
storage/ # Uploaded files (branding/, imports/, tenants/, users/)
|
||||
db/init/init.sql # Full schema + seed data (no migration framework)
|
||||
db/updates/ # Idempotent SQL update scripts for existing installs
|
||||
tests/ # PHPUnit tests (namespace MintyPHP\Tests\)
|
||||
docs/ # German-language documentation (Markdown)
|
||||
i18n/ # Translation files (de, en)
|
||||
bin/ # CLI scripts (scheduler)
|
||||
bin/ # CLI scripts (scheduler, doctor.php health check)
|
||||
tools/ # Dev tooling scripts
|
||||
docker/ # Dockerfiles, Nginx configs, PHP configs
|
||||
```
|
||||
|
||||
@@ -64,11 +66,12 @@ docker/ # Dockerfiles, Nginx configs, PHP configs
|
||||
|
||||
### Strict Layering (enforce in all changes)
|
||||
|
||||
1. **Repository** (`lib/Repository/`): All SQL lives here. No HTTP, session, or rendering.
|
||||
2. **Service** (`lib/Service/`): Business rules and validation. No HTML. Uses factory pattern (`*ServicesFactory`).
|
||||
3. **Action** (`pages/**/*.php`): Reads input, checks permissions + tenant scope, calls services, sets view vars.
|
||||
4. **View** (`pages/**/*.phtml`): Pure rendering. **No DB calls.** HTML escaping via `e(...)`.
|
||||
5. **Template** (`templates/`): Layouts and partials.
|
||||
1. **App** (`lib/App/`): DI container bootstrap. Registers all service/repository factories. No business logic.
|
||||
2. **Repository** (`lib/Repository/`): All SQL lives here. No HTTP, session, or rendering.
|
||||
3. **Service** (`lib/Service/`): Business rules and validation. No HTML. Uses factory pattern (`*ServicesFactory`).
|
||||
4. **Action** (`pages/**/*.php`): Reads input, checks permissions + tenant scope, calls services, sets view vars.
|
||||
5. **View** (`pages/**/*.phtml`): Pure rendering. **No DB calls.** HTML escaping via `e(...)`.
|
||||
6. **Template** (`templates/`): Layouts and partials.
|
||||
|
||||
### Routing
|
||||
|
||||
@@ -110,7 +113,7 @@ docker/ # Dockerfiles, Nginx configs, PHP configs
|
||||
|
||||
- **PHPStan level 5** — scans `config/`, `lib/`, `pages/`, `tests/`
|
||||
- **PHPUnit 11** — bootstrap: `tests/bootstrap.php`
|
||||
- **ESLint** — ES2022, strict `eqeqeq`, `curly`, `no-unused-vars`, `no-console` (warn, allow warn/error)
|
||||
- **Frontend Smoke-Check** — browser console bleibt fehlerfrei in Kernflows
|
||||
- **composer-unused** — periodic check for unused dependencies
|
||||
|
||||
## Environment
|
||||
|
||||
Reference in New Issue
Block a user