README.md 12.6 KB
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1 2 3 4 5 6 7

<div align=center>
<img src="http://qmplusimg.henrongyi.top/gvalogo.jpg" width=300" height="300" />
</div>
<div align=center>
<img src="https://img.shields.io/badge/golang-1.12-blue"/>
<img src="https://img.shields.io/badge/gin-1.4.0-lightBlue"/>
8 9
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen"/>
<img src="https://img.shields.io/badge/element--ui-2.12.0-green"/>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
10
<img src="https://img.shields.io/badge/gorm-1.9.12-red"/>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
11 12
</div>

13
English | [简体中文](./README-zh_CN.md)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
14

15
# Project Guidelines
Mr.奇淼('s avatar
Mr.奇淼( 已提交
16 17 18
[Online Documentation](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/


Mr.奇淼('s avatar
Mr.奇淼( 已提交
19

Mr.奇淼('s avatar
Mr.奇淼( 已提交
20
[Development Steps](https://www.gin-vue-admin.com/docs/help) (Contributor:  <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
21
- Web UI Framework:[element-ui](https://github.com/ElemeFE/element)  
R
rainyan 已提交
22
- Server Framework:[gin](https://github.com/gin-gonic/gin) 
Mr.奇淼('s avatar
Mr.奇淼( 已提交
23

24
## 1. Basic Introduction
25 26 27

### 1.1 Project Introduction

Mr.奇淼('s avatar
Mr.奇淼( 已提交
28 29 30 31 32 33
[Online Demo](http://demo.gin-vue-admin.com/)

username:admin

password:123456

34 35
> Gin-vue-admin is a full-stack (frontend and backend separation) framework designed for management system. 
> It integrates multiple functions, such as JWT authentication, dynamic routing, dynamic menu, casbin authentication, form generator, code generator, etc. So that you can focus more time on your business Requirements.
Mr.奇淼('s avatar
Mr.奇淼( 已提交
36

R
rainyan 已提交
37
Hi! Thank you for choosing gin-vue-admin.
38

R
rainyan 已提交
39
Gin-vue-admin is a full-stack (frontend and backend separation) framework for developers, designers and product managers.
40

R
rainyan 已提交
41 42
We are excited that you are interested in contributing to gin-vue-admin. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.

R
rainyan 已提交
43
### 1.2 Contributing Guide
R
rainyan 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#### 1.2.1 Issue Guidelines

- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/element-en/Lobby) for help.

- Before submitting an issue, please check if similar problems have already been issued.

#### 1.2.2 Pull Request Guidelines

- Fork this repository to your own account. Do not create branches here.

- Commit info should be formatted as `[File Name]: Info about commit.` (e.g. `README.md: Fix xxx bug`)

- <font color=red>Make sure PRs are created to `develop` branch instead of `master` branch.</font>

- If your PR fixes a bug, please provide a description about the related bug.

- Merging a PR takes two maintainers: one approves the changes after reviewing, and then the other reviews and merges.

### 1.3 Version list

Mr.奇淼('s avatar
Mr.奇淼( 已提交
64
- master: 2.0 code, for prod
R
rainyan 已提交
65

R
rainyan 已提交
66
- develop: 2.0 dev code, for test
R
rainyan 已提交
67 68 69

- [gin-vue-admin_v2.0_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v2_dev) (v2.0 is no longer compatible with v1.0)

Mr.奇淼('s avatar
Mr.奇淼( 已提交
70
- [gin-vue-admin_v1.0_stable](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_stable) (stop maintenance)
R
rainyan 已提交
71

Mr.奇淼('s avatar
Mr.奇淼( 已提交
72
- [gin-vue-admin_v1.0_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_dev) (stop maintenance)
73 74


75
## 2. Getting started
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

> Use docker-compose to experience this project
- Installation docker-compose [Official document](https://docs.docker.com/compose/install/)
    - ```shell script
       # Install on Linux
       # 1.1 Run this command to download the current stable version of Docker Compose
       sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
       # 1.2 Apply executable permissions to binary files
       sudo chmod +x /usr/local/bin/docker-compose 
      ```
    - ```shell script
       # Use Python's pip installation
       pip3 install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple
      ```
    - Use Docker Desktop 
        - Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows
        - Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/

- Use git to clone this project
    - ```git
        git clone https://github.com/flipped-aurora/gin-vue-admin.git
      ```
- Use docker-compose up to start the startup project with one click
    - ```shell script
      # Use docker-compose to start four containers
      docker-compose up
      # If you modify some configuration options, you can use this command to repackage the image
      docker-compose up --build
      # Use docker-compose to start in the background
      docker-compose up -d
      ```

    - Web project preview [http://127.0.0.1:8888/admin](http://127.0.0.1:8888/admin)

    - swagger APIs [http://127.0.0.1:8888/swagger/index.html](http://127.0.0.1:8888/swagger/index.html)

Mr.奇淼('s avatar
Mr.奇淼( 已提交
112
```
113 114 115 116 117
- node version > v8.6.0
- golang version >= v1.11
- IDE recommendation: Goland
- After you clone the project, use the scripts in directory db to create your own database.
- We recommend you to apply for your own cloud service in QINIU. Replace the public key, private key, warehouse name and default url address with your own, so as not to mess up the test database.
Mr.奇淼('s avatar
Mr.奇淼( 已提交
118 119
```

R
rainyan 已提交
120
### 2.1 Web
Mr.奇淼('s avatar
Mr.奇淼( 已提交
121

122 123 124
```bash
# clone the project
git clone https://github.com/piexlmax/gin-vue-admin.git
Mr.奇淼('s avatar
Mr.奇淼( 已提交
125

126 127
# enter the project directory
cd web
Mr.奇淼('s avatar
Mr.奇淼( 已提交
128

129 130
# install dependency
npm install
Mr.奇淼('s avatar
Mr.奇淼( 已提交
131

132
# develop
Mr.奇淼('s avatar
Mr.奇淼( 已提交
133
npm run serve
134
```
Mr.奇淼('s avatar
Mr.奇淼( 已提交
135

R
rainyan 已提交
136
### 2.2 Server
Mr.奇淼('s avatar
Mr.奇淼( 已提交
137

138 139
```bash
# using go.mod
Mr.奇淼('s avatar
Mr.奇淼( 已提交
140

141 142
# install go modules
go list (go mod tidy)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
143

144 145 146
# build the server
go build
```
Mr.奇淼('s avatar
Mr.奇淼( 已提交
147

148
### 2.3 API docs auto-generation using swagger
Mr.奇淼('s avatar
Mr.奇淼( 已提交
149

R
rainyan 已提交
150
#### 2.3.1 install swagger 
S
sun_song_1203 已提交
151

R
rainyan 已提交
152
##### (1) Using VPN or outside mainland China
153 154 155
````
go get -u github.com/swaggo/swag/cmd/swag
````
Mr.奇淼('s avatar
Mr.奇淼( 已提交
156

157 158 159 160
##### (2) In mainland China
 
In mainland China, access to go.org/x is prohibited,we recommend [goproxy.io](https://goproxy.io/zh/)

161
````bash
162 163 164 165 166 167 168 169 170

If you are using Go version 1.13 and above (recommended)
# Enable Go Modules function
go env -w GO111MODULE=on 
# Configure GOPROXY environment variables
go env -w GOPROXY=https://goproxy.io,direct
If you are using Go version 1.12 and below
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io
Mr.奇淼('s avatar
Mr.奇淼( 已提交
171

172
# get swag
173
go get -g -v github.com/swaggo/swag/cmd/swag
Mr.奇淼('s avatar
Mr.奇淼( 已提交
174

175 176 177
# cd GOPATH/src/github.com/swaggo/swag/cmd/swag
go install
````
Mr.奇淼('s avatar
Mr.奇淼( 已提交
178

179
#### 2.3.2 API docs generation
Mr.奇淼('s avatar
Mr.奇淼( 已提交
180

181 182 183 184 185
````
cd server
swag init
````
After executing the above command,`docs` will show in `server/`,then open your browser, jump into `http://localhost:8888/swagger/index.html` to see the swagger APIs.
Mr.奇淼('s avatar
Mr.奇淼( 已提交
186 187


R
rainyan 已提交
188
## 3. Technical selection
Mr.奇淼('s avatar
Mr.奇淼( 已提交
189

190 191
- Frontend: using `Element-UI` based on vue,to code the page.
- Backend: using `Gin` to quickly build basic RESTful API. `Gin` is a web framework written in Go (Golang).
192
- DB: `MySql`(5.6.44),using `gorm` to implement data manipulation, added support for SQLite databases.
193 194 195
- Cache: using `Redis` to implement the recording of the JWT token of the currently active user and implement the multi-login restriction.
- API: using Swagger to auto generate APIs docs。
- Config: using `fsnotify` and `viper` to implement `yaml` config file。
G
Granty1 已提交
196
- Log: using `go-logging` record logs。
S
sun_song_1203 已提交
197

R
rainyan 已提交
198 199
## 4. Project Architecture

R
rainyan 已提交
200
### 4.1 Architecture Diagram
S
sun_song_1203 已提交
201

Mr.奇淼('s avatar
Mr.奇淼( 已提交
202
![Architecture diagram](http://qmplusimg.henrongyi.top/gva/gin-vue-admin.png)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
203

R
rainyan 已提交
204
### 4.2 Front-end Detailed Design Diagram (Contributor: <a href="https://github.com/baobeisuper">baobeisuper</a>)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
205

R
rainyan 已提交
206
![Front-end Detailed Design Diagram](http://qmplusimg.henrongyi.top/naotu.png)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
207

R
rainyan 已提交
208
### 4.3 Project Layout
Mr.奇淼('s avatar
Mr.奇淼( 已提交
209

210
```
211
    ├─server  	     (backend)
212 213 214 215 216 217 218 219 220 221 222
    │  ├─api            (API entrance)
    │  ├─config         (config file)
    │  ├─core  	        (core code)
    │  ├─db             (db scripts)
    │  ├─docs  	        (swagger APIs docs)
    │  ├─global         (global objet)
    │  ├─initialiaze    (initialiazation)
    │  ├─middleware     (middle ware)
    │  ├─model          (model and services)
    │  ├─resource       (resources, such as static pages, templates)
    │  ├─router         (routers)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
223
    │  ├─service         (services)
224
    │  └─utils	        (common utilities)
225
    └─web            (frontend)
226 227 228 229 230 231 232 233 234 235
        ├─public        (deploy templates)
        └─src           (source code)
            ├─api       (frontend APIs)
            ├─assets	(static files)
            ├─components(components)
            ├─router	(frontend routers)
            ├─store     (vuex state management)
            ├─style     (common styles)
            ├─utils     (frontend common utilitie)
            └─view      (pages)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
236

237
```
Mr.奇淼('s avatar
Mr.奇淼( 已提交
238

239 240 241 242 243 244 245 246 247 248 249 250
## 5. Features

- Authority management: Authority management based on `jwt` and `casbin`. 
- File upload & download: File upload operation based on Qiniu Cloud (In order to make it easier for everyone to test, I have provided various important tokens of my Qiniu test number, and I urge you not to make things a mess).
- Pagination Encapsulation:The frontend uses mixins to encapsulate paging, and the paging method can call mixins
- User management: The system administrator assigns user roles and role permissions.
- Role management: Create the main object of permission control, and then assign different API permissions and menu permissions to the role.
- Menu management: User dynamic menu configuration implementation, assigning different menus to different roles.
- API management: Different users can call different API permissions.
- Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function).
- Rich text editor: Embed MarkDown editor function.
- Conditional search: Add an example of conditional search.
R
rainyan 已提交
251
- Restful example: You can see sample APIs in user management module.
252

253 254 255 256 257 258 259 260
```
fontend code file: src\view\superAdmin\api\api.vue 
backend code file: model\dnModel\api.go 
```
- Multi-login restriction: Change `userMultipoint` to true in `system` in `config.yaml` (You need to configure redis and redis parameters yourself. During the test period, please report in time if there is a bug).
- Upload file by chunk:Provides examples of file upload and large file upload by chunk.
- Form Builder:With the help of [@form-generator](https://github.com/JakHuang/form-generator).
- Code generator: Providing backend with basic logic and simple curd code generator.
Mr.奇淼('s avatar
Mr.奇淼( 已提交
261

262
## 6. To-do list
Mr.奇淼('s avatar
Mr.奇淼( 已提交
263

264 265 266 267
- [ ] upload & export Excel
- [ ] e-chart
- [ ] workflow, task transfer function
- [ ] frontend independent mode, mock
Mr.奇淼('s avatar
Mr.奇淼( 已提交
268

R
rainyan 已提交
269
## 7. Knowledge base
Mr.奇淼('s avatar
Mr.奇淼( 已提交
270

R
rainyan 已提交
271
### 7.1 Team blog
Mr.奇淼('s avatar
Mr.奇淼( 已提交
272

R
rainyan 已提交
273
> https://www.yuque.com/flipped-aurora
274
>
R
rainyan 已提交
275
>There are video courses about frontend framework in our blo. If you think the project is helpful to you, you can add my personal WeChat:shouzi_1994,your comments is welcomed。
Mr.奇淼('s avatar
Mr.奇淼( 已提交
276

R
rainyan 已提交
277
### 7.2 Video courses
Mr.奇淼('s avatar
Mr.奇淼( 已提交
278

R
rainyan 已提交
279
(1) Development environment course
Mr.奇淼('s avatar
Mr.奇淼( 已提交
280
> Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/
Mr.奇淼('s avatar
Mr.奇淼( 已提交
281
    
R
rainyan 已提交
282
(2) Template course
Mr.奇淼('s avatar
Mr.奇淼( 已提交
283
> Bilibili:https://www.bilibili.com/video/BV16K4y1r7BD/
Mr.奇淼('s avatar
Mr.奇淼( 已提交
284

Mr.奇淼('s avatar
Mr.奇淼( 已提交
285 286 287 288
(3)2.0 version introduction and development experience
> Bilibili:https://www.bilibili.com/video/BV1aV411d7Gm#reply2831798461

(4) Golang basic course (coming soon)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
289

R
rainyan 已提交
290
> https://space.bilibili.com/322210472/channel/detail?cid=108884
Mr.奇淼('s avatar
Mr.奇淼( 已提交
291

R
rainyan 已提交
292 293
## 8. Contacts
### 8.1 Groups
R
rainyan 已提交
294
#### QQ group: 622360840
Mr.奇淼('s avatar
Mr.奇淼( 已提交
295

R
rainyan 已提交
296 297
| QQ group | 
|  :---:  |  
298 299
| <img src="http://qmplusimg.henrongyi.top/qq.jpg" width="180"/> |

R
rainyan 已提交
300 301

#### Wechat group: add anyone above, comment "加入gin-vue-admin交流群"
302

R
rainyan 已提交
303
### 8.2 Team members
R
rainyan 已提交
304
| Jiang | Yan | Yin | Du | Yin | Song |
305
|  :---:  |  :---: | :---: | :---:  |  :---: | :---: |
R
rainyan 已提交
306
| <img width="150" src="http://qmplusimg.henrongyi.top/qrjjz.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qryr.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qryx.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qrdjl.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qrygl.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qrsong.png"> |
Mr.奇淼('s avatar
Mr.奇淼( 已提交
307

308 309 310
|  Nick name   | Project position  | First name  |
|  ----  | ----  | ----  |
| [@piexlmax](https://github.com/piexlmax)  | Project sponsor | Jiang |
R
rainyan 已提交
311
| [@Ruio9244](https://github.com/Ruio9244)  | Architect | Yan |
G
Granty1 已提交
312
| [@granty1](https://github.com/granty1)  | Backend developer | Yin |
313
| [@1319612909](https://github.com/1319612909)  | UI developer |  Du |
G
Granty1 已提交
314
| [@krank666](https://github.com/krank666)  | Frontend developer | Yin |
315
| [@chen-chen-up](https://github.com/chen-chen-up)  | Novice developer | Song |
Mr.奇淼('s avatar
Mr.奇淼( 已提交
316
| [@SliverHorn](https://github.com/SliverHorn)  | Community Administrator | Lai |
Mr.奇淼('s avatar
Mr.奇淼( 已提交
317

R
rainyan 已提交
318
## 9. Donate
Mr.奇淼('s avatar
Mr.奇淼( 已提交
319

Mr.奇淼('s avatar
Mr.奇淼( 已提交
320
If you find this project useful, you can buy author a glass of juice :tropical_drink: [here](https://www.gin-vue-admin.com/docs/coffee)
Mr.奇淼('s avatar
Mr.奇淼( 已提交
321

Mr.奇淼('s avatar
Mr.奇淼( 已提交
322 323
## 10. Commercial considerations

Mr.奇淼('s avatar
Mr.奇淼( 已提交
324
If you use this project for commercial purposes, please comply with the Apache2.0 agreement and retain the author's technical support statement.