2.7k sao GitHub và vẫn tăng — gothinkster/golang-gin-realworld-example-app là dự án Go mà TopGit đang theo dõi trên nền tảng. Exemplary real world application built with Golang + Gin
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Golang/Gin codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with Golang/Gin including CRUD operations, authentication, routing, pagination, and more.
Recent Updates
This project has been modernized with the following updates:
Go 1.21+: Updated from Go 1.15 to require Go 1.21 or higher
GORM v2: Migrated from deprecated jinzhu/gorm v1 to gorm.io/gorm v2
JWT v5: Updated from deprecated dgrijalva/jwt-go to golang-jwt/jwt/v5 (fixes CVE-2020-26160)
Validator v10: Updated validator tags and package to match gin v1.10.0
Latest Dependencies: All dependencies updated to their 2025 production-stable versions
RealWorld API Spec Compliance:
GET /profiles/:username now supports optional authentication (anonymous access allowed)
POST /users/login returns 401 Unauthorized on failure (previously 403)
GET /articles/feed registered as dedicated authenticated route
DELETE /articles/:slug and DELETE /articles/:slug/comments/:id return empty response body
Test Coverage
The project maintains high test coverage across all core packages:
Package
Coverage
articles
93.4%
users
99.5%
common
85.7%
Total
90.0%
To generate a coverage report locally, run:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
Dependencies (2025 Stable Versions)
Package
Version
Release Date
Known Issues
gin-gonic/gin
v1.10.0
2024-05
None; v1.11 has experimental HTTP/3 support
gorm.io/gorm
v1.25.12
2024-08
None; v1.30+ has breaking changes
golang-jwt/jwt/v5
v5.2.1
2024-06
None; v5.3 only bumps Go version requirement
go-playground/validator/v10
v10.24.0
2024-12
None; v10.30+ requires Go 1.24
golang.org/x/crypto
v0.32.0
2025-01
None; keep updated for security fixes
gorm.io/driver/sqlite
v1.5.7
2024-09
None; requires cgo; use glebarez/sqlite for pure Go
gosimple/slug
v1.15.0
2024-12
None
stretchr/testify
v1.10.0
2024-10
None; v2 still in development
Directory structure
.
├── gorm.db
├── hello.go
├── common
│ ├── utils.go //small tools function
│ └── database.go //DB connect manager
├── users
| ├── models.go //data models define & DB operation
| ├── serializers.go //response computing & format
| ├── routers.go //business logic & router binding
| ├── middlewares.go //put the before & after logic of handle request
| └── validators.go //form/json checker
├── ...
...
Getting started
Install Golang
Make sure you have Go 1.21 or higher installed.
https://golang.org/doc/install
Environment Config
Environment variables can be set directly in your shell or via a .env file (requires a tool like source or direnv).
Available environment variables:
PORT=8080 # Server port (default: 8080)
GIN_MODE=debug # Gin mode: debug or release
DB_PATH=./data/gorm.db # SQLite database path (default: ./data/gorm.db)
TEST_DB_PATH=./data/test.db # Optional: SQLite database path used for tests
Example usage:
# Option 1: Set environment variables directly
export PORT=3000
export DB_PATH=./data/myapp.db
go run hello.go
# Option 2: Inline with command
PORT=3000 go run hello.go
See .env.example for a complete template.
Install Dependencies
From the project root, run:
go build ./...
go test ./...
go mod tidy
Run the Server
# Using default port 8080
go run hello.go
# Using custom port
PORT=3000 go run hello.go
Testing
From the project root, run:
go test ./...
API spec tests (Hurl & Bruno)
This backend passes the full RealWorld API spec test suite,
available in two flavors (Hurl is the source of truth; the Bruno collection is generated from it).
The run-spec-tests.sh script downloads the specs at a pinned commit (sha256-verified tarball, go.sum-style),
builds the app, starts a temporary server and runs the chosen suite against it:
# Hurl (requires https://hurl.dev)
bash ./scripts/run-spec-tests.sh hurl
# Bruno (requires node/npx or bun)
bash ./scripts/run-spec-tests.sh bruno
Both suites run in CI (hurl-api-test and bruno-api-test jobs) and are the authoritative compliance check.
(They replace the retired upstream Postman/Newman collection, which asserted a strict subset of the same behavior.)
To bump the spec version, update SPECS_REF_DEFAULT (upstream commit) and SPECS_SHA256_DEFAULT
(tarball checksum) in scripts/run-spec-tests.sh. To try a different version ad hoc:
SPECS_REF=main bash ./scripts/run-spec-tests.sh hurl (checksum verification is skipped unless you
also pass SPECS_SHA256). A weekly spec-drift workflow runs the suite against upstream main
so we notice when the spec moves without blocking PRs.
or
go test ./... -cover
or
go test -v ./... -cover
depending on whether you want to see test coverage and how verbose the output you want.
Todo
More elegance config
ProtoBuf support
Code structure optimize (I think some place can use interface)
Continuous integration (done)
Test Coverage
Current test coverage (2026):
Total: 89.2%
articles: 92.1%
users: 99.5%
common: 85.7%
Run coverage report:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
gothinkster/golang-gin-realworld-example-app thuộc nhóm API trên TopGit, cùng 20 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về gothinkster/golang-gin-realworld-example-app ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/gothinkster/golang-gin-realworld-example-app là nguồn chính thức.
gothinkster/golang-gin-realworld-example-app có phải mã nguồn mở không?
Có — gothinkster/golang-gin-realworld-example-app phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/gothinkster/golang-gin-realworld-example-app.
gothinkster/golang-gin-realworld-example-app là gì?
gothinkster/golang-gin-realworld-example-app (gothinkster/golang-gin-realworld-example-app) là dự án Go trên GitHub. Theo mô tả gốc: Exemplary real world application built with Golang + Gin
gothinkster/golang-gin-realworld-example-app so với các dự án API khác thế nào?
gothinkster/golang-gin-realworld-example-app được TopGit xếp vào nhóm API, với 2.7k sao GitHub và viết bằng Go. Xem trang chủ đề API trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Vì sao gothinkster/golang-gin-realworld-example-app được xếp vào nhóm API?
TopGit xếp gothinkster/golang-gin-realworld-example-app vào nhóm API dựa trên GitHub topics và mô tả của repo (gắn thẻ: "api", "best", "best-practices"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc golang-gin-realworld-example-app có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về golang-gin-realworld-example-app.