Page - Schedule

abstract

Displays all active APScheduler jobs with live countdown timers, grouped by category (strategy vs. system) — and auto-refreshes every 60 seconds.

Route

PropertyValue
Path/schedule
Filefrontend/src/app/schedule/page.tsx
Auth RequiredNo
LayoutRoot layout with sidebar
Dynamic SegmentNone

Component Tree

SchedulePage (page.tsx)
├── AppHeader (title="Scheduled Tasks", subtitle="All active APScheduler jobs with live countdowns")
├── Toolbar Row
│   ├── Job count badge (Timer icon + "{N} jobs registered")
│   ├── Last refreshed time
│   └── Button (Manual refresh with RefreshCw icon)
├── Section: "Strategy Jobs" (category="strategy")
│   └── ScheduledJobCard[] (one per job)
│       └── EmptyGroup (if no strategy jobs)
└── Section: "System Jobs" (category="system")
    └── ScheduledJobCard[] (one per job)
        └── EmptyGroup (if no system jobs)

Data Layer

Server State — Direct fetch

CallAPIEndpointTriggered When
Fetch jobsschedulerApi.getJobs()GET /api/v1/schedulerOn mount (initial)
Auto-refreshschedulerApi.getJobs()GET /api/v1/schedulerEvery 60 seconds (REFRESH_INTERVAL_MS = 60_000)
Manual refreshschedulerApi.getJobs()GET /api/v1/schedulerButton click (shows refreshing spinner)

Global State — Zustand

None — this page does not read from useTradingStore.

Local State — useState

VariableTypeInitialPurpose
jobsScheduledJob[][]All scheduled jobs from API
loadingbooleantrueInitial load skeleton
errorstring | nullnullError message if fetch fails
lastRefreshedDate | nullnullTimestamp shown in toolbar
refreshingbooleanfalseSpinner during manual refresh

Page Lifecycle

Validation & Conditions

Render Conditions

ConditionWhat Shows
loadingSkeleton (not shown explicitly — inferred from component state)
error !== nullError message string in UI
strategyJobs.length === 0<EmptyGroup label="Strategy" /> placeholder
systemJobs.length === 0<EmptyGroup label="System" /> placeholder

Job Grouping Logic

const strategyJobs = jobs.filter((j) => j.category === "strategy");
const systemJobs = jobs.filter((j) => j.category === "system");
RoleLink
Backend APIAPI-GET-v1-Scheduler
DB SchemaDB - strategies