A modern web reader for MDict dictionaries with React 19 SPA, dark mode, and faithful dictionary rendering.Project Website | GitHub Repository
The Problem
- Slow & Clunky: Server-side rendering that feels sluggish.
- Broken Rendering: Trying to "sanitize" or native-render the dictionary HTML, which breaks the complex, custom CSS layouts used by high-quality dictionaries (like Oxford or Longman).
The Solution: MdictLive
Key Architecture Decisions
1. Iframe Isolation for Fidelity
- The dictionary's custom CSS/JS works 100% as intended.
- The main app's dark mode doesn't break the dictionary's layout.
- Scrolling and interaction are isolated and performant.
2. Modern State Management
3. Server-Side Caching
4. Legacy Support via Modern Infra
Tech Stack
- Frontend: React 19, Vite 7, Tailwind CSS v4, Framer Motion
- Backend: Python 3.11, Flask, C-optimized LZO
- Deployment: Docker, GitHub Actions, Unraid XML Template
Conclusion
基于 React 19 重构的现代化 MDict 词典阅读器,支持暗黑模式、生词本和原生渲染。项目主页 | GitHub 仓库
问题背景
- 体验陈旧:传统的服务端渲染,操作迟滞,缺乏交互感。
- 渲染崩坏:试图清洗或直接渲染词典 HTML,导致破坏了许多高质量词典(如牛津、朗文)复杂的自定义 CSS 布局。
解决方案:MdictLive
关键架构决策
1. Iframe 隔离渲染
- 词典原本的 CSS/JS 能够 100% 完美运行。
- 主应用的暗黑模式不会破坏词典原本的排版。
- 滚动和交互相互隔离,性能更佳。
2. 现代状态管理
3. 服务端缓存
4. 现代基建支持遗留格式
技术栈
- 前端: React 19, Vite 7, Tailwind CSS v4, Framer Motion
- 后端: Python 3.11, Flask, C 优化 LZO 库
- 部署: Docker, GitHub Actions, Unraid XML 模板