{"id":26621590,"url":"https://github.com/zhitrend/zhitrend-shop-front","last_synced_at":"2025-03-24T09:17:28.228Z","repository":{"id":266496007,"uuid":"897898765","full_name":"zhitrend/zhitrend-shop-front","owner":"zhitrend","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-05T13:14:26.000Z","size":492,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T08:15:43.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhitrend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T12:41:50.000Z","updated_at":"2024-12-05T13:14:31.000Z","dependencies_parsed_at":"2024-12-04T15:35:45.892Z","dependency_job_id":"21c1fda4-c78e-47a9-ad47-32853ac11be1","html_url":"https://github.com/zhitrend/zhitrend-shop-front","commit_stats":null,"previous_names":["zhangrongwu/zhitrend-shop-front","zhitrend/zhitrend-shop-front"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2Fzhitrend-shop-front","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2Fzhitrend-shop-front/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2Fzhitrend-shop-front/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2Fzhitrend-shop-front/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhitrend","download_url":"https://codeload.github.com/zhitrend/zhitrend-shop-front/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240835,"owners_count":20583102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-24T09:17:27.520Z","updated_at":"2025-03-24T09:17:28.212Z","avatar_url":"https://github.com/zhitrend.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 电商系统\n\n一个基于 React + Cloudflare Workers 的现代电商系统。初创公司/个人独立站最好的组合\n\n## 功能特点\n\n### 用户端\n- 商品浏览和搜索\n- 购物车管理\n- 订单管理\n- 商品评价\n- 收藏夹\n- 个人中心\n\n### 管理端\n- 商品管理\n- 库存管理\n- 订单管理\n- 营销活动\n- 数据分析\n- 用户管理\n\n## 技术栈\n\n### 前端\n- React 18\n- TypeScript\n- Vite\n- React Router\n- TanStack Query\n- Tailwind CSS\n- Headless UI\n- Hero Icons\n\n### 后端\n- Cloudflare Workers\n- Hono\n- D1 (SQLite)\n- R2 Storage\n\n## 开始使用\n\n### 前置要求\n- Node.js 16+\n- npm 7+\n- Cloudflare 账号\n\n### 安装步骤\n\n1. 克隆项目 \n\n2. 安装前端依赖\ncd frontend\nnpm install\n3. 安装后端依赖\ncd backend\nnpm install\n\n4. 配置环境变量\n- 复制 `backend/wrangler.toml.example` 为 `backend/wrangler.toml`\n- 更新配置文件中的必要信息：\n  - D1 数据库 ID\n  - R2 存储桶名称\n  - JWT 密钥\n\n5. 初始化数据库\ncd backend\nnpm run db:migrate\n\n6. 启动开发服务器\n\n前端：\ncd frontend\nnpm run dev\n\n后端：\ncd backend\nnpm run dev\n\n## 项目结构\n.\n├── frontend/ # 前端项目\n│ ├── src/\n│ │ ├── components/ # 可复用组件\n│ │ ├── pages/ # 页面组件\n│ │ ├── hooks/ # 自定义 Hooks\n│ │ └── utils/ # 工具函数\n│ └── public/ # 静态资源\n│\n└── backend/ # 后端项目\n├── src/\n│ ├── middleware/ # 中间件\n│ ├── utils/ # 工具函数\n│ └── index.ts # 入口文件\n└── schema.sql # 数据库模式\n\n## API 文档\n\n### 认证 API\n- POST `/api/auth/register` - 用户注册\n- POST `/api/auth/login` - 用户登录\n\n### 商品 API\n- GET `/api/products` - 获取商品列表\n- GET `/api/products/:id` - 获取商品详情\n- POST `/api/products` - 创建商品\n- PUT `/api/products/:id` - 更新商品\n- DELETE `/api/products/:id` - 删除商品\n\n### 购物车 API\n- GET `/api/cart` - 获取购物车\n- POST `/api/cart` - 添加商品到购物车\n- PUT `/api/cart/:id` - 更新购物车商品\n- DELETE `/api/cart/:id` - 删除购物车商品\n\n### 订单 API\n- GET `/api/orders` - 获取订单列表\n- GET `/api/orders/:id` - 获取订单详情\n- POST `/api/orders` - 创建订单\n- PUT `/api/orders/:id` - 更新订单状态\n\n### 管理 API\n- GET `/api/admin/stats` - 获取统计数据\n- GET `/api/admin/users` - 获取用户列表\n- GET `/api/admin/analytics` - 获取分析数据\n\n## 部署\n\n1. 构建前端\ncd frontend\nnpm run build\n\n2. 部署后端\ncd backend\nnpm run deploy\n\n3. 部署前端\n- 将 `frontend/dist` 目录部署到静态托管服务\n- 或部署到 Cloudflare Pages\n\n## 贡献指南\n\n1. Fork 项目\n2. 创建功能分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 提交 Pull Request\n\n## 许可证\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情\n\n## 联系方式\n\nemail: zhitrend@gmail.com\n\n[公司主页](https://zhitrend.us.kg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhitrend%2Fzhitrend-shop-front","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhitrend%2Fzhitrend-shop-front","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhitrend%2Fzhitrend-shop-front/lists"}