An open API service indexing awesome lists of open source software.

https://github.com/xhdndmm/webcat

一个网页聊天工具
https://github.com/xhdndmm/webcat

chatapp css flask html javascript js python python3 sqlite webapp website

Last synced: 3 months ago
JSON representation

一个网页聊天工具

Awesome Lists containing this project

README

          


WebCat --- 一个网页聊天工具


Stars
License
Python Version
Downloads






## 项目源码结构
```
.
├── app.py
├── static
│ ├── css
│ │ ├── index.css
│ │ └── register.css
│ └── js
│ ├── index.js
│ └── register.js
└── templates
├── index.html
└── register.html

5 directories, 7 files
```

## 使用说明
### 1.先决条件
首先你需要准备好[python3](https://www.python.org/downloads/)环境,然后下载[源代码](https://github.com/xhdndmm/webcat/releases)并解压。
- 建议使用linux系统运行。
### 2.准备运行环境
#### 2.1创建python虚拟环境
```shell
cd /path/to/webcat
python -m venv .venv
```
#### 2.2 安装依赖包
```shell
.venv/bin/pip install -r requirements.txt
```
### 3.运行程序
```shell
cd src/
.venv/bin/python app.py
```
运行后会生成默认配置。
```json
{
"log_path": "wc_log.log",
"db_path": "wc_db.db",
"secret_key": "123"
}
```
其中
- `log_path`是日志路径
- `db_path`是数据库路径
- `secret_key`是socket安全密钥

请按需修改配置文件,修改后即可使用`gunicorn`运行。
```shell
.venv/bin/pip install gunicorn eventlet
.venv/bin/gunicorn --bind 0.0.0.0:5000 --worker-class eventlet -w 1 app:app
```

## 技术说明
目前采用python+flask的后端,使用sqlite数据库存储用户信息与历史消息。前后端使用websocket保持连接来确保信息按时收发,分页加载历史消息。

### 程序参数说明
- `--debug`:调试模式,可在开发测试时使用

## 问题反馈
如果在使用中遇到问题,请在[Issues](https://github.com/xhdndmm/webcat/issues)页面反馈。

## 贡献
我们非常欢迎你来贡献代码等,但是请遵守以下几点:
- 1.请将pr提交到dev分支。
- 2.不要提交没有意义的代码及相关内容。
- 3.不要提交未经测试的代码。

## 协议
本程序使用[MIT](./LICENSE)许可证。