Skip to content

fwidjaya20/symphonic-skeleton

Repository files navigation

Symphonic Skeleton

Developer Guide

Installation

// Download the skeleton
git clone [email protected]:fwidjaya20/symphonic-skeleton.git [project-name] && rm -rf [project-name]/.git*

// Installation dependencies
cd [project-name] && go mod tidy

// Rename the module path
find . -type f \( -name "*.go" -o -name "go.mod" -o -name "go.sum" \) -exec sed -i '' 's|github.com/fwidjaya20/symphonic-skeleton|[your-module-path]|g' {} +

// Create .env environment configuration file
cp .env.example .env

Development

Supercharge your development workflow with these handy libraries. Install them effortlessly to streamline your coding process:

go install github.com/deepmap/oapi-codegen/cmd/[email protected]
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/segmentio/golines@latest
go install github.com/bombsimon/wsl/v4/cmd...@master
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

Enhance your project's code consistency by automating the application of Prettier formatting using GitHooks. Follow these steps to set it up:

./scripts/install-git-hooks.sh

Architecture

DDD proposes a Layered Architecture as a way to separate concerns and avoid responsibility confusion by splitting the codebase in 4 main layers: User Interface, Application, Domain, and Infrastructure.

The main rule here is that components in each layer should depend only on components in the same layer or any layer beneath it. Upper layers can use components of lower ones just by calling their public interfaces and lower layers can only communicate upwards by Inversion of Control (IoC).

  • User Interface Layer: is responsible for displaying data and capturing user’s commands. (Views, Controllers, CLI, etc.)
  • Application Layer: serves as an orchestrator of domain work, it does not know domain rules, but organizes and delegates domain objects to do their job. It is also the only layer accessible to other bounded contexts. (Commands, Command Handlers, etc.)
  • Domain Layer: holds the business logic and rules, as well as the business state. It is where the Domain Model lives. (Interfaces, Entities, Value Objects, Aggregates, Domain Services, etc.)
  • Infrastructure Layer: implements all the technical functionalities the application needs to support the higher layers, persistence, messaging, communication between layers, etc... (Repositories, Caching, External Integrations, etc.)

Even though not all layers are required in every system, the existence of the Domain Layer is a prerequisite in DDD.

Resources:

Example Implementation:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published