TopGit theo dõi amitshekhariitbhu/go-backend-clean-architecture trên GitHub trong nhóm Backend, đã đạt 6.2k sao. A Go (Golang) Backend Clean Architecture project with Gin, MongoDB, JWT Authentication Middleware, Test, and Docker.
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.
A Go (Golang) Backend Clean Architecture project with Gin, MongoDB, JWT Authentication Middleware, Test, and Docker.
You can use this project as a template to build your Backend project in the Go language on top of this project.
Before creating this project, I have gone through more than 20 projects related to the Go(Golang) Clean Architecture on GitHub.
Thanks to all those projects, I learned a lot from all of those. As I keep saying:
The best way to learn to code is to code. But, to write good code, you will also have to read good code. Make a habit of reading good code. You can find many open-source projects on GitHub and start reading.
Then for the implementation part, I combined all of my ideas, experiences, and learnings from those projects to create this project.
And as always I would love to get feedback on my project. This helps everyone and most importantly me.
Learn about this project architecture in detail from the blogs mentioned below:
Go Backend Clean Architecture
Go JWT Authentication Middleware
Configuration with Viper in Go
Test with Testify and Mockery in Go
Database Normalization vs Denormalization
Architecture Layers of the project
Router
Controller
Usecase
Repository
Domain
About me
Hi, I am Amit Shekhar, Founder @ Outcome School • IIT 2010-14 • I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.
Follow Amit Shekhar
X/Twitter
LinkedIn
GitHub
Follow Outcome School
YouTube
X/Twitter
LinkedIn
GitHub
I teach at Outcome School
AI and Machine Learning
Android
Join Outcome School and get a high-paying tech job: Outcome School
System Design Playlist on YouTube
We have launched our YouTube channel. Subscribe to the Outcome School YouTube Channel
What is System Design?
Twitter Timeline Design with Fanout Approach - System Design
HTTP Request vs HTTP Long-Polling vs WebSocket vs Server-Sent Events
Prepare for Machine Learning Interview: Machine Learning Interview Questions
Major Packages used in this project
gin: Gin is an HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need a smashing performance, get yourself some Gin.
mongo go driver: The Official Golang driver for MongoDB.
jwt: JSON Web Tokens are an open, industry-standard RFC 7519 method for representing claims securely between two parties. Used for Access Token and Refresh Token.
viper: For loading configuration from the .env file. Go configuration with fangs. Find, load, and unmarshal a configuration file in JSON, TOML, YAML, HCL, INI, envfile, or Java properties formats.
testify: A toolkit with common assertions and mocks that plays nicely with the standard library.
mockery: A mock code autogenerator for Golang used in testing.
Check more packages in go.mod.
Public API Request Flow without JWT Authentication Middleware
Private API Request Flow with JWT Authentication Middleware
JWT Authentication Middleware for Access Token Validation.
How to run this project?
We can run this Go Backend Clean Architecture project with or without Docker. Here, I am providing both ways to run this project.
Clone this project
# Move to your workspace
cd your-workspace
# Clone this project into your workspace
git clone https://github.com/amitshekhariitbhu/go-backend-clean-architecture.git
# Move to the project root directory
cd go-backend-clean-architecture
Run without Docker
Create a file .env similar to .env.example at the root directory with your configuration.
Install go if not installed on your machine.
Install MongoDB if not installed on your machine.
Important: Change the DB_HOST to localhost (DB_HOST=localhost) in .env configuration file. DB_HOST=mongodb is needed only when you run with Docker.
Run go run cmd/main.go.
Access API using http://localhost:8080
Run with Docker
Create a file .env similar to .env.example at the root directory with your configuration.
Install Docker and Docker Compose.
Run docker-compose up -d.
Access API using http://localhost:8080
How to run the test?
# Run all tests
go test ./...
How to generate the mock code?
In this project, to test, we need to generate mock code for the use-case, repository, and database.
# Generate mock code for the usecase and repository
mockery --dir=domain --output=domain/mocks --outpkg=mocks --all
# Generate mock code for the database
mockery --dir=mongo --output=mongo/mocks --outpkg=mocks --all
Whenever you make changes in the interfaces of these use-cases, repositories, or databases, you need to run the corresponding command to regenerate the mock code for testing.
Always try to update with the latest version of the packages used.
If this project helps you in anyway, show your love ❤️ by putting a ⭐ on this project ✌️
License
Copyright (C) 2025 Amit Shekhar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
amitshekhariitbhu/go-backend-clean-architecture có bao nhiêu sao?
amitshekhariitbhu/go-backend-clean-architecture có 6.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/amitshekhariitbhu/go-backend-clean-architecture. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
amitshekhariitbhu/go-backend-clean-architecture có phải mã nguồn mở không?
Có — amitshekhariitbhu/go-backend-clean-architecture phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/amitshekhariitbhu/go-backend-clean-architecture.
amitshekhariitbhu/go-backend-clean-architecture còn đang phát triển không?
Commit gần nhất trên amitshekhariitbhu/go-backend-clean-architecture là 7 tháng trước (theo timestamp GitHub). Repo có 677 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
amitshekhariitbhu/go-backend-clean-architecture là gì?
amitshekhariitbhu/go-backend-clean-architecture (amitshekhariitbhu/go-backend-clean-architecture) là dự án Go trên GitHub. Theo mô tả gốc: A Go (Golang) Backend Clean Architecture project with Gin, MongoDB, JWT Authentication Middleware, Test, and Docker.
amitshekhariitbhu/go-backend-clean-architecture so với các dự án Backend khác thế nào?
amitshekhariitbhu/go-backend-clean-architecture được TopGit xếp vào nhóm Backend, với 6.2k sao GitHub và viết bằng Go. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc thêm về amitshekhariitbhu/go-backend-clean-architecture ở đâ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/amitshekhariitbhu/go-backend-clean-architecture là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc go-backend-clean-architecture 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ề go-backend-clean-architecture.