feat: define clean architecture layers and ports

This commit is contained in:
donghyeon-ka
2026-07-25 20:39:59 +09:00
parent 24d7072d66
commit 49b20bd557
11 changed files with 227 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/**
* Application facade factory. Concrete dependencies are supplied by bootstrap.
*
* @param {{
* resources: {
* query: import("./ports/resource-ports.js").ResourceQueryPort<unknown, unknown>,
* command: import("./ports/resource-ports.js").ResourceCommandPort<unknown, unknown>
* },
* cache: import("./ports/query-cache-port.js").QueryCachePort,
* storage: import("./ports/storage-port.js").StoragePort,
* telemetry: import("./ports/telemetry-port.js").TelemetryPort
* }} ports
*/
export function createApplication(ports) {
return Object.freeze({
resources: Object.freeze({
query: (query, context) => ports.resources.query.execute(query, context),
command: (command, context) => ports.resources.command.execute(command, context),
}),
cache: ports.cache,
storage: ports.storage,
telemetry: ports.telemetry,
});
}