Ingen beskrivning

SliverHorn 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
.docker-compose 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
.github 3066b2ae85 Update FUNDING.yml 4 år sedan
docker 59a138f032 优化docker-compose的前端项目不依赖于Gin,使用nginx 4 år sedan
docs 70414b725e Modify readme. 4 år sedan
server 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
web ad1ca6ec07 取消头像地址配置 4 år sedan
.dockerignore 669ced9073 feat: 增加docker 支持 4 år sedan
.gitattributes 75dff71227 显示语言修改 5 år sedan
.gitignore 8c62ee93a1 feat: 增加sqlite 支持 4 år sedan
CODE_OF_CONDUCT.md e9cf6e164d Create CODE_OF_CONDUCT.md 5 år sedan
CONTRIBUTING.md e22f378411 Create CONTRIBUTING.md 4 år sedan
Dockerfile 669ced9073 feat: 增加docker 支持 4 år sedan
LICENSE 22da7dd0c0 Update LICENSE 4 år sedan
README-en.md 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
README.md 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
docker-compose.yaml 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
dockerfile_server 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
dockerfile_web 64e7ecedd5 更新文档,优化docker-compose的网络自定义 4 år sedan
package-lock.json b5172171df yx 4 år sedan

README-en.md

English | 简体中文

Project Guidelines

Online Documentation : https://www.gin-vue-admin.com/

Development Steps (Contributor: LLemonGreen And Fann)

1. Basic Introduction

1.1 Project Introduction

Online Demo

username:admin

password:123456

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.

Hi! Thank you for choosing gin-vue-admin.

Gin-vue-admin is a full-stack (frontend and backend separation) framework for developers, designers and product managers.

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.

1.2 Contributing Guide

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 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)

  • Make sure PRs are created to develop branch instead of master branch.

  • 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

2. Getting started

- 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.

Use docker-compose to experience this project

  • Installation docker-compose Official document

  • Use git to clone this project

    • git clone https://github.com/flipped-aurora/gin-vue-admin.git
      
    • Use docker-compose up to start the startup project with one click

    • # 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:8000

    • swagger APIs http://127.0.0.1:8888/swagger/index.html

  • If the internal ip of the server's 177.7.0.12 container is occupied, the place to be modified is

  • docker-compose uses a custom docker network

    • networks:
        network:
          ipam:
            driver: default
            config:
              - subnet: '177.7.0.0/16' 
      
    • Subnet address, the default gateway is 177.7.0.1 (docker-compose V2 needs to write, V3 does not need),For specific information, see the official document

    • The default network name is gin-vue-admin_network, and the default is bridge mode

    • If the subnet is modified, the ipv4_address of each service needs to be modified, and the ip of the server on line 20 of .docker-compose/nginx/conf.d/my.conf also needs to be modified

2.1 Web

```bash

clone the project

git clone https://github.com/piexlmax/gin-vue-admin.git

enter the project directory

cd web

install dependency

npm install

develop

npm run serve


### 2.2 Server

bash

using go.mod

install go modules

go list (go mod tidy)

build the server

go build


### 2.3 API docs auto-generation using swagger

#### 2.3.1 install swagger 

##### (1) Using VPN or outside mainland China
````
go get -u github.com/swaggo/swag/cmd/swag
````

##### (2) In mainland China

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

````bash

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

# get swag
go get -g -v github.com/swaggo/swag/cmd/swag

# cd GOPATH/src/github.com/swaggo/swag/cmd/swag
go install
````

#### 2.3.2 API docs generation

````
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.


## 3. Technical selection

- 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).
- DB: `MySql`(5.6.44),using `gorm` to implement data manipulation, added support for SQLite databases.
- 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。
- Log: using `go-logging` record logs。

## 4. Project Architecture

### 4.1 Architecture Diagram

![Architecture diagram](http://qmplusimg.henrongyi.top/gva/gin-vue-admin.png)

### 4.2 Front-end Detailed Design Diagram (Contributor: <a href="https://github.com/baobeisuper">baobeisuper</a>)

![Front-end Detailed Design Diagram](http://qmplusimg.henrongyi.top/naotu.png)

### 4.3 Project Layout

├─server  	     (backend)
│  ├─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)
│  ├─service         (services)
│  └─utils	        (common utilities)
└─web            (frontend)
    ├─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)

## 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.
- Restful example: You can see sample APIs in user management module.

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.
  • Code generator: Providing backend with basic logic and simple curd code generator.

6. To-do list

  • upload & export Excel
  • e-chart
  • workflow, task transfer function
  • frontend independent mode, mock

7. Knowledge base

7.1 Team blog

https://www.yuque.com/flipped-aurora

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。

7.2 Video courses

(1) Development environment course

Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/

(2) Template course

Bilibili:https://www.bilibili.com/video/BV16K4y1r7BD/

(3)2.0 version introduction and development experience

Bilibili:https://www.bilibili.com/video/BV1aV411d7Gm#reply2831798461

(4) Golang basic course (coming soon)

https://space.bilibili.com/322210472/channel/detail?cid=108884

8. Contacts

8.1 Groups

QQ group: 622360840

QQ group

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

8.2 Team members

Jiang Yan Yin Du Yin Song
Nick name Project position First name
@piexlmax Project sponsor Jiang
@Ruio9244 Architect Yan
@granty1 Backend developer Yin
@1319612909 UI developer Du
@krank666 Frontend developer Yin
@chen-chen-up Novice developer Song
@SliverHorn Community Administrator Lai

9. Donate

If you find this project useful, you can buy author a glass of juice :tropical_drink: here

10. Commercial considerations

If you use this project for commercial purposes, please comply with the Apache2.0 agreement and retain the author's technical support statement.