An AI that remembers your body: it maps the aches and changes you mention onto a 3D body, forms an overall assessment once you confirm it, and coaches you through each training plan.
Language: English · Simplified Chinese
Live App · Project Page · Product Spec · Architecture
BodySense keeps long-term body information as structured, time-aware data. A clear user statement about their own body is recorded automatically, while ambiguities are clarified through interactive tools. The Agent can help analyze specific conditions within one comprehensive Diagnosis and suggest adjustments to individual training plans. Formal Diagnosis changes require the user's request or authorization; training content changes require a direct request or acceptance of an Agent proposal.
The interface uses a persistent interactive 3D body canvas with movable Chat and business windows for Person, Diagnosis, TrainingPlan and Trainer. The normal experience shows current results rather than internal revision history.
Important
BodySense supports personal health-information organization and evidence-aware explanation. It is not a medical device and does not replace qualified medical diagnosis or treatment.
若您是相关内容的权利人并认为知识库内容侵权,请联系维护者,我们将及时下架处理。
- BodyState — one durable state per user, with clear self-reports saved automatically and correction distinguished from actual progression.
- Diagnosis — one comprehensive current result, made up of condition entries that can be updated independently within an atomic overall revision.
- TrainingPlan — multiple independent current plans, changed only when the user requests or explicitly accepts a proposed modification.
- Agent — natural-language interaction, targeted evidence gathering, clarification, scoped diagnosis analysis and plan-impact review.
- 3D workspace — persistent body canvas, context tools and movable windows, consistent on desktop and mobile.
For detailed semantics, see the product specification.
BodySense focuses less on “how to call a model” and more on how AI output becomes durable, traceable, reviewable product state.
| Engineering concern | BodySense approach |
|---|---|
| Long-running AI interaction | Run / Turn / checkpoint + durable event log |
| Human-in-the-loop | structured ask_user interrupt / resume |
| AI ↔ business state | Go owns durable business state; AI runtime produces validated proposals/events |
| Retrieval | pgvector-backed evidence retrieval with provenance |
| Model boundary | standalone LiteLLM gateway; application code does not own physical provider routing |
| Diagnosis governance | immutable configuration identity, replay/eval, hard safety gates |
| Production delivery | coherent immutable release artifacts + revision-checked rollout |
React Web
│ HTTP + SSE
▼
Go API / domain authority
│
├── PostgreSQL + pgvector
├── Redis
└── Python AI Service
│
├── FastAPI
├── LangGraph durable runtime
├── PydanticAI typed agents
└── LiteLLM model gateway
The repository is an Nx + pnpm monorepo:
apps/
├── web/ React 19 + TypeScript + Vite
├── api/ Go + Gin + GORM
└── ai-service/ Python + FastAPI + LangGraph + PydanticAI
docker/ Local / production orchestration
scripts/ Validation and release utilities
docs/ Product specs, ADRs, architecture and plans
tools/ Project-specific engineering tools
For the current runtime and deployment boundaries, see docs/architecture/deployment-architecture.md.
- Frontend: React 19, TypeScript 6, Vite 8, Tailwind CSS 4, shadcn/ui
- Backend: Go 1.26, Gin, GORM
- AI: Python 3.13, FastAPI, LangGraph, PydanticAI
- Data: PostgreSQL + pgvector, Redis
- Model gateway: LiteLLM
- Workspace: Nx 23, pnpm 11
- Quality: Vitest, Go test, Pytest, Playwright, Ruff/Pyright, ESLint
- Delivery: GitHub Actions, Docker/Compose, Alibaba Cloud ACR + ECS
- Node.js 24+
- pnpm 11+
- Go 1.26+
- Python 3.13+
- Docker with Compose
git clone https://github.com/BakerSean168/BodySense.git
cd BodySense
pnpm install
pnpm devpnpm dev is the canonical interactive direct-dev entrypoint. It idempotently ensures the Docker-only development infrastructure is healthy, loads .env.dev.local when present, and then runs Web/API/AI on the host with hot reload.
The infrastructure is intentionally longer-lived than the application processes:
pnpm dev:infra:status # PostgreSQL 18 + pgvector, Redis, LiteLLM
pnpm dev:infra:up # create/start and wait for health
pnpm dev:infra:logs # infrastructure logs
pnpm dev:infra:down # explicit teardown; persistent volumes are preservedThe default direct-dev ports are Web 20100, API 20101, AI 20102, PostgreSQL 20110, Redis 20111, and LiteLLM 20112. Infrastructure containers use restart: unless-stopped, so a normal Docker/host restart brings them back without requiring the application processes to stay running.
Put host-specific overrides and provider credentials in the gitignored .env.dev.local; scripts/dev-env.sh supplies non-secret development defaults, so copying .env.example to .env is not required. The direct-dev Web lane enables Vite Bundled Dev by default so a workstation reaching GCP over Tailscale/SSH receives a small set of bundled development assets instead of a large native-ESM request waterfall while keeping HMR. Set BODYSENSE_VITE_BUNDLED_DEV=false in .env.dev.local to temporarily return to classic Vite for diagnostics; tests remain on classic Vite.
For a persistent remote development host, use Process Compose inside one tmux window to manage independent application processes instead of the single-terminal pnpm dev process group:
pnpm dev:tmux # starts Docker infra and tmux windows: services (Process Compose TUI), ops
pnpm dev:tmux:status # includes HTTP health and Docker status
bash scripts/dev-tmux.sh restart api # restart only the Go API
bash scripts/dev-tmux.sh stop ai # stop only the AI process
bash scripts/dev-tmux.sh logs api # inspect API logs from Process Compose
tmux attach -t bodysense-dev # Process Compose TUI: start/stop/restart/logs; detach Ctrl+a, d
pnpm dev:tmux:down # stop app processes; leave Postgres/Redis/LiteLLM runningGo auto-restart uses Air (GOBIN="$HOME/.local/bin" go install github.com/air-verse/[email protected]). Process Compose v1.124.0 (GOBIN="$HOME/.local/bin" go install github.com/f1bonacc1/[email protected]) provides service dependency ordering, status, logs, health checks and manual start/stop/restart via TUI or CLI. The Process Compose control API is bound to 127.0.0.1:20120, not exposed to the internet. Vite and Python retain their own hot reload. The stable session is started from the main worktree only. Feature worktrees do not affect its source files, but shared database and Redis state are not isolated by Git.
To discard only the dedicated BodySense development database, first stop the application session, then run bash scripts/dev-tmux.sh reset-db. It validates the Compose project, loopback port, database name and active connections before dropping/recreating the empty database. Starting the Go API then initializes the current schema from the repository baseline; no old rows are migrated. This does not affect production or other projects. Do not run it while feature processes use the same database.
When the dev stack runs on a remote host, use ssh -N -L 20100:127.0.0.1:20100 <dev-host> from your workstation and open http://127.0.0.1:20100; when it runs on your own machine, open the same address directly. The Vite /api proxy forwards requests to Go. No public ingress is required.
Run a single surface when you do not need the full stack:
pnpm dev:web
pnpm dev:api
pnpm dev:aiThe repository keeps local and CI validation close to the same contract.
pnpm lint
pnpm typecheck
pnpm test
pnpm e2e
pnpm verify:releasepnpm verify:release is the broad repository release gate. CI also validates published database migration history and longitudinal browser journeys before a release becomes production-eligible.
The browser-facing REST contract has one source of truth: packages/contracts/openapi/bodysense.v1.openapi.yaml. The Postman collection is generated from that OpenAPI rather than maintained as a second specification:
pnpm postman:generate # regenerate collection + safe environment templates
pnpm postman:verify # freshness + 95/95 OpenAPI route parity
pnpm postman:validate-native # optional: validate with the installed Postman CLISee postman/README.md for environment handling, internal-service boundaries, and Native Git / Postman Cloud binding.
The current production application is available at body.bakersean.top.
The production path is intentionally separated from the GitHub Pages project page:
- GitHub Pages explains the project and its engineering story.
- Alibaba Cloud ECS runs the actual product.
- Alibaba Cloud ACR stores production OCI artifacts.
- GitHub Actions owns CI, release creation, and immutable image publication.
See docs/architecture/deployment-architecture.md for the current deployment contract.
- Documentation index (Chinese) — what is current, where each topic lives, what is archived
- Product overview
- Product requirements
- Domain contracts
- Agent interactions
- UI behavior
- Acceptance
- Glossary & Penpot name mapping
- Architecture
- Repository conventions
BodySense is a public source repository, but it currently does not include an open-source license. Public visibility alone does not grant permission to copy, modify, or redistribute the code; copyright remains with the repository owner unless a license is added later.