Commit Graph

719 Commits

Author SHA1 Message Date
b505427355 fix: Update url_for to use api. blueprint prefix for migrated endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:57:18 +01:00
8e3346178d refactor: Move GBP and Social Audit API routes to blueprints
- Create blueprints/api/routes_gbp_audit.py (4 routes)
- Create blueprints/api/routes_social_audit.py (1 route)
- app.py: 6354 → 5860 lines (-494 total this batch)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:54:54 +01:00
60c19ec188 refactor: Migrate SEO audit API routes to api blueprint
- Created blueprints/api/routes_seo_audit.py with 3 routes:
  - /api/seo/audit (GET)
  - /api/seo/audit/<slug> (GET)
  - /api/seo/audit (POST - trigger)
- Includes helper functions for building audit responses
- Removed ~420 lines from app.py (6770 -> 6348)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:48:43 +01:00
52e5395a04 refactor: Migrate contacts API routes to api blueprint
- Created blueprints/api/routes_contacts.py with 2 routes:
  - /api/contacts/ai-parse (POST)
  - /api/contacts/bulk-create (POST)
- Includes AI prompts for contact parsing
- Removed ~300 lines from app.py (7063 -> 6764)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:42:18 +01:00
eaadef0bc1 refactor: Migrate recommendations API routes to api blueprint
- Created blueprints/api/routes_recommendations.py with 4 routes:
  - /api/recommendations/<company_id> (GET)
  - /api/recommendations/create (POST)
  - /api/recommendations/<rec_id>/edit (POST)
  - /api/recommendations/<rec_id>/delete (POST)
- Removed ~320 lines from app.py (7378 -> 7057)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:39:48 +01:00
3c5795ee4a refactor: Migrate announcements routes to public blueprint
- Created blueprints/public/routes_announcements.py with 2 routes:
  - /ogloszenia (announcements_list)
  - /ogloszenia/<slug> (announcement_detail)
- Added endpoint aliases for backward compatibility
- Removed ~130 lines from app.py (7506 -> 7378)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:37:08 +01:00
0337d1a0bb refactor: Migrate analytics API routes to api blueprint
- Created blueprints/api/ with 6 routes:
  - /api/analytics/track
  - /api/analytics/heartbeat
  - /api/analytics/scroll
  - /api/analytics/error
  - /api/analytics/performance
  - /api/analytics/conversion
- Added CSRF exemption for analytics routes
- Removed ~230 lines from app.py (7729 -> 7506)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:35:08 +01:00
e6cca4ec19 refactor: Migrate KRS API routes to admin blueprint
- Created blueprints/admin/routes_krs_api.py with 3 routes:
  - /admin/krs-api/audit (POST)
  - /admin/krs-api/audit/batch (POST)
  - /admin/krs-api/pdf/<company_id>
- Updated templates to use new URL paths
- Added endpoint aliases for backward compatibility
- Removed ~420 lines from app.py (8150 -> 7729)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:31:36 +01:00
236e929d10 refactor: Migrate IT Audit routes to it_audit blueprint
- Created blueprints/it_audit/ with 5 routes:
  - /it-audit/form (it_audit_form)
  - /it-audit/save (it_audit_save)
  - /api/it-audit/matches/<company_id>
  - /api/it-audit/history/<company_id>
  - /api/it-audit/export
- Added endpoint aliases for backward compatibility
- Removed ~600 lines from app.py (8750 -> 8150)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:25:28 +01:00
ab15cf3cba refactor: Migrate ZOPK public routes to public blueprint
- Created blueprints/public/routes_zopk.py with 3 public routes:
  - /zopk (zopk_index)
  - /zopk/projekty/<slug> (zopk_project_detail)
  - /zopk/aktualnosci (zopk_news_list)
- Added endpoint aliases for backward compatibility
- Removed ZOPK public routes from app.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:19:53 +01:00
bdae7f5309 fix: Add ZOPK endpoint aliases for backward compatibility
Templates use url_for('admin_zopk') but blueprint endpoints are
'admin.admin_zopk'. Added aliases in blueprints/__init__.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:12:46 +01:00
f36aa07137 fix: Remove non-existent routes_ai_usage import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:08:15 +01:00
49830855a2 refactor: Migrate ZOPK and Users API routes to admin blueprint
Major refactoring to reduce app.py size by ~22%:
- Move all ZOPK routes (47 endpoints) to 4 blueprint files:
  - routes_zopk_dashboard.py - main dashboard
  - routes_zopk_news.py - news management, scraping, AI evaluation
  - routes_zopk_knowledge.py - knowledge base, embeddings, graph
  - routes_zopk_timeline.py - milestones management
