小而美的通知中心,适用于站内信、评论区等场景。
- 类即时通讯应用架构,支持多设备消息同步与漫游
- 支持类群聊模式,可根据实际场景手动切换读写扩散模型
- 支持 MySQL / TableStore (WIP)
- 部分主键常驻 Redis 实现严格自增
- 分会话未读消息数量统计
- 支持已发出消息撤回,可类比自行实现消息内容更新等功能
- 钩子函数拓展业务逻辑,例如写入消息成功后执行发送邮件、消息推送等任务
绝大部分配置可在 config/config.default.ts 中找到,可参考 Egg - 配置。
- NodeJS@~10.X.X
- Redis
- MySQL / MariaDB
- Other nodejs modules
首先需要安装 Redis 、 Mysql 或 MariaDB 、 NodeJS 与 npm / yarn ,NodeJS 官方安装包通常会自带 npm ,你也可以使用 yarn 代替 npm 进行后续操作。
Windows 平台上
yarn run cov
无法正常执行,请使用npm run cov
代替。
# Ubuntu
$ git clone https://github.com/alitajs/notification.git
$ cd notification
$ npm install
$ apt-get install nodejs
$ sh ./scripts/install/mariadb.sh
$ sh ./scripts/install/redis.sh
$ npm run start:mysql && npm run start:redis && npm run dev:migrate
$ npm run dev
# Ubuntu
$ git clone https://github.com/alitajs/notification.git
$ cd notification
$ npm install --production
$ apt-get install nodejs
$ sh ./scripts/install/mariadb.sh
$ sh ./scripts/install/redis.sh
$ npm run start:mysql && npm run start:redis && npm run start:migrate
$ npm run restart:tsc