{"id":13600360,"url":"https://github.com/openscrm/api-server","last_synced_at":"2025-05-15T15:07:21.004Z","repository":{"id":40641106,"uuid":"399419285","full_name":"openscrm/api-server","owner":"openscrm","description":"OpenSCRM是一套基于Go和React的高质量企业微信私域流量管理系统 。遵守Apache2.0协议，全网唯一免费商用。企业微信、私域流量、SCRM。","archived":false,"fork":false,"pushed_at":"2024-10-11T04:20:46.000Z","size":119785,"stargazers_count":1416,"open_issues_count":17,"forks_count":269,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-04-12T02:55:52.597Z","etag":null,"topics":["antd","apache2","go","golang","openscrm","react","scrm","wechat","wecom","weixin","wework"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openscrm.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-24T10:10:28.000Z","updated_at":"2025-04-12T00:13:20.000Z","dependencies_parsed_at":"2024-05-18T13:39:43.213Z","dependency_job_id":"9934bae8-ff81-4639-9010-d8e102d8188b","html_url":"https://github.com/openscrm/api-server","commit_stats":{"total_commits":86,"total_committers":7,"mean_commits":"12.285714285714286","dds":0.2674418604651163,"last_synced_commit":"a1c8d0bc85cc6cc757f13d57cded7578f6f83435"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscrm%2Fapi-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscrm%2Fapi-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscrm%2Fapi-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscrm%2Fapi-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openscrm","download_url":"https://codeload.github.com/openscrm/api-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"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":["antd","apache2","go","golang","openscrm","react","scrm","wechat","wecom","weixin","wework"],"created_at":"2024-08-01T18:00:37.418Z","updated_at":"2025-05-15T15:07:15.996Z","avatar_url":"https://github.com/openscrm.png","language":"Go","readme":"\u003ch4 align=\"center\"\u003e\n重要：本项目缺乏维护，目前没有力量继续维护，如果有兴趣维护的朋友，可以联系我，我会尽力提供帮助。\n\u003c/h4\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"logo\" height=\"48\" src=\"https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/openscrm_logo.svg\"\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\n安全，强大，易开发的企业微信SCRM\n\u003c/h3\u003e\n\n\u003ch4 align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/openscrm/api-server/wiki\" target=\"_blank\"\u003e文档\u003c/a\u003e |\n[截图](#项目截图) |\n\u003ca href=\"http://dashboard.demo.openscrm.cn:8000/\" target=\"_blank\"\u003e演示\u003c/a\u003e |\n\u003ca href=\"https://github.com/openscrm/api-server/wiki/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B\" target=\"_blank\"\u003e安装\u003c/a\u003e \n\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"260\" src=\"https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/感谢赞助.svg\"\u003e\n\u003c/p\u003e\n\n### 项目简介\n\u003e OpenSCRM是一套基于**Go**和**React**的**高质量**企业微信私域流量管理系统\n\n### 快速开始，启动演示项目（docker-compose）\n我们依靠docker-compose启动mysql和redis。\napi-server后端API本地编译启动，\ndashboard前端界面同样本地编译启动\n\n#### 启动mysql和redis\ndocker-compose up\n\n#### 启动api-server\n* conf/config.example.yaml -\u003e conf/config.yaml // 修改SuperAdmin字段就行了，其他的跑起来再改\n* 项目根目录下启动 go run main.go\n* api监听地址 http://localhost:9001/\n\n#### 启动前端dashboard\n* git clone https://github.com/openscrm/dashboard \n* 安装 16.20.2 版本的nodejs，只能是这个版本，其他版本会有兼容问题，推荐用nvm管理node版本\n* 可选，安装国内npm包镜像源，参考https://npmmirror.com/\n* npm install --legacy-peer-deps\n* npm run start\n\n#### 访问站点\nhttp://localhost:9000/\n\n--- \n\n### 搭建后端开发环境(可选)\n#### 安装go语言环境\nhttps://go.dev/doc/install\n\n#### 修改配置文件\nconf/config.example.yaml -\u003e conf/config.yaml\n\n#### 启动程序\n```\ngo run main.go\n```\n\n#### 访问站点\nhttp://dashboard.dev.openscrm.cn:9000/\n\n### 搭建前端开发环境\n具体看：https://github.com/openscrm/dashboard\n\n### 子项目\n\n[会话存档服务](https://github.com/openscrm/msg-server)\n[管理面板](https://github.com/openscrm/dashboard)\n[企业微信H5侧边栏](https://github.com/openscrm/sidebar)\n\n### 项目特点\n\n* **安全性高**：企业微信控制了企业所有员工和客户的敏感数据，如电话号码，职位，客户标签，联系方式等，如果发生泄露，\n  对企业的打击将是致命的。我们团队有丰富的Web安全经验保证项目安全性。\n\n\n* **高性能，高稳定性**：得益于Go出色的工程能力，简单有效的并发控制能力，OpenSCRM具备比肩头部Saas厂商的高性能和高稳定\n\n\n* **代码可读性优先**：我们深刻认同Google对于代码管理的看法，项目开发完成只是项目的开始，更多的工作在于维护和迭代，\n  唯有易读的代码才能保证后期迭代的高质量，高效率，这也是Go语言的设计目标。我们有非常完善的代码注释，所有代码力求清晰易读。\n\n\n* **易开发**：作为开源项目，我们为了让更多的人可以受益于此项目，我们做了大量工作力求项目简单易上手。\n  我们只做必要抽象（MVC），避免引入新慨念。我们坚持尽量少的中间件依赖，仅依赖Mysql和Redis，\n  比如延迟队列我们基于Redis实现， 没有引入Kafka；比如全文检索基于Mysql8全文检索实现，没有引入ES。\n\n\u003e Python，PHP，NodeJS开发者可以放心使用本项目，本项目做了大量工作力求简单，非常容易上手。\n\n### 项目截图\n\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E5%90%8E%E5%8F%B0%E9%A6%96%E9%A1%B5.png)\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E4%BF%AE%E6%94%B9%E6%B8%A0%E9%81%93%E6%B4%BB%E7%A0%81.png)\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E4%BF%AE%E6%94%B9%E6%B8%A0%E9%81%93%E6%B4%BB%E7%A0%812.png)\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E5%AE%A2%E6%88%B7%E6%A0%87%E7%AD%BE%E7%AE%A1%E7%90%86.png)\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E4%BF%AE%E6%94%B9%E7%BE%A4%E5%8F%91.png)\n![](https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/screenshots/%E4%BF%AE%E6%94%B9%E6%AC%A2%E8%BF%8E%E8%AF%AD.png)\n\n### 技术栈\n#### 后端技术栈\n* [Go](https://learnku.com/docs/the-way-to-go)\n* [Gin](https://learnku.com/docs/gin-gonic/2019)\n* [GORM](https://gorm.io/zh_CN/docs/)\n* Redis\n* Mysql \u003e= 5.7\n\n#### 前端技术栈\n* [React](https://zh-hans.reactjs.org/)\n* [TypeScript](https://www.tslang.cn/docs/handbook/typescript-in-5-minutes.html)\n* [Ant Design](https://ant.design/components/overview-cn/)\n* [Ant Design Pro](https://pro.ant.design/zh-CN/docs/overview)\n* [Pro Components](https://procomponents.ant.design/components)\n\n\n### 目录结构\n\n```\n├─app\n│  ├─callback 企业微信事件回调处理\n│  │  ├─customer_event\n│  │  ├─department_event\n│  │  ├─group_chat_event\n│  │  ├─msg_arch_event\n│  │  ├─staff_event\n│  │  └─tag_event\n│  ├─constants 常量定义\n│  ├─consumers 队列消费\n│  ├─controller 控制器\n│  ├─entities 消息实体，主要定义参数，请求，响应结构体\n│  ├─middleware gin请求中间件\n│  ├─models 数据库模型\n│  ├─requests 请求定义\n│  ├─responses 响应定义\n│  ├─services 服务\n│  ├─tasks 定时任务\n├─bin 二进制文件\n├─common 共同库\n│  ├─app 基于Gin封装的常用请求响应处理函数\n│  ├─delay_queue 基于Redis延迟队列\n│  ├─ecode 错误码\n│  ├─id_generator uuid生成\n│  ├─log 日志\n│  ├─redis redis操作库\n│  ├─session session会话\n│  ├─storage 存储\n│  ├─util 常用工具函数\n│  └─validator 请求验证\n├─conf 配置文件\n├─docker\n│  ├─data\n│  │  ├─dashboard\n│  │  │  └─dist 管理后台构建的前端静态文件\n│  │  ├─mysql\n│  │  │  ├─conf mysql容器配置文件\n│  │  │  └─db mysql容器数据文件\n│  │  ├─nginx\n│  │  │  ├─conf nginx容器配置文件\n│  │  │  │  └─conf.d \n│  │  │  └─logs\n│  │  ├─redis \n│  │  │  └─db redis容器数据文件\n│  │  └─sidebar\n│  │      └─dist 侧边栏构建的前端静态文件\n│  └─lib 企业微信提供的会话存档动态链库\n├─docs 文档\n├─pkg 三方库\n│  └─easywework 企业微信Api调用库\n│      ├─errcodes 企业微信Api错误码\n├─routers Gin路由\n├─scripts 脚本\n└─test 测试代码\n\n```\n\n### 安装教程\nhttps://github.com/openscrm/api-server/wiki/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B\n\n### Api调试\n`docs目录包含postman导出文件，可方便调试api`\n\n### 版权声明\n\nOpenSCRM遵循Apache2.0协议，可免费商用\n\n### FAQ\n#### 1.初始化失败，出现 not allow to access from your ip 错误\n##### 错误示例：\n```text\nget all departments from wx failedClientError { Code: 60020, Msg: \"not allow to access from your ip, 错误\n```\n##### 解决办法\n登录企业微信管理员后台-\u003e安全与管理-\u003e管理工具-\u003e通讯录同步-\u003e企业可信IP 添加允许访问企业微信接口的公网IP\n\n---\n#### 2.登录界面提示：redirect_uri 与配置的授权完成回调域名不一致\n##### 错误原因\n企业微信扫描登录需要配置授权登录地址域名，如果域名不一致会提示此错误，演示站点用的我的配置，你需要自建应用完成相关配置\n##### 解决方法1（用于生产环境）\n登录企业微信管理员后台-\u003e应用管理-\u003e应用-\u003e自建应用（你的应用）-\u003e企业微信授权登录-\u003e授权回调域\n##### 解决方法2（用于开发环境）\n本地开发的时候，不方便配置登录回调。可以使用强制登录。\n登录界面url加上参数?debug=1。\n同时确保conf/config.yaml中的Env配置为DEV或TEST\n---\n#### 3.前端无法连接后端api-server.\n检查nginx配置 docker/nginx/conf/conf.d/dashboard.conf\n\n---\n#### 4.容器中运行的程序如何链接宿主机\ndocker中宿主机ip地址为172.17.0.1，所有docker服务默认监听端口到宿主机上，配置文件中需要填host的地方填172.17.0.1\n\n---","funding_links":[],"categories":["成品项目","Go","StandAlone Projects","Finished Items","Repositories"],"sub_categories":["组织","To Organize"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscrm%2Fapi-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenscrm%2Fapi-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscrm%2Fapi-server/lists"}