Redesign admin dashboard: pipeline view, round-specific stats, smart actions
Complete rewrite of the admin dashboard replacing the 1056-line monolith with
modular components. Key improvements:
- Competition pipeline: horizontal visualization of all rounds in pipeline order
(by sortOrder, not creation date) with type-specific icons and metrics
- Round-specific stats: stat cards dynamically change based on active round type
(INTAKE shows submissions/docs, FILTERING shows pass/fail/flagged, EVALUATION
shows assignments/completion, fallback shows generic project/jury stats)
- Smart actions: context-aware "Action Required" panel that only flags the next
draft round (not all), only flags unassigned projects for EVALUATION rounds,
includes deadline warnings with severity levels (critical/warning/info)
- Active round panel: detailed view with project state bar, type-specific content,
and deadline countdown
- Extracted components: project list, activity feed, category breakdown, skeleton
Backend enriched with 17 parallel queries building rich PipelineRound data
including per-round project states, eval stats, filtering stats, live session
status, and deliberation counts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:12:28 +01:00
|
|
|
/**
|
|
|
|
|
* Next.js Instrumentation — runs once on server startup.
|
|
|
|
|
* https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation
|
|
|
|
|
*/
|
|
|
|
|
export async function onRequestInit() {
|
|
|
|
|
// no-op — required export for instrumentation file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function register() {
|
|
|
|
|
// Only run on the Node.js server runtime (not edge, not build)
|
|
|
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
|
|
|
// Retroactive document analysis: analyze all files that haven't been analyzed yet.
|
|
|
|
|
// Runs in background on startup, non-blocking.
|
|
|
|
|
import('./server/services/document-analyzer')
|
|
|
|
|
.then(({ analyzeAllUnanalyzed }) => {
|
|
|
|
|
console.log('[Startup] Starting retroactive document analysis...')
|
|
|
|
|
analyzeAllUnanalyzed()
|
|
|
|
|
.then((result) => {
|
|
|
|
|
console.log(
|
|
|
|
|
`[Startup] Document analysis complete: ${result.analyzed} analyzed, ${result.skipped} skipped, ${result.failed} failed out of ${result.total} total`
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.warn('[Startup] Document analysis failed:', err)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {})
|
2026-02-18 11:35:28 +01:00
|
|
|
|
|
|
|
|
// Round scheduler: check every 60s for rounds that need to open/close
|
|
|
|
|
import('./server/services/round-scheduler')
|
|
|
|
|
.then(({ processScheduledRounds }) => {
|
|
|
|
|
console.log('[Startup] Round scheduler started (60s interval)')
|
|
|
|
|
// Run once immediately, then every 60 seconds
|
|
|
|
|
processScheduledRounds().catch(() => {})
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
processScheduledRounds().catch((err) => {
|
|
|
|
|
console.error('[RoundScheduler] Error:', err)
|
|
|
|
|
})
|
|
|
|
|
}, 60_000)
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {})
|
Redesign admin dashboard: pipeline view, round-specific stats, smart actions
Complete rewrite of the admin dashboard replacing the 1056-line monolith with
modular components. Key improvements:
- Competition pipeline: horizontal visualization of all rounds in pipeline order
(by sortOrder, not creation date) with type-specific icons and metrics
- Round-specific stats: stat cards dynamically change based on active round type
(INTAKE shows submissions/docs, FILTERING shows pass/fail/flagged, EVALUATION
shows assignments/completion, fallback shows generic project/jury stats)
- Smart actions: context-aware "Action Required" panel that only flags the next
draft round (not all), only flags unassigned projects for EVALUATION rounds,
includes deadline warnings with severity levels (critical/warning/info)
- Active round panel: detailed view with project state bar, type-specific content,
and deadline countdown
- Extracted components: project list, activity feed, category breakdown, skeleton
Backend enriched with 17 parallel queries building rich PipelineRound data
including per-round project states, eval stats, filtering stats, live session
status, and deliberation counts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:12:28 +01:00
|
|
|
}
|
|
|
|
|
}
|