Skip to content

Commit

Permalink
Merge branch 'docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayheaven committed Jan 22, 2024
2 parents f415663 + 2813340 commit cead236
Show file tree
Hide file tree
Showing 14 changed files with 15,796 additions and 179 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
![CI](https://github.com/sanjayheaven/go-gin-boilerplate/workflows/Go/badge.svg)
![License](https://img.shields.io/github/license/sanjayheaven/go-gin-boilerplate)

[Swagger 接口文档](https://go-gin-boilerplate.gganbu.services/swagger/index.html)
## 📘 Documents

- [项目文档](https://sanjayheaven.github.io/go-gin-boilerplate/)
- [Swagger 接口文档](https://go-gin-boilerplate.gganbu.services/swagger/index.html)

</div>

## 项目介绍
## 🎬 项目介绍

一个基于 Gin 框架的开发脚手架,旨在帮助开发者快速搭建和开发 Web 应用程序。

- [English](./README_en.md)
- [中文介绍](./README.md)

## 关键词
## 👀 关键词

[Go](https://github.com/golang/go)
[Gin](https://github.com/gin-gonic/gin)
Expand All @@ -30,9 +33,10 @@
[Air](https://github.com/cosmtrek/air)
[Logrus](https://github.com/sirupsen/logrus)
[Lumberjack](https://github.com/natefinch/lumberjack)
[Zap](https://github.com/uber-go/zap)
[Jwt](https://github.com/golang-jwt/jwt)

## 特性
## 特性

- **快速开发**: 使用 **Gin** 框架和相关工具,加速项目的开发和迭代过程。
- **简单易用**: 遵循 [project-layout](https://github.com/golang-standards/project-layout/tree/master) 规范, 提供清晰简单的代码结构,使新手也能轻松上手。
Expand All @@ -41,9 +45,12 @@
- **一体化日志系统**: 集成 **Logrus****Lumberjack**, 实现全方位的日志记录和管理。
- **数据库支持**: 集成 **Gorm**, 支持主流数据库,如 MySQL、PostgreSQL 等。
- **灵活的中间件**: 整合常用中间件,轻松实现日志、认证、跨域、限流等功能。
<!-- - **统一错误处理**: 统一的错误处理机制,简化错误信息的捕获和处理。 -->
- **API 文档**: 使用 **Gin-Swagger** 生成 API 文档,方便查看和调试接口。

<!-- 我用了swag生成文档,非常方便用于调试 -->
<!-- - **统一错误处理**: 统一的错误处理机制,简化错误信息的捕获和处理。 -->

## 快速开始
## 🚀 快速开始

```sh
git clone https://github.com/sanjayheaven/go-gin-boilerplate.git
Expand Down Expand Up @@ -103,13 +110,13 @@ air
go run main.go server
```

## 打包
## 🔨 打包

```sh
make build
```

## 部署
## 🪤 部署

### docker-compose

Expand All @@ -123,7 +130,7 @@ make build
docker compose up -d
```

## 支持 🫶
## 🤝 支持

- Star 🌟 项目
- 欢迎提交 [issue](https://github.com/sanjayheaven/go-gin-boilerplate/issues)。感谢您的支持
Expand Down
32 changes: 25 additions & 7 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
![CI](https://github.com/sanjayheaven/go-gin-boilerplate/workflows/Go/badge.svg)
![License](https://img.shields.io/github/license/sanjayheaven/go-gin-boilerplate)

[Swagger Api Document](https://go-gin-boilerplate.gganbu.services/swagger/index.html)
## 📘 Documents

- [Project Document](https://sanjayheaven.github.io/go-gin-boilerplate/)
- [Swagger Api Document](https://go-gin-boilerplate.gganbu.services/swagger/index.html)

</div>

## Introduction
## 🎬 Introduction

A development boilerplate based on the Gin framework, aimed at helping developers quickly build and develop web applications.

- [English](./README_en.md)
- [中文介绍](./README.md)

## Keywords
## 👀 Keywords

[Go](https://github.com/golang/go)
[Gin](https://github.com/gin-gonic/gin)
Expand All @@ -30,9 +33,10 @@ A development boilerplate based on the Gin framework, aimed at helping developer
[Air](https://github.com/cosmtrek/air)
[Logrus](https://github.com/sirupsen/logrus)
[Lumberjack](https://github.com/natefinch/lumberjack)
[Zap](https://github.com/uber-go/zap)
[Jwt](https://github.com/golang-jwt/jwt)

## Features
## Features

- **Rapid Development**: Accelerate project development and iteration using the **Gin** framework and related tools.
- **Simple and Easy to Use**: Follow the [project-layout](https://github.com/golang-standards/project-layout/tree/master) specification, providing a clear and simple code structure that even beginners can easily understand.
Expand All @@ -41,8 +45,9 @@ A development boilerplate based on the Gin framework, aimed at helping developer
- **Integrated Logging System**: Integrated Logrus and Lumberjack for comprehensive log recording and management.
- **Database Support**: Integrated Gorm, supporting mainstream databases such as MySQL, PostgreSQL, etc.
- **Flexible Middleware**: Incorporate common middleware for easy implementation of features such as logging, authentication, cross-origin resource sharing (CORS), rate limiting, etc.
- **API Document**: Use **Gin-Swagger** to generate API documents for easy viewing and debugging of interfaces.

## Quick Start
## 🚀 Quick Start

```sh
git clone https://github.com/sanjayheaven/go-gin-boilerplate.git
Expand Down Expand Up @@ -102,7 +107,20 @@ air
go run main.go server
```

## Deployment
<!--
## 🔨 打包
```sh
make build
``` -->

## 🔨 Build

```sh
make build
```

## 🪤 Deployment

### docker-compose

Expand All @@ -116,7 +134,7 @@ Ensure that Docker is installed on the server, and you are familiar with the usa
docker compose up -d
```

## Support 🫶
## 🤝 Support

- Star 🌟 the project
- Welcome to submit [issue](https://github.com/sanjayheaven/go-gin-boilerplate/issues). Thank you for your support
Expand Down
13 changes: 13 additions & 0 deletions docs/go-gin-boilerplate/docs/guide/CLI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
sidebar_position: 7
---

# CLI

Go Gin Boilerplate 使用 [Cobra](https://github.com/spf13/cobra) 打造现代命令行工具,简化项目管理和操作。

## 介绍

## 需求

## 使用
27 changes: 27 additions & 0 deletions docs/go-gin-boilerplate/docs/guide/swagger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
sidebar_position: 6
---

# Swagger

Swagger 是一个 API 文档生成工具,可以根据代码注释生成 API 文档。
项目中使用 [Gin-Swagger](https://github.com/swaggo/gin-swagger)生成 API 文档,方便查看和调试接口。 [在线文档地址](https://go-gin-boilerplate.gganbu.services/swagger/index.html)

## 介绍

Go Gin Boilerplate 使用 [Gin-Swagger](https://github.com/swaggo/gin-swagger) 生成 API 文档,方便查看和调试接口。

## 需求

在平时的开发过程中,我们需要编写接口文档,方便前端开发人员查看和调试接口。
一般我们会有以下几点主要的需求:

- **接口文档生成**,根据代码注释快速生成接口文档
- **接口文档查看**,方便共享给其他开发人员查看
- **接口文档调试**,能够在线调试,尽可能的和目前开发环境保持一致

## 使用

<!-- 介绍使用 swagger,一步步来 -->

<!-- ,怎么安装,添加到路由,注入权限 -->
91 changes: 45 additions & 46 deletions docs/go-gin-boilerplate/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ const config: Config = {
editUrl:
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
theme: { customCss: "./src/css/custom.css" },
theme: {
customCss: ["./src/css/custom.css", "./src/css/tailwind.css"],
},
sitemap: {
changefreq: EnumChangefreq.WEEKLY,
priority: 0.5,
Expand Down Expand Up @@ -114,51 +116,48 @@ const config: Config = {
},
],
},
// footer: {
// style: "dark",
// links: [
// {
// title: "Docs",
// items: [
// {
// label: "Tutorial",
// to: "/docs/intro",
// },
// ],
// },
// {
// title: "Community",
// items: [
// {
// label: "Stack Overflow",
// href: "https://stackoverflow.com/questions/tagged/docusaurus",
// },
// {
// label: "Discord",
// href: "https://discordapp.com/invite/docusaurus",
// },
// {
// label: "Twitter",
// href: "https://twitter.com/docusaurus",
// },
// ],
// },
// {
// title: "More",
// items: [
// {
// label: "Blog",
// to: "/blog",
// },
// {
// label: "GitHub",
// href: "https://github.com/facebook/docusaurus",
// },
// ],
// },
// ],
// copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
// },
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{ label: "Tutorial", to: "/docs/intro" },
{
label: "Swagger",
to: "https://go-gin-boilerplate.gganbu.services/swagger/index.html",
},
],
},
{
title: "Community",
items: [
{
label: "GitHub",
href: "https://github.com/sanjayheaven/go-gin-boilerplate",
},
// {
// label: "Discord",
// href: "https://discordapp.com/invite/docusaurus",
// },
],
},
{
title: "More",
items: [
{
label: "Dorvan's Blog",
to: "https://blog.hdxsanjay.com",
},
// {
// label: "GitHub",
// href: "https://github.com/facebook/docusaurus",
// },
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Dorvan, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
Expand Down
Loading

0 comments on commit cead236

Please sign in to comment.