Files
digital-psychology/CLAUDE.md
T

2.9 KiB
Raw Blame History

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project overview

愈心谷 (YuXinGu) — a digital mental health platform. The codebase is a collection of standalone, mobile-first HTML pages with no build step, no framework, and no JavaScript dependencies.

Running the app

python3 server.py [port]   # default port 8001

The server serves all static files from the project root and exposes two JSON API endpoints:

  • GET /load — returns mindmap data from mindmap_data.json
  • POST /save — persists mindmap data to mindmap_data.json (validates JSON before writing)

File map

File Purpose
index.html Landing page linking to all sections
yuxingu.html Main app shell — hero, service cards, activity center, bottom nav
shuzi.html Digital psychology calculator — life-number triangle, bagua, liuren, zodiac, wuxing modules
mindmap.html Canvas-based mind-map editor with multi-map management
yangsheng.html AI Eastern wellness — bazi/wuxing constitution analysis, weekly/daily reports
manual.html Static "life manual" poster with pyramid triangle charts rendered via inline SVG
yuxingu_v1.html Earlier iteration of the main page
server.py Minimal HTTP server (Python stdlib, no dependencies)

Architecture notes

  • Every HTML file is self-contained. All CSS and JS are embedded in <style> / <script> tags. There are no shared .js or .css files.
  • Mobile-first design with max-width: 430px500px containers, user-scalable=no, and env(safe-area-inset-bottom) for notched phones.
  • CSS custom properties define the brand palette: --pri: #E54D42 (primary red), with per-page accent colors (gold, blue, green, orange).
  • Emoji are deliberately avoided in the main UI — icons use CSS shapes, Unicode text symbols (△, ☯, ◈), or inline SVG.
  • mindmap.html uses a <canvas> for rendering with hand-rolled hit-testing, drag-to-pan, and inline text editing. It persists maps to both localStorage (client-side key yuxingu_maps) and the server via /save / /load.
  • shuzi.html contains a full numerology engine in embedded JS — digit reduction, triangle calculation, joint codes, missing-number detection — plus tabbed panels for 梅花易数, 小六壬, 大六壬, 奇门遁甲, 星座, and 五行八卦 (content rendered dynamically).
  • yangsheng.html computes bazi (八字), five elements (五行), organ-meridian mapping, and wuyun-liuqi (五运六气) from a birth date. The weekly/daily panels use the current date to generate time-appropriate health advice.
  • The server is a thin wrapper around http.server.SimpleHTTPRequestHandler. It disables caching for HTML/JSON responses and adds the /save + /load routes. No database, no auth.
  • Target audience is Chinese-speaking; all UI text is Chinese (zh-CN).