Skip to content

Refactor/backend cleanup#142

Merged
tasaje1 merged 23 commits into
developmentfrom
refactor/backend-cleanup
Jun 1, 2026
Merged

Refactor/backend cleanup#142
tasaje1 merged 23 commits into
developmentfrom
refactor/backend-cleanup

Conversation

@tasaje1
Copy link
Copy Markdown
Collaborator

@tasaje1 tasaje1 commented May 27, 2026

Description

This PR refactors the backend package layout to a clearer feature-oriented structure with explicit layer boundaries (api, application, domain, infrastructure/shared).

Goal: improve maintainability, reduce package ambiguity, and make ownership/responsibilities easier to understand.

What Was Refactored

  • Split websocket responsibilities into feature APIs vs shared websocket infrastructure.
  • Consolidated lobby into:
    • lobby.api
    • lobby.application
    • lobby.domain
  • Consolidated game into:
    • game.api
    • game.application
    • game.domain
    • game.mapping
    • game.api.dto
  • Consolidated chat into:
    • chat.api
    • chat.application
    • chat.domain
    • chat.api.dto
  • Consolidated recovery into:
    • recovery.application
    • recovery.domain.snapshot
    • recovery.infrastructure
  • Moved shared technical config to:
    • shared.config
  • Moved websocket infrastructure to:
    • shared.websocket
  • Removed the legacy utility bucket by moving enums into feature-owned packages.

Key Class Renames

  • GameController -> LobbySocketController
  • CardDataTransferObject -> CardDto
  • GameStateDataTransferObject -> GameStateDto

Notes

  • Structural refactor only (no intended behavior change).
  • Imports/tests were updated to match the new package and type names.

Package Structure (High-Level)

backend
├─ shared
│  ├─ config
│  └─ websocket
├─ lobby
│  ├─ api
│  │  └─ dto
│  ├─ application
│  └─ domain
├─ game
│  ├─ api
│  │  └─ dto
│  ├─ application
│  ├─ domain
│  └─ mapping
├─ chat
│  ├─ api
│  │  └─ dto
│  ├─ application
│  └─ domain
└─ recovery
   ├─ application
   ├─ domain
   │  └─ snapshot
   └─ infrastructure

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@XtophB XtophB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, final warnings are fixed.
We have warnings about local field variables in some tests. Can be fixed in the future, we might need the variables in the future

Copy link
Copy Markdown
Collaborator

@the-only-queen-anna the-only-queen-anna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grundsätzlich LGTM; sehr saubere Struktur mMn.
LobbySocketController wird aber soweit ich weiß nie verwendet, eventuell überdenken, ob / wofür wir den noch brauchen (Stichwort reconnect?)

@tasaje1 tasaje1 merged commit 9e7478f into development Jun 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants