scherzma / Skunk

P2P Tor Chat App
GNU General Public License v3.0
4 stars 0 forks source link

Create folder structure. #9

Closed scherzma closed 6 months ago

scherzma commented 6 months ago

Implements hexagonal architecture folder structure (domain, application, adapters, infrastructure). Improves code organization, maintainability, and testability.

A few example files were added. These should be used, or deleted later on.

Closes #8

JavaHammes commented 6 months ago

What purpose has the adapter folder?

scherzma commented 6 months ago

The structure is strongly orientated towards that shown in the book "Get Your Hands Dirty on Clean Architecture". I assume we could (and maybe should) put application/ and adapter/ under cmd/.

go.mod should stay at the project root.

Like mentioned in #8 is this structure not complete and should be expanded in the future.

We can put the tests either in a test/ folder, or directly next to the service.

Adapters: The Domain/Business Logic defines an interface for storage, front end, ... This Interface gets implemented by an Adapter. The Adapter implements it and implements, for example, storage or networking. The Domain uses the Adapter with the pre-defined Interface and doesn't have to care about the implementation of storage or w/e. The adapter folder is split in in/ and out/ for input and output adapters. Like a UI as input and a Database as output.

image

JavaHammes commented 6 months ago

The structure is strongly orientated towards that shown in the book "Get Your Hands Dirty on Clean Architecture". I assume we could (and maybe should) put application/ and adapter/ under cmd/.

go.mod should stay at the project root.

Like mentioned in #8 is this structure not complete and should be expanded in the future.

We can put the tests either in a test/ folder, or directly next to the service.

Adapters: The Domain/Business Logic defines an interface for storage, front end, ... This Interface gets implemented by an Adapter. The Adapter implements it and implements, for example, storage or networking. The Domain uses the Adapter with the pre-defined Interface and doesn't have to care about the implementation of storage or w/e. The adapter folder is split in in/ and out/ for input and output adapters. Like a UI as input and a Database as output.

image

Then please add the cmd/ and test/ folder as well as the go.mod file. Otherwise this looks good to me!

scherzma commented 6 months ago

I pushed the changes.