Multi-page frontend for the hybrid ConvNeXt classifier + Attention U-Net segmenter + XAI visualizations.
/Home overview/demoInteractive upload (classification, segmentation, XAI) with blended overlays/modelsModel summaries and comparison placeholders/xaiExplainability overview and methodology/datasetDataset overview and class taxonomy/aboutProject information
Create .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
cd "d:/Projects/Major Project/frontend"
npm install
npm run devPOST {API}/api/v1/segmentation/predict(multipartfile) →{ predicted_class, probabilities, segmentation_mask_base64, xai_heatmap_base64 }GET {API}/api/v1/classification/classes→["Dyskeratotic", "Koilocytotic", "Metaplastic", "Parabasal", "Superficial-Intermediate"]- Optional:
POST {API}/api/v1/classification/predictfor classification only.
If the backend is not running, a mock response is returned for local UI development.
The design system is implemented via CSS variables (design tokens) in app/globals.css.
- Color (light/dark):
--color-bg,--color-bg-alt,--color-fg,--color-fg-muted,--color-border,--color-accent,--color-accent-hover,--color-danger - Radius:
--radius-sm,--radius-md,--radius-lg - Shadow:
--shadow-sm,--shadow-md - Transition:
--transition
.btn/.btn-secondaryfor primary and secondary actions.cardstructured container with consistent padding and radius.skeletonloading placeholder shimmer- Focus ring via
:focus-visibleuses accent color for accessibility
Dark mode is toggled using a root data-theme="dark" attribute (ThemeToggle component). Prefers-color-scheme applies if no explicit selection.
- All interactive components use visible focus states
- ARIA labels added to upload zone, heatmap overlay, segmentation blend
- Toast notifications use
aria-live="polite"
- Heatmap opacity slider(
HeatmapOverlay) - Segmentation blended canvas with adjustable mask alpha (
SegmentationBlend) - Toast notifications (
ToastStore) for success/error states - Mock API fallback for offline development
- Adjust tokens in
globals.cssto refine visual design - Extend toast variants if required (info, warning)
- Replace mock response when backend endpoints become available
- Visual: Snapshot test of probability list ordering
- Accessibility: Ensure focus traversal includes ThemeToggle and sliders
- Interactivity: Opacity slider updates image style, segmentation alpha updates canvas layering
See root project license (MIT) for usage terms.