Skip to content

Latest commit

 

History

History
290 lines (235 loc) · 10.3 KB

README-en.md

File metadata and controls

290 lines (235 loc) · 10.3 KB

English | 简体中文

START--

First of thanks: At present, the source code of the business part of Hertz vue admin open source project refers to the open source project Gin Vue Admin And Eladmin

Important statement: Since Hertz vue admin is being restructured, it is only open source for non-commercial use before the completion of the reconstruction. If you need to use it commercially, please move to the open source project Gin Vue Admin According to its flipped aurora team Declaration. (At the same time, Hertz vue admin team decided to provide some open source commercial products after the reconstruction of Hertz vue admin is completed.)

1. Basic introduction

1.1 Project introduction

Hertz vue admin is a new Golang microservice HTTP framework based on Vue3 and bytedance team Hertz It is a development basic platform that separates the front end from the back end of the whole stack, integrating functions such as jwt authentication, dynamic routing, dynamic menu, casbin authentication, form generator, code generator, etc.

1.2 Online experience

Online address:http://1.117.77.53:8080/index.html

username:admin

password:123456

2. Project operation

2.1 Environment configuration

- node version > v16.8.3
- golang version >= v1.16

2.2 server

Try to put Hertz-vue-admin in the GOPATH directory

# Enter the server folder
cd server

# Use go mod and install the go dependency package
go generate

# compile
go build -o server main.go (windows compilego: go build -o server.exe main.go )

# Run
./server (windows运行命令为 server.exe)

2 .3、web

# Enter the web folder
cd web

# Installation Dependencies
npm install

# Run
npm run serve

2.3 swagger Automation API Documentation

# Installation Dependencies
go get -u github.com/swaggo/swag/cmd/swag

# Enter the server folder
cd server

# Run
swag init

After executing the above command, docs go, swagger. json, swagger. Yaml The three files are updated. After starting the go service, enter them in the browser http://localhost:8888/swagger/index.html You can view the swagger document

3. Technical selection

  • Web: use Vue based Element Build the base page.

  • Server:use ByteDance Cloudwego's Golang microservice HTTP framework — Hertz.

  • Database: adopt the MySql >(5.7) version database engine InnoDB, and use gorm Implement the basic operation of the database.

  • Caching: Use Redis to record the jwt token of the current active user and implement the restrictions on multiple logins.

  • API document: use Swagger to build an automatic document.。

  • Configuration file: using fsnotify And viper Implement the configuration file in the format of yaml.。

  • Log: using zap Implement logging.

4. Project architecture

4.1 web architecture

web
 ├── babel.config.js
 ├── Dockerfile
 ├── favicon.ico
 ├── index.html                  
 ├── limit.js
 ├── package.json              
 ├── src                         
 │   ├── api              
 │   ├── App.vue
 │   ├── assets               
 │   ├── components
 │   ├── core                   
 │   │   ├── config.js       
 │   │   ├── hertz-vue-admin.js  
 │   │   └── global.js         
 │   ├── directive             
 │   ├── main.js                
 │   ├── permission.js          
 │   ├── pinia                  
 │   │   ├── index.js          
 │   │   └── modules         
 │   │       ├── dictionary.js
 │   │       ├── router.js
 │   │       └── user.js
 │   ├── router                 
 │   │   └── index.js
 │   ├── style                 
 │   │   ├── base.scss
 │   │   ├── basics.scss
 │   │   ├── element_visiable.scss  
 │   │   ├── iconfont.css         
 │   │   ├── main.scss
 │   │   ├── mobile.scss
 │   │   └── newLogin.scss
 │   ├── utils                 
 │   │   ├── asyncRouter.js    
 │   │   ├── btnAuth.js      
 │   │   ├── bus.js           
 │   │   ├── date.js          
 │   │   ├── dictionary.js     
 │   │   ├── downloadImg.js  
 │   │   ├── format.js         
 │   │   ├── image.js          
 │   │   ├── page.js           
 │   │   ├── request.js        
 │   │   └── stringFun.js      
 |   ├── view                  
 |   |   ├── about              
 |   |   ├── dashboard         
 |   |   ├── error              
 |   |   ├── example           
 |   |   ├── iconList          
 |   |   ├── init              
 |   |   ├── layout             
 |   |   |   ├── aside          
 |   |   |   ├── bottomInfo     
 |   |   |   ├── screenfull     
 |   |   |   ├── setting        
 |   |   |   └── index.vue      
 |   |   ├── login             
 |   |   ├── person             
 |   |   ├── superAdmin         
 |   |   ├── system             
 |   |   ├── systemTools        
 |   |   └── routerHolder.vue   
 ├── vite.config.js             
 └── yarn.lock


4.2 server architecture

├── server
        ├── api            
        │   └── v1          
        ├── config         
        ├── core            
        ├── docs            
        ├── global                            
        ├── initialize                          
        │   └── internal                             
        ├── middleware                            
        ├── model                             
        │   ├── request                            
        │   └── response                               
        ├── packfile                            
        ├── resource                               
        │   ├── excel                            
        │   ├── page                             
        │   └── template                               
        ├── router                        
        ├── service                          
        ├── source                             
        └── utils                            
            ├── timer                              
            └── upload                         
    
            web
        ├── babel.config.js
        ├── Dockerfile
        ├── favicon.ico
        ├── index.html               
        ├── limit.js                  
        ├── package.json            
        ├── src                       
        │   ├── api                    
        │   ├── App.vue              
        │   ├── assets               
        │   ├── components            
        │   ├── core                   
        │   │   ├── config.js        
        │   │   ├── gin-vue-admin.js  
        │   │   └── global.js         
        │   ├── directive              
        │   ├── main.js              
        │   ├── permission.js          
        │   ├── pinia                 
        │   │   ├── index.js           
        │   │   └── modules            
        │   │       ├── dictionary.js
        │   │       ├── router.js
        │   │       └── user.js
        │   ├── router                
        │   │   └── index.js
        │   ├── style                 
        │   │   ├── base.scss
        │   │   ├── basics.scss
        │   │   ├── element_visiable.scss  
        │   │   ├── iconfont.css           
        │   │   ├── main.scss
        │   │   ├── mobile.scss
        │   │   └── newLogin.scss
        │   ├── utils                  
        │   │   ├── asyncRouter.js     
        │   │   ├── btnAuth.js         
        │   │   ├── bus.js            
        │   │   ├── date.js            
        │   │   ├── dictionary.js      
        │   │   ├── downloadImg.js     
        │   │   ├── format.js         
        │   │   ├── image.js         
        │   │   ├── page.js            
        │   │   ├── request.js         
        │   │   └── stringFun.js       
        |   ├── view 
        |   |   ├── about 
        |   |   ├── dashboard 
        |   |   ├── error 
        |   |   ├── example 
        |   |   ├── iconList 
        |   |   ├── init  
        |   |   |   ├── index 
        |   |   |   ├── init 
        |   |   ├── layout  
        |   |   |   ├── aside 
        |   |   |   ├── bottomInfo     
        |   |   |   ├── screenfull   
        |   |   |   ├── setting        
        |   |   |   └── index.vue      
        |   |   ├── login            
        |   |   ├── person             
        |   |   ├── superAdmin         
        |   |   ├── system             
        |   |   ├── systemTools       
        |   |   └── routerHolder.vue   
        ├── vite.config.js            
        └── yarn.lock