go-realworld-clean

a clean architecture implementation of the realworldapp : https://github.com/gothinkster/realworld

Github星跟蹤圖

RealWorld Example App

Golang clean-architecture codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

Demo    RealWorld

This codebase was created to demonstrate a fully fledged fullstack application built with go including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the go community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

Build Status
BCH compliance
Codacy Badge
codecov

How it works

Clean Architecture :

Layers ( from the most abstract to the most concrete ) :

  • domain : abstract data structures
  • uc : "use cases", the pure business logic
  • implem : implementations of the interfaces used in the business logic (uc layer)
  • infra : setup/configuration of the implementation

Golden rules :

  • a layer never imports something from a layer below it
  • 3rd-party libraries are forbidden in the 2 topmost layers

Benefits :

  • flexibility
  • testability

Getting started

Build the app

make

Run the app

./go-realworld-clean

Run the integration tests

Start the server with an existing user

./go-realworld-clean --populate=true

In another terminal, run the tests against the API

newman run api/Conduit.postman_collection.json \
  -e api/Conduit.postman_integration_test_environment.json \
  --global-var "EMAIL=joe@what.com" \
  --global-var "PASSWORD=password"

Additional

Make Targets

The version is either 0.1.0 if no tag has ever been defined or the latest
tag defined. The build number is the SHA1 of the latest commit.

  • make: Builds and injects version/build in binary
  • make init: Sets the pre-commit hook in the repository
  • make docker: Build docker image and tag it with both latest and version
  • make latest: Build docker image and tag it only with latest
  • make test: Executes the test suite
  • make mock: Generate the necessary mocks
  • make clean: Removes the built binary if present

主要指標

概覽
名稱與所有者err0r500/go-realworld-clean
主編程語言Go
編程語言Shell (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2018-07-22 19:53:26
推送於2023-06-05 02:05:00
最后一次提交2023-04-10 16:25:17
發布數0
用户参与
星數521
關注者數15
派生數81
提交數45
已啟用問題?
問題數8
打開的問題數2
拉請求數3
打開的拉請求數5
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?