YuHeng (玉衡)

A local nutrition tracking app powered by AI

View the Project on GitHub formaxcn/yuheng

Backend Status and Settings Redirect

Implemented real-time backend status monitoring and improved the settings page user experience.

Features

Backend Health Check

Real-time Version & Status Indicator

Settings UX Improvement

Implementation Details

API Endpoint

The health check endpoint is located at app/api/health/route.ts. It returns the current version from package.json.

Frontend Component

The BackendStatus component (components/backend-status.tsx) handles the polling logic (every 30 seconds) and UI state.

Settings Page Logic

The save handler in app/settings/page.tsx was modified to use router.push('/') upon success.