$ show lobehub/lobe-midjourney-webui
This is a standalone web UI for Midjourney image generation, built as a Next.js 14 application. It provides a prompt editor, image preview with upscale/variant/reroll actions, a task history list, and settings to configure a midjourney-proxy service. The app can run standalone or be embedded as a LobeChat plugin via an iframe. It uses React with Zustand for state management, SWR for data fetching, Immer for immutable state updates, and antd-style for theming. The backend consists of two API routes: one proxies requests to the midjourney-proxy service, and another uploads images to Imgur. The codebase is well-structured with clean separation of concerns, i18n support, and responsive design. While the application is functionally straightforward, it demonstrates solid engineering practices including pure reducer functions with unit tests, typed state management, and a modular layout system.
The LLM identified 1 files worth highlighting for reuse:
A pure reducer function for managing a list of Midjourney tasks using Immer for immutable updates. It handles four action types (addTask, deleteTask, updateTask, batchUpdateTasks) via a discriminated union payload. The reducer is fully covered by unit tests (task.test.ts) and can be extracted as a generic pattern for any entity list management. It demonstrates clean separation of state mutation logic from side effects, making it reusable across projects that need a predictable, testable state reducer.