Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
基于RBAC模型权限控制的中小型应用的基础开发平台,前后端分离,后端采用django+django-rest-framework,前端采用vue+ElementUI,移动端采用uniapp+uView(可发布h5和小程序).
| Date | Stars |
|---|---|
| 2026-07-30 | 1096 |
| 2026-08-11 | 1097 |
| 2026-08-23 | 1096 |
| 2026-08-24 | 1096 |
| 2026-08-27 | 1098 |
| 2026-08-31 | 1097 |
| 2026-09-01 | 1096 |
| 2026-09-02 | 1097 |
| 2026-09-03 | 1098 |
| 2026-09-05 | 1099 |
| 2026-09-08 | 1100 |
| 2026-09-14 | 1100 |
| 2026-09-15 | 1100 |
| 2026-09-18 | 1101 |
| 2026-09-23 | 1102 |
| 2026-09-27 | 1103 |
| 2026-10-02 | 1104 |
| 2026-10-06 | 1104 |
| 2026-10-10 | 1104 |
| 2026-10-18 | 1106 |
| 2026-10-19 | 1105 |
| 2026-10-23 | 1104 |
| 2026-10-27 | 1104 |
| 2026-10-28 | 1104 |
| 2026-11-03 | 1105 |
| 2026-11-04 | 1105 |
Today
— stars today
This week
+1 stars this week
This month
+1 stars this month
Momentum
1.0
growth rate 0.09%/day
# django-vue-admin
基于 RBAC 权限模型的前后端分离后台管理平台,适合作为中小型业务系统的基础开发骨架。
后端使用 Django + Django REST Framework,前端使用 Vue 2 + Element UI,移动端目录中提供了基于 uni-app + uView 的实现。
## 项目特性
- 前后端分离:后端提供 REST API,前端按权限动态加载路由和菜单
- RBAC 权限控制:支持接口级功能权限控制
- 数据权限:内置全部、本级及以下、同级及以下、本人等基础规则
- JWT 认证:默认使用 `djangorestframework-simplejwt`
- 审计能力:可结合 `django-simple-history` 记录变更历史
- 定时任务:集成 Celery + `django-celery-beat`
- 接口文档:内置 Swagger 页面
- 工作流模块:参考 loonflow 思路做了简化实现
## 内置模块
- 组织机构
- 用户管理
- 角色管理
- 岗位管理
- 权限管理
- 数据字典
- 文件库
- 定时任务
- 工作流
- 系统监控
## 技术栈
### 后端
- Django 4.2.27
- Django REST Framework 3.14.0
- Simple JWT 5.5.1
- django-celery-beat 2.5.0
- django-simple-history 3.4.0
- drf-yasg 1.21.7
- Redis
### 前端
- Vue 2.6
- Element UI 2.15
- Vue Router 3
- Vuex 3
- Axios 1.6
## 目录结构
```text
.
├─ client/ Web 管理端
├─ client_mp/ 移动端(uni-app + uView)
├─ img/ README 截图资源
├─ server/ Django 后端
├─ docker-compose.yml
└─ README.md
```
## 快速开始
### 运行环境
- Python 3.10+(建议)
- Node.js 16 或更高版本
- Redis 6+(使用定时任务时需要)
- PostgreSQL(如需完整使用工作流模块,建议使用)
### 1. 启动后端
进入目录:`server`
```bash
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txt
```
项目使用 `server/server/conf.py` 读取数据库和调试配置。
如果是首次初始化,可参考同目录下的 `conf_e.py` 创建或调整配置。
首次启动前,在 `server/server/conf.py` 中配置 `SECRET_KEY` 和 `JWT_SIGNING_KEY`。
分别运行两次 `python -c "import secrets; print(secrets.token_urlsafe(64))"`,
将两个不同的随机值分别填入这两个配置项。`conf.py` 已被 Git 忽略,不要提交到 Git。
所有 Web/Celery 进程和副本应使用同一组持久化密钥,不能每次启动重新生成。
未配置密钥或两者相同都会阻止服务启动,不需要设置环境变量。
从旧版本升级时必须轮换密钥,不能复用旧代码中的公开密钥。
轮换后旧的 Django 会话及 JWT access/refresh token 将失效,用户需要重新登录。
此变更不提供单个 token 的即时注销/吊销功能。
执行数据库迁移:
```bash
python manage.py migrate
```
可选:导入初始化数据
```bash
python manage.py loaddata db.json
```
说明:仓库当前已包含 `server/db.sqlite3`,本地体验时也可以直接使用。
创建超级管理员:
```bash
python manage.py createsuperuser
```
启动开发服务:
```bash
python manage.py runserver 8000
```
### 2. 启动前端
进入目录:`client`
```bash
npm install --registry=https://registry.npmmirror.com
npm run dev
```
默认开发环境下,前端接口地址为:`http://localhost:8000/api`
### 回归测试
配置好 `conf.py` 和上述两个密钥后,在 `server` 目录运行
`python manage.py test apps.system --settings=server.test_settings --noinput`。
测试使用内存 SQLite 和本地内存缓存,不连接业务数据库或 Redis。
Python 3.12 新建环境若提示缺少 `pkg_resources`,需先安装
`python -m pip install "setuptools<81"`(现有 drf-yasg 依赖)。
在 `client` 目录运行
`npx vue-cli-service test:unit --runInBand --cacheDirectory node_modules/.cache/jest Organization.spec.js`。
### 3. 访问入口
前端开发服务默认端口通常为 `9528`。如果通过 Nginx 代理,可统一从 `8012` 访问。
- 前端页面:`http://localhost:8012/` 或 `http://localhost:9528/`
- Swagger 文档:`http://localhost:8000/api/swagger/`
- Django Admin:`http://localhost:8000/django/admin/`
## 本地联调 Nginx 示例
如果你希望本地通过一个端口同时访问前端页面和后端媒体文件,可以参考以下配置:
```nginx
listen 8012;
location /media {
proxy_pass http://localhost:8000;
}
location / {
proxy_pass http://localhost:9528;
}
```
## Docker Compose 运行
仓库根目录提供了 `docker-compose.yml`,默认包含以下服务:
- `backend`:Django 后端
- `frontend`:Vue 前端
- `redis`:Redis
启动:
先在 `server/server/conf.py` 中配置上述两个密钥;Compose 通过现有的
`./server:/code` 挂载读取此配置文件。
```bash
docker-compose up -d
```
启动后默认访问:
- 后端:`http://localhost:8000/`
- 前端:`http://localhost:8012/`
在容器内执行命令示例:
```bash
docker-compose exec backend python manage.py makemigrations
```
说明:当前 `docker-compose.yml` 默认更偏向开发模式,若用于单机生产部署,建议切换为生产镜像和生产配置。
## 生产部署说明
部署时请重点检查以下配置:
- `server/server/conf.py` 中的数据库连接、`DEBUG`、主机配置
- 静态资源和媒体文件目录
- Nginx 反向代理配置
- Redis、Celery、数据库的网络连通性
前后端可以分开部署,也可以先构建前端,再将前端 `dist` 内容替换到后端 `server/dist` 中统一托管,然后执行 `collectstatic`。
Gunicorn 启动示例:
```bash
gunicorn -w 5 -b 0.0.0.0:2251 server.wsgi
```
如需 WebSocket,可额外使用 Daphne 并配合 Supervisor 管理进程。
Nginx 可参考:
```nginx
server {
listen 2250;
client_max_body_size 1024m;
location /media/ {
alias /home/lighthouse/xx/media/;
limit_rate 800k;
}
location / {
alias /home/lighthouse/xx/dist/;
index index.html;
}
location ~ ^/(api|django)/ {
set $CSRFTOKEN "";
if ($http_cookieExcerpt of 6,227 characters
Read on GitHub132
8
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:a53b2e9a2fb8f3b5, topic:workflow