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.

292 lines
12 KiB

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
  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.10-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://qmplus.henrongyi.top/)
  20. > Gin-vue-admin is a full-stack (frontend and backend separation) framework designed for management system.
  21. > 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.
  22. Hi! Thank you for choosing gin-vue-admin.
  23. Gin-vue-admin is a full-stack (frontend and backend separation) framework for developers, designers and product managers.
  24. 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.
  25. ### 1.2 Contributing Guide
  26. #### 1.2.1 Issue Guidelines
  27. - 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.
  28. - Before submitting an issue, please check if similar problems have already been issued.
  29. #### 1.2.2 Pull Request Guidelines
  30. - Fork this repository to your own account. Do not create branches here.
  31. - Commit info should be formatted as `[File Name]: Info about commit.` (e.g. `README.md: Fix xxx bug`)
  32. - <font color=red>Make sure PRs are created to `develop` branch instead of `master` branch.</font>
  33. - If your PR fixes a bug, please provide a description about the related bug.
  34. - Merging a PR takes two maintainers: one approves the changes after reviewing, and then the other reviews and merges.
  35. ### 1.3 Version list
  36. - master: 2.0 dev code, for prod
  37. - develop: 2.0 dev code, for test
  38. - [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)
  39. - [gin-vue-admin_v1.0_stable](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_stable) (v1.0 is kept up to date and maintained)
  40. - [gin-vue-admin_v1.0_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v1_dev) (v1.0 is kept up to date and maintained)
  41. ## 2. Getting started
  42. ```
  43. - node version > v8.6.0
  44. - golang version >= v1.11
  45. - IDE recommendation: Goland
  46. - After you clone the project, use the scripts in directory db to create your own database.
  47. - 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.
  48. ```
  49. ### 2.1 Web
  50. ```bash
  51. # clone the project
  52. git clone https://github.com/piexlmax/gin-vue-admin.git
  53. # enter the project directory
  54. cd web
  55. # install dependency
  56. npm install
  57. # develop
  58. npm run serve
  59. ```
  60. ### 2.2 Server
  61. ```bash
  62. # using go.mod
  63. # install go modules
  64. go list (go mod tidy)
  65. # build the server
  66. go build
  67. ```
  68. ### 2.3 API docs auto-generation using swagger
  69. #### 2.3.1 install swagger
  70. ##### (1) Using VPN or outside mainland China
  71. ````
  72. go get -u github.com/swaggo/swag/cmd/swag
  73. ````
  74. ##### (2) In mainland China
  75. In mainland China, access to go.org/x is prohibited,we recommend `gopm`
  76. ````bash
  77. # install gopm
  78. go get -v -u github.com/gpmgo/gopm
  79. # get swag
  80. gopm get -g -v github.com/swaggo/swag/cmd/swag
  81. # cd GOPATH/src/github.com/swaggo/swag/cmd/swag
  82. go install
  83. ````
  84. #### 2.3.2 API docs generation
  85. ````
  86. cd server
  87. swag init
  88. ````
  89. 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.
  90. ### 2.4 Docker image
  91. Thanks [@chenlinzhong](https://github.com/chenlinzhong) for providing docker image.
  92. ```
  93. # start docker
  94. docker run -itd --net=host --name=go_container shareclz/go_node /bin/bash;
  95. # come into docker
  96. docker exec -it go_container /bin/bash;
  97. git clone https://github.com/piexlmax/gin-vue-admin.git /data1/www/htdocs/go/admin;
  98. # run web
  99. cd /data1/www/htdocs/go/admin/QMPlusVuePage;
  100. cnpm i ;
  101. npm run serve;
  102. # update db config
  103. vi /data1/www/htdocs/go/admin/QMPlusServer/static/dbconfig/config.json;
  104. # run server
  105. cd /data1/www/htdocs/go/admin/QMPlusServer;z
  106. go run main.go;
  107. ```
  108. ## 3. Technical selection
  109. - Frontend: using `Element-UI` based on vue,to code the page.
  110. - Backend: using `Gin` to quickly build basic RESTful API. `Gin` is a web framework written in Go (Golang).
  111. - DB: `MySql`(5.6.44),using `gorm` to implement data manipulation, added support for SQLite databases.
  112. - Cache: using `Redis` to implement the recording of the JWT token of the currently active user and implement the multi-login restriction.
  113. - API: using Swagger to auto generate APIs docs。
  114. - Config: using `fsnotify` and `viper` to implement `yaml` config file。
  115. - Log: using `go-logging` record logs。
  116. ## 4. Project layout
  117. ```
  118. ├─server (backend)
  119. │ ├─api (API entrance)
  120. │ ├─config (config file)
  121. │ ├─core (core code)
  122. │ ├─db (db scripts)
  123. │ ├─docs (swagger APIs docs)
  124. │ ├─global (global objet)
  125. │ ├─initialiaze (initialiazation)
  126. │ ├─middleware (middle ware)
  127. │ ├─model (model and services)
  128. │ ├─resource (resources, such as static pages, templates)
  129. │ ├─router (routers)
  130. │ ├─service (services)
  131. │ └─utils (common utilities)
  132. └─web (frontend)
  133. ├─public (deploy templates)
  134. └─src (source code)
  135. ├─api (frontend APIs)
  136. ├─assets (static files)
  137. ├─components(components)
  138. ├─router (frontend routers)
  139. ├─store (vuex state management)
  140. ├─style (common styles)
  141. ├─utils (frontend common utilitie)
  142. └─view (pages)
  143. ```
  144. ## 5. Features
  145. - Authority management: Authority management based on `jwt` and `casbin`.
  146. - 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).
  147. - Pagination Encapsulation:The frontend uses mixins to encapsulate paging, and the paging method can call mixins
  148. - User management: The system administrator assigns user roles and role permissions.
  149. - Role management: Create the main object of permission control, and then assign different API permissions and menu permissions to the role.
  150. - Menu management: User dynamic menu configuration implementation, assigning different menus to different roles.
  151. - API management: Different users can call different API permissions.
  152. - Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function).
  153. - Rich text editor: Embed MarkDown editor function.
  154. - Conditional search: Add an example of conditional search.
  155. - Restful example: You can see sample APIs in user management module.
  156. ```
  157. fontend code file: src\view\superAdmin\api\api.vue
  158. backend code file: model\dnModel\api.go
  159. ```
  160. - 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).
  161. - Upload file by chunk:Provides examples of file upload and large file upload by chunk.
  162. - Form Builder:With the help of [@form-generator](https://github.com/JakHuang/form-generator).
  163. - Code generator: Providing backend with basic logic and simple curd code generator.
  164. ## 6. To-do list
  165. - [ ] upload & export Excel
  166. - [ ] e-chart
  167. - [ ] workflow, task transfer function
  168. - [ ] frontend independent mode, mock
  169. ## 7. Changelog
  170. | Date | Log |
  171. | :---: | --- |
  172. |2020/01/07| Added data resource function to Role, added the return of data resource association, the demo code was synchronized, and the multi-point login interception has been turned on, which may prevent being crowded out by others |
  173. |2020/01/13| Added configuration management function. This function is not published to the test environment. The test environment will not be published until the protection mechanism and the service restart mechanism are released. Please clone and import the sql scripts into your own database |
  174. |2020/02/21| Modified `casbin` custom authentication method to fully support `/:params and?Query=` interface modes in RESTful API |
  175. |2020/03/17| Added verification code function with [@dchest/captcha](https://github.com/dchest/captcha) |
  176. |2020/03/30| Code generator implementation, form generator implementation with[@form-generator](https://github.com/JakHuang/form-generator) |
  177. |2020/04/01| Add frontend history tab function, add (modify) condition query example, and change the frontend background to white. (If you don't need this feature, you can change `background` in `&.el-main` to shield background color of `HistoryComponent`, which is located at line 260 of the code `web/src/view/layout/index.vue`) |
  178. |2020/04/04| Starting version 2.x, standardize the project documentation, reconstructing the log function, and adding English comments to all methods |
  179. ## 8. Team blog
  180. > https://blog.henrongyi.top
  181. >
  182. >
  183. 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。
  184. ## 9. Video courses
  185. ### 9.1 Development environment course
  186. > Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/ (coming soon)
  187. ### 9.2 Template course
  188. > Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/ (coming soon)
  189. ### 9.3 Golang basic course (coming soon)
  190. > URL: https://space.bilibili.com/322210472/channel/detail?cid=108884
  191. ## 10. Contacts
  192. | QQ group |
  193. | :---: |
  194. | <img src="http://qmplusimg.henrongyi.top/qq.jpg" width="180"/> |
  195. | Jiang | Yin | Yan | Du | Yin | Song |
  196. | :---: | :---: | :---: | :---: | :---: | :---: |
  197. | <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"> |
  198. ### QQ group: 622360840
  199. ### Wechat group: add anyone above, comment "加入gin-vue-admin交流群"
  200. ## 11. Developers
  201. | Nick name | Project position | First name |
  202. | ---- | ---- | ---- |
  203. | [@piexlmax](https://github.com/piexlmax) | Project sponsor | Jiang |
  204. | [@granty1](https://github.com/granty1) | Backend developer | Yin |
  205. | [@Ruio9244](https://github.com/Ruio9244) | Full-stack developer | Yan |
  206. | [@1319612909](https://github.com/1319612909) | UI developer | Du |
  207. | [@krank666](https://github.com/krank666) | Frontend developer | Yin |
  208. | [@chen-chen-up](https://github.com/chen-chen-up) | Novice developer | Song |
  209. ## 12. Donate
  210. If you find this project useful, you can buy author a glass of juice :tropical_drink: