OpenSCRM是一套基于Go和React的超高质量企业微信私域流量管理系统 。企业微信、私域流量、SCRM、CRM、Golang、React、企业微信SDK

logo

安全,强大,易开发的企业微信SCRM

文档 | 截图 | 演示 | 安装

项目简介

OpenSCRM是一套基于GoReact超高质量企业微信私域流量管理系统

在线演示

http://dashboard.demo.openscrm.cn:8000/

项目特点

  • 安全性高:企业微信控制了企业所有员工和客户的敏感数据,如电话号码,职位,客户标签,联系方式等,如果发生泄露, 对企业的打击是非常致命的。我们团队有来自360的资深安全开发工程师cover此问题。

  • 高性能,高稳定性:得益于Go出色的工程能力,简单有效的并发控制能力,OpenSCRM具备比肩头部Saas厂商的高性能和高稳定

  • 代码可读性优先:我们深刻认同Google对于代码管理的看法,项目开发完成只是项目的开始,更多的工作在于维护和迭代, 唯有易读的代码才能保证后期迭代的高质量,高效率,这也是Go语言的设计目标。我们有非常完善的代码注释,所有代码力求清晰易读。

  • 易开发:作为开源项目,我们为了让更多的人可以受益于此项目,我们做了大量工作力求项目简单易上手。 我们只做必要抽象(MVC),避免引入新慨念。我们坚持尽量少的中间件依赖,仅依赖Mysql和Redis, 比如延迟队列我们基于Redis实现, 没有引入Kafka;比如全文检索基于Mysql8全文检索实现,没有引入ES。

Python,PHP,NodeJS开发者可以放心使用本项目,本项目做了大量工作力求简单,非常容易上手。

对于PHPer

我想大多数PHPer看到本项目一定有强烈的熟悉感,没错,此项目吸收了大量Laravel的宝贵经验,代码清晰易读, 几乎没有额外门槛。对于没有接触过Go的PHPer,只需学习掌握Go的管道协程即可驾驭本项目。

与其学Swoole,何不用Go

Swoole和Go的学习成本是差不多的,最核心的都是协程,管道。额外的只需学习Go生态的Gin和GORM两个库即可。 Go基础库不熟,可以使用goframe过渡。

项目截图

联系作者加入交流群

扫码可加入交流群

技术栈

后端技术栈

前端技术栈

目录结构

├─app
│  ├─callback 企业微信事件回调处理
│  │  ├─customer_event
│  │  ├─department_event
│  │  ├─group_chat_event
│  │  ├─msg_arch_event
│  │  ├─staff_event
│  │  └─tag_event
│  ├─constants 常量定义
│  ├─consumers 队列消费
│  ├─controller 控制器
│  ├─entities 消息实体,主要定义参数,请求,响应结构体
│  ├─middleware gin请求中间件
│  ├─models 数据库模型
│  ├─requests 请求定义
│  ├─responses 响应定义
│  ├─services 服务
│  ├─tasks 定时任务
├─bin 二进制文件
├─common 共同库
│  ├─app 基于Gin封装的常用请求响应处理函数
│  ├─delay_queue 基于Redis延迟队列
│  ├─ecode 错误码
│  ├─id_generator uuid生成
│  ├─log 日志
│  ├─redis redis操作库
│  ├─session session会话
│  ├─storage 存储
│  ├─util 常用工具函数
│  └─validator 请求验证
├─conf 配置文件
├─docker
│  ├─data
│  │  ├─dashboard
│  │  │  └─dist 管理后台构建的前端静态文件
│  │  ├─mysql
│  │  │  ├─conf mysql容器配置文件
│  │  │  └─db mysql容器数据文件
│  │  ├─nginx
│  │  │  ├─conf nginx容器配置文件
│  │  │  │  └─conf.d 
│  │  │  └─logs
│  │  ├─redis 
│  │  │  └─db redis容器数据文件
│  │  └─sidebar
│  │      └─dist 侧边栏构建的前端静态文件
│  └─lib 企业微信提供的会话存档动态链库
├─docs 文档
├─pkg 三方库
│  └─easywework 企业微信Api调用库
│      ├─errcodes 企业微信Api错误码
├─routers Gin路由
├─scripts 脚本
└─test 测试代码

安装教程

https://www.yuque.com/gargantuax/openscrm/zioec5

联系作者

扫码可加入交流群

版权声明

OpenSCRM是开源软件,但仅用于学习和研究,商用请联系我们购买授权。

Similar Resources

A URL shortener using http://is.gd/ and the Go programming language (http://golang.org/)

goisgd A simple command line URL shortener using http://is.gd/. Getting the Code go get github.com/NickPresta/GoURLShortener Usage Import this librar

Apr 6, 2022

Extensible wiki system using CouchDB and written in Golang

Extensible wiki system using CouchDB and written in Golang

Wikifeat Introduction Wikifeat is an open source collaboration platform built around the ever-popular Wiki concept. It is meant to be extensible and h

Aug 23, 2022

A golang framework helps gopher to build a data visualization and admin panel in ten minutes

A golang framework helps gopher to build a data visualization and admin panel in ten minutes

the missing golang data admin panel builder tool. Documentation | 中文介绍 | DEMO | 中文DEMO | Twitter | Forum Inspired by laravel-admin Preface GoAdmin is

Dec 30, 2022

Online Preview Word,Excel,PPT,PDF,Image by Golang

Online Preview Word,Excel,PPT,PDF,Image by Golang

Online Preview Word,Excel,PPT,PDF,Image by Golang.基于Golang的在线预览Word,Excel,PPT,PDF,图片.

Dec 26, 2022

GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework

GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework

GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework, it features a simple organized directory structure for your next project with a pleasant development experience, made for developing modern APIs and microservices.

Dec 29, 2022

Example golang using gin framework everything you need, i create this tutorial special for beginner.

Golang Gin Framework Fundamental Example golang using gin framework everything you need, i create this tutorial special for beginner. Feature Containe

Dec 16, 2022

Software of Development with Golang and MySQL

Software of Development with Golang and MySQL

CRUD REST API GOLANG GORM AND MYSQL Description This repository is a Software of Application with Golang, Mux, GORM (ORM) and MySQL. Installation Usin

Nov 24, 2022

Forms is a fast, powerful, flexible, sortable web form rendering library written in golang.

forms Description forms makes form creation and handling easy. It allows the creation of form without having to write HTML code or bother to make the

Oct 2, 2022

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

Sep 23, 2022
Comments
  • 这个项目如何在k8s上跑起来?

    这个项目如何在k8s上跑起来?

    将这个项目部署在 k8s 上,分配 3 个副本,如何保证只有 1 个副本在刷新 access_token ? 看了下源代码,是直接开一个协程在刷新 access_token,但是项目部署在 3 个副本时,每个副本都会启动刷新 access_token 的协程,那就意味着每个副本都在刷新 access_token?

    func (t *Token) tokenRefresher(ctx context.Context) {
        // refresh per 30m
        const refreshTimeWindow = (2*60 - 30) * time.Minute
        const minRefreshDuration = 5 * time.Second
    
        var nextRefreshDuration time.Duration = 0
        for {
            select {
            case <-time.After(nextRefreshDuration):
                retryer := backoff.WithContext(backoff.NewExponentialBackOff(), ctx)
                if err := backoff.Retry(t.syncToken, retryer); err != nil {
                    log.Println("retry getting access token failed", "err", err)
                    _ = err
                }
    
                nextRefreshDuration = t.LastRefresh.Add(t.ExpiresIn - refreshTimeWindow).Sub(t.LastRefresh)
                if nextRefreshDuration < minRefreshDuration {
                    nextRefreshDuration = minRefreshDuration
                }
            case <-ctx.Done():
                return
            }
        }
    }
    
  • 会话存档没法显示,我看后台有报错 Unknown column 'ext_staff_id' in 'where clause'

    会话存档没法显示,我看后台有报错 Unknown column 'ext_staff_id' in 'where clause'

    
    api_1      |
    api_1      | 2022/01/06 11:00:00 /root/scrm/scrm/app/models/mass_msg_staff.go:121
    api_1      | [4.555ms] [rows:0] SELECT mass_msg.ext_msg_id as ext_msg_id, mass_msg_staff.ext_staff_id as ext_staff_id, mass_msg_staff.id as id FROM `mass_msg` join mass_msg_staff on  mass_msg_staff.mass_msg_id = mass_msg.id WHERE (mass_msg.ext_corp_id = 'ww17efc9574291cc91') AND is_sent = 0
    api_1      |
    api_1      | 2022/01/06 11:00:00 /root/scrm/scrm/app/models/staff.go:351 Error 1054: Unknown column 'ext_staff_id' in 'where clause'
    api_1      | [0.745ms] [rows:0] UPDATE `staff` SET `enable_msg_arch`='1',`updated_at`='2022-01-06 11:00:00.563' WHERE ext_corp_id = 'ww17efc9574291cc91' and  ext_staff_id in ('HuBoYu_zero')
    api_1      | 2022-01-06T11:00:00.563+0800       ERROR   tasks/message_arch.go:28        UpdateStaffMsgArchStatus failed {"err": "Error 1054: Unknown column 'ext_staff_id' in 'where clause'", "errVerbose": "Error 1054: Unknown column 'ext_staff_id' in 'where clause'\nopenscrm/app/services.StaffService.doUpdateMsgArchStatus\n\t/root/scrm/scrm/app/services/staff.go:696\nopenscrm/app/services.StaffService.UpdateStaffMsgArchStatus\n\t/root/scrm/scrm/app/services/staff.go:679\nopenscrm/app/tasks.Staff.UpdateMsgArchStatus\n\t/root/scrm/scrm/app/tasks/message_arch.go:26\ngithub.com/gogf/gf/os/gcron.(*Entry).check\n\t/root/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gogf/[email protected]/os/gcron/gcron_entry.go:146\ngithub.com/gogf/gf/os/gtimer.(*Entry).Run.func1\n\t/root/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gogf/[email protected]/os/gtimer/gtimer_entry.go:59\nruntime.goexit\n\t/root/.asdf/installs/golang/1.17.5/go/src/runtime/asm_amd64.s:1581\nopenscrm/app/services.StaffService.UpdateStaffMsgArchStatus\n\t/root/scrm/scrm/app/services/staff.go:681\nopenscrm/app/tasks.Staff.UpdateMsgArchStatus\n\t/root/scrm/scrm/app/tasks/message_arch.go:26\ngithub.com/gogf/gf/os/gcron.(*Entry).check\n\t/root/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gogf/[email protected]/os/gcron/gcron_entry.go:146\ngithub.com/gogf/gf/os/gtimer.(*Entry).Run.func1\n\t/root/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gogf/[email protected]/os/gtimer/gtimer_entry.go:59\nruntime.goexit\n\t/root/.asdf/installs/golang/1.17.5/go/src/runtime/asm_amd64.s:1581"}
    api_1      | openscrm/app/tasks.Staff.UpdateMsgArchStatus
    
  • model类型修改建议

    model类型修改建议

    model目录下的mass_msg_staff.go文件的struct,建议将MassMsgId属性的gorm:"index;type:bigint"改为gorm:"index;type:varchar(64)",由于QueryExtStaffids方法中第一个where语句的mysql的in函数需要字段类型与in中类型匹配,前端MassMsgId是string类型,而mysql中是bigint类型,会导致搜索不匹配,后续不判空会报index [0] out of range 错误。 同理,file_size字段也是bigint,调用parse-url接口时前端填写的fileSize是空字符串”“,与数据库字段不匹配,素材库页面解析网页功能不可用,要么在前端改类型。 客户详情age字段前端没有限定num类型和长度,数据库是tinyint(3) ,修改基本信息时字段不匹配也会报错。

