YuHeng (玉衡)

A local nutrition tracking app powered by AI

View the Project on GitHub formaxcn/yuheng

Resumable Upload System

To handle large image uploads on unstable mobile networks (especially iPhone lock-screen disconnections), YuHeng implements a highly robust, chunked, and resumable upload system based on the Tus protocol.

Core Components

1. Server-side (Tus Protocol Implementation)

The backend implements a custom Tus-compatible handler at /api/upload/tus.

2. Client-side (UploadManager)

The UploadManager wraps the tus-js-client with YuHeng-specific logic.

3. State Management (RecognitionStore)

The RecognitionStore acts as the orchestrator for the upload lifecycle.

User Experience Design