Files
cmsPRO/.paul/ROADMAP.md
Jacek Pyziak a3caeb9a9a feat(06-admin-base): Admin\ base infrastructure — Form Edit System + Support layer (Phase 6)
Phase 6 zamknięta po 2 planach. Pełny fundament dla Phase 7-13 (migracja
17 admin controllers do Admin\ namespace).

06-01 (Forms infrastructure):
- Admin\ViewModels\Forms\* — 5 ViewModeli (687 L)
- Admin\Validation\FormValidator (196 L)
- composer.json: php >=7.4, PSR-4 paths cross-platform safe
  (Admin\ → autoload/admin/, Frontend\ → autoload/front/)

06-02 (Support layer):
- Admin\Support\TableListRequestFactory (99 L) — parser list z $_GET
- Admin\Support\Forms\FormRequestHandler (159 L) — POST + CSRF + walidacja + persist
- Admin\Support\Forms\FormFieldRenderer (494 L) — renderer HTML pól

Decyzje:
- Brak BaseController — Phase 7+ kontrolery jako POJOs z DI (jak shopPRO)
- PSR-4 filename fix: TableListRequestFactory.php (bez shopPRO 'class.' prefix)
- PascalCase namespace (Admin\Support) na lowercase folder admin/
  ze względu na Windows fs case-insensitivity vs legacy admin/controls/

Pliki: 8 nowych klas, 1635 L kodu PHP 7.4-kompatybilnego, zero regresji.
Smoke test: walidacja e-maila zwraca PL komunikat, factory parsuje
?page=&per_page=&sort=&filter=, Domain/Shared nadal ładują się.

PHPUnit: 37/37 OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 23:32:26 +02:00

310 lines
9.7 KiB
Markdown

