refactor: DDD/CQRS architecture, unified crate layout

- crates: common→application, api→presentation, infrastructure/*→adapters/*
- new crates: api-types, infra-wiring
- domain: errors/, models/, value_objects/, ports/, services/
- application: CQRS use cases (songs/, tabs/) w/ commands, queries, deps
- unified DomainError replaces RepositoryError
- workspace deps, unused dep cleanup
- fix: parse plain-text chord lines (UG drops spans mid-song)
- tests extracted to separate modules (tests/ dirs)
This commit is contained in:
2026-07-11 21:02:10 +02:00
parent a520251dab
commit d13df586dd
74 changed files with 1493 additions and 1076 deletions

136
Cargo.lock generated
View File

@@ -24,23 +24,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
[[package]]
name = "api"
name = "api-types"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",
"common",
"domain",
"persistence",
"rand 0.10.0",
"serde",
"serde_json",
"thiserror 2.0.18",
"tokio",
"tower-http",
"tracing",
"tracing-subscriber",
"ug-parser",
]
[[package]]
name = "application"
version = "0.1.0"
dependencies = [
"domain",
"uuid",
]
@@ -240,17 +234,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chacha20"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
"rand_core 0.10.0",
]
[[package]]
name = "cmake"
version = "0.1.58"
@@ -270,23 +253,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "common"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"domain",
"rand 0.10.0",
"reqwest",
"serde",
"serde_json",
"thiserror 2.0.18",
"tokio",
"tracing",
"uuid",
]
[[package]]
name = "concurrent-queue"
version = "2.5.0"
@@ -337,15 +303,6 @@ dependencies = [
"libc",
]
[[package]]
name = "cpufeatures"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
dependencies = [
"libc",
]
[[package]]
name = "crc"
version = "3.4.0"
@@ -458,12 +415,9 @@ dependencies = [
name = "domain"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"rand 0.10.0",
"serde",
"thiserror 2.0.18",
"tracing",
"uuid",
]
@@ -745,7 +699,6 @@ dependencies = [
"cfg-if",
"libc",
"r-efi 6.0.0",
"rand_core 0.10.0",
"wasip2",
"wasip3",
]
@@ -1081,6 +1034,10 @@ dependencies = [
"serde_core",
]
[[package]]
name = "infra-wiring"
version = "0.1.0"
[[package]]
name = "ipnet"
version = "2.12.0"
@@ -1452,23 +1409,6 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "persistence"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"common",
"domain",
"rand 0.10.0",
"serde_json",
"sqlx",
"thiserror 2.0.18",
"tokio",
"tracing",
"uuid",
]
[[package]]
name = "phf"
version = "0.11.3"
@@ -1584,6 +1524,24 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "presentation"
version = "0.1.0"
dependencies = [
"api-types",
"application",
"axum",
"domain",
"infra-wiring",
"sqlite",
"tokio",
"tower-http",
"tracing",
"tracing-subscriber",
"ug-parser",
"uuid",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -1701,17 +1659,6 @@ dependencies = [
"rand_core 0.9.5",
]
[[package]]
name = "rand"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
dependencies = [
"chacha20",
"getrandom 0.4.2",
"rand_core 0.10.0",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
@@ -1750,12 +1697,6 @@ dependencies = [
"getrandom 0.3.4",
]
[[package]]
name = "rand_core"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba"
[[package]]
name = "redox_syscall"
version = "0.5.18"
@@ -2126,7 +2067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
"cfg-if",
"cpufeatures 0.2.17",
"cpufeatures",
"digest",
]
@@ -2137,7 +2078,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
"cfg-if",
"cpufeatures 0.2.17",
"cpufeatures",
"digest",
]
@@ -2226,6 +2167,17 @@ dependencies = [
"der",
]
[[package]]
name = "sqlite"
version = "0.1.0"
dependencies = [
"async-trait",
"domain",
"serde_json",
"sqlx",
"uuid",
]
[[package]]
name = "sqlx"
version = "0.8.6"
@@ -2801,12 +2753,10 @@ checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
name = "ug-parser"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"domain",
"reqwest",
"scraper",
"thiserror 2.0.18",
"tokio",
]