同步操作将从 pixel/gin-vue-admin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
English | 简体中文
Online Documentation : https://www.gin-vue-admin.com/
Development Steps (Contributor: LLemonGreen And Fann)
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.
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.
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.
- node version > v8.6.0
- golang version >= v1.14
- IDE recommendation: Goland
- 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
# 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
# Use Python's pip installation
pip3 install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple
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
Use docker-compose to deploy this project need attention
# 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
# using go.mod
# install go modules
go list (go mod tidy)
# build the server
go build
Zap log library usage guide && configuration guide
The configuration of the Zap log library selects zap under config.yaml
# zap logger configuration
zap:
level: 'debug'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link_name: 'latest_log'
show_line: true
encode_level: 'LowercaseColorLevelEncoder'
stacktrace_key: 'stacktrace'
log_in_console: true
Configuration Name | Type Of Configuration | Description |
---|---|---|
level | string | For a detailed description of the level mode, please see the official zap documentation info: info mode, stack information without errors, only output information debug: debug mode, stack details with errors warn:warn mode error: error mode, stack details with error dpanic: dpanic mode panic: panic mode fatal: fatal mode |
format | string | console: Output log in console format json: json format output log |
prefix | string | Log prefix |
director | string | The folder to store the log can be modified, no need to create it manually |
link_name | string | A soft connection file of link_name will be generated in the server directory, and the link is the latest log file of the director configuration item |
show_line | bool | Display the line number, the default is true, it is not recommended to modify |
encode_level | string | LowercaseLevelEncoder: lowercase LowercaseColorLevelEncoder: lowercase with color CapitalLevelEncoder: uppercase CapitalColorLevelEncoder: uppercase with color |
stacktrace_key | string | The name of the stack, that is, the key of josn when outputting the log in json format |
log_in_console | bool | Whether to output to the console, the default is true |
level:debug
format:console
encode_level:LowercaseColorLevelEncoder
或者encode_leve:CapitalColorLevelEncoder
level:error
format:json
encode_level: LowercaseLevelEncoder
或者 encode_level:CapitalLevelEncoder
log_in_console: false
go get -u github.com/swaggo/swag/cmd/swag
In mainland China, access to go.org/x is prohibited,we recommend goproxy.io
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
# Use the following command to download swag
go get -u github.com/swaggo/swag/cmd/swag
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.
Element-UI
based on vue,to code the page.Gin
to quickly build basic RESTful API. Gin
is a web framework written in Go (Golang).MySql
(5.6.44),using gorm
to implement data manipulation, added support for SQLite databases.Redis
to implement the recording of the JWT token of the currently active user and implement the multi-login restriction.fsnotify
and viper
to implement yaml
config file。go-logging
record logs。 ├─server (backend)
│ ├─api (API entrance)
│ ├─config (config file)
│ ├─core (core code)
│ ├─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)
jwt
and casbin
.fontend code file: src\view\superAdmin\api\api.vue
backend code file: model\dnModel\api.go
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).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。
(1) Development environment course
(2) Template course
(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
| QQ group |d | :---: | | |
If you find this project useful, you can buy author a glass of juice here
If you use this project for commercial purposes, please comply with the Apache2.0 agreement and retain the author's technical support statement.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。