129 lines
3.6 KiB
Markdown
129 lines
3.6 KiB
Markdown
<p align="center">
|
||
<a href="https://github.com/mizhexiaoxiao/vue-fastapi-admin">
|
||
<img alt="Vue FastAPI Admin Logo" width="200" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/logo.svg">
|
||
</a>
|
||
</p>
|
||
|
||
<h1 align="center">vue-fastapi-admin</h1>
|
||
|
||
基于 FastAPI + Vue3 + Naive UI 的现代化前后端分离开发平台,融合了 RBAC 权限管理、动态路由和 JWT 鉴权,助力中小型应用快速搭建,也可用于学习参考。
|
||
|
||
### 特性
|
||
- **最流行技术栈**:基于 Python 3.11 和 FastAPI 高性能异步框架,结合 Vue3 和 Vite 等前沿技术进行开发,同时使用高效的 npm 包管理器 pnpm。
|
||
- **代码规范**:项目内置丰富的规范插件,确保代码质量和一致性,有效提高团队协作效率。
|
||
- **动态路由**:后端动态路由,结合 RBAC(Role-Based Access Control)权限模型,提供精细的菜单路由控制。
|
||
- **JWT鉴权**:使用 JSON Web Token(JWT)进行身份验证和授权,增强应用的安全性。
|
||
- **细粒度权限控制**:实现按钮和接口级别的权限控制,确保不同用户或角色在界面操作和接口访问时具有不同的权限限制。
|
||
|
||
### 在线预览
|
||
- http://139.9.100.77:9999
|
||
- username: admin
|
||
- password: 123456
|
||
|
||
### 登录页
|
||
|
||

|
||
### 工作台
|
||
|
||

|
||
|
||
### 用户管理
|
||
|
||

|
||
### 角色管理
|
||
|
||

|
||
|
||
### 菜单管理
|
||
|
||

|
||
|
||
### API管理
|
||
|
||

|
||
|
||
### 快速开始
|
||
#### 方法一:dockerhub拉取镜像
|
||
|
||
```sh
|
||
docker pull mizhexiaoxiao/vue-fastapi-admin:latest
|
||
docker run -d --restart=always --name=vue-fastapi-admin -p 9999:80 mizhexiaoxiao/vue-fastapi-admin
|
||
```
|
||
|
||
#### 方法二:dockerfile构建镜像
|
||
##### docker安装(版本17.05+)
|
||
|
||
```sh
|
||
yum install -y docker-ce
|
||
systemctl start docker
|
||
```
|
||
|
||
##### 构建镜像
|
||
|
||
```sh
|
||
git clone https://github.com/mizhexiaoxiao/vue-fastapi-admin.git
|
||
cd vue-fastapi-admin
|
||
docker build --no-cache . -t vue-fastapi-admin
|
||
```
|
||
|
||
##### 启动容器
|
||
|
||
```sh
|
||
docker run -d --restart=always --name=vue-fastapi-admin -p 9999:80 vue-fastapi-admin
|
||
```
|
||
|
||
##### 访问
|
||
|
||
http://localhost:9999
|
||
|
||
username:admin
|
||
|
||
password:123456
|
||
|
||
### 本地启动
|
||
#### 后端
|
||
启动项目需要以下环境:
|
||
- Python 3.11
|
||
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer)
|
||
|
||
1. 创建虚拟环境
|
||
```sh
|
||
poetry shell
|
||
```
|
||
2. 安装依赖
|
||
```sh
|
||
poetry install
|
||
```
|
||
3. 启动服务
|
||
```sh
|
||
make run
|
||
```
|
||
服务现在应该正在运行,访问 http://localhost:9999/docs 查看API文档
|
||
|
||
#### 前端
|
||
启动项目需要以下环境:
|
||
- node v18.8.0+
|
||
|
||
1. 进入前端目录
|
||
```sh
|
||
cd web
|
||
```
|
||
|
||
2. 安装依赖(建议使用pnpm: https://pnpm.io/zh/installation)
|
||
```sh
|
||
npm i -g pnpm # 已安装可忽略
|
||
pnpm i # 或者 npm i
|
||
```
|
||
|
||
3. 启动
|
||
```sh
|
||
pnpm dev
|
||
```
|
||
|
||
### 进群交流
|
||
<img alt="Vue FastAPI Admin Logo" width="400" src="https://github.com/mizhexiaoxiao/vue-fastapi-admin/blob/main/deploy/sample-picture/group.jpg">
|
||
|
||
### Visitors Count
|
||
|
||
<img align="left" src = "https://profile-counter.glitch.me/vue-fastapi-admin/count.svg" alt="Loading">
|