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>
Added GBP (Google Business Profile) audit API endpoints:
- GET /api/gbp/audit/health - Health check for GBP audit service
- GET /api/gbp/audit - Fetch latest audit results by company_id or slug
- GET /api/gbp/audit/<slug> - Fetch audit results by slug path
- POST /api/gbp/audit - Run GBP audit for a company
Features:
- Health endpoint returns service status and version
- GET endpoints return completeness score, field status, and recommendations
- POST endpoint runs audit and saves results (configurable)
- Access control: members can audit own company, admins can audit any
- Rate limited to 20 requests per hour
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: /admin/seo zwracał błąd 500 z AttributeError: category
Przyczyna: Company.category jest relacją SQLAlchemy (obiektem), nie stringiem.
Rozwiązanie: Użycie Category.name.label('category_name') z właściwym JOIN.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added /admin/seo route with:
- Admin-only access with @login_required and is_admin check
- Fetches all active companies with SEO analysis data using outerjoin
- Calculates statistics: good_count (90-100), medium_count (50-89),
poor_count (0-49), not_audited_count, avg_score
- Gets unique categories for filter dropdown
- Passes companies, stats, categories, and now to template
- Uses CompanyRow class for Jinja2 attribute access
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added POST /api/seo/audit endpoint to trigger SEO audits for companies:
- Admin-only access with current_user.is_admin check
- Rate limited to 10 requests per hour per user
- Accepts company_id or slug in JSON body
- Runs full SEO audit (PageSpeed, on-page, technical)
- Saves results to database and returns audit data
- Comprehensive error handling and logging
- Uses existing _build_seo_audit_response helper for response format
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added two API endpoints for retrieving SEO audit data:
- GET /api/seo/audit?company_id=X or ?slug=Y
- GET /api/seo/audit/<slug>
Features:
- Returns pagespeed scores (SEO, performance, accessibility, best practices)
- Returns on-page metrics (meta tags, headings, images, links, structured data)
- Returns technical SEO checks (SSL, sitemap, robots.txt, mobile-friendly)
- Returns Core Web Vitals (LCP, FID, CLS)
- Automatically generates issues list from audit data
- Handles companies without SEO audit gracefully
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add MembershipFee and MembershipFeeConfig models
- Add /health endpoint for monitoring
- Add Microsoft Fluent Design CSS
- Update templates with new CSS structure
- Add Announcement model
- Update .gitignore to exclude analysis files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>