docs: Analiza zależności między modułami refaktoryzacji

- Dodano graf zależności (auth + public muszą być razem)
- utils/decorators.py wymaga url_for('auth.login') i url_for('public.index')
- Faza 2 jest krytyczna - blokuje wszystkie kolejne fazy
- Zaktualizowano harmonogram z kolumną zależności

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-01-31 06:44:57 +01:00
parent 50a549c3ff
commit d6d5fa07f2
2 changed files with 114 additions and 52 deletions

View File

@ -78,12 +78,63 @@ ensure_url_filter(url)
---
## Plan fazowy
## Analiza zależności
### Faza 2: Auth + Account (NASTĘPNA)
### Funkcje pomocnicze
**Szacowany czas:** 2-3 godziny
**Redukcja app.py:** ~1,000 linii
| Funkcja | Lokalizacja | Status |
|---------|-------------|--------|
| `sanitize_input()` | utils/helpers.py | ✅ Gotowe |
| `validate_email()` | utils/helpers.py | ✅ Gotowe |
| `validate_password()` | utils/helpers.py | ✅ Gotowe |
| `ensure_url()` | utils/helpers.py | ✅ Gotowe |
| `admin_required` | utils/decorators.py | ✅ Gotowe |
| `verified_required` | utils/decorators.py | ✅ Gotowe |
### Dekoratory - zależności krytyczne!
```python
# utils/decorators.py używa:
url_for('auth.login') # Wymaga blueprintu 'auth'
url_for('public.index') # Wymaga blueprintu 'public'
```
**WNIOSEK:** Blueprinty `auth` i `public` muszą być wdrożone RAZEM, zanim można używać dekoratorów w innych blueprintach.
### Graf zależności
```
utils/helpers.py ──────────────────────────────────────┐
│ │
▼ │
utils/decorators.py ─────► wymaga: auth + public │
│ │
▼ │
┌──────────────────────────────────────────────────────┴─┐
│ FAZA 2 (KRYTYCZNA - razem!) │
│ ┌─────────┐ ┌─────────┐ │
│ │ auth │◄──►│ public │ ◄── wzajemne url_for │
│ └─────────┘ └─────────┘ │
└────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ FAZA 3+: Wszystkie pozostałe blueprinty │
│ - mogą używać utils/decorators.py │
│ - mogą używać url_for('auth.login') │
│ - mogą używać url_for('public.index') │
└─────────────────────────────────────────────────────────┘
```
---
## Plan fazowy (z uwzględnieniem zależności)
### Faza 2: Auth + Public (RAZEM - KRYTYCZNA!)
**Szacowany czas:** 4-5 godzin
**Redukcja app.py:** ~1,300 linii
**WAŻNE:** Te dwa blueprinty MUSZĄ być wdrożone razem!
#### 2.1 Blueprint: auth
@ -103,7 +154,35 @@ ensure_url_filter(url)
- `send_registration_notification()`
- Flask-Login
#### 2.2 Blueprint: account
#### 2.2 Blueprint: public
| Route | Endpoint |
|-------|----------|
| / | index |
| /company/<id> | company_detail |
| /company/<slug> | company_detail_by_slug |
| /company/<slug>/recommend | company_recommend |
| /osoba/<id> | person_detail |
| /search | search |
| /aktualnosci | events |
| /nowi-czlonkowie | new_members |
| /mapa-polaczen | connections_map |
| /release-notes | release_notes |
**Po wdrożeniu Fazy 2:**
- `url_for('auth.login')` działa ✅
- `url_for('public.index')` działa ✅
- Można używać `utils/decorators.py` w kolejnych fazach ✅
---
### Faza 3: Account + Forum
**Szacowany czas:** 3-4 godziny
**Redukcja app.py:** ~1,100 linii
**Zależności:** auth, public (Faza 2)
#### 3.1 Blueprint: account
| Route | Endpoint | Metody |
|-------|----------|--------|
@ -120,28 +199,6 @@ ensure_url_filter(url)
| /settings/blocks/remove/<id> | settings_blocks_remove | POST |
| /dashboard | dashboard | GET |
---
### Faza 3: Public + Forum
**Szacowany czas:** 3-4 godziny
**Redukcja app.py:** ~1,400 linii
#### 3.1 Blueprint: public
| Route | Endpoint |
|-------|----------|
| / | index |
| /company/<id> | company_detail |
| /company/<slug> | company_detail_by_slug |
| /company/<slug>/recommend | company_recommend |
| /osoba/<id> | person_detail |
| /search | search |
| /aktualnosci | events |
| /nowi-czlonkowie | new_members |
| /mapa-polaczen | connections_map |
| /release-notes | release_notes |
#### 3.2 Blueprint: forum
| Route | Endpoint |
@ -380,19 +437,21 @@ nordabiz/
## Harmonogram szacunkowy
| Faza | Zakres | Czas | Status |
|------|--------|------|--------|
| 1 | reports, community, education | 4h | ✅ DONE |
| 2 | auth, account | 3h | 🔜 Następna |
| 3 | public, forum | 4h | ⏳ |
| 4 | messages, notifications | 2h | ⏳ |
| 5 | chat | 2h | ⏳ |
| 6 | admin (8 modułów) | 8h | ⏳ |
| 7 | audits (6 modułów) | 5h | ⏳ |
| 8 | zopk (5 modułów) | 5h | ⏳ |
| 9 | api misc, honeypot | 2h | ⏳ |
| 10 | utils extraction | 2h | ⏳ |
| **RAZEM** | | **~37h** | |
| Faza | Zakres | Czas | Zależności | Status |
|------|--------|------|------------|--------|
| 1 | reports, community, education | 4h | utils/helpers | ✅ DONE |
| **2** | **auth + public (RAZEM!)** | **5h** | **utils/helpers** | 🔜 Następna |
| 3 | account, forum | 4h | Faza 2 | ⏳ |
| 4 | messages, notifications | 2h | Faza 2 | ⏳ |
| 5 | chat | 2h | Faza 2 | ⏳ |
| 6 | admin (8 modułów) | 8h | Faza 2 + decorators | ⏳ |
| 7 | audits (6 modułów) | 5h | Faza 2 + decorators | ⏳ |
| 8 | zopk (5 modułów) | 5h | Faza 2 + decorators | ⏳ |
| 9 | api misc, honeypot | 2h | Faza 2 | ⏳ |
| 10 | cleanup (usunięcie duplikatów z app.py) | 2h | Wszystkie fazy | ⏳ |
| **RAZEM** | | **~39h** | | |
**UWAGA:** Faza 2 jest krytyczna - `auth` i `public` muszą być wdrożone RAZEM, bo `utils/decorators.py` wymaga obu blueprintów.
---

