Skip to content

Commit 35dca94

Browse files
authored
Merge pull request #273 from MikeFalcon77/refactor/233-move_local_clients_last
chore(layout and doc): local clients moved under ./domain folders
2 parents 0503d35 + b6fd166 commit 35dca94

17 files changed

Lines changed: 63 additions & 124 deletions

File tree

docs/ARCHITECTURE_MANIFEST.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -252,26 +252,6 @@ hyperspot/
252252
Every module follows a **Domain-Driven Design (DDD-light)** structure:
253253

254254
```
255-
modules/<module-name>/
256-
├── Cargo.toml
257-
├── src/
258-
│ ├── lib.rs # Public exports
259-
│ ├── module.rs # Module struct + #[modkit::module(...)]
260-
│ ├── config.rs # Typed module config
261-
│ ├── local_client.rs # Local adapter implementing an SDK API trait (optional)
262-
│ ├── api/
263-
│ │ └── rest/
264-
│ │ ├── dto.rs # REST-only DTOs (serde + ToSchema)
265-
│ │ ├── handlers.rs # Thin HTTP handlers
266-
│ │ ├── routes.rs # Route + OpenAPI registration (OperationBuilder)
267-
│ │ ├── error.rs # DomainError -> Problem mapping
268-
│ │ └── mappers.rs # DTO <-> domain mapping
269-
│ ├── domain/ # Business logic
270-
│ └── infra/ # Infrastructure adapters (optional)
271-
├── tests/ # Optional
272-
└── (optional extras: gts/, openspec/, build.rs, etc.)
273-
274-
# SDK pattern (used by e.g. `modules/system/types-registry/` and `examples/modkit/users_info/`)
275255
modules/<module-dir>/
276256
├── <module-name>-sdk/
277257
│ ├── Cargo.toml
@@ -285,13 +265,21 @@ modules/<module-dir>/
285265
└── <module-name>/
286266
├── Cargo.toml
287267
└── src/
288-
├── lib.rs # Re-exports SDK + module struct
289-
├── module.rs # Module struct + #[modkit::module(...)]
290-
├── config.rs
291-
├── local_client.rs
268+
├── lib.rs # Public exports
269+
├── module.rs # Module struct + #[modkit::module(...)]
270+
├── config.rs # Typed module config
292271
├── api/
293-
├── domain/
294-
└── infra/
272+
│ └── rest/
273+
│ ├── dto.rs # REST-only DTOs (serde + ToSchema)
274+
│ ├── handlers.rs # Thin HTTP handlers
275+
│ ├── routes.rs # Route + OpenAPI registration (OperationBuilder)
276+
│ ├── error.rs # DomainError -> Problem mapping
277+
│ └── mappers.rs # DTO <-> domain mapping
278+
├── domain/ # Business logic
279+
├── local_client.rs # Local adapter implementing an SDK API trait (optional)
280+
├── infra/ # Infrastructure adapters (optional)
281+
├── tests/ # Optional
282+
└── (optional extras: gts/, openspec/, build.rs, etc.)
295283
```
296284

297285
Additional common patterns (see `examples/`):

docs/MODKIT_PLUGINS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ modules/<gateway-name>/
220220
│ ├── lib.rs # Re-exports SDK + module struct
221221
│ ├── module.rs # Module declaration, init, REST registration
222222
│ ├── config.rs # Gateway config (e.g., vendor selection)
223-
│ ├── local_client.rs # Public client adapter (implements PublicClient)
224223
│ ├── api/rest/ # REST handlers, DTOs, routes
225224
│ └── domain/
226225
│ ├── service.rs # Plugin resolution and delegation
226+
│ ├── local_client.rs # Public client adapter (implements PublicClient)
227227
│ └── error.rs # Domain errors
228228
229229
└── plugins/ # Plugin implementations

examples/modkit/users_info/users_info/src/infra/local_client/addresses.rs renamed to examples/modkit/users_info/users_info/src/domain/local_client/addresses.rs

File renamed without changes.

examples/modkit/users_info/users_info/src/infra/local_client/cities.rs renamed to examples/modkit/users_info/users_info/src/domain/local_client/cities.rs

File renamed without changes.

examples/modkit/users_info/users_info/src/infra/local_client/client.rs renamed to examples/modkit/users_info/users_info/src/domain/local_client/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use user_info_sdk::{
1010
UpdateUserRequest, User, UserFull, UsersInfoClient, UsersInfoError,
1111
};
1212

13-
use crate::infra::local_client::{
13+
use crate::domain::local_client::{
1414
addresses::LocalAddressesStreamingClient, cities::LocalCitiesStreamingClient,
1515
users::LocalUsersStreamingClient,
1616
};

examples/modkit/users_info/users_info/src/infra/local_client/mod.rs renamed to examples/modkit/users_info/users_info/src/domain/local_client/mod.rs

File renamed without changes.

examples/modkit/users_info/users_info/src/infra/local_client/users.rs renamed to examples/modkit/users_info/users_info/src/domain/local_client/users.rs

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod error;
22
pub mod events;
3+
pub mod local_client;
34
pub mod ports;
45
pub mod repos;
56
pub mod service;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
pub mod audit;
2-
pub mod local_client;
32
pub mod storage;

examples/modkit/users_info/users_info/src/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use crate::api::rest::routes;
2121
use crate::api::rest::sse_adapter::SseUserEventPublisher;
2222
use crate::config::UsersInfoConfig;
2323
use crate::domain::events::UserDomainEvent;
24+
use crate::domain::local_client::client::UsersInfoLocalClient;
2425
use crate::domain::ports::{AuditPort, EventPublisher};
2526
use crate::domain::service::{AppServices, ServiceConfig};
2627
use crate::infra::audit::HttpAuditClient;
27-
use crate::infra::local_client::client::UsersInfoLocalClient;
2828
use crate::infra::storage::{OrmAddressesRepository, OrmCitiesRepository, OrmUsersRepository};
2929

3030
/// Type alias for the concrete `AppServices` type used with ORM repositories.

0 commit comments

Comments
 (0)