- Dodano stałą globalną COMPANY_COUNT_MARKETING w app.py
- Dodano do context_processor jako COMPANY_COUNT
- Zaktualizowano szablony: index.html, chat.html, landing.html, release_notes
- Jedno miejsce do zmiany gdy Izba zaktualizuje cel
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Health monitoring:
- Dodano: /settings/privacy, /settings/blocks, /settings/2fa
- Dodano: /wiadomosci, /wiadomosci/wyslane, /wiadomosci/nowa
- Dodano: /edukacja, /admin/insights
Release notes:
- Połączono v1.18.0 i v1.19.0 w jeden wpis (28 stycznia 2026)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Zmiany w kategoriach:
- Utworzono "Budownictwo ogólne" (9 firm) i "Produkcja ogólna" (13 firm)
- Utworzono "Usługi finansowe" (banki, kantory, ubezpieczenia)
- Rozdzielono "Księgowość" od "Usługi finansowe"
- Przeniesiono INPI i SEO PARTNER do "IT i Technologie"
- Dodano kategorię "Do uzupełnienia" (żółta, 27 firm bez opisu)
Zmiany UI:
- Sortowanie podkategorii malejąco po liczbie firm
- Poprawka podświetlania aktywnej kategorii
- Dropdown blokowania: domena emaila przy duplikatach nazw
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Nowe funkcje w v1.18.0 (28 stycznia 2026):
- Prywatność: ukrywanie telefonu/emaila, preferencje kontaktu
- Blokowanie kontaktów (bidirectional)
- Hierarchiczne kategorie firm
- Platforma Edukacyjna
- Panel Insights dla adminów
- RODO: sanityzacja danych wrażliwych w czacie
- Security: izolacja sesji czata
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Automatyczne wykrywanie i maskowanie danych wrażliwych w czacie:
- PESEL (walidacja sumy kontrolnej)
- Numery kart kredytowych (algorytm Luhn)
- IBAN (konta bankowe)
- Hasła (detekcja kontekstowa)
- Dowody osobiste i paszporty
NIE wykrywa (zgodnie z wymogami):
- NIP (publiczne dane biznesowe)
- Adresy email (celowo podawane)
API dla adminów: POST /api/admin/test-sanitization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ZMIANY BEZPIECZEŃSTWA:
1. Defense in depth w NordaBizChatEngine:
- send_message() - wymaga user_id i weryfikuje właściciela rozmowy
- get_conversation_history() - opcjonalna walidacja user_id
- Logowanie prób nieautoryzowanego dostępu
2. Anonimizacja w panelu admina:
- Usunięto wyświetlanie treści zapytań użytkowników
- Zastąpiono statystykami: długość, kategoria tematyczna
- Zachowano AI responses (publiczne dane firm)
3. Ochrona prywatności:
- Użytkownicy NIE mogą zobaczyć zapytań innych użytkowników
- Admini widzą tylko zanonimizowane statystyki
- Audit logging dla prób nieautoryzowanego dostępu
Odblokowuje zadanie #10 (Baza wiedzy Norda GPT).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Użytkownicy mogą teraz wskazać preferowane kanały komunikacji:
- Email, telefon, wiadomości w portalu (toggle)
- Dodatkowa notatka (np. najlepsze godziny kontaktu)
Migracja: 031_add_contact_preferences.sql
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Główne kategorie jako wyróżnione przyciski
- Podkategorie z mniejszym fontem
- filterCategoryGroup() - filtruje po grupie (główna + podkategorie)
- Nowe style: category-main, category-sub, category-group
- Zachowano kompatybilność wsteczną z płaską strukturą
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa tabela user_blocks do przechowywania blokad
- Model UserBlock w database.py
- Sprawdzanie blokad przed wysłaniem wiadomości (messages_send, messages_reply)
- UI zarządzania blokadami w /settings/blocks
- Nawigacja między ustawieniami (prywatność, blokady, 2FA)
- Blokada działa w obie strony
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowe pola: privacy_show_phone, privacy_show_email w tabeli users
- Nowy route /settings/privacy z UI do zarządzania prywatnością
- Link "Ustawienia" w menu użytkownika
- Toggle switches do włączania/wyłączania widoczności danych
- Migracja SQL: 028_add_user_privacy_settings.sql
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- notify_all_users_release(): Notify all users about new system version
- notify_all_users_announcement(): Notify all users about new announcement
- Auto-send notifications when admin publishes an announcement
- New admin endpoint POST /admin/notify-release for manual release notifications
- Category-specific icons for announcement notifications
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Używa istniejącego email_service.py z Microsoft Graph API
- Ładniejszy HTML email z dark theme
- Usunięto niepotrzebne importy smtplib/MIMEText
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Naprawia ostrzeżenie HTTP 308 w Health Check Dashboard.
Flask blueprint z url_prefix='/raporty' wymaga trailing slash.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Obsługa pola 'text' z frontendu (oprócz 'content')
- Zmiana nazw pól odpowiedzi: ai_response→analysis, proposed_contacts→contacts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano modal "Dodaj z AI" z parsowaniem tekstu/obrazów przez Gemini
- API endpoints: /api/contacts/ai-parse, /api/contacts/bulk-create
- Nowy widok grupowania kontaktów po organizacji (domyślny)
- Widok tabeli dla kompaktowego przeglądu
- Przełącznik widoków z zapamiętywaniem preferencji
- Drag & drop dla zdjęć wizytówek
- Docker: PostgreSQL 16 (zgodność z produkcją)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowy model ExternalContact z pełnymi danymi kontaktowymi, social media, related_links (JSONB)
- Migracja SQL 020_external_contacts.sql z full-text search
- Routes: /kontakty (lista), /kontakty/dodaj, /kontakty/<id>, /kontakty/<id>/edytuj
- Szablony: lista z filtrami, karta szczegółów, formularz CRUD
- Nawigacja: link "Kontakty zewnętrzne" w dropdown Społeczność
- Poprawka: aktualizacja liczby firm z 80 na 111
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa tabela announcement_reads do śledzenia kto przeczytał
- Avatary użytkowników z inicjałami (tooltip z nazwiskiem)
- Statystyki: liczba i procent użytkowników którzy przeczytali
- Progress bar wizualizujący zasięg ogłoszenia
- Automatyczny zapis odczytu przy otwarciu ogłoszenia
Autor: Maciej Pienczyn
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano funkcje automatycznego uzupełniania Timeline z bazy wiedzy:
- get_timeline_suggestions() - pobiera milestone facts jako sugestie
- create_milestone_from_suggestion() - tworzy milestone z faktu
- categorize_milestones_with_ai() - kategoryzacja AI (nuclear/offshore/etc)
- Auto-detekcja kategorii, dat i statusu z tekstu polskiego
- API endpoints:
- GET /api/zopk/timeline/suggestions - lista sugestii z bazy wiedzy
- POST /api/zopk/timeline/suggestions/approve - zatwierdź sugestię
- Fix: /zopk zwracał 500 (nieistniejąca kolumna is_verified)
- Dodano kolumnę is_verified do modelu ZOPKMilestone
- Usunięto filtr is_verified z query (do migracji)
- Health check rozszerzony z 15 do 55+ endpointów:
- Public pages, Raporty, ZOPK, Chat, IT Audit
- API publiczne, Admin Core, Admin Audits, Admin ZOPK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Zalogowani użytkownicy z is_admin=True są teraz wyłączeni z limitów
requestów (request_filter=is_admin_exempt). Rozwiązuje problem
"Too Many Requests" w panelu admina ZOPK.
Limity dla zwykłych użytkowników pozostają bez zmian:
- 200/dzień
- 50/godzinę
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa funkcja find_similar_to_verified_facts() w zopk_knowledge_service.py
używa pg_trgm do wyszukiwania podobnych faktów
- Nowa funkcja auto_verify_similar_to_verified() automatycznie weryfikuje
fakty podobne do już zweryfikowanych (próg 80% podobieństwa)
- Nowy endpoint POST /api/zopk/knowledge/auto-verify/similar
- Nowy endpoint GET /api/zopk/knowledge/suggest-similar-facts
- Przycisk "Ucz się z weryfikacji" na dashboardzie bazy wiedzy ZOPK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano skrypt cron do automatycznej ekstrakcji wiedzy (scripts/cron_extract_knowledge.py)
- Dodano panel deduplikacji faktów (/admin/zopk/knowledge/fact-duplicates)
- Dodano API i funkcje auto-weryfikacji encji i faktów
- Dodano panel Timeline ZOPK (/admin/zopk/timeline) z CRUD
- Rozszerzono dashboard bazy wiedzy o statystyki weryfikacji i przyciski auto-weryfikacji
- Dodano migrację 016_zopk_milestones.sql dla tabeli kamieni milowych
- Naprawiono duplikat modelu ZOPKMilestone w database.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano in-memory cache dla API /api/zopk/knowledge/graph/data
- Cache key oparty o parametry: entity_type, min_cooccurrence, limit
- TTL = 300 sekund (5 minut)
- Flaga 'cached' w odpowiedzi informuje czy dane z cache
Korzyść: Drugie i kolejne ładowania grafu są natychmiastowe.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano endpoint /admin/zopk/knowledge/graph z wizualizacją D3.js
- Dodano API endpoint /api/zopk/knowledge/graph/data
- Graf współwystępowania encji z kolorami według typu
- Rozmiar węzłów proporcjonalny do liczby wzmianek
- Filtry: typ encji, minimalna liczba współwystąpień
- Tooltips z informacjami o encjach
- Zoom i drag-and-drop interakcje
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Nowe funkcje w zopk_knowledge_service.py:
- find_duplicate_entities() - wyszukiwanie podobnych encji (pg_trgm)
- merge_entities() - łączenie encji z transferem relacji
- get_entity_merge_preview() - podgląd przed połączeniem
Nowe endpointy w app.py:
- GET /admin/zopk/knowledge/duplicates - panel zarządzania duplikatami
- POST /api/zopk/knowledge/duplicates/preview - podgląd merge
- POST /api/zopk/knowledge/duplicates/merge - wykonanie merge
Nowy szablon:
- templates/admin/zopk_knowledge_duplicates.html - UI z kartami encji
Dodatkowo:
- Aktualizacja CLAUDE.md z procedurą wdrażania
- Skrypt scripts/run_migration.py do uruchamiania migracji SQL
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Priorytet 1 - Panel admina bazy wiedzy ZOPK:
- /admin/zopk/knowledge - dashboard ze statystykami
- /admin/zopk/knowledge/chunks - lista chunks z filtrowaniem
- /admin/zopk/knowledge/facts - lista faktów z typami
- /admin/zopk/knowledge/entities - lista encji z mentions
- CRUD operacje: weryfikacja, usuwanie
Priorytet 2 - Poprawa jakości odpowiedzi NordaGPT:
- Linki markdown do źródeł w kontekście ZOPK
- Ulepszone formatowanie (bold, listy, nagłówki)
- Sekcja "Źródła" na końcu odpowiedzi
- Instrukcje w system prompt dla lepszej prezentacji
Priorytet 3 - Timeline ZOPK:
- Model ZOPKMilestone w database.py
- Migracja 016_zopk_milestones.sql z sample data
- Sekcja "Roadmapa ZOPK" na stronie /zopk
- Pionowa oś czasu z markerami lat
- Statusy: completed, in_progress, planned, delayed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: Podwójny import ZOPKContentScraper powodował błąd 'cannot access local variable'
Rozwiązanie: Przeniesiono import na początek funkcji generate()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dodano Server-Sent Events (SSE) dla śledzenia postępu w czasie rzeczywistym:
- Scraping treści artykułów
- Ekstrakcja wiedzy przez Gemini AI
- Generowanie embeddingów
Funkcje:
- Modal z paskiem postępu i statystykami
- Live log operacji z kolorowaniem statusów
- Podsumowanie na zakończenie (sukces/błędy/czas)
- Możliwość zamknięcia modalu po zakończeniu
Zmiany techniczne:
- 3 nowe SSE endpointy (/stream)
- ProgressUpdate dataclass w scraperze
- Callback pattern w batch_scrape, batch_extract, generate_chunk_embeddings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Endpoint /admin/news był planowany (dokumentacja CLAUDE.md) ale nigdy
nie zaimplementowany. Tylko /admin/zopk/news istnieje.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano pasek statystyk newsów (łącznie, dzień, tydzień, miesiąc)
- Zwiększono limit wyświetlanych newsów z 10 do 25
- Usunięto przycisk "Zobacz wszystkie" - pełny widok od razu
- Przycisk "Starsze aktualności" pojawia się gdy jest więcej niż 25
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BUG: Strona publiczna pokazywała tylko status='approved',
ale AI ustawia status='auto_approved' dla newsów 3+★.
Wynik: Newsy zatwierdzone przez AI NIE pojawiały się publicznie!
Naprawione miejsca:
- /zopk (strona główna ZOPK)
- /zopk/projekt/<slug> (szczegóły projektu)
- /zopk/aktualnosci (lista newsów)
Teraz wszystkie 3 miejsca pokazują obie wartości:
status IN ('approved', 'auto_approved')
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa funkcja reevaluate_low_score_news() szuka newsów z 1-2★
zawierających Via Pomerania, NORDA, S6, Droga Czerwona, etc.
- Nowy endpoint POST /admin/zopk/news/reevaluate-low-scores
- Przycisk w UI "Re-ewaluuj niskie oceny" z szczegółowym raportem
- Automatyczne auto-approve jeśli nowa ocena >= 3★
Problem: Artykuły o Via Pomerania miały 1★ bo były ocenione
przed dodaniem tego tematu do promptu AI.
Rozwiązanie: Re-ewaluacja nowym promptem podniesie ich oceny.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Zamiana auto-odświeżania na przycisk OK
- Dodanie sekcji szczegółowych statystyk (12 metryk)
- Dodanie listy artykułów odrzuconych przez AI
- Śledzenie czasu przetwarzania
- API zwraca nowe pola: sent_to_ai, ai_rejected_articles, processing_time
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes:
- Lower auto-approve threshold from 4★ to 3★ (verified 2026-01-15)
- Add detailed progress bar for ZOPK search process
- Add auto-approved articles list with star ratings
- Document ZOPK topics (ZOP Kaszubia) in CLAUDE.md
- Add 8-second countdown before auto-refresh
Technical:
- zopk_news_service.py: Changed score threshold from >=4 to >=3
- Templates: New CSS for progress phases and results display
- CLAUDE.md: Added "ZOP Kaszubia News" section with topic guidelines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
429 (Too Many Requests) means the endpoint is working correctly
and is protected by rate limiting - this is expected behavior
for /register endpoint.
- Add 429 to acceptable status codes (200, 302, 304, 429)
- Update legend to explain 429 means protection is working
- Apply to all health check endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Always check INPI and Waterm profiles (fixed)
- Add 3 random company profiles each refresh
- Total 5 company profiles tested for better coverage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/health route with visual status indicators
- Create health_dashboard.html with category-based endpoint cards
- Color-coded status: green (OK), yellow (warning), red (error)
- Show response times with color indicators (fast/medium/slow)
- Add HTTP status code legend
- Auto-refresh every 2 minutes
- Add link in admin navigation menu
- Categories: public pages, auth, API, admin panel, company profiles
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Verify all software versions via SSH (NORDABIZ-01, R11-REVPROXY-01, Proxmox)
- Remove Redis (not used), Gunicorn (app runs directly via python)
- Add PostgreSQL version dynamic fetch from database
- Add Docker version for R11-REVPROXY-01
- Update all package versions to verified values
- Handle unknown versions (Fortigate) with yellow "nieznana" badge
- Add comment with verification date (2026-01-14)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/status route with real-time system metrics (CPU, RAM, disk)
- Add /api/admin/status API endpoint for auto-refresh
- Add technology stack section showing all platform technologies
- Add auto-refresh (5 min) to GeoIP stats in security dashboard
- Add "Status systemu" link to admin navigation menu
- Fix /health/full endpoint list (remove non-existent endpoints)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Checks 14 critical endpoints (public + admin pages)
- Returns JSON with pass/fail status for each endpoint
- HTTP 200 if all OK, HTTP 503 if any failures
- Useful for deployment verification and monitoring
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GeoIP blocking, security panel, and stats to v1.16.0 release notes
- Add comprehensive security mechanisms table to CLAUDE.md
- Document GeoIP configuration and MaxMind setup
- List all 12 security mechanisms with star ratings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New 'Mechanisms' tab listing all security features with star ratings (5★=critical)
- New 'GeoIP' tab with blocking statistics (daily/monthly/yearly/total)
- Country breakdown with flags for blocked connections
- Status indicators for each security mechanism
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update security_service.py with BLOCKED_COUNTRIES list
- Add check_geoip() middleware in app.py
- Log blocked attempts with security alerts
- Uses MaxMind GeoLite2-Country database
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Trap URLs: /wp-admin, /phpmyadmin, /.env, /.git/config, etc.
- Log to security.log for fail2ban integration
- Instant 24h ban via fail2ban after 1 hit
- Company.category is a relationship, not a column
- Use Company.category_id for grouping and filtering
- Load category names via separate query to Category table
Fixes 500 error on /raporty/struktura-branzowa
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add .label('category') to SQLAlchemy query for proper Row attribute access
- Change filter_by to filter() for better NULL handling
Fixes 500 error on /raporty/struktura-branzowa
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed AI model from Gemini 2.0 Flash to Gemini 2.5 Flash-Lite
- Added info button next to model badge in chat header
- Created modal with technical specs and development history timeline
- Benefits: 8x longer responses (65k tokens), 4x daily limit (1000 RPD)
- Model remains FREE (Free Tier)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Endpointy /api/chat/start i /api/chat/{id}/message
wymagały tokenu CSRF, co blokowało żądania z JavaScript.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano API /api/chat/conversations (lista konwersacji użytkownika)
- Dodano API DELETE /api/chat/<id>/delete (usuwanie konwersacji)
- Przebudowano chat.html z sidebarem historii (styl ChatGPT)
- Sidebar z listą konwersacji, przyciski "Nowa rozmowa" i usuwania
- Responsywny design dla mobile (toggle sidebar)
- Integracja ze stylem NordaGPT (purple gradient header)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano link Raporty w menu nawigacyjnym (dla zalogowanych)
- Utworzono 3 raporty generowane w czasie rzeczywistym:
- Staż członkostwa w Izbie NORDA
- Pokrycie Social Media (6 platform)
- Struktura branżowa (kategorie firm)
- Dodano dokumentację strategii monetyzacji 3-tier pricing
- Release notes v1.18.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Data przystąpienia do Izby NORDA (member_since)
- Karta "Członek Izby NORDA od" z datą i stażem w latach
- Import 57 firm z historią od 1997 roku
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa kolumna member_since w tabeli companies
- Karta "Członek Izby NORDA od" na profilu firmy (niebieski kolor #3b82f6)
- Wyświetlanie liczby lat w Izbie
- Import 57 dat przystąpienia z pliku Excel od Artura
- Skrypt import_member_since.py do importu dat
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Batch SEO audit was stopping after 10 companies due to
restrictive rate limit. Increased to 200/hour to allow
full batch processing of all companies.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Search Brave API for company news and web results
- Fetch company website content with BeautifulSoup
- Combine all sources (database, Brave, website) in AI prompt
- Return source usage info in API response
- Add "Wzbogac dane AI" button visible to all users
- Button enabled only for admins and company owners
- New API endpoint POST /api/company/<id>/enrich-ai
- Integrates with Gemini AI to generate:
- Business summary
- Services list
- Target market
- Unique selling points
- Company values
- Certifications
- Industry tags
- Rate limited to 5 requests/hour per user
- Results saved to CompanyAIInsights table
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show all PKD codes from KRS audit (not just main one)
- Primary PKD highlighted with 'GŁÓWNY' badge
- Secondary PKDs listed below with descriptions
- Fallback to CEIDG data if no KRS audit data
- Shows source (eKRS or CEIDG) and total count
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- All columns now sortable (click header to sort asc/desc)
- PKD codes displayed with primary code highlighted (★)
- Show first 2 PKD codes, click '+N more' for tooltip with all
- Backend returns full PKD codes list instead of just count
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Increase rate limit from 20/hour to 200/hour for batch operations
- Add nip, regon, liczba_udzialow, prokurenci_count to API response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New admin panel /admin/krs-audit for KRS data extraction
- Full PDF parser extracting: company data, capital, shares, PKD codes,
management board, shareholders, procurators, financial reports
- API endpoints for single/batch audits and PDF download
- Company profile shows "Odpis PDF" button and last audit date
- Database migration for krs_audits, company_pkd, company_financial_reports
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show next upcoming event banner on main page (after login)
- Display event title, date, time, location
- Show attendee count with Polish grammar
- Button changes to "Jesteś zapisany/a" when registered
- Orange gradient design to attract attention
- Responsive layout for mobile
Replaces WhatsApp polls for event attendance tracking.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New features:
- GBP audit: Educational section explaining Google Business Profile
- GBP audit: Direct link to Google Maps business listing
- GBP audit: Full audit with Places API for 40 companies
- Clickable audit banners linking to detail pages
- Inline audit sections on company profile
Improvements:
- Unified 5-level color scale for all audits
- Social Media score as percentage
- URL normalization for company websites
Fixes:
- ZOPK stakeholder duplicates removed
- Unique constraint to prevent future duplicates
- SEO score consistency between views
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed Social Media audit banner to show percentage score (e.g., 16%)
instead of platform count, matching the detailed audit page
- Fixed SEO score inconsistency by sorting website_analysis query by
seo_audited_at desc (same as seo_audit_dashboard)
- Both audit sections on company profile now show same values as
their detailed pages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add normalize_social_url() function to database.py to prevent
www vs non-www duplicates in social media records
- Update update_social_media.py to normalize URLs before insert
- Update social_media_audit.py to normalize URLs before insert
- Add inline GBP Audit section to company profile
- Add inline Social Media Audit section to company profile
- Add inline IT Audit section to company profile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix XSS: innerHTML → textContent for modal messages
- Fix XSS: Safe DOM element creation for toast notifications
- Add project_id validation in admin_zopk_news_add
- Add URL protocol validation (allow only http/https)
- Hide exception details from API responses (log instead)
- Add rate limiting (60/min) on public ZOPK routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update navigation menu labels
- Update page titles and headings
- Update modal texts and notifications
- Keep internal class names (ZOPKNews, etc.) unchanged
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Search people by imiona/nazwisko with partial match (ILIKE)
- Display person cards with avatar, name, company count
- Show "Znaleziono X firm i Y osób"
- People section appears above companies if matches found
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New /osoba/<id> route for person detail page
- Shows company roles with links to company pages
- Displays portal data (email, phone) if user has account
- Tooltip shows all company connections (no "4 wiecej" limit)
- Click on person node navigates to profile instead of filtering
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- API: Count unique company_ids instead of all roles
- Tooltip: Show "X firmami (Y ról)" to distinguish companies from roles
- Bogdan Łaga has 6 unique companies with 9 roles (was showing 9 companies)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- API endpoint for connections graph visualization
- Include Person/CompanyPerson data in company profile
- Support for Zarząd, Wspólnicy, Prokurenci, JDG relationships
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AI Learning System:
- Add FeedbackLearningService for few-shot learning from user feedback
- Integrate learning context into chat prompts (nordabiz_chat.py)
- Add seed examples for cold start (when insufficient real feedback)
- Add /api/admin/ai-learning-status endpoint
- Add learning status section to chat analytics panel
Other Changes:
- Update release notes to v1.12.0
- Remove old password references from documentation (CLAUDE.md)
- Fix password masking in run_migration.py (use regex for any password)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/ai-usage/user/<id> route for detailed AI usage per user
- Add ai_usage_user.html template with stats, usage breakdown, logs
- Make user names clickable in AI usage dashboard ranking
- Replace all native browser dialogs (alert, confirm) with styled modals/toasts:
- admin/fees.html, forum.html, recommendations.html, announcements.html, debug.html
- calendar/admin.html, event.html
- company_detail.html, company/recommend.html
- forum/new_topic.html, topic.html
- classifieds/view.html
- auth/reset_password.html
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix type_labels keys to match actual feature names (ai_chat, zopk_news_evaluation)
- Fix SQLAlchemy query syntax (remove invalid .options())
- Add null safety for daily_history values in template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add period filter buttons (day/week/month/all)
- Add user ranking table with name, company, requests, tokens, cost
- Add company ranking table with unique users and costs
- Show user names in recent logs
- Add all-time statistics
- Rankings filtered by selected period
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add AIUsageLog, AIUsageDaily, AIRateLimit models to database.py
- Update gemini_service.py to log to new AIUsageLog table
- Create /admin/ai-usage dashboard with stats and charts
- Show daily/weekly/monthly requests, tokens, costs
- Track usage by type (chat, news_evaluation, etc.)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change info-only div to clickable link with warning style
- Add ai_not_evaluated filter to show items where ai_relevant is NULL
- Consistent UX with other filter cards
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add reevaluate_news_without_score() to upgrade old binary evals to stars
- Add /admin/zopk/news/reevaluate-scores endpoint
- Add ai_missing_score stat to dashboard
- Add 'Dodaj gwiazdki' button in dashboard UI
- JS function with progress modal and auto-reload
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ai_relevant, ai_evaluation_reason, ai_evaluated_at columns to zopk_news
- Add evaluate_news_relevance() and evaluate_pending_news() functions
- Add /admin/zopk/news/evaluate-ai endpoint
- Add AI filter tiles (Pasuje wg AI, Nie pasuje wg AI)
- Add "Oceń przez AI" button with progress feedback
- Show AI evaluation badge on news items
- Add new sources: Norda FM, Twoja Telewizja Morska, Nadmorski24.pl, Facebook (Samsonowicz)
AI evaluates news against ZOPK topics: offshore wind, nuclear plant,
Kongsberg investment, data centers, hydrogen labs, key people.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add clickable stat cards to filter news by status (pending/approved/rejected)
- Add pagination (20 items per page) with navigation controls
- Filter out old news by default (before 2024 - ZOPK didn't exist)
- Show warning about hidden old news with option to show or reject all
- Add endpoint to bulk reject old news (/admin/zopk/news/reject-old)
- Add old news badge (⚠️ Sprzed 2024) for visibility
- Add status badges for approved/rejected news
- Update news list to show all statuses with appropriate actions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ZOPKNewsService with multiple RSS sources (12 feeds)
- Implement cross-verification logic (3+ sources = auto_approved)
- Add title hash normalization for fuzzy deduplication
- Include government sources: MON, Ministerstwo Rozwoju
- Include Google News searches for key topics and people
- Add confidence scoring (1-5 based on source count)
- Update SQL migration with cross-verification columns
Sources: Brave API, trojmiasto.pl, Dziennik Bałtycki, Google News,
gov.pl/obrona-narodowa, gov.pl/rozwoj-technologia
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add database models for ZOPK projects, stakeholders, news, resources
- Add migration with initial data (5 projects, 7 stakeholders)
- Implement admin dashboard with news moderation workflow
- Add Brave Search API integration for automated news discovery
- Create public knowledge base pages (index, project detail, news list)
- Add navigation links in main menu and admin bar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add category selection (feature_request, bug, question, announcement)
- Add status tracking (new, in_progress, resolved, rejected) with admin controls
- Add file attachments support (JPG, PNG, GIF up to 5MB)
- Multi-file upload (up to 10 files per reply) with drag & drop and paste
- New FileUploadService with EXIF stripping for privacy
- Admin panel with status statistics and change modal
- Grid display for multiple attachments
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add POST /api/admin/users/ai-parse endpoint for text/image parsing
- Add POST /api/admin/users/bulk-create for batch user creation
- Add "Dodaj z AI" button with purple gradient in admin users panel
- Add 3-step modal flow (Input → Review → Results)
- Support text paste from any source (email, Excel, CRM, Slack)
- Support screenshot upload and clipboard paste (Ctrl+V / Cmd+V)
- AI extracts emails, names, matches companies, detects admin roles
- Display generated passwords with copy functionality
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/users panel for managing users (toggle admin, toggle verified, assign company, reset password, delete)
- Add link to admin menu in base.html
- Replace native confirm()/alert() with styled modals and toast notifications
- Add confirmation modal for password reset with warning icon
- Add styled reset URL modal with copy functionality
- Add danger-styled confirmation modal for user deletion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove sensitive tokens from logs (show only 8-char preview)
- Enforce SECRET_KEY minimum 32 characters (no default value)
- Reduce login rate limit from 100/hour to 5/hour
- Remove exposed PageSpeed API key from CLAUDE.md
BREAKING: Application requires SECRET_KEY >= 32 chars in .env
Author: Maciej Pienczyn z wykorzystaniem AI i Claude Opus
- Add /release-notes route with changelog from v1.0.0 to v1.9.0
- Document all major features added since platform launch
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/gbp-audit panel with completeness stats, field coverage, company table
- Add /admin/social-audit panel with platform coverage, top followers, company table
- Update admin menu with new dashboard links
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Edge cases handled:
1. Partial submission:
- Added is_partial flag to save response
- Dynamic success message based on completeness score
- Completeness threshold messages (< 30%, 30-70%, > 70%)
2. Company without audit:
- Fixed template to show "Brak audytu" for companies without audit
- Added "Utwórz audyt" button (+ icon) for companies without audit
- Fixed data structure mismatch between route and template
3. Multiple audit history:
- Added get_company_audit_history() convenience function
- Added has_company_audit() helper function
- Added /api/it-audit/history/<company_id> API endpoint
- Returns history_count in save response
Other fixes:
- Fixed stats variable naming in admin_it_audit route
- Fixed collaboration_matches data structure for template
- Fixed url_for to use slug instead of company_id
- Fixed match_type filter (shared_licensing not shared_m365_licensing)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add user-facing IT audit dashboard route following the pattern of existing
SEO and GBP audit dashboards:
- Route: /audit/it/<slug>
- Access control: admin can view any company, members only their own
- Returns latest IT audit data with scores, technology flags, and recommendations
- Renders it_audit.html template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add API endpoint for getting IT audit collaboration matches for a company.
- Admin-only access (matches are not visible to regular users per spec)
- Returns all matches where company is either party A or B
- Includes partner company info, match type/score/reason, status
- Follows existing API patterns (login_required, try/finally, jsonify)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implemented POST endpoint at /it-audit/save that:
- Accepts JSON or form data with IT audit fields
- Validates company access (admin for any, users for their own)
- Parses boolean, array, and string fields with proper type handling
- Uses ITAuditService to save audit with scoring calculation
- Returns JSON with audit scores and redirect URL
- Includes rate limiting (30 per hour)
- Handles errors with rollback and logging
Added helper function _parse_it_audit_form_data() to properly parse:
- Boolean fields (checkboxes)
- Array fields (multi-select)
- String fields
- JSON fields (zabbix_integration)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Flask route for IT audit form display:
- GET /it-audit/form with optional company_id query parameter
- Access control: admin can access any company, users only their own
- Defaults to current user's company if no company_id provided
- Pre-fills form with existing audit data if available
- Renders it_audit_form.html template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implemented the IT audit admin dashboard route at /admin/it-audit that:
- Checks for admin authentication (is_admin flag)
- Queries all active companies with their latest IT audit data
- Calculates statistics (audit count, avg scores, maturity distribution)
- Provides technology adoption stats (Azure AD, M365, PBS, Zabbix, EDR, DR)
- Queries collaboration flags from IT audits
- Retrieves and organizes collaboration matches by type
- Renders admin/it_audit_dashboard.html template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import and use SocialMediaAuditor from scripts/social_media_audit.py
- Audit now scans website HTML for social media links
- Discovers profiles via Brave Search API (if configured)
- Fetches Google Business Profile data via Google Places API
- Saves discovered profiles to database
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Uruchom audyt" button to social_audit.html
- Create POST /api/social/audit endpoint to verify profile URLs
- Add loading overlay and modal for audit progress/results
- Audit verifies each social media URL and updates check_status
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create /audit/social/<slug> route with platform presence analysis
- Create social_audit.html template with 6 platforms (FB, IG, LinkedIn, YT, X, TikTok)
- Add purple "Audyt Social" button on company profile next to GBP and SEO audits
- Show score based on platforms count, profile details and recommendations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create /audit/seo/<slug> route with access control (admin or company owner)
- Create seo_audit.html template with score visualization
- Add green "Audyt SEO" button next to GBP audit button on company profile
- Match styling and UX patterns from GBP audit feature
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add fetch_google_business_data() to fetch fresh data from Google Places API
- Progress overlay shows all 10 data fields with actual values:
* Place search, Rating, Reviews, Photos, Hours, Phone, Website, Status
- 5-second delay after completion for user to read results
- Fix opening hours display (show formatted weekday_text)
- Fix reviews scoring (integer-based: 3 base + 1/review + 1 bonus)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add user-facing GBP audit dashboard route at /audit/gbp/<company_slug>:
- Requires login (@login_required)
- Admin users can view audit for any company
- Regular users can only view audit for their own company
- Passes can_audit flag to template for run audit button visibility
- Gracefully handles missing audit data (template shows "no audit" state)
- Logs audit dashboard views for monitoring
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>