Code Monkey home page Code Monkey logo

wechat-admin's Introduction

wechat-admin

微信管理系统

pyversions vueversions es2015 celery element ui pypi ver License: GPL v3 contributions welcome

特性

  • 支持显示好友列表,可过滤
  • 支持显示群聊列表,可过滤
  • 可以同时给多个用户/群聊成员发送消息,支持发送文件,emoji表情。可预览
  • 如果为群聊创建者,可以删除(多个)成员
  • 可以选择好友/群聊成员创建新群
  • 对自动建群,邀请文本等可配置
  • 永久保存消息,可以通过消息列表页面查看和过滤。接收消息进程停止自动重启
  • 支持消息提醒
  • 支持发送加群聊成员好友请求
  • 自动添加联系人,拉对方入群,群满之后自动创建新群

...

使用的技术和库

前端

  • Vue
  • Axios
  • Element-ui
  • Vue-cli

后端

  • Flask
  • Celery
  • SSE
  • Walrus
  • Gunicorn
  • Flask-Migrate
  • Flask-SQLAlchemy
  • ItChat
  • Wxpy
  • PyMySQL

使用方法

安装MySQL、Redis,然后创建库(默认是test):

❯ mysql -u root -p
mysql> drop database test;
Query OK, 9 rows affected (0.32 sec)

mysql> create database test;
Query OK, 1 row affected (0.01 sec)

mysql> ^DBye

下载源码并安装依赖:

❯ git clone https://github.com/dongweiming/wechat-admin
❯ cd wechat-admin
❯ virtualenv venv  # 只支持Python 3source venv/bin/activate  # 推荐使用autoenv
❯ venv/bin/pip install -r requirements.txt

初始化数据库:

export FLASK_APP=manager.pyvenv/bin/flask initdb

启动服务:

❯ venv/bin/gunicorn app:app --bind 0.0.0.0:8100 -w 4 -t 0

访问 WEB页面 http://localhost:8100 使用微信扫码登录

登录成功后,启动Celery Beat和Worker:

❯ venv/bin/celery -A wechat worker -l info -B

注意:第一次会拉取全部的联系人和各群聊成员列表,需要一点时间。观察终端输出了解初始化任务的完成情况。

本地开发

配置前端开发环境

安装cnpm提高包下载速度:

❯ npm install -g cnpm --registry=https://registry.npm.taobao.org

安装需要的包:

❯ cnpm i 

启动调试环境:

❯ npm run dev

启动成功默认会打开 http://localhost:8080 ,后端API依然使用的是 http://localhost:8100/j

本地开发完毕通过如下方式构建:

❯ npm run build

刷新 http://localhost:8100 就可以看到最新的效果了。

如果希望修改线上/环境的地址,需要修改build/webpack.dev.conf.js或者build/webpack.prod.conf.js中的API_URL的值。

WARN: 每次build会删除static目录,所以收到的内容被会删除,请提前备份!

后端开发

要注意修改表结构,每次都要:

❯ venv/bin/flask db migrate
❯ venv/bin/flask db upgrade

感谢

TODO

  1. 自定义help内容和关键词
  2. 灵活的插件系统,方便自定义

wechat-admin's People

Contributors

dongweiming avatar

Watchers

zan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.