Commit Graph

44 Commits

Author SHA1 Message Date
Matt 8be740a4fb Fix multiple UI/UX issues and invite token migration
Build and Push Docker Image / build (push) Successful in 8m39s Details
Fixes:
- Round edit: Add cache invalidation for voting dates
- Criteria weights: Replace number input with visual slider
- Member invite: Per-member expertise tags with suggestions
  - Tags now added per member, not globally
  - Comma key support for quick tag entry
  - Suggested tags based on ocean/business expertise
- Accept-invite: Add Suspense boundary for useSearchParams
- Add missing inviteToken columns migration

The invite token columns were accidentally skipped in prototype1
migration. This adds them with IF NOT EXISTS checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:25:28 +01:00
Matt 3986da172f Fix GPT-5 API compatibility and add AIUsageLog migration
Build and Push Docker Image / build (push) Successful in 8m50s Details
- Add AIUsageLog table migration for token tracking
- Fix GPT-5 temperature parameter (not supported, like o-series)
- Add usesNewTokenParam() and supportsTemperature() functions
- Add GPT-5+ category to model selection UI
- Update model sorting to show GPT-5+ first

GPT-5 and newer models use max_completion_tokens and don't support
custom temperature values, similar to reasoning models.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:04:16 +01:00
Matt c0ce6f9f1f Fix GPT-5 max_completion_tokens parameter detection
Build and Push Docker Image / build (push) Successful in 8m35s Details
GPT-5 and newer models require max_completion_tokens instead of max_tokens.
Added usesNewTokenParam() to detect GPT-5+ models separately from reasoning
model restrictions (temperature, json_object, system messages).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:08:01 +01:00
Matt fd82a9b981 Expand GDPR documentation with comprehensive compliance details
Build and Push Docker Image / build (push) Successful in 8m39s Details
- Add complete definitions section (GDPR terms, AI-specific terms)
- Document Monaco Law 1.565 (Dec 2024) and new APDP authority
- List all joint controllers (IUM, Oceanographic Institute, etc.)
- Detail all personal data categories processed
- Document legal bases with Legitimate Interests Assessments
- Add complete data subject rights procedures
- Document server location (Austria, EU) and EU data residency for OpenAI
- Add security measures, encryption standards, backup procedures
- Include Data Protection Impact Assessments
- Add breach notification procedures with timelines
- Document OpenAI as subprocessor with DPA and ZDR details
- Add compliance checklists and audit procedures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:22:15 +01:00
Matt 928b1c65dc Optimize AI system with batching, token tracking, and GDPR compliance
Build and Push Docker Image / build (push) Successful in 9m11s Details
- Add AIUsageLog model for persistent token/cost tracking
- Implement batched processing for all AI services:
  - Assignment: 15 projects/batch
  - Filtering: 20 projects/batch
  - Award eligibility: 20 projects/batch
  - Mentor matching: 15 projects/batch
- Create unified error classification (ai-errors.ts)
- Enhance anonymization with comprehensive project data
- Add AI usage dashboard to Settings page
- Add usage stats endpoints to settings router
- Create AI system documentation (5 files)
- Create GDPR compliance documentation (2 files)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:58:12 +01:00
Matt a72e815d3a Remove remaining Settings and Assignments links
Build and Push Docker Image / build (push) Successful in 8m43s Details
Fix stale links to deleted pages:
- Remove Settings link from programs list dropdown
- Remove Manage Assignments link from projects list dropdown

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:56:14 +01:00
Matt 406ec46c81 UI simplification: remove redundant pages, reorganize Quick Actions
Phase 2 UI Cleanup:
- Delete empty programs/[id]/settings page
- Delete redundant projects/[id]/assignments page (use round-level management)
- Delete unused /users redirect directory
- Remove Settings button from program detail page
- Reorganize Round Quick Actions into visual groups (Project Management, Round Management)

Note: Mentor inline assignment deferred - the existing mentor page has
complex AI suggestion functionality that would need careful refactoring.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:50:47 +01:00
Matt d068d9b6f6 Improve AI filtering error handling and visibility
- Add listAvailableModels() and validateModel() to openai.ts
- Improve testOpenAIConnection() to test configured model
- Add checkAIStatus endpoint to filtering router
- Add pre-execution AI config check in executeRules
- Improve error messages in AI filtering service (rate limit, quota, etc.)
- Add AI status warning banner on round detail page for filtering rounds

