Weight_Tracker/docs/v1.md
Chever John fe4616d41b
Adds initial documentation for v1
Adds a first version of the documentation, describing the
architecture and features of the weight loss system.

This documentation includes:

*   A high-level overview of the system's components.
*   Details on public access and admin functionalities.
*   A description of the frontend/backend architecture.
*   Mockups of the user interfaces.

Good taste requires questioning if this is a real problem or imagined,
and if there is a simpler method. We must consider if this implementation
breaks anything and ensure user space is not disrupted. This provides
a baseline to build upon, but needs to be refined as the project evolves.
The code is not garbage, but simplification might be possible.
2025-09-02 15:47:46 +08:00

124 lines
No EOL
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 这是一个减肥的小系统
```mermaid
flowchart TD
A[访问者] --> B[公开页面]
B --> C[数据展示]
B --> D[进度预测]
B --> E[健康建议]
F[管理员] --> G[管理员入口]
G --> H[数据录入界面]
H --> I[权限验证]
I --> J[数据库写入操作]
J --> K[数据存储]
K --> C
K --> D
K --> E
```
1. 公开访问层
无需登录:任何访问者都可查看主页和所有数据可视化内容
全透明展示:完整显示减重进度、预测和健康建议
静态链接采用固定URL便于书签收藏或分享
2. 管理员功能层
隐蔽式管理入口通过特定URL访问管理界面
简单认证机制:基本的密码保护,无需复杂账户系统
一键录入功能:简化管理员数据录入流程
技术实现细节
前后端分离架构
```shell
+---------------------+ +---------------------+
| | | |
| 前端应用 | | 后端API服务 |
| (静态托管) | | |
| | | |
+--------+------------+ +---------+-----------+
| |
| 公开API调用 |
+--------------->--------------+
|
+--------------->--------------+
| 管理API调用(带认证) |
| |
+--------+------------+ +---------+-----------+
| | | |
| 管理员界面 | | 数据库 |
| | | |
+---------------------+ +---------------------+
```
数据安全实现方案
## 页面
### 公开展示页面(无需登陆)
```shell
+---------------------------------------------------+
| 减重监督系统 |
+---------------------------------------------------+
| 当前日期: 2025-09-02 目标日期: 2025-12-31 |
| 起始体重: 109kg 目标体重: 90kg |
| 当前体重: 109kg 已减重: 0kg (0%) |
| 剩余减重: 19kg 平均速度要求: 0.16kg/天|
+---------------------------------------------------+
| |
| [大型进度条显示,带有颜色编码的健康指示] |
| |
+---------------------------------------------------+
| |
| 最近更新2025-09-02 |
| |
+---------------------------------------------------+
| |
| 进度预测 |
| • 当前速度下预计完成日期: 2025-12-31 |
| • 是否符合计划: 是 |
| • 是否健康: 需要密切监控 |
| |
+---------------------------------------------------+
```
### 管理员数据录入页面(需认证)
```shell
+---------------------------------------------------+
| 管理员数据录入 |
+---------------------------------------------------+
| [返回公开页面] [退出管理模式] |
+---------------------------------------------------+
| |
| 今日体重记录 |
| +--------+ |
| | ___kg | [记录] |
| +--------+ |
| |
+---------------------------------------------------+
| |
| 最近记录历史 |
| • 2025-09-02: 109kg [编辑] [删除] |
| • ... |
| |
+---------------------------------------------------+
| |
| 目标设置 |
| 起始体重: [109] kg 起始日期: [2025-09-02] |
| 目标体重: [90] kg 目标日期: [2025-12-31] |
| [更新目标] |
| |
+---------------------------------------------------+
```
管理入口实现方案
1. 半隐藏式管理入口
在公开页面底部添加一个小型、不明显的"管理"链接,点击后导向管理员认证页面。
2. 直接URL访问
设置一个专用URL路径如/admin或/manage用于访问管理功能。