View File

@ -52,18 +52,21 @@ nordabiz/
### Podsumowanie faz
| Faza | Zakres | Routes | Status |
|------|--------|--------|--------|
| **1** | reports, community, education | 19 | ✅ WDROŻONA |
| **2** | auth, account | ~20 | 🔜 Następna |
| **3** | public, forum | ~25 | ⏳ |
| **4** | messages, notifications | ~10 | ⏳ |
| **5** | chat | ~8 | ⏳ |
| **6** | admin (8 modułów) | ~60 | ⏳ |
| **7** | audits (6 modułów) | ~35 | ⏳ |
| **8** | zopk (5 modułów) | ~32 | ⏳ |
| **9** | api misc, honeypot | ~25 | ⏳ |
| **10** | utils extraction | - | ⏳ |
| Faza | Zakres | Routes | Zależności | Status |
|------|--------|--------|------------|--------|
| **1** | reports, community, education | 19 | utils/helpers | ✅ WDROŻONA |
| **2** | **auth + public (RAZEM!)** | ~28 | utils/helpers | 🔜 Następna |
| **3** | account, forum | ~25 | Faza 2 | ⏳ |
| **4** | messages, notifications | ~10 | Faza 2 | ⏳ |
| **5** | chat | ~8 | Faza 2 | ⏳ |
| **6** | admin (8 modułów) | ~60 | Faza 2 + decorators | ⏳ |
| **7** | audits (6 modułów) | ~35 | Faza 2 + decorators | ⏳ |
| **8** | zopk (5 modułów) | ~32 | Faza 2 + decorators | ⏳ |
| **9** | api misc, honeypot | ~25 | Faza 2 | ⏳ |
| **10** | cleanup | - | Wszystkie | ⏳ |
**⚠️ WAŻNE:** Faza 2 jest krytyczna - `auth` i `public` muszą być wdrożone RAZEM!
Powód: `utils/decorators.py` używa `url_for('auth.login')` i `url_for('public.index')`
**Cel:** Redukcja app.py z 15,570 → ~500 linii