# Roadmap: cmsPRO
## Overview
Pełna refaktoryzacja cmsPRO do architektury DDD wzorowanej na shopPRO. Wzorzec: wrapper delegation — stare klasy delegują do nowych, zero regresji. Referencja: C:\visual studio code\projekty\shopPRO. PHP < 8.0 (produkcja).
## Current Milestone
**v0.1 Refaktoryzacja** (v0.1.0)
Status: In progress
Phases: 6 of 19 complete
## Already Completed (before PAUL)
- **Domain (6 repos):** Articles, Languages, Layouts, Pages, Settings, User
- **Shared (5 modules):** Cache, Helpers, Html, Image, Tpl
- **Form Edit System:** Universal form handling framework (FormEditViewModel, multi-tab, validation)
- **PHPUnit base:** Bootstrap, 3 test files (Languages, Settings, User)
## Phases
| Phase | Name | Plans | Status | Completed |
|-------|------|-------|--------|-----------|
| 1 | Infrastructure & Autoloader | 1 | Complete | 2026-04-04 |
| 2 | Shared: Email + Security | 1 | Complete | 2026-04-04 |
| 3 | Domain: Scontainers + Banners | 1 | Complete | 2026-04-04 |
| 4 | Domain: Authors + Newsletter | 1 | Complete | 2026-04-04 |
| 04h | **HOTFIX:** HTTPS update endpoint (out-of-roadmap) | 1 | Complete | 2026-04-26 |
| 5 | Domain: SeoAdditional + Cron + Releases | 1 | Complete | 2026-04-26 |
| 6 | Admin: Base Infrastructure | 2 | Complete | 2026-04-30 |
| 7 | Admin: Articles + ArticlesArchive | 1 | Not started | - |
| 8 | Admin: Pages + Layouts | 1 | Not started | - |
| 9 | Admin: Languages + Settings | 1 | Not started | - |
| 10 | Admin: Banners + Authors + Scontainers | 1 | Not started | - |
| 11 | Admin: Newsletter + Emails + SeoAdditional | 1 | Not started | - |
| 12 | Admin: Users + Backups + Filemanager | 1 | Not started | - |
| 13 | Admin: Releases + Update | 1 | Not started | - |
| 14 | Front: Site + Articles | 1 | Not started | - |
| 15 | Front: Pages + Menu + Banners + Scontainers | 1 | Not started | - |
| 16 | Front: Remaining modules | 1-2 | Not started | - |
| 17 | Users & Security: HMAC-SHA256 | 1 | Not started | - |
| 18 | Tests | 1-2 | Not started | - |
| 19 | Legacy Cleanup | 1 | Not started | - |
## Phase Details
### Phase 1: Infrastructure & Autoloader
**Goal:** Centralny autoloader (PSR-4 + legacy), composer.json z mapowaniem, usunięcie duplikatów z entry pointów.
**Depends on:** Nothing (first phase)
**Research:** Unlikely
**Scope:**
- autoload/autoloader.php (hybrydowy)
- composer.json PSR-4: Domain\, Shared\, Admin\, Frontend\
- Migracja 6 entry pointów (index.php, admin/index.php, ajax.php, api.php, cron.php, download.php)
**Plans:**
- [ ] 01-01: PSR-4 autoloader setup i composer.json
### Phase 2: Shared: Email + Security
**Goal:** Dodać brakujące moduły Shared — Email (migracja z legacy) i Security (CsrfToken, wzór shopPRO).
**Depends on:** Phase 1 (autoloader)
**Research:** Unlikely
**Scope:**
- Shared\Email\Email — migracja z legacy
- Shared\Security\CsrfToken — nowy moduł (wzór shopPRO)
- Wrapper w starym class.Email.php (jeśli istnieje)
**Plans:**
- [ ] 02-01: Email + Security modules
### Phase 3: Domain: Scontainers + Banners
**Goal:** Repository dla Scontainers i Banners — przeniesienie logiki z factory do Domain\.
**Depends on:** Phase 1 (autoloader)
**Research:** Unlikely (wzorzec ustalony)
**Scope:**
- Domain\Scontainers\ScontainersRepository
- Domain\Banners\BannersRepository
- Wrappery w starych factory (delegacja)
**Plans:**
- [ ] 03-01: Scontainers + Banners repositories
### Phase 4: Domain: Authors + Newsletter
**Goal:** Repository dla Authors i Newsletter.
**Depends on:** Phase 1
**Research:** Unlikely
**Scope:**
- Domain\Authors\AuthorsRepository
- Domain\Newsletter\NewsletterRepository
**Plans:**
- [ ] 04-01: Authors + Newsletter repositories
### Phase 5: Domain: SeoAdditional + Cron + Releases
**Goal:** Repository dla SEO, Cron, i systemu Releases/Update.
**Depends on:** Phase 1
**Research:** Unlikely
**Scope:**
- Domain\SeoAdditional\SeoAdditionalRepository
- Domain\Cron\CronRepository
- Domain\Releases\ReleasesRepository (lub Update)
**Plans:**
- [ ] 05-01: SeoAdditional + Cron + Releases repositories
### Phase 6: Admin: Base Infrastructure
**Goal:** Bazowe klasy Admin\ — Form Edit System + helpers do request handling i renderowania (wzór shopPRO). **Bez BaseController** — shopPRO używa POJOs z DI, kontrolery Phase 7+ będą zwykłymi klasami z Domain repos w konstruktorze.
**Depends on:** Phase 1 (autoloader)
**Research:** Done (06-01 SUMMARY)
**Scope:**
- Admin\ViewModels\Forms\* (FormEditViewModel, FormField, FormFieldType, FormTab, FormAction) — done in 06-01
- Admin\Validation\FormValidator — done in 06-01
- Admin\Support\TableListRequestFactory — 06-02
- Admin\Support\Forms\FormRequestHandler — 06-02
- Admin\Support\Forms\FormFieldRenderer — 06-02
**Plans:**
- [x] 06-01: Forms infrastructure (Form ViewModels + FormValidator) — 2026-04-30
- [x] 06-02: Support layer (TableListRequestFactory + FormRequestHandler + FormFieldRenderer) — 2026-04-30
### Phase 7: Admin: Articles + ArticlesArchive
**Goal:** Migracja kontrolerów Articles i ArticlesArchive do Admin\ z DI.
**Depends on:** Phase 6 (Admin base), Phase 1 (Domain\Articles already exists)
**Research:** Unlikely
**Scope:**
- Admin\Articles\ArticlesController
- Admin\Articles\ArticlesArchiveController
- Wrapper w starym controls/class.Articles.php
**Plans:**
- [ ] 07-01: Articles admin controllers
### Phase 8: Admin: Pages + Layouts
**Goal:** Migracja kontrolerów Pages i Layouts do Admin\.
**Depends on:** Phase 6
**Research:** Unlikely
**Scope:**
- Admin\Pages\PagesController
- Admin\Layouts\LayoutsController
**Plans:**
- [ ] 08-01: Pages + Layouts admin controllers
### Phase 9: Admin: Languages + Settings
**Goal:** Migracja kontrolerów Languages i Settings do Admin\.
**Depends on:** Phase 6
**Research:** Unlikely
**Scope:**
- Admin\Languages\LanguagesController
- Admin\Settings\SettingsController
**Plans:**
- [ ] 09-01: Languages + Settings admin controllers
### Phase 10: Admin: Banners + Authors + Scontainers
**Goal:** Migracja kontrolerów Banners, Authors, Scontainers do Admin\.
**Depends on:** Phase 6, Phase 3 (Domain repos), Phase 4 (Domain repos)
**Research:** Unlikely
**Scope:**
- Admin\Banners\BannersController
- Admin\Authors\AuthorsController
- Admin\Scontainers\ScontainersController
**Plans:**
- [ ] 10-01: Banners + Authors + Scontainers admin controllers
### Phase 11: Admin: Newsletter + Emails + SeoAdditional
**Goal:** Migracja kontrolerów Newsletter, Emails, SeoAdditional do Admin\.
**Depends on:** Phase 6, Phase 4, Phase 5
**Research:** Unlikely
**Scope:**
- Admin\Newsletter\NewsletterController
- Admin\Emails\EmailsController
- Admin\SeoAdditional\SeoAdditionalController
**Plans:**
- [ ] 11-01: Newsletter + Emails + SeoAdditional admin controllers
### Phase 12: Admin: Users + Backups + Filemanager
**Goal:** Migracja kontrolerów Users, Backups, Filemanager do Admin\.
**Depends on:** Phase 6
**Research:** Unlikely
**Scope:**
- Admin\Users\UsersController
- Admin\Backups\BackupsController
- Admin\Filemanager\FilemanagerController
**Plans:**
- [ ] 12-01: Users + Backups + Filemanager admin controllers
### Phase 13: Admin: Releases + Update
**Goal:** Migracja kontrolerów Releases i Update do Admin\.
**Depends on:** Phase 6, Phase 5 (Domain repos)
**Research:** Unlikely
**Scope:**
- Admin\Releases\ReleasesController
- Admin\Update\UpdateController
**Plans:**
- [ ] 13-01: Releases + Update admin controllers
### Phase 14: Front: Site + Articles
**Goal:** Migracja głównych kontrolerów front — Site i Articles do Frontend\.
**Depends on:** Phase 1 (autoloader), Domain repos
**Research:** Unlikely
**Scope:**
- Frontend\Site\SiteController (lub controls + factory + view)
- Frontend\Articles\ArticlesController
- LayoutEngine (jeśli potrzebny, wzór shopPRO)
**Plans:**
- [ ] 14-01: Site + Articles frontend controllers
### Phase 15: Front: Pages + Menu + Banners + Scontainers
**Goal:** Migracja front kontrolerów Pages, Menu, Banners, Scontainers.
**Depends on:** Phase 14 (Front base)
**Research:** Unlikely
**Scope:**
- Frontend\Pages, Frontend\Menu, Frontend\Banners, Frontend\Scontainers
**Plans:**
- [ ] 15-01: Pages + Menu + Banners + Scontainers frontend
### Phase 16: Front: Remaining modules
**Goal:** Migracja pozostałych front modułów — Authors, Languages, Newsletter, Search, AuditSEO, SeoAdditional, Layouts, Settings.
**Depends on:** Phase 14
**Research:** Unlikely
**Scope:**
- Wszystkie pozostałe front factories/controls/views
**Plans:**
- [ ] 16-01: Remaining frontend modules (batch 1)
- [ ] 16-02: Remaining frontend modules (batch 2, if needed)
### Phase 17: Users & Security: HMAC-SHA256
**Goal:** Wymiana insecure remember-me cookies (hash w JSON) na HMAC-SHA256 signed tokens.
**Depends on:** Phase 2 (Shared\Security), Phase 12 (Admin\Users)
**Research:** Likely (strategia migracji istniejących cookies, backward compat)
**Scope:**
- Nowy system remember-me z HMAC-SHA256
- Migracja istniejących sesji/cookies
- Security hardening w UserRepository
**Plans:**
- [ ] 17-01: HMAC-SHA256 cookie system
### Phase 18: Tests
**Goal:** Rozbudowa PHPUnit testów dla nowych Domain repositories i Admin controllers.
**Depends on:** Phase 5 (all Domain repos), Phase 13 (all Admin controllers)
**Research:** Unlikely
**Scope:**
- Testy dla nowych Domain repositories
- Testy dla Admin controllers (unit)
- Rozbudowa test bootstrap
**Plans:**
- [ ] 18-01: Domain repository tests
- [ ] 18-02: Admin controller tests
### Phase 19: Legacy Cleanup
**Goal:** Usunięcie legacy wrapperów i starych class.*.php po weryfikacji że cały kod używa nowych klas.
**Depends on:** All prior phases
**Research:** Unlikely
**Scope:**
- Usunięcie wrapperów z class.*.php
- Usunięcie starych controls/factory/view plików
- Finalna weryfikacja i cleanup
**Plans:**
- [ ] 19-01: Legacy wrapper removal and cleanup
---
*Roadmap created: 2026-04-04*
*Last updated: 2026-04-04*