Skip to content

Conversation

@DanZai233
Copy link

@DanZai233 DanZai233 commented Jan 28, 2026

Add Web UI, Multilingual Support, Docker Deployment, and CJK Font Support

Summary

Transform Map Poster Generator into a production-ready web application with:

  • 🌐 Complete React + FastAPI web UI
  • 🌍 Chinese-English bilingual interface
  • 🔍 Intelligent city search (multilingual)
  • 🐳 Docker containerization (one-command deploy)
  • 🈲 Full CJK font support (Chinese/Japanese/Korean)

Type of Change

  • New feature
  • Enhancement
  • Bug fix
  • Documentation update
  • Breaking change (Python <3.14 required)

Key Features

Web UI

  • Modern React + TypeScript frontend
  • 6 RESTful API endpoints
  • Real-time preview and gallery
  • 17 beautiful themes
  • Progress tracking

Multilingual

  • i18next + react-i18next
  • Auto language detection
  • Persistent settings
  • Full UI translation

Smart Search

  • OpenStreetMap Nominatim API
  • Autocomplete with debounce
  • Multi-language support
  • Auto-fill coordinates

Docker

  • Multi-stage build
  • Health checks
  • Auto-restart

CJK Fonts

  • Noto Sans SC (TTF)
  • 30MB full character set
  • Perfect rendering

Changes

37 files changed: +7,618, -225 lines

Added

  • webapp/ - Complete React frontend
  • api_server.py - FastAPI backend (303 lines)
  • Dockerfile - Multi-stage build
  • docker-compose.yml - Deployment config
  • fonts/NotoSansSC-*.ttf - Chinese fonts (30MB)
  • DOCKER.md, QUICKSTART_EN.md - English docs

Modified

  • pyproject.toml - Added fastapi, pydantic, uvicorn
  • requirements.txt - Synced dependencies
  • font_management.py - TTF font support

Testing

# Docker deployment
docker-compose up -d
curl http://localhost:8000/api/themes  # ✅ 17 themes

# Chinese font rendering
curl -X POST http://localhost:8000/api/generate \
  -d '{"city":"Beijing","display_city":"北京","theme":"terracotta"}'
# ✅ Generated beijing_terracotta.png with perfect Chinese text

# Container health
docker ps | grep maptoposter
# ✅ Up and healthy

Breaking Changes

⚠️ Python Version: Now requires >=3.11,<3.14 (was >=3.11)

  • Reason: pydantic-core doesn't support Python 3.14
  • Action: Use Python 3.11, 3.12, or 3.13

Checklist

  • Code follows style guidelines
  • Self-review completed
  • Documentation updated
  • Tests pass
  • Docker builds successfully
  • No new warnings
  • Backward compatible (CLI still works)

Usage

Docker (Recommended)

docker-compose up -d
open http://localhost:8000

Manual

./start.sh
open http://localhost:3000

API

curl -X POST http://localhost:8000/api/generate \
  -H "Content-Type: application/json" \
  -d '{"city":"Tokyo","theme":"noir"}'

Documentation

Related Issues

Fixes: #N/A (new feature)

Notes for Reviewers

Please review:

  • Frontend components (webapp/src/components/)
  • API endpoints (api_server.py)
  • Docker configuration
  • Font handling changes
  • Documentation clarity

- 添加完整的 React + TypeScript 前端应用
- FastAPI 后端服务器 (api_server.py)
- 实时海报预览和图库管理
- 交互式主题选择器
- 响应式设计,支持移动端
- 一键启动脚本 (start.sh)

- 完整的中英文界面切换
- 使用 i18next + react-i18next
- 自动检测浏览器语言
- 语言选择持久化保存
- 所有界面元素完整翻译

- 全球城市自动补全功能
- 支持中文、英文、日文等多语言搜索
- 后端代理 OpenStreetMap Nominatim API
- 实时搜索 + 防抖优化 (300ms)
- 自动填充城市、国家、坐标信息

- 精美的进度条显示生成步骤
- 图库点击切换功能
- 自定义渐变滚动条
- 玻璃态效果和渐变设计
- 流畅的动画和过渡效果

- 新增 6 个 RESTful API 端点
- 城市搜索代理解决 CORS 问题
- 正确的 User-Agent 设置
- 完善的错误处理

- 现代化 React 组件架构
- TypeScript 类型安全
- TailwindCSS 样式系统
- Vite 快速构建
- 响应式布局

- 修复 Python 3.14 兼容性问题(限制为 <3.14)
- 修复 THEME 全局变量共享问题
- 修复 Nominatim API User-Agent 问题
- 修复城市搜索表单验证
- 修复图库点击切换功能

- pyproject.toml: 添加 fastapi, pydantic, uvicorn
- requirements.txt: 同步更新 Web API 依赖
- uv.lock: 更新依赖锁文件
- webapp/: 完整的前端依赖 (React, i18next, axios)

- UPDATE_SUMMARY.md: 综合更新总结
- MULTILINGUAL_UPDATE.md: 多语言功能详解
- CHINESE_SEARCH_SUPPORT.md: 中文搜索支持说明
- UI_IMPROVEMENTS.md: UI 改进详细说明
- WEBUI_README.md: Web UI 使用指南
- 其他技术文档和修复说明

---
Files changed: 40+ files
主要目录: webapp/ (新增), api_server.py (新增), 多个文档

UPG

UPG

docs: consolidate documentation to English-only user guides

Remove all Chinese process and requirement documents, keeping only essential English user-facing documentation.

Changes:
- Remove 14 Chinese documentation files (process/requirements)
- Add DOCKER.md: Comprehensive Docker deployment guide
- Add QUICKSTART_EN.md: English quick start guide
- Add COMMITS_SUMMARY.md: Summary of recent 3 commits
- Keep: README.md, WEBUI_README.md, CHANGELOG.md

Documentation structure:
Before: 17+ mixed language docs (process/requirements/usage)
After: 5 focused English user guides

Removed docs:
- CHINESE_FONT_SUPPORT.md (process)
- CHINESE_SEARCH_SUPPORT.md (requirement)
- CITY_SEARCH_FIX.md (process)
- COMMIT_SUMMARY.md (process)
- DEPLOYMENT_SUCCESS.md (process)
- DOCKER_DEPLOYMENT.md (Chinese)
- DOCKER_QUICKSTART.md (Chinese)
- FONT_FIX_COMPLETE.md (process)
- MULTILINGUAL_UPDATE.md (requirement)
- NOMINATIM_FIX.md (process)
- QUICKSTART.md (Chinese)
- UI_IMPROVEMENTS.md (requirement)
- UPDATE_SUMMARY.md (summary)
- WEBUI.md (Chinese)

Rationale: Streamline documentation for international users, remove redundant process documents that clutter the repository.

docs: add documentation cleanup summary

docs: add recommended commit messages for recent changes
@DanZai233 DanZai233 changed the title feat: 添加完整 Web UI、多语言支持和城市搜索 feat: Add Web UI, Multilingual Support, Docker Deployment, and CJK Font Support Jan 28, 2026
@merwok
Copy link

merwok commented Jan 29, 2026

Based on other PRs, this will probably be rejected.

  • Author doesn’t want docker config (not sure why; the latest open PR with that is nice though, with publishing automation)
  • Multilingual support is already there
  • CJK fonts, if not already supported (there is google fonts support now), should be its own PR
  • the author is working on their own UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants