# xinliangnote/go-gin-api

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/xinliangnote-go-gin-api).**

5,967 stars · 1,125 forks · Go · MIT

## Links

- GitHub: https://github.com/xinliangnote/go-gin-api
- Homepage: https://www.yuque.com/xinliangnote/go-gin-api/ngc3x5
- awesome-repositories: https://awesome-repositories.com/repository/xinliangnote-go-gin-api.md

## Topics

`api-gin` `cron` `gin` `gin-api` `go` `golang` `gorm` `graphql` `jaeger` `jwt` `pprof` `prometheus` `swagger` `trace` `viper` `zap`

## Description

go-gin-api is an API framework built on the Gin HTTP router that integrates common middleware and tools for rapid business development. It provides a modular structure for organizing API handlers and middleware, with built-in support for JWT token authentication to secure endpoints and GORM for database object-relational mapping and operations.

The framework includes a gRPC service component for inter-service communication, along with middleware for collecting Prometheus metrics and generating Swagger API documentation from code annotations. It also features OpenTelemetry trace propagation for distributed request tracing across services, panic recovery middleware for structured error responses, and Viper-based configuration management for loading settings from YAML, JSON, or environment variables.

Additional capabilities include Zap structured logging for high-performance log processing, enabling monitoring and observability through trace visualization and Prometheus metric exposure.

## Tags

### Software Engineering & Architecture

- [Gin-Based Modular Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/modular-architecture-frameworks/gin-based-modular-frameworks.md) — Organizes API handlers and middleware into reusable modules around the Gin HTTP router for clean separation of concerns.
- [Structured Logging](https://awesome-repositories.com/f/software-engineering-architecture/structured-logging.md) — Collects application logs with leveled, structured output using the Zap library for high-performance log processing.

### Web Development

- [Gin-Based Frameworks](https://awesome-repositories.com/f/web-development/api-frameworks/gin-based-frameworks.md) — An API framework built on Gin that integrates common middleware and tools for rapid business development.
- [Interactive Document Generators](https://awesome-repositories.com/f/web-development/api-schema-endpoints/interactive-document-generators.md) — Tool that automatically generates interactive API documentation from code annotations.
- [Panic Recovery](https://awesome-repositories.com/f/web-development/error-handling/panic-recovery.md) — Catches runtime panics in HTTP handlers and returns a structured error response instead of crashing the server.

### Data & Databases

- [Relational Database Abstractions](https://awesome-repositories.com/f/data-databases/relational-database-abstractions.md) — Maps Go structs to database tables and provides CRUD operations, migrations, and query building through the GORM ORM library.
- [Relational Database Integrations](https://awesome-repositories.com/f/data-databases/relational-database-integrations.md) — Database component that uses GORM for object-relational mapping and database operations.

### DevOps & Infrastructure

- [Viper-Based Configurations](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/environment-management/environment-variable-management/environment-variable-configurations/environment-variable-configuration/viper-based-configurations.md) — Loads application settings from YAML, JSON, or environment variables using the Viper library for runtime configuration.

### Security & Cryptography

- [JWT Authentications](https://awesome-repositories.com/f/security-cryptography/token-authentication/jwt-authentications.md) — Middleware that validates JSON Web Tokens to secure API endpoints with signature verification.

### System Administration & Monitoring

- [Application Metrics Exporters](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/prometheus-system-metrics-exporters/application-metrics-exporters.md) — Exposes HTTP request counters, latency histograms, and error rates as Prometheus metrics for monitoring and alerting.
- [Application Metrics Exporters](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/application-metrics-exporters.md) — Middleware that exposes application performance metrics in Prometheus format for monitoring.

### Networking & Communication

- [gRPC Service Implementations](https://awesome-repositories.com/f/networking-communication/polyglot-client-support/grpc-implementations/grpc-service-implementations.md) — Framework component that enables building and consuming gRPC services for inter-service communication.
- [Tracing Context Propagation](https://awesome-repositories.com/f/networking-communication/tracing-context-propagation.md) — Injects and extracts trace context across HTTP requests to enable distributed tracing through OpenTelemetry-compatible backends.

### Testing & Quality Assurance

- [Distributed Request Tracing](https://awesome-repositories.com/f/testing-quality-assurance/api-call-loggers/distributed-request-tracing.md) — Trace API calls across services by propagating context and visualizing request flows in a distributed tracing backend. ([source](https://github.com/xinliangnote/go-gin-api/blob/master/docs/jaeger.md))