- Move Users API routes to routes_users_api.py:
  - /admin/users-api/ai-parse - AI-powered user parsing
  - /admin/users-api/bulk-create - bulk user creation
- Move notify-release to routes.py

app.py reduced from 11518 to 8916 lines (-22.6%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:05:36 +01:00
351c8fba75 refactor: Move admin_model_comparison routes to admin blueprint
- Created routes_model_comparison.py with model comparison functionality
- Updated base.html to use full blueprint name
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:48:18 +01:00
532d666fa8 refactor: Move admin_ai_usage routes to admin blueprint
- Added admin_ai_usage and admin_ai_usage_user to routes_analytics.py
- Updated templates to use full blueprint names (admin.admin_ai_usage)
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:43:28 +01:00
8909641ff3 refactor: Migrate analytics routes to blueprints
- Create new blueprints/admin/routes_analytics.py (~350 lines)
- Move admin_analytics and admin_analytics_export routes
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2b - Analytics dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:36:23 +01:00
9b9ae40932 refactor: Add ai-learning-status and chat-stats API to blueprints
- Add api_ai_learning_status and api_chat_stats to routes_insights.py
- Update chat_analytics template to use new API path
- Add endpoint aliases for backward compatibility

Phase 6.2b - AI API routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:31:29 +01:00
42f04e065f refactor: Migrate insights routes to blueprints
- Create new blueprints/admin/routes_insights.py
- Move 5 insights routes (dashboard + API endpoints)
- Update template to use new /admin/insights-api/* paths
- Add endpoint aliases for backward compatibility

Phase 6.2b - Insights routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:27:35 +01:00
54c1878d66 refactor: Migrate announcements routes to blueprints
- Create new blueprints/admin/routes_announcements.py
- Move 6 announcements routes to blueprint
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2d - Announcements routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:41:49 +01:00
82162874b8 refactor: Migrate security routes to blueprints
- Create new blueprints/admin/routes_security.py
- Move 5 security routes: admin_security, acknowledge_security_alert,
  resolve_security_alert, unlock_account, api_geoip_stats
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2d - Security routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:39:12 +01:00
470e2a8bb7 refactor: Migrate admin_it_audit to blueprints
- Move IT audit dashboard route to blueprints/admin/routes_audits.py
- Add ITAudit, ITCollaborationMatch imports
- Update base.html template to use full blueprint name
- Add endpoint alias for backward compatibility

Phase 6.2f continued

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:25:31 +01:00
806f9e730e refactor: Migrate digital_maturity_dashboard and admin_krs_audit to blueprints
- Move routes from app.py to blueprints/admin/routes_audits.py
- Add endpoint aliases for backward compatibility
- Update base.html template to use full blueprint names
- Comment old routes in app.py with _old_ prefix

Phase 6.2f of blueprint migration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:19:56 +01:00
9dedab2929 refactor: Faza 6.2e - Social Media do blueprintu admin
Przeniesiono 2 trasy do blueprints/admin/routes_social.py:
- admin_social_media (analytics dashboard)
- admin_social_audit (audit dashboard)

Zaktualizowano szablony:
- base.html, dashboard.html, social_audit_dashboard.html

Dodano aliasy dla kompatybilności wstecznej.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:07:51 +01:00
61a32d9bfa refactor: Faza 6.2c - Status, Health, Debug do blueprintu admin
Przeniesiono 9 tras do blueprints/admin/routes_status.py:
- admin_status, api_admin_status
- admin_health, api_admin_health
- debug_panel
- api_get_logs, api_logs_stream, api_clear_logs, api_test_log

Zaktualizowano szablony na pełne nazwy blueprintów:
- base.html: admin.admin_status, admin.admin_health
- health_dashboard.html: admin.admin_status

Dodano aliasy dla kompatybilności wstecznej.
Stare trasy w app.py oznaczone jako _old_* (do usunięcia po weryfikacji).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:59:15 +01:00
dd4eb52521 refactor: Aliasy admin_seo/gbp_audit + poprawka chat.chat_analytics
- Dodano aliasy w blueprints/__init__.py dla admin_seo i admin_gbp_audit
- Poprawiono url_for('chat_analytics') na url_for('chat.chat_analytics')
  (trasa już jest w blueprincie chat)

Minimalne, bezpieczne zmiany zgodne z metodologią.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:41:28 +01:00
978481ec00 refactor: Użycie pełnych nazw blueprintów w szablonach admin
Zamieniono url_for('admin_*') na url_for('admin.admin_*') dla tras
już przeniesionych do blueprintu admin. Zgodnie z metodologią
bezpiecznego wdrażania - pełne nazwy blueprintów są niezawodne,
aliasy mogą nie działać dla tras w oddzielnych plikach.

Zaktualizowane pliki:
- base.html (4 linki)
- dashboard.html (2 linki)
- calendar/admin.html (2 linki)
- calendar/admin_new.html (3 linki)
- calendar/index.html (1 link)
- admin/fees.html (2 linki)
- admin/analytics_dashboard.html (1 link)

Zapobiega awariom produkcji przy dalszym refaktoringu.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:33:25 +01:00
e116eeadc6 docs: Add safe deployment methodology after production incident
- Document incident 2026-01-31 (alias failure)
- New rule: Use full blueprint names, NOT aliases
- New procedure: Update templates BEFORE moving routes
- Enhanced checklist: Test page rendering, not just HTTP status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:29:24 +01:00
67d35c5d61 fix: Use full blueprint endpoint names in base.html
admin_seo -> admin.admin_seo
admin_gbp_audit -> admin.admin_gbp_audit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:24:52 +01:00
52ffdafd00 refactor: Remove dead SEO/GBP audit code from app.py
Removed 280 lines of dead code after moving to blueprint.
app.py: 11,774 → 11,494 lines (-280)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:20:07 +01:00
1384c7f090 refactor: Add SEO & GBP audit routes to admin blueprint (Phase 6.2a)
- Created blueprints/admin/routes_audits.py (2 routes)
- admin_seo, admin_gbp_audit moved from app.py
- Aliases created for backward compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:16:22 +01:00
ba0baf1305 fix: Correct template paths for admin calendar
- calendar/admin.html (not admin/calendar.html)
- calendar/admin_new.html (not admin/calendar_form.html)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:12:15 +01:00
80ec8dd949 docs: Update metrics after Phase 6.1 cleanup
app.py reduced from 12,600 to 11,774 lines (-826)
Total reduction: 24.4% from start

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:10:32 +01:00
3e834c168c refactor: Remove dead admin code after Phase 6.1 verification
Removed 831 lines of dead code (_old_* functions):
- Recommendations: 3 functions
- Users: 8 functions
- Fees: 5 functions
- Calendar admin: 3 functions

app.py: 12,605 → 11,774 lines (-831)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:09:42 +01:00
214eadeaf0 docs: Update refactoring status after Phase 6.1
- Admin blueprint Part 1 deployed (19 routes)
- Added metrics for blueprints/admin/routes.py (828 lines)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:06:08 +01:00
44268c5425 refactor: Extract admin blueprint Part 1 (Phase 6)
Moved 19 admin routes to blueprints/admin/:
- Recommendations: 3 routes (list, approve, reject)
- Users: 8 routes (list, add, toggle-admin, toggle-verified, update, assign-company, delete, reset-password)
- Fees: 5 routes (list, generate, mark-paid, bulk-mark-paid, export)
- Calendar admin: 3 routes (list, new, delete)

Note: AI-parse routes (/api/admin/users/ai-parse, ai-create) remain in app.py.

Aliases created for backward compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:05:06 +01:00
55718ed211 refactor: Extract chat blueprint (Phase 5)
- Create blueprints/chat/ with 9 routes:
  - chat, chat_settings, chat_start, chat_send_message
  - chat_get_history, chat_list_conversations, chat_delete_conversation
  - chat_feedback, chat_analytics
- Register chat blueprint with backward-compatible aliases
- Remove dead code from app.py (-458 lines)
- app.py: 13,058 → 12,600 lines (-3.5%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:54:08 +01:00
0f482cc4aa refactor: Extract messages + notifications blueprint (Phase 4)
- Create blueprints/messages/ with 11 routes:
  - messages_inbox, messages_sent, messages_new, messages_send
  - messages_view, messages_reply, api_unread_count
  - api_notifications, api_notification_mark_read
  - api_notifications_mark_all_read, api_notifications_unread_count
- Register messages blueprint with backward-compatible aliases
- Remove dead code from app.py (-340 lines)
- app.py: 13,398 → 13,058 lines (-2.5%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:47:55 +01:00
ad2262388b refactor: Extract forum blueprint (Phase 3)
- Create blueprints/forum/ with 10 routes:
  - forum_index, forum_new_topic, forum_topic, forum_reply
  - admin_forum, admin_forum_pin, admin_forum_lock
  - admin_forum_delete_topic, admin_forum_delete_reply
  - admin_forum_change_status
- Register forum blueprint with backward-compatible aliases
- Remove dead code from app.py (-422 lines)
- app.py: 13,820 → 13,398 lines (-3.1%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:42:18 +01:00
e06d3b172d docs: Mark Phase 2a as deployed to production
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:34:37 +01:00
0ccb1093b8 docs: Update refactoring status after Phase 2a completion
- Phase 2a marked as complete (DEV ready)
- Updated metrics: 15,577 → 13,820 lines (-11.3%)
- Documented Alias Bridge methodology
- Updated harmonogram

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:30:31 +01:00
cdd050a0ef refactor(phase2a): Cleanup dead code after blueprint migration
Removed 31 _old_ functions from app.py that were migrated to blueprints.

Stats:
- Lines removed: 1,757 (11.3% reduction)
- app.py: 15,577 → 13,820 lines

All endpoints tested and working:
- Public: /, /login, /register, /health, /release-notes
- Protected: /dashboard, /search, /kalendarz/, /chat
- Aliases: url_for('login') = url_for('auth.login')

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:29:31 +01:00
d5adf029aa refactor(phase2a): Extract auth + public blueprints with Alias Bridge
Phase 2a of modular monolith refactoring:

New blueprints:
- blueprints/auth/routes.py (1,040 lines, 20 routes)
  - login, logout, register, verify_2fa, settings_2fa
  - forgot_password, reset_password, verify_email
  - konto_dane, konto_prywatnosc, konto_bezpieczenstwo, konto_blokady
- blueprints/public/routes.py (862 lines, 11 routes)
  - index, company_detail, person_detail, search
  - dashboard, events, new_members, release_notes

Alias Bridge strategy:
- Both url_for('login') and url_for('auth.login') work
- Templates don't require changes (backward compatible)
- Original routes in app.py marked with _old_ prefix (dead code)

Next step: Cleanup dead code from app.py after production verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:28:18 +01:00
9c39ff06ba docs: Strategia Alias Bridge dla bezpiecznego wdrożenia Fazy 2
Odkrycie: Flask pozwala zarejestrować ten sam URL pod dwoma nazwami
- url_for('login') i url_for('auth.login') mogą współistnieć
- Zero zmian w szablonach podczas wdrożenia blueprintów

Strategia 3 podfaz:
- Faza 2a: Blueprinty + aliasy (niskie ryzyko)
- Faza 2b: Stopniowa migracja szablonów
- Faza 2c: Usunięcie aliasów

Porównanie z Big Bang: 20 vs 125 plików do zmiany naraz

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 06:54:56 +01:00
d6d5fa07f2 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>
2026-01-31 06:44:57 +01:00
50a549c3ff docs: Plan refaktoryzacji - Modularny Monolit (10 faz)
- Szczegółowy plan wydzielenia 235 routes do ~25 blueprintów
- Kategoryzacja routes według modułów
- Harmonogram 10 faz (~33h pracy)
- Docelowa struktura katalogów
- Zasady refaktoryzacji i procedury wdrożenia

Cel: Redukcja app.py z 15,570 → ~500 linii

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 06:40:49 +01:00
aea65b0bad docs: Aktualizacja statusu refaktoringu - Faza 1 wdrożona
- Status Fazy 1 zmieniony na "WDROŻONA NA PRODUKCJĘ"
- Dodano datę wdrożenia (2026-01-28)
- Usunięto nieaktualną blokadę wdrożeń
- Zaktualizowano harmonogram z checkboxami statusu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 06:27:06 +01:00
2158c409a6 fix: Powiadomienia znikają po przeczytaniu
- Lista pokazuje tylko nieprzeczytane (unread_only=true)
- Po kliknięciu powiadomienie znika z animacją
- "Oznacz wszystkie" usuwa wszystkie z listy
- Animacja fadeOut dla płynnego usuwania

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:43:26 +01:00
69c0d7fc72 style: Ładny modal potwierdzenia w release notes
- Modal z ikoną dzwoneczka zamiast natywnego confirm()
- Toast zamiast alert() dla wyników
- Informacja o działaniu powiadomień

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:39:07 +01:00
85cb5f14e0 docs: Release notes v1.21.0 - zmiany z 30 stycznia 2026
- Moje konto: nowa sekcja ustawień
- Forum/B2B: panel moderacji dla admina
- Reset hasła: auto-weryfikacja emaila
- UX: ikonka oka, ładne modale

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:36:24 +01:00
4ac2fd93e4 fix: Usunięto placeholder video "Jak korzystać z NordaGPT" z Akademii
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:35:01 +01:00