Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brittonhayes/staffing

This is an example of a staffing service for a fictional consulting company. It is an implementation of Domain Driven Design and Clean Architecture.
https://github.com/brittonhayes/staffing

cqrs ddd event-sourcing golang

Last synced: 10 days ago
JSON representation

This is an example of a staffing service for a fictional consulting company. It is an implementation of Domain Driven Design and Clean Architecture.

Awesome Lists containing this project

README

        

# Staffing Service

[![Go Reference](https://pkg.go.dev/badge/github.com/brittonhayes/staffing.svg)](https://pkg.go.dev/github.com/brittonhayes/staffing)
![Latest Release](https://img.shields.io/github/v/release/brittonhayes/staffing?label=latest%20release)
[![Go Report Card](https://goreportcard.com/badge/github.com/brittonhayes/staffing)](https://goreportcard.com/report/github.com/brittonhayes/staffing)

This is an example of a staffing service for a fictional consulting company. It is an implementation of [Domain Driven Design](https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215) and [Clean Architecture](https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164).

The structure of the service is based off [github.com/marcusolsson/goddd by Marcus Olsson](https://github.com/marcusolsson/goddd).

## Usage

```bash
# Clone the repository
gh repo clone brittonhayes/staffing

# Run the service with default settings
go run ./cmd/staffd/main.go
```

### Configuration

The service can be run with a few different customization options. These options can be set with environment variables or command line flags.

```bash
# OR run the service with in-memory storage and debug logging
go run ./cmd/staffd/main.go -storage inmem -debug
# OR run the service with sqlite storage and debug logging
go run ./cmd/staffd/main.go -storage sqlite -debug
```

## Docker

```bash
# Build the image
docker build -t ghcr.io/brittonhayes/staffing:latest .

# Run the image
docker run ghcr.io/brittonhayes/staffing:latest
```

## Docker Compose

You can run with docker-compose see how the service integrates with external metrics or storage services like prometheus or postgres.

```bash
# Run the service with docker-compose
docker-compose up
```

## Development

```bash
# Clone the repository
gh repo clone brittonhayes/staffing
cd ./staffing

# Checkout to a new branch
git checkout -b feat/my-new-feature

# Commit your changes
git commit -am "feat:Add some feature"

# Create a PR
gh pr create -w
```

## Resources

### Articles

- http://www.citerus.se/go-ddd
- http://www.citerus.se/part-2-domain-driven-design-in-go
- http://www.citerus.se/part-3-domain-driven-design-in-go