TechFlipp Frontend Task Overview 👋 This is a NextJS interview challenge. Please fork this repo, and push your code to a branch in your forked repo (following the instructions below).
You are tasked with building a responsive frontend application that interfaces with our Camera Management API. The application will allow users to manage cameras and view demographic analytics data collected by these cameras.
Submission Please fork this repository and submit your solution as a pull request. Include in your README:
Setup instructions Overview of your implementation Any assumptions or design decisions Screenshots of the UI If you have any questions or need assistance, feel free to open an issue in the main repository. We're here to help!
Requirements
Different rendering ways as needed (SSR, ISR, SSG, etc.) Skeleton loading states to improve perceived performance Seamless data refresh mechanisms Render error messages in form fields Optimistic UI updates for a better user experience Organized state management Use React Query (TanStack Query) for fetching and caching data. Creative and intuitive UI/UX design SEO and performance optimizations Unit tests for key components API Specification Base URL: https://task-451-api.ryd.wafaicloud.com/ Schema: https://task-451-api.ryd.wafaicloud.com/docs
Enum Definitions Genders MALE = "male" FEMALE = "female" Ages ZERO_EIGHTEEN = "0-18" NINETEEN_THIRTY = "19-30" THIRTYONE_FORTYFIVE = "31-45" FORTYSIX_SIXTY = "46-60" SIXTYPLUS = "60+" Emotions ANGRY = "angry" FEAR = "fear" HAPPY = "happy" NEUTRAL = "neutral" SAD = "sad" SURPRISE = "surprise" Ethnic Groups WHITE = "white" AFRICAN = "african" SOUTH_ASIAN = "south_asian" EAST_ASIAN = "east_asian" MIDDLE_EASTERN = "middle_eastern" Tags Endpoint
Camera Endpoints
Get Camera Details GET /cameras/{camera_id} Response: Detailed camera information including demographics config if it exists
Update Camera PUT /cameras/{camera_id} Body: { "name": string, "rtsp_url": string, "stream_frame_width": int (optional, min=1, max=2560), "stream_frame_height": int (optional, min=1, max=2560), "stream_max_length": int (optional, min=0, max=10000), "stream_quality": int (optional, min=80, max=100), "stream_fps": int (optional, min=1, max=120), "stream_skip_frames": int (optional, min=0, max=100), "tags": array of tag ids (optional) } Demographics Endpoints
Create Demographics Configuration POST /demographics/config Body: { "camera_id": string, "track_history_max_length": int (optional, min=1, max=100), "exit_threshold": int (optional, min=1, max=300), "min_track_duration": int (optional, min=1, max=60), "detection_confidence_threshold": float (optional, min=0.1, max=1.0), "demographics_confidence_threshold": float (optional, min=0.1, max=1.0), "min_track_updates": int (optional, min=1, max=100), "box_area_threshold": float (optional, min=0.05, max=1.0), "save_interval": int (optional, min=300, max=1800), "frame_skip_interval": float (optional, min=0.1, max=5.0) }
Update Demographics Configuration PUT /demographics/config/{config_id} Body: { "track_history_max_length": int (optional, min=1, max=100), "exit_threshold": int (optional, min=1, max=300), "min_track_duration": int (optional, min=1, max=60), "detection_confidence_threshold": float (optional, min=0.1, max=1.0), "demographics_confidence_threshold": float (optional, min=0.1, max=1.0), "min_track_updates": int (optional, min=1, max=100), "box_area_threshold": float (optional, min=0.05, max=1.0), "save_interval": int (optional, min=300, max=1800), "frame_skip_interval": float (optional, min=0.1, max=5.0) }
Get Demographics Results GET /demographics/results Query Parameters:
Evaluation Criteria Your submission will be evaluated based on:
Feature completeness according to requirements Code quality and organization UI/UX design and responsiveness Performance optimizations Unit test coverage Error handling
Loading...
use the sonner toast, change whats necessary only
I'll update the application to use Sonner toast instead of the current shadcn/ui toast implementation. Let me make the necessary changes:
The changes I made:
richColors
and position="top-right"
for better styling and positioning.useToast
hook and replaced it with Sonner's toast
function, updating the success and error notifications to use Sonner's API.Sonner provides a cleaner API and better visual design out of the box. The toast notifications will now appear in the top-right corner with rich colors and smooth animations.
Something went wrong. Please check the error below for more details. If the problem persists, please open an issue on GitHub.
The component at https://ui.shadcn.com/r/styles/new-york-v4/multi-select.json was not found. It may not exist at the registry. Please make sure it is a valid component.