#2121st of 21 in Backends, databases and hosting

go-backend-clean-architecture

Go REST API template with Gin, MongoDB and JWT auth in layers

Stars
6.2k
License
Apache-2.0
Last commit
Feb 2026
Language
Go
Stars, last 29 weeks+325
31 Mar 2026: 5,839 stars7 Apr 2026: 5,845 stars14 Apr 2026: 5,854 stars21 Apr 2026: 5,860 stars28 Apr 2026: 5,903 stars5 May 2026: 5,936 stars12 May 2026: 5,946 stars19 May 2026: 5,965 stars26 May 2026: 5,979 stars2 Jun 2026: 5,988 stars9 Jun 2026: 5,998 stars16 Jun 2026: 6,006 stars23 Jun 2026: 6,009 stars30 Jun 2026: 6,056 stars7 Jul 2026: 6,065 stars14 Jul 2026: 6,077 stars21 Jul 2026: 6,087 stars28 Jul 2026: 6,092 stars4 Aug 2026: 6,098 stars11 Aug 2026: 6,105 stars18 Aug 2026: 6,113 stars25 Aug 2026: 6,122 stars1 Sept 2026: 6,127 stars8 Sept 2026: 6,132 stars15 Sept 2026: 6,137 stars22 Sept 2026: 6,144 stars29 Sept 2026: 6,152 stars6 Oct 2026: 6,157 stars13 Oct 2026: 6,162 stars20 Oct 2026: 6,164 stars

5,839 on 31 Mar 20266,164 on 20 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

A Go backend template organized into router, controller, usecase, repository and domain layers. It ships signup, login, refresh-token, profile and task endpoints on Gin, with MongoDB storage, JWT access and refresh tokens, bcrypt hashing and Viper .env configuration. Unit tests use Testify with Mockery-generated mocks. It has no AI features.

Who it is for: Go developers who want a layered REST API starter with JWT auth

Strengths

  • Clear layer separation behind interfaces, so usecases and repositories are mockable in tests
  • JWT middleware with access and refresh token flow already implemented
  • Runs with go run or docker-compose; API served on port 8080
  • Postman API docs and curl examples for every endpoint

Weaknesses

  • Only MongoDB is supported; other databases need a rewritten repository layer
  • Small example domain: users and tasks only, no billing or roles
  • Test coverage is thin; README lists more test cases as a TODO
  • No tagged releases

What it needs

  • no GPU
  • Docker + Compose
  • Needs MongoDB, Go, Docker (optional)
  • port 8080

Also in Backends, databases and hosting

See all 21
Also in Backends, databases and hosting
RankProjectScore
1appwriteSelf-hostable backend with auth, databases, storage, functions, messaging and hosting Live demo ↗ (opens in a new tab)57.7k starsBSD-3-Clause94 out of 100
2dokploySelf-hosted PaaS for deploying apps and databases across Docker Swarm nodes Live demo ↗ (opens in a new tab)37.9k starscustom license85 out of 100
3dokkuSelf-hosted mini-Heroku PaaS that deploys apps with git push32.2k starsMIT77 out of 100
#4pocketbaseGo backend with embedded SQLite, auth, file storage and admin UI61.5k starsMIT76 out of 100
#5spacetimedbRelational database that runs your app logic as modules and syncs clients live25.3k starscustom license75 out of 100