Files
memory/README.md
2025-12-14 20:33:33 +08:00

93 lines
1.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.
# Memory
一个类似 X (Twitter) 的个人生活记录应用。
## 功能
- 📝 发帖:支持文字 + 图片/视频
- 💬 评论:帖子评论功能
- ❤️ 点赞:帖子点赞
- 😊 表情反应:给帖子添加表情
- 🔍 搜索:按内容和时间范围搜索
- 📊 归档GitHub 风格热力图展示发帖记录
- 👤 个人中心:修改头像、昵称、简介
## 技术栈
### 服务端
- Go + Gin
- SQLite
- Cloudflare R2 (图片存储)
### Android
- Kotlin + Jetpack Compose
- Retrofit + OkHttp
- Coil (图片加载)
## 部署
### 服务端
1. 复制配置文件:
```bash
cd server
cp .env.example .env
```
2. 编辑 `.env` 配置 R2 存储和 JWT 密钥
3. 使用 Docker 部署:
```bash
docker-compose up -d
```
或直接运行:
```bash
go build -o memory .
./memory
```
### Android
1. 修改 `app/build.gradle.kts` 中的 `API_BASE_URL` 为你的服务器地址
2. 使用 Android Studio 构建 APK
## API 接口
### 认证
- `POST /api/auth/register` - 注册
- `POST /api/auth/login` - 登录
### 帖子
- `GET /api/posts` - 获取帖子列表
- `POST /api/posts` - 创建帖子
- `GET /api/posts/:id` - 获取帖子详情
- `DELETE /api/posts/:id` - 删除帖子
- `POST /api/posts/:id/like` - 点赞
- `DELETE /api/posts/:id/like` - 取消点赞
- `POST /api/posts/:id/reactions` - 添加表情
- `DELETE /api/posts/:id/reactions` - 移除表情
### 评论
- `GET /api/posts/:id/comments` - 获取评论
- `POST /api/posts/:id/comments` - 发表评论
- `DELETE /api/posts/:id/comments/:comment_id` - 删除评论
### 用户
- `GET /api/user/profile` - 获取个人信息
- `PUT /api/user/profile` - 更新个人信息
- `PUT /api/user/avatar` - 更新头像
### 搜索
- `GET /api/search` - 搜索帖子
- `GET /api/heatmap` - 获取热力图数据
### 管理员
- `GET /api/admin/settings` - 获取系统设置
- `PUT /api/admin/settings` - 更新系统设置
## License
MIT