A todo app written in Golang, MongoDB, and React.
A todo app written in Golang, MongoDB, and React.

A todo app written in Golang, MongoDB, and React.

Jun 5, 2022
Generate a modern Web project with Go and Angular, React or Vue in seconds 🚀
Generate a modern Web project with Go and Angular, React or Vue in seconds 🚀

Goxygen Generate a Web project with Go and Angular, React or Vue. Goxygen aims at saving your time while setting up a new project. It creates a skelet

Jan 5, 2023
A basic example of a go web server with a react frontend
A basic example of a go web server with a react frontend

GO-React starter This is a basic example of a go web server with a react frontend. It uses the go fiber framework Getting started Running locally Clon

Nov 16, 2021
My daily routine implements Atomic Pattern to the react app

RAGE (React Atomic Generator) Purpose My daily routine implements Atomic Pattern to the react app, I was doing that repeatedly, so the reason I create

Mar 8, 2022
This is my solution the React exercise on Exercism's Go track.

Solution to React Exercise on Exercism This is my solution the React exercise on Exercism's Go track. The original readme is below. React Welcome to R

Feb 8, 2022
A Discord clone using React and Go

Valkyrie A Discord clone using React and Go. Live Demo Notes: File Upload is disabled. The design does not fully match current Discord anymore. Data r

May 12, 2022
A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.
A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

Oct 10, 2021
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
A user-friendly CMS written in Go (golang)

Fragmenta CMS Fragmenta CMS is a user-friendly Content Management System built with Go. For more information and a demo of the CMS in action, see the

Dec 24, 2022
[爬虫框架 (golang)] An awesome Go concurrent Crawler(spider) framework. The crawler is flexible and modular. It can be expanded to an Individualized crawler easily or you can use the default crawl components only.

go_spider A crawler of vertical communities achieved by GOLANG. Latest stable Release: Version 1.2 (Sep 23, 2014). QQ群号:337344607 Features Concurrent

Dec 30, 2022