一个智能的购物价格对比应用,帮助用户在多个平台中找到最优惠的商品价格。
BestDeal(最佳交易)是一款基于React Native + TypeScript开发的移动应用,旨在为用户提供跨平台的商品价格对比服务。通过聚合多个电商平台的商品信息,为用户展示最优的购物选择。
- 商品搜索 - 快速搜索商品信息
- 价格对比 - 多平台价格实时对比
- 评分系统 - 多维度商品评分展示
- 价格趋势 - 历史价格变化图表
- 收藏功能 - 心愿单和商品收藏
- 智能推荐 - 基于用户行为的个性化推荐
- 框架: React Native + Expo
- 语言: TypeScript
- 状态管理: Zustand
- 导航: React Navigation v6
- UI组件: React Native Paper
- 网络请求: Axios
- 图表: React Native Charts
- 代码规范: ESLint + Prettier
- Node.js >= 18.0.0
- npm >= 8.0.0
- Android Studio (Android开发)
- Expo Go App (真机调试)
# 安装项目依赖
npm install
# 安装iOS依赖 (如果开发iOS)
cd ios && pod install && cd ..# 启动Expo开发服务器
npm start
# 直接启动Android
npm run android
# 直接启动iOS
npm run ios
# 启动Web版本
npm run web- 真机调试: 手机安装Expo Go,扫描二维码
- 模拟器调试: 在Android Studio中启动模拟器
- Web调试: 浏览器中直接预览
BestDeal/
├── src/
│ ├── components/ # 可复用组件
│ ├── screens/ # 页面组件
│ ├── services/ # API服务
│ ├── store/ # 状态管理
│ ├── types/ # TypeScript类型定义
│ ├── utils/ # 工具函数
│ └── constants/ # 常量配置
├── assets/ # 静态资源
├── __tests__/ # 测试文件
└── docs/ # 项目文档
# 功能开发
git commit -m "feat: 添加商品搜索功能"
# 问题修复
git commit -m "fix: 修复价格显示错误"
# 文档更新
git commit -m "docs: 更新API文档"
# 样式调整
git commit -m "style: 优化商品卡片布局"# 代码检查
npm run lint
# 自动修复
npm run lint:fix
# 类型检查
npm run type-check
# 运行测试
npm run test创建 .env 文件:
# API配置
API_BASE_URL=https://api.bestdeal.com
API_TIMEOUT=10000
# 第三方服务
ANALYTICS_API_KEY=your_analytics_key
项目配置了以下路径别名:
@/→src/@/components/→src/components/@/screens/→src/screens/@/services/→src/services/
- 在
src/screens/创建页面组件 - 在
src/navigation/配置路由 - 添加对应的类型定义
- 定义API接口 (
src/services/) - 创建数据模型 (
src/types/) - 实现业务逻辑 (
src/store/) - 开发UI组件 (
src/components/)
# 开发构建
npm run build:android
# 生产构建
eas build --platform android --profile production# 开发构建
npm run build:ios
# 生产构建
eas build --platform ios --profile production- Fork本仓库
- 创建功能分支:
git checkout -b feature/新功能 - 提交变更:
git commit -m 'feat: 添加新功能' - 推送分支:
git push origin feature/新功能 - 提交Pull Request
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
- 项目地址: GitHub
- 问题反馈: Issues
- 邮箱: [email protected]
BestDeal Team - 让每一次购物都是最佳交易!