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.

274 lines
11 KiB

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