Skip to content

fanqie03/vue-admin-fastapi-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-admin-fastapi-example

简体中文 | English

简介

vue-admin-templateFastAPI前后端分离的小例子

  • 项目小,python端只有一个文件
  • 用户登陆,JWT令牌认证
  • 密码哈希
  • 前后端分离
  • CORS跨域访问
  • 使用FastAPI
  • 使用SQLAlchemy ORM框架
  • 包含docker

项目结构

vue-admin-fastapi-example
├── backend  # 后台项目
│   ├── admin  # 前端构建过后的文件
│   ├── log  # 后台日志文件
│   ├── manage.py  # python主要文件
│   └── requirements.txt  # python依赖文件
├── docker  # docker配置文件
│   ├── docker-compose.yaml
│   └── Dockerfile
├── docs  # 文档说明
├── frontend  # 前端项目
├── README-en.md
└── README.md

运行项目

克隆本项目,进入后

打开backend文件

cd backend

安装依赖

pip install requirements.txt

运行文件

python manage.py

重新构建

手动构建

nodejs 14 可以

在frontend目录下运行

npm install
npm run build:prod

将dist目录下的文件复制到 /backend/admin/ 目录下,在backend目录下运行

python manage.py

使用docker

构建image

docker build -t vue-admin-fastapi-examples:0.1 -f docker/Dockerfile  .

运行image

docker run -it --rm -p 8000:8000 vue-admin-fastapi-examples:0.1

使用docker-compose

docker-compose -f docker/docker-compose.yaml up -d

项目预览

参考项目

About

vue-admin-template和FastAPI前后端分离的小例子。 A small example with vue-admin-template & FastAPI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published