一个基于 React + TypeScript 的智能化移动端语言学习应用,专注于卡片式学习体验和个性化学习进度管理。
TanGo 是一款语言学习应用,通过卡片式学习模式帮助用户高效掌握外语词汇。应用支持自定义词包导入、智能学习进度追踪,以及直观的交互体验。
- 熟练度管理
- Excel 词包导入支持
- 基于 IndexedDB 的本地存储
📋 详细的产品功能说明请查看 PRODUCT.md
| 技术 | 版本 | 用途 |
|---|---|---|
| React | 19.1.0 | 前端框架,组件化开发 |
| TypeScript | 5.8.3 | 类型安全,代码质量保障 |
| Vite | 6.3.5 | 构建工具,快速开发体验 |
| Tailwind CSS | 4.1.8 | 原子化CSS,快速样式开发 |
| Framer Motion | 12.15.0 | 动画库,丰富交互效果 |
| Zustand | 5.0.5 | 状态管理,轻量级方案 |
| IndexedDB (IDB) | 8.0.3 | 本地数据存储 |
src/
├── components/ # 通用组件库
│ ├── Button.tsx # 按钮组件
│ ├── Card.tsx # 卡片组件
│ ├── Modal.tsx # 模态框组件
│ ├── ProficiencySlider.tsx # 熟练度滑块
│ └── ...
├── pages/ # 页面组件
│ ├── practice/ # 练习页面
│ ├── profile/ # 个人中心
│ ├── wordpack/ # 词包管理
│ ├── recommended-packs/ # 词包库
| └── settings/ # 设置
├── services/ # 业务服务层
│ ├── wordPackService.ts # 词包服务
│ ├── practiceService.ts # 练习服务
│ └── vocabularyService.ts # 词汇服务
├── schemas/ # 数据模型定义
│ ├── wordPackSchema.ts # 词包数据模式
│ ├── vocabularySchema.ts # 词汇数据模式
│ └── practiceSchema.ts # 练习记录模式
├── stores/ # 状态管理
├── hooks/ # 自定义Hook
├── utils/ # 工具函数
└── types/ # TypeScript类型定义
基于 IndexedDB 的本地存储方案,包含以下数据表:
interface WordPackEntity {
id: number // 自增主键
name: string // 词包名称
createdAt: string // 创建时间
updatedAt: string // 更新时间
cardPacks: CardPackEntity[] // 关联卡包
}interface CardPackEntity {
id: number // 自增主键
wordPackId: number // 词包ID(外键)
name: string // 卡包名称
createdAt: string // 创建时间
updatedAt: string // 更新时间
}interface VocabularyEntity {
id: number // 自增主键
cardPackId: number // 卡包ID(外键)
phonetic?: string // 音标/假名
word: string // 写法
definition: string // 释义
example?: string // 例句
wordAudio?: string // 词汇音频
exampleAudio?: string // 例句音频
createdAt: string // 创建时间
updatedAt: string // 更新时间
}interface PracticeEntity {
id: number // 自增主键
vocabularyId: number // 词汇ID(外键)
practiceCount: number // 练习次数
proficiency: number // 熟练度 (1-100)
lastPracticeTime: string // 最近练习时间
createdAt: string // 创建时间
updatedAt: string // 更新时间
}- Node.js >= 18.0.0
- pnpm >= 8.0.0
-
克隆项目
git clone https://github.com/sone47/tango.git cd tango -
安装依赖
pnpm install
-
启动开发服务器
pnpm run dev
-
在浏览器中访问
http://localhost:5173
| 命令 | 说明 |
|---|---|
pnpm run dev |
启动开发服务器 |
pnpm run build |
构建生产版本 |
pnpm run preview |
预览生产构建 |
pnpm run lint |
运行ESLint检查 |
pnpm run lint:fix |
自动修复ESLint问题 |
pnpm run format |
格式化代码 |
pnpm run type-check |
TypeScript类型检查 |
pnpm run build构建后的文件位于 dist/ 目录,可以部署到任何静态文件服务器:
- Vercel: 直接连接 Git 仓库自动部署
- Netlify: 拖拽
dist/文件夹即可部署 - GitHub Pages: 使用 GitHub Actions 自动部署
- Nginx: 配置静态文件服务
目前项目为纯前端应用,无需配置环境变量。
本项目基于 MIT License 开源协议。
我们欢迎所有形式的贡献,包括但不限于:
- 🐛 Bug 报告
- 💡 功能建议
- 📝 文档改进
- 🔧 代码贡献
- Fork 本仓库
- 创建功能分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'feat: Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 打开 Pull Request
- 遵循现有的代码风格
- 添加适当的类型定义
- 编写清晰的提交信息
- 更新相关文档