{"id":13672692,"url":"https://github.com/HoPGoldy/react-koa-template","last_synced_at":"2025-04-27T22:32:41.511Z","repository":{"id":112085311,"uuid":"507933995","full_name":"HoPGoldy/react-koa-template","owner":"HoPGoldy","description":"基于 Node 的全栈项目模板，前端使用 react，后端使用 koa","archived":false,"fork":false,"pushed_at":"2022-07-02T11:21:35.000Z","size":328,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-11T10:42:42.354Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HoPGoldy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-27T14:05:30.000Z","updated_at":"2023-08-30T14:53:19.000Z","dependencies_parsed_at":"2023-03-08T22:15:45.697Z","dependency_job_id":null,"html_url":"https://github.com/HoPGoldy/react-koa-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoPGoldy%2Freact-koa-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoPGoldy%2Freact-koa-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoPGoldy%2Freact-koa-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoPGoldy%2Freact-koa-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoPGoldy","download_url":"https://codeload.github.com/HoPGoldy/react-koa-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219600,"owners_count":21554444,"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":"2024-08-02T09:01:44.583Z","updated_at":"2025-04-27T22:32:36.501Z","avatar_url":"https://github.com/HoPGoldy.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-koa-template\n\n基于 Node / TypeScript 的全栈项目模板，前端使用 react，后端使用 koa。包含如下功能：\n\n**项目**\n\n- 使用 typescript\n- 使用 yarn 管理依赖\n- 一键启动、打包前后端\n- 路径别名: `@ =\u003e src/`\n- 添加 eslint 检查\n- 包含使用了 HTTP 接口的 TODO 示例\n- 包含登录鉴权的示例\n\n**前端**\n\n- 使用 vite 构建项目\n- 添加 react、react-router-dom\n- 添加 react-vant 组件库\n- 添加 tailwindcss\n- 已配置路由懒加载\n- 基于 fetch 的 HTTP 请求封装\n\n**后端**\n\n- 使用 koa 构建项目\n- 添加 router、logger、bodyParser、static 中间件\n- 前端 history 模式适配\n- 添加 [joi](https://joi.dev/) 进行参数校验\n- 添加 koa-jwt 和 jsonwebtoken 进行登录鉴权\n\n## 使用方法\n\n需求：`node 16+`、`yarn`\n\n```bash\n# 安装依赖\nyarn\n\n# 启动开发环境\nyarn dev\n\n# 打包项目\nyarn build\n\n# 运行打包后的项目\nyarn start\n```\n\n开发环境中，前端默认开放在端口 `3500` 后端开放在端口 `3600`，前端接口通过代理将请求转发到后端。\n\n运行打包后的代码将会默认开放在端口 `3700`，前端静态页面由后端 koa 服务托管。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHoPGoldy%2Freact-koa-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHoPGoldy%2Freact-koa-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHoPGoldy%2Freact-koa-template/lists"}