clean-architecture-with-go

command module
v0.0.0-...-a6c5799 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 2 Imported by: 0

README ¶

Template project of Clean-Architecture

This is a simple CRUD application build on a Clean-Architecture written in Golang.

🚩 DEMO

1. use Docker to set up an environment to run the application
> make init
> make up 
2. Call API by curl command
create
> curl -i -XPOST -d '{"title": "test", "body": "this is a test article"}' localhost:8080/articles
read
> curl -i -XGET localhost:8080/articles
> curl -i -XGET localhost:8080/articles/1
update
> curl -i -XPUT -d '{"title": "updated title", "body": "this article is updated"}' localhost:8080/articles/1
delete
> curl -i -XDELETE localhost:8080/articles/1

📖 Explanation

cleanarchitecture

layer directory
Enterprise Business Rules entities
Application Business Rules usecase
Interface Adapters adapter
Frameworks & Drivers driver
Enterprise Business Rules

Core business rules are implemented in this layer.

Application Business Rules

By describing the business logic API, this layer expresses what this software will achieve.

Interface Adapters

This layer describes the input(controller), output(presenter) and data presistence process(gateway).

Frameworks & Drivers

This layer describes establishing DB connections, configuring routing and using the framework.

Documentation ¶

The Go Gopher

There is no documentation for this package.

Directories ¶

Path Synopsis
adapter
usecase

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL