The web/ folder contains the Next.js frontend for the Soft Computing final project. It lets users upload an image, sends that image to the FastAPI AI engine, and displays the resulting engagement classification.
- render the upload and preview interface
- forward image uploads through the app's API route
- display the CNN prediction, FIS score, and final label
- provide reusable authentication and API helper utilities from the base template
src/app/page.tsx- main landing pagesrc/components/engagement/- upload, preview, and results UIsrc/app/api/engagement/predict/route.ts- server route that proxies uploads to the AI enginesrc/lib/auth/- Better Auth setup and helperssrc/lib/api-helper/- API wrapper, JSend helpers, and API error utilities
The frontend expects the AI engine to expose POST /predict.
It reads the backend base URL from:
AI_ENGINE_URLNEXT_PUBLIC_AI_ENGINE_URL
If neither is set, it falls back to:
http://localhost:8000
This app still includes the reusable full-stack template helpers:
AuthPageHelper.requireUser()for protected server pageswithApiPublic(...)for public API routeswithApiAuth(...)for authenticated API routesjsendandApiErrorfor consistent API responses
Example helper sources:
src/lib/auth/auth-page-helper.tssrc/lib/auth/auth-api-helper.tssrc/lib/api-helper/api-wrapper.tssrc/lib/api-helper/jsend.tssrc/lib/api-helper/error.ts