Now admins get clear errors when AI is misconfigured instead of silent flags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:46:38 +01:00
Matt d45eccea47 Add detailed logging to AI filtering for debugging
Added console logging throughout the AI screening process to help
diagnose issues when all projects get flagged. Logs model being used,
batch processing, token usage, and actual error messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:36:51 +01:00
Matt c063f5bba3 Display filtering controls inline for FILTERING round type
For rounds with roundType=FILTERING, the filtering controls (run button,
stats, finalize) are now shown directly on the round detail page instead
of requiring navigation to a separate /filtering page. Rules configuration
and results review still link to their dedicated pages for detailed work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:33:34 +01:00
Matt db728830d4 Add cache invalidation to all project/round mutations platform-wide
Build and Push Docker Image / build (push) Successful in 8m21s Details
Mutations for create, update, delete, import, filtering finalize,
override, and reinstate now properly invalidate related queries so
the UI updates without requiring a page refresh.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:36:46 +01:00
Matt 56a44049d3 Show full country name instead of code in assign dialog
Build and Push Docker Image / build (push) Successful in 8m11s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:15:51 +01:00
Matt a3f12ed5de Raise project list limit to 5000 for admin dialogs
Build and Push Docker Image / build (push) Has been cancelled Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:11:43 +01:00
Matt fd5e5222da Decouple projects from rounds with RoundProject join table
Build and Push Docker Image / build (push) Successful in 8m16s Details
Projects now exist at the program level instead of being locked to a
single round. A new RoundProject join table enables many-to-many
relationships with per-round status tracking. Rounds have sortOrder
for configurable progression paths.

- Add RoundProject model, programId on Project, sortOrder on Round
- Migration preserves existing data (roundId -> RoundProject entries)
- Update all routers to query through RoundProject join
- Add assign/remove/advance/reorder round endpoints
- Add Assign, Advance, Remove Projects dialogs on round detail page
- Add round reorder controls (up/down arrows) on rounds list
- Show all rounds on project detail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:33:55 +01:00
Matt 0d2bc4db7e Fix modal animation to scale from center instead of sliding from top-left
Build and Push Docker Image / build (push) Successful in 8m32s Details
Remove slide-in-from-left/top animations from Dialog and AlertDialog
components, keeping only fade + zoom for a clean center-grow effect.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:09:06 +01:00
Matt 0b3c2b6804 Redesign member invite page with per-member form rows
Build and Push Docker Image / build (push) Waiting to run Details
Replace bulk email textarea with individual name/email/role rows.
Each member gets their own entry with full name, email, and role
selector. New rows inherit the role from the previous row. CSV
import kept as an alternative tab. Invites sent automatically on
creation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:07:03 +01:00
Matt 8931da98ba Add AI eligibility toggle and include-submitted filter for awards
Build and Push Docker Image / build (push) Has been cancelled Details
- Add useAiEligibility boolean to SpecialAward schema (default true)
- Toggle on creation form lets admins disable AI for feeling-based awards
- Detail page shows "Load All Projects" when AI is off vs "Run AI Eligibility"
- Include Submitted toggle lets admins include SUBMITTED-status projects
- Fix perPage: 200 → 100 to match user.list validation max
- Fix edition display on award detail page
- Add migration for new column

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:02:58 +01:00
Matt e34cafebbf Show edition year instead of program name platform-wide
Build and Push Docker Image / build (push) Successful in 8m33s Details
Change program selectors and display labels from full program name
to "2026 Edition" format across admin, jury, mentor, observer, and
public pages. Selector labels changed from "Program" to "Edition".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:52:52 +01:00
Matt 86d38ba743 Add delete button for draft rounds with confirmation dialog
Build and Push Docker Image / build (push) Successful in 8m26s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:37:54 +01:00
Matt 46694154dc Fix favicon: point to existing MOPC logo PNG instead of missing favicon.ico
Build and Push Docker Image / build (push) Has been cancelled Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:32:55 +01:00
Matt e57c46afdc Fix health check: use node instead of wget (not available in Alpine image)
Build and Push Docker Image / build (push) Successful in 8m41s Details
Also increase start_period to 60s to allow time for migrations on first boot.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:35:52 +01:00
Matt afe8a58535 Fix migration: skip inviteToken columns and index that already exist in production
Build and Push Docker Image / build (push) Successful in 8m49s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:17:55 +01:00
Matt 90e3adfab2 Implement Prototype 1 improvements: unified members, project filters, audit expansion, filtering rounds, special awards
Build and Push Docker Image / build (push) Successful in 9m9s Details
- Unified Member Management: merge /admin/users and /admin/mentors into /admin/members with role tabs, search, pagination
- Project List Filters: add search, multi-status filter, round/category/country selects, boolean toggles, URL persistence
- Audit Log Expansion: track logins, round state changes, evaluation submissions, file access, role changes via shared logAudit utility
- Founding Date Field: add foundedAt to Project model with CSV import support
- Filtering Round System: configurable rules (field-based, document check, AI screening), execution engine, results review with override/reinstate
- Special Awards System: named awards with eligibility criteria, dedicated jury, PICK_WINNER/RANKED/SCORED voting modes, AI eligibility
- Dashboard resilience: wrap heavy queries in try-catch to prevent error boundary on transient DB failures
- Reusable pagination component extracted to src/components/shared/pagination.tsx
- Old /admin/users and /admin/mentors routes redirect to /admin/members
- Prisma migration for all schema additions (additive, no data loss)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:58:29 +01:00
Matt 8fda8deded Add image cropping to avatar upload and show avatars platform-wide
Build and Push Docker Image / build (push) Successful in 12m20s Details
- Add react-easy-crop for circular crop + zoom UI on avatar upload
- Create server-side getUserAvatarUrl utility for generating pre-signed URLs
- Update all nav components (admin, jury, mentor, observer) to show user avatars
- Add avatar URLs to user list, mentor list, and project detail API responses
- Replace initials-only avatars with UserAvatar component across admin pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:19:28 +01:00
Matt f9f88d68ab Restore EmailProvider server config required by NextAuth validation
Build and Push Docker Image / build (push) Successful in 8m6s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:16:31 +01:00
Matt 81db15333f Fix S3/SMTP connectivity and add one-click invite flow
Build and Push Docker Image / build (push) Failing after 2m29s Details
- Fix MinIO port parsing bug: use protocol-appropriate defaults (443/80)
  instead of hardcoded 9000 fallback, enabling public URL endpoint
- Remove unused SMTP server config from NextAuth EmailProvider to prevent
  connection errors (sendVerificationRequest is fully overridden)
- Replace extra_hosts with DNS config (8.8.8.8) so container resolves
  mail.monaco-opc.com to public IP instead of host loopback
- Add invite token auth: single-click accept-invite flow replacing broken
  two-email invitation process
- Auto-send invitation emails on bulk user creation
- Update email template expiry text from 24 hours to 7 days

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:13:16 +01:00
Matt 5aedade41d Use DB settings for SMTP and unify email design to all-white
Build and Push Docker Image / build (push) Successful in 7m43s Details
- Read SMTP settings from database (admin panel) with env var fallback
- Cache transporter and rebuild when settings change
- Remove dark blue footer from emails; use single white content box
  with logo and tagline at the bottom separated by a subtle border

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 11:49:35 +01:00
Matt 43680d4173 Log tRPC errors in all environments
Build and Push Docker Image / build (push) Has been cancelled Details
Previously only logged in development mode, making production
debugging impossible.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 11:44:34 +01:00
Matt fcafbaadd3 Add host.docker.internal mapping for MinIO access
Build and Push Docker Image / build (push) Successful in 8m31s Details
Add extra_hosts directive so the app container can reach
MinIO on the host machine via host.docker.internal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:16:17 +01:00
Matt 7ff961f0c2 Fix profile photo section: replace hover overlay with button
Build and Push Docker Image / build (push) Has been cancelled Details
Remove showEditOverlay that stretched across the full width.
Show avatar and a "Change Photo" button side by side instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:08:59 +01:00
Matt 402bdfd8c5 Add profile settings page, mentor management, and S3 email logos
Build and Push Docker Image / build (push) Successful in 8m10s Details
- Add universal /settings/profile page accessible to all roles with
  avatar upload, bio, phone, password change, and account deletion
- Expand updateProfile endpoint to accept bio (metadataJson), phone,
  and notification preference
- Add deleteAccount endpoint with password confirmation
- Add Profile Settings link to all nav components (admin, jury, mentor,
  observer)
