Commit Graph

19 Commits

Author SHA1 Message Date
Matt 4f0531d2ee Add ExpertiseSelect component for onboarding
Replace database-backed TagInput with a cleaner ExpertiseSelect
component that has predefined ocean conservation expertise areas.
Features a checkbox grid UI that's more user-friendly for onboarding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 00:56:03 +01:00
Matt b0189cad92 Add styled notification emails and round-attached notifications
Build and Push Docker Image / build (push) Successful in 8m18s Details
- Add 15+ styled email templates matching existing invite email design
- Wire up notification triggers in all routers (assignment, round, project, mentor, application, onboarding)
- Add test email button for each notification type in admin settings
- Add round-attached notifications: admins can configure which notification to send when projects enter a round
- Fall back to status-based notifications when round has no configured notification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 00:10:51 +01:00
Matt 3be6a743ed Add multiple admin improvements and bug fixes
Build and Push Docker Image / build (push) Successful in 8m58s Details
- Email settings: Add separate sender display name field
- Rounds page: Drag-and-drop reordering with visible order numbers
- Round creation: Auto-assign projects to filtering rounds, auto-activate if voting started
- Round detail: Fix incorrect "voting period ended" message for draft rounds
- Projects page: Add delete option with confirmation dialog
- AI filtering: Add configurable batch size and parallel request settings
- Filtering results: Fix duplicate criteria display
- Add seed scripts for notification settings and MOPC onboarding form

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 23:19:45 +01:00
Matt 1d137ce93e Improve notification bell placement and change sender to MOPC Portal
Build and Push Docker Image / build (push) Successful in 8m14s Details
- Move notification bell to sidebar header next to logo (desktop)
- Keep bell in mobile header bar (already well-placed)
- Change email sender name from 'MOPC Platform' to 'MOPC Portal'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 22:47:24 +01:00
Matt 03c031a8b6 Fix rounds management bugs and invitation flow
Build and Push Docker Image / build (push) Successful in 8m45s Details
- Fix rounds list showing 0 projects by adding _count to program.list query
- Fix round reordering by using correct cache invalidation params
- Fix finalizeResults to auto-advance passed projects to next round
- Fix member list not updating after add/remove by invalidating user.list
- Fix invitation link error page by correcting path from /auth-error to /error
- Add /apply, /verify, /error to public paths in auth config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 22:15:22 +01:00
Matt 0277768ed7 Add notification bell system and MOPC onboarding form
Build and Push Docker Image / build (push) Successful in 8m59s Details
Notification System:
- Add InAppNotification and NotificationEmailSetting database models
- Create notification service with 60+ notification types for all user roles
- Add notification router with CRUD endpoints
- Build NotificationBell UI component with dropdown and unread count
- Integrate bell into admin, jury, mentor, and observer navs
- Add notification email settings admin UI in Settings > Notifications
- Add notification triggers to filtering router (complete/failed)
- Add sendNotificationEmail function to email library
- Add formatRelativeTime utility function

MOPC Onboarding Form:
- Create /apply landing page with auto-redirect for single form
- Create seed script for MOPC 2026 application form (6 steps)
- Create seed script for default notification email settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:30:25 +01:00
Matt e2782b2b19 Add background filtering jobs, improved date picker, AI reasoning display
Build and Push Docker Image / build (push) Successful in 14m19s Details
- Implement background job system for AI filtering to avoid HTTP timeouts
- Add FilteringJob model to track progress of long-running filtering operations
- Add real-time progress polling for filtering operations on round details page
- Create custom DateTimePicker component with calendar popup (no year picker hassle)
- Fix round date persistence bug (refetchOnWindowFocus was resetting form state)
- Integrate filtering controls into round details page for filtering rounds
- Display AI reasoning for flagged/filtered projects in results table
- Add onboarding system scaffolding (schema, routes, basic UI)
- Allow setting round dates in the past for manual overrides

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:48:41 +01:00
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 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 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 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 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 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 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