You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

320 lines
13 KiB

5 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
  1. 
  2. <div align=center>
  3. <img src="http://qmplusimg.henrongyi.top/gvalogo.jpg" width=300" height="300" />
  4. </div>
  5. <div align=center>
  6. <img src="https://img.shields.io/badge/golang-1.12-blue"/>
  7. <img src="https://img.shields.io/badge/gin-1.4.0-lightBlue"/>
  8. <img src="https://img.shields.io/badge/vue-2.6.10-brightgreen"/>
  9. <img src="https://img.shields.io/badge/element--ui-2.12.0-green"/>
  10. <img src="https://img.shields.io/badge/gorm-1.9.12-red"/>
  11. </div>
  12. English | [简体中文](./README-zh_CN.md)
  13. # Project Guidelines
  14. [Online Documentation](http://doc.henrongyi.top/)
  15. [Development Steps](http://doc.henrongyi.top/help/) (Contributor: <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
  16. - Web UI Framework:[element-ui](https://github.com/ElemeFE/element)
  17. - Server Framework:[gin](https://github.com/gin-gonic/gin)
  18. ## 1. Basic Introduction
  19. ### 1.1 Project Introduction
  20. [Online Demo](http://demo.gin-vue-admin.com/)
  21. username:admin
  22. password:123456
  23. > Gin-vue-admin is a full-stack (frontend and backend separation) framework designed for management system.
  24. > 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.
  25. Hi! Thank you for choosing gin-vue-admin.
  26. Gin-vue-admin is a full-stack (frontend and backend separation) framework for developers, designers and product managers.
  27. 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.
  28. ### 1.2 Contributing Guide
  29. #### 1.2.1 Issue Guidelines
  30. - 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.
  31. - Before submitting an issue, please check if similar problems have already been issued.
  32. #### 1.2.2 Pull Request Guidelines
  33. - Fork this repository to your own account. Do not create branches here.
  34. - Commit info should be formatted as `[File Name]: Info about commit.` (e.g. `README.md: Fix xxx bug`)
  35. - <font color=red>Make sure PRs are created to `develop` branch instead of `master` branch.</font>
  36. - If your PR fixes a bug, please provide a description about the related bug.
  37. - Merging a PR takes two maintainers: one approves the changes after reviewing, and then the other reviews and merges.
  38. ### 1.3 Version list
  39. - master: 2.0 code, for prod
  40. - develop: 2.0 dev code, for test
  41. - [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)
  42. - [gin-vue-admin_v1.0_stable](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_stable) (stop maintenance)
  43. - [gin-vue-admin_v1.0_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_dev) (stop maintenance)
  44. ## 2. Getting started
  45. > Use docker-compose to experience this project
  46. - Installation docker-compose [Official document](https://docs.docker.com/compose/install/)
  47. - ```shell script
  48. # Install on Linux
  49. # 1.1 Run this command to download the current stable version of Docker Compose
  50. 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
  51. # 1.2 Apply executable permissions to binary files
  52. sudo chmod +x /usr/local/bin/docker-compose
  53. ```
  54. - ```shell script
  55. # Use Python's pip installation
  56. pip3 install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple
  57. ```
  58. - Use Docker Desktop
  59. - Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows
  60. - Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/
  61. - Use git to clone this project
  62. - ```git
  63. git clone https://github.com/flipped-aurora/gin-vue-admin.git
  64. ```
  65. - Use docker-compose up to start the startup project with one click
  66. - ```shell script
  67. # Use docker-compose to start four containers
  68. docker-compose up
  69. # If you modify some configuration options, you can use this command to repackage the image
  70. docker-compose up --build
  71. # Use docker-compose to start in the background
  72. docker-compose up -d
  73. ```
  74. - Web project preview [http://127.0.0.1:8888/admin](http://127.0.0.1:8888/admin)
  75. - swagger APIs [http://127.0.0.1:8888/swagger/index.html](http://127.0.0.1:8888/swagger/index.html)
  76. ```
  77. - node version > v8.6.0
  78. - golang version >= v1.11
  79. - IDE recommendation: Goland
  80. - After you clone the project, use the scripts in directory db to create your own database.
  81. - 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.
  82. ```
  83. ### 2.1 Web
  84. ```bash
  85. # clone the project
  86. git clone https://github.com/piexlmax/gin-vue-admin.git
  87. # enter the project directory
  88. cd web
  89. # install dependency
  90. npm install
  91. # develop
  92. npm run serve
  93. ```
  94. ### 2.2 Server
  95. ```bash
  96. # using go.mod
  97. # install go modules
  98. go list (go mod tidy)
  99. # build the server
  100. go build
  101. ```
  102. ### 2.3 API docs auto-generation using swagger
  103. #### 2.3.1 install swagger
  104. ##### (1) Using VPN or outside mainland China
  105. ````
  106. go get -u github.com/swaggo/swag/cmd/swag
  107. ````
  108. ##### (2) In mainland China
  109. In mainland China, access to go.org/x is prohibited,we recommend [goproxy.io](https://goproxy.io/zh/)
  110. ````bash
  111. If you are using Go version 1.13 and above (recommended)
  112. # Enable Go Modules function
  113. go env -w GO111MODULE=on
  114. # Configure GOPROXY environment variables
  115. go env -w GOPROXY=https://goproxy.io,direct
  116. If you are using Go version 1.12 and below
  117. go env -w GO111MODULE=on
  118. go env -w GOPROXY=https://goproxy.io
  119. # get swag
  120. go get -g -v github.com/swaggo/swag/cmd/swag
  121. # cd GOPATH/src/github.com/swaggo/swag/cmd/swag
  122. go install
  123. ````
  124. #### 2.3.2 API docs generation
  125. ````
  126. cd server
  127. swag init
  128. ````
  129. 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.
  130. ## 3. Technical selection
  131. - Frontend: using `Element-UI` based on vue,to code the page.
  132. - Backend: using `Gin` to quickly build basic RESTful API. `Gin` is a web framework written in Go (Golang).
  133. - DB: `MySql`(5.6.44),using `gorm` to implement data manipulation, added support for SQLite databases.
  134. - Cache: using `Redis` to implement the recording of the JWT token of the currently active user and implement the multi-login restriction.
  135. - API: using Swagger to auto generate APIs docs。
  136. - Config: using `fsnotify` and `viper` to implement `yaml` config file。
  137. - Log: using `go-logging` record logs。
  138. ## 4. Project Architecture
  139. ### 4.1 Architecture Diagram
  140. ![Architecture diagram](http://qmplusimg.henrongyi.top/gva/gin-vue-admin.png)
  141. ### 4.2 Front-end Detailed Design Diagram (Contributor: <a href="https://github.com/baobeisuper">baobeisuper</a>)
  142. ![Front-end Detailed Design Diagram](http://qmplusimg.henrongyi.top/naotu.png)
  143. ### 4.3 Project Layout
  144. ```
  145. ├─server (backend)
  146. │ ├─api (API entrance)
  147. │ ├─config (config file)
  148. │ ├─core (core code)
  149. │ ├─db (db scripts)
  150. │ ├─docs (swagger APIs docs)
  151. │ ├─global (global objet)
  152. │ ├─initialiaze (initialiazation)
  153. │ ├─middleware (middle ware)
  154. │ ├─model (model and services)
  155. │ ├─resource (resources, such as static pages, templates)
  156. │ ├─router (routers)
  157. │ ├─service (services)
  158. │ └─utils (common utilities)
  159. └─web (frontend)
  160. ├─public (deploy templates)
  161. └─src (source code)
  162. ├─api (frontend APIs)
  163. ├─assets (static files)
  164. ├─components(components)
  165. ├─router (frontend routers)
  166. ├─store (vuex state management)
  167. ├─style (common styles)
  168. ├─utils (frontend common utilitie)
  169. └─view (pages)
  170. ```
  171. ## 5. Features
  172. - Authority management: Authority management based on `jwt` and `casbin`.
  173. - 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).
  174. - Pagination Encapsulation:The frontend uses mixins to encapsulate paging, and the paging method can call mixins
  175. - User management: The system administrator assigns user roles and role permissions.
  176. - Role management: Create the main object of permission control, and then assign different API permissions and menu permissions to the role.
  177. - Menu management: User dynamic menu configuration implementation, assigning different menus to different roles.
  178. - API management: Different users can call different API permissions.
  179. - Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function).
  180. - Rich text editor: Embed MarkDown editor function.
  181. - Conditional search: Add an example of conditional search.
  182. - Restful example: You can see sample APIs in user management module.
  183. ```
  184. fontend code file: src\view\superAdmin\api\api.vue
  185. backend code file: model\dnModel\api.go
  186. ```
  187. - 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).
  188. - Upload file by chunk:Provides examples of file upload and large file upload by chunk.
  189. - Form Builder:With the help of [@form-generator](https://github.com/JakHuang/form-generator).
  190. - Code generator: Providing backend with basic logic and simple curd code generator.
  191. ## 6. To-do list
  192. - [ ] upload & export Excel
  193. - [ ] e-chart
  194. - [ ] workflow, task transfer function
  195. - [ ] frontend independent mode, mock
  196. ## 7. Knowledge base
  197. ### 7.1 Team blog
  198. > https://www.yuque.com/flipped-aurora
  199. >
  200. >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。
  201. ### 7.2 Video courses
  202. (1) Development environment course
  203. > Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/
  204. (2) Template course
  205. > Bilibili:https://www.bilibili.com/video/BV16K4y1r7BD/
  206. (3)2.0 version introduction and development experience
  207. > Bilibili:https://www.bilibili.com/video/BV1aV411d7Gm#reply2831798461
  208. (4) Golang basic course (coming soon)
  209. > https://space.bilibili.com/322210472/channel/detail?cid=108884
  210. ## 8. Contacts
  211. ### 8.1 Groups
  212. | QQ group |
  213. | :---: |
  214. | <img src="http://qmplusimg.henrongyi.top/qq.jpg" width="180"/> |
  215. ### QQ group: 622360840
  216. ### Wechat group: add anyone above, comment "加入gin-vue-admin交流群"
  217. ### 8.2 Team members
  218. | Jiang | Yin | Yan | Du | Yin | Song |
  219. | :---: | :---: | :---: | :---: | :---: | :---: |
  220. | <img width="150" src="http://qmplusimg.henrongyi.top/qrjjz.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qryx.png"> | <img width="150" src="http://qmplusimg.henrongyi.top/qryr.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"> |
  221. | Nick name | Project position | First name |
  222. | ---- | ---- | ---- |
  223. | [@piexlmax](https://github.com/piexlmax) | Project sponsor | Jiang |
  224. | [@granty1](https://github.com/granty1) | Backend developer | Yin |
  225. | [@Ruio9244](https://github.com/Ruio9244) | Full-stack developer | Yan |
  226. | [@1319612909](https://github.com/1319612909) | UI developer | Du |
  227. | [@krank666](https://github.com/krank666) | Frontend developer | Yin |
  228. | [@chen-chen-up](https://github.com/chen-chen-up) | Novice developer | Song |
  229. | [@SliverHorn](https://github.com/SliverHorn) | Community Administrator | Lai |
  230. ## 9. Donate
  231. If you find this project useful, you can buy author a glass of juice :tropical_drink: [here](http://doc.henrongyi.top/more/coffee.html)
  232. ## 10. Commercial considerations
  233. If you use this project for commercial purposes, please comply with the Apache2.0 agreement and retain the author's technical support statement.