文件
csp/frontend
cryptocommuniums-afk 7dd10bef2d fix: image upload proxy, compression, and JSON parse safety
- Add /api/v1/ and /files/ rewrite rules in next.config.ts so frontend
  can call backend without /admin139 prefix
- Fix upload using MultiPartParser instead of req->getUploadedFiles()
- Add client-side image compression (canvas resize to 1920px, quality 0.8)
  for photos >500KB before upload
- Safe JSON parsing: catch HTML error responses instead of throwing
  SyntaxError on non-JSON backend responses
- Fix backslash escape in delete filename validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-16 18:10:47 +08:00
..

Frontend (Next.js) - Minecraft Edition 🧱

This project now features a full Minecraft-themed UI overhaul!

📖 Read the Gameplay Guide for details on the RPG mechanics, Quest Board, and more.

Theme Features

  • 8-bit Aesthetic: Uses Press Start 2P and VT323 fonts.
  • RPG Terminology: Problems are "Quests", Submissions are "Spells".
  • Gamification: XP Bar, Levels, and Trading Post.

开发

npm ci
npm run dev

默认访问:http://localhost:3000

构建

npm run lint
npm run build
npm run start

环境变量

  • NEXT_PUBLIC_API_BASE:浏览器访问后端 API 的基地址。
    • 开发默认:http://localhost:8080
    • Docker/生产推荐:/admin139
  • BACKEND_INTERNAL_URLNext.js 反向代理后端目标(服务端)
    • Docker 默认:http://backend:8080

页面

  • /auth 登录/注册
  • /problems Quest Board (Questions)
  • /problems/:id 题目详情与提交
  • /submissions Spell History (Submissions)
  • /submissions/:id 提交详情
  • /wrong-book Cursed Tome (Wrong Book)
  • /contests Raid Board (Contests)
  • /contests/:id 比赛详情/报名/排行榜
  • /kb 知识库列表
  • /kb/:slug 文章详情
  • /imports 题库导入任务状态与结果
  • /run 在线 C++ 运行
  • /me 当前用户信息
  • /leaderboard Hall of Fame (Rankings)