- Add /admin/mentors list page and /admin/mentors/[id] detail page for
  mentor management
- Add Mentors nav item to admin sidebar
- Update email logo URLs to S3 (s3.monaco-opc.com/public/)
- Add ocean.png background image to email wrapper

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:57:12 +01:00
Matt 0c0a9b7eb5 Add round delete with confirmation dialog
Build and Push Docker Image / build (push) Successful in 7m57s Details
- Add delete procedure to round tRPC router with cascade and audit log
- Add delete option to rounds list dropdown menu
- Show confirmation dialog with project/assignment counts before deletion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:28:57 +01:00
Matt 4c5a49cede Fix: add AUTH_TRUST_HOST for reverse proxy support
Build and Push Docker Image / build (push) Has been cancelled Details
Auth.js v5 requires explicit trust for hosts behind a reverse proxy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:24:25 +01:00
Matt 4071606005 Add initial Prisma migration from schema
Build and Push Docker Image / build (push) Successful in 8m27s Details
Generated via prisma migrate diff --from-empty for fresh DB deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:10:27 +01:00
Matt e686a73b75 Fix: copy full node_modules into runner for prisma/seed support
Build and Push Docker Image / build (push) Successful in 8m24s Details
Cherry-picking individual prisma modules fails due to transitive
deps (effect, @prisma/config, etc). Copy full node_modules instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 18:51:37 +01:00
Matt c2506edd52 Fix: prisma not found in Docker runner stage
Build and Push Docker Image / build (push) Successful in 4m13s Details
- Use direct node path to prisma CLI instead of npx
- Copy seed dependencies (bcryptjs, papaparse, tsx, esbuild) for manual seeding
- Copy package.json for module resolution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 18:44:39 +01:00
Matt a020d13c00 Update seed: real admin accounts, remove all dummy data
Build and Push Docker Image / build (push) Successful in 4m3s Details
- Add matt@monaco-opc.com and admin@monaco-opc.com as SUPER_ADMIN with passwords
- Remove dummy jury members (jury1-3@example.com)
- Remove dummy sample projects
- Keep system settings, program, round, and evaluation form

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:40:07 +01:00
Matt bfcfd84008 Use admin-configured AI model and add GPT-5/o-series options
Build and Push Docker Image / build (push) Successful in 4m6s Details
- Add getConfiguredModel() that reads ai_model from SystemSettings
- AI assignment and mentor matching now use the admin-selected model
- Remove duplicate OpenAI client in mentor-matching (use shared singleton)
- Add GPT-5, GPT-5 Mini, o3, o3 Mini, o4 Mini to model dropdown

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:24:46 +01:00
Matt 8c598ba3ee Add email password change feature and fix nginx config
Build and Push Docker Image / build (push) Successful in 4m22s Details
- Add public page at /email/change-password for Poste.io mailbox password management
- Add API routes for SMTP credential verification and Poste.io password change
- Rewrite nginx config as HTTP-only (certbot --nginx will add SSL)
- Add Poste.io admin API env vars to docker-compose and env templates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:15:08 +01:00
Matt d5398e93a0 Fix: remove invalid 'name' field from EvaluationForm create
Build and Push Docker Image / build (push) Successful in 9m11s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:51:44 +01:00
Matt a0016fbccb Fix: sync package-lock.json and update CLAUDE.md dev notes
Build and Push Docker Image / build (push) Failing after 4m16s Details
Add missing @mantine/utils to lock file so npm ci works in CI.
Document that npm/node commands must also use PowerShell on Windows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:47:00 +01:00
Matt 65ebcd3731 Fix CI: hardcode Gitea registry URL
Build and Push Docker Image / build (push) Failing after 28s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:45:07 +01:00
Matt 8da7f111ef Fix CI: use REGISTRY_TOKEN secret for registry auth
Build and Push Docker Image / build (push) Failing after 8s Details
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:43:40 +01:00
Matt a606292aaa Initial commit: MOPC platform with Docker deployment setup
Build and Push Docker Image / build (push) Failing after 10s Details
Full Next.js 15 platform with tRPC, Prisma, PostgreSQL, NextAuth.
Includes production Dockerfile (multi-stage, port 7600), docker-compose
with registry-based image pull, Gitea Actions CI workflow, nginx config
for portal.monaco-opc.com, deployment scripts, and DEPLOYMENT.md guide.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:41:32 +01:00