@ironbackend/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +33 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +123 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/rules/index.d.ts +36 -0
  7. package/dist/rules/index.d.ts.map +1 -0
  8. package/dist/rules/index.js +505 -0
  9. package/dist/rules/index.js.map +1 -0
  10. package/dist/security/index.d.ts +15 -0
  11. package/dist/security/index.d.ts.map +1 -0
  12. package/dist/security/index.js +243 -0
  13. package/dist/security/index.js.map +1 -0
  14. package/dist/stacks/index.d.ts +38 -0
  15. package/dist/stacks/index.d.ts.map +1 -0
  16. package/dist/stacks/index.js +193 -0
  17. package/dist/stacks/index.js.map +1 -0
  18. package/dist/styles/clean-monolith.d.ts +7 -0
  19. package/dist/styles/clean-monolith.d.ts.map +1 -0
  20. package/dist/styles/clean-monolith.js +124 -0
  21. package/dist/styles/clean-monolith.js.map +1 -0
  22. package/dist/styles/event-driven.d.ts +12 -0
  23. package/dist/styles/event-driven.d.ts.map +1 -0
  24. package/dist/styles/event-driven.js +247 -0
  25. package/dist/styles/event-driven.js.map +1 -0
  26. package/dist/styles/hexagonal.d.ts +7 -0
  27. package/dist/styles/hexagonal.d.ts.map +1 -0
  28. package/dist/styles/hexagonal.js +146 -0
  29. package/dist/styles/hexagonal.js.map +1 -0
  30. package/dist/styles/index.d.ts +33 -0
  31. package/dist/styles/index.d.ts.map +1 -0
  32. package/dist/styles/index.js +75 -0
  33. package/dist/styles/index.js.map +1 -0
  34. package/dist/styles/microservices.d.ts +12 -0
  35. package/dist/styles/microservices.d.ts.map +1 -0
  36. package/dist/styles/microservices.js +218 -0
  37. package/dist/styles/microservices.js.map +1 -0
  38. package/dist/styles/modular-monolith.d.ts +7 -0
  39. package/dist/styles/modular-monolith.d.ts.map +1 -0
  40. package/dist/styles/modular-monolith.js +131 -0
  41. package/dist/styles/modular-monolith.js.map +1 -0
  42. package/dist/styles/specialized.d.ts +17 -0
  43. package/dist/styles/specialized.d.ts.map +1 -0
  44. package/dist/styles/specialized.js +379 -0
  45. package/dist/styles/specialized.js.map +1 -0
  46. package/dist/types.d.ts +143 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +7 -0
  49. package/dist/types.js.map +1 -0
  50. package/package.json +56 -0
@@ -0,0 +1,247 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cqrs = exports.eventDriven = void 0;
4
+ /**
5
+ * Event-Driven Backend Architecture
6
+ * Components communicate through events, asynchronously
7
+ */
8
+ exports.eventDriven = {
9
+ id: 'event-driven',
10
+ name: 'Event-Driven Backend',
11
+ description: 'System components communicate through events. Actions trigger events; handlers react to events asynchronously. Enables loose coupling and high scalability.',
12
+ whenToUse: [
13
+ 'High throughput with eventual consistency acceptable',
14
+ 'Multiple services reacting to same business events',
15
+ 'Audit trail required for all state changes',
16
+ 'Decoupling producers from consumers',
17
+ 'Need to replay events for debugging or recovery',
18
+ 'Complex workflows with multiple steps'
19
+ ],
20
+ whenNotToUse: [
21
+ 'Strong consistency required everywhere',
22
+ 'Simple request-response patterns sufficient',
23
+ 'Team lacks event sourcing experience',
24
+ 'Debugging complexity unacceptable',
25
+ 'Real-time synchronous responses needed',
26
+ 'Small, simple domains'
27
+ ],
28
+ corePrinciples: [
29
+ 'Events are immutable facts about what happened',
30
+ 'Publishers do not know their subscribers',
31
+ 'Handlers must be idempotent',
32
+ 'Event ordering matters within aggregate boundaries',
33
+ 'Events carry enough data for handlers to act',
34
+ 'Eventual consistency is the norm'
35
+ ],
36
+ folderStructure: {
37
+ name: 'src',
38
+ type: 'folder',
39
+ children: [
40
+ {
41
+ name: 'events',
42
+ type: 'folder',
43
+ description: 'Event infrastructure',
44
+ children: [
45
+ { name: 'definitions', type: 'folder', description: 'Event schemas/types' },
46
+ { name: 'publishers', type: 'folder', description: 'Event publishing logic' },
47
+ { name: 'handlers', type: 'folder', description: 'Event handlers' },
48
+ { name: 'store', type: 'folder', description: 'Event persistence' }
49
+ ]
50
+ },
51
+ {
52
+ name: 'aggregates',
53
+ type: 'folder',
54
+ description: 'Event-sourced domain aggregates'
55
+ },
56
+ {
57
+ name: 'projections',
58
+ type: 'folder',
59
+ description: 'Read models built from events'
60
+ },
61
+ {
62
+ name: 'sagas',
63
+ type: 'folder',
64
+ description: 'Long-running processes / process managers'
65
+ },
66
+ {
67
+ name: 'api',
68
+ type: 'folder',
69
+ description: 'External interfaces',
70
+ children: [
71
+ { name: 'commands', type: 'folder', description: 'Write operations' },
72
+ { name: 'queries', type: 'folder', description: 'Read operations' }
73
+ ]
74
+ },
75
+ {
76
+ name: 'infrastructure',
77
+ type: 'folder',
78
+ children: [
79
+ { name: 'messaging', type: 'folder', description: 'Message broker integration' },
80
+ { name: 'event-store', type: 'folder', description: 'Event storage implementation' }
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ commonPitfalls: [
86
+ 'Non-idempotent handlers - same event processed twice should have same result',
87
+ 'Missing event versioning strategy - events schema will evolve',
88
+ 'Tight coupling through event payload - events should be self-contained',
89
+ 'Ignoring event ordering requirements - order matters within aggregate',
90
+ 'No dead letter handling - failed events need a home',
91
+ 'Synchronous event handling - defeats the purpose',
92
+ 'Events without correlation IDs - hard to trace'
93
+ ],
94
+ aiInstructions: `When generating code for Event-Driven Backend:
95
+
96
+ EVENT STRUCTURE:
97
+ - Every event has: id, type, timestamp, version, correlationId, payload
98
+ - Event names in past tense: OrderCreated, PaymentProcessed
99
+ - Events are immutable once published
100
+ - Include event version for schema evolution
101
+
102
+ HANDLERS:
103
+ - All handlers MUST be idempotent
104
+ - Store processed event IDs to detect duplicates
105
+ - Handle events asynchronously
106
+ - Log event processing start/end
107
+
108
+ PUBLISHING:
109
+ - Commands return immediately after emitting events
110
+ - Publisher does not wait for handlers
111
+ - Use transactional outbox for reliability
112
+
113
+ PROJECTIONS:
114
+ - Read models built by projecting events
115
+ - Queries read from projections, never event store
116
+ - Projections can be rebuilt from events
117
+
118
+ SAGAS:
119
+ - Coordinate multi-step processes
120
+ - Listen for events, issue commands
121
+ - Handle compensation for failures`
122
+ };
123
+ /**
124
+ * CQRS Architecture Style
125
+ * Separate models for reading and writing data
126
+ */
127
+ exports.cqrs = {
128
+ id: 'cqrs',
129
+ name: 'CQRS',
130
+ description: 'Command Query Responsibility Segregation. Separate models for reading and writing data. Commands mutate state; queries return state without modification.',
131
+ whenToUse: [
132
+ 'Read and write patterns differ significantly',
133
+ 'Read-heavy workloads with complex queries',
134
+ 'Different scaling needs for reads vs writes',
135
+ 'Eventual consistency acceptable for reads',
136
+ 'Need to optimize read and write models independently',
137
+ 'Complex reporting requirements'
138
+ ],
139
+ whenNotToUse: [
140
+ 'Simple CRUD with 1:1 read/write ratio',
141
+ 'Strong consistency required for reads',
142
+ 'Small data volumes with simple queries',
143
+ 'Team unfamiliar with eventual consistency',
144
+ 'Added complexity not justified'
145
+ ],
146
+ corePrinciples: [
147
+ 'Commands never return data (void or acknowledgment only)',
148
+ 'Queries never modify state',
149
+ 'Write model optimized for consistency, read model for queries',
150
+ 'Keep write model normalized, denormalize read models',
151
+ 'Read and write models can use different databases',
152
+ 'Synchronization between models is explicit'
153
+ ],
154
+ folderStructure: {
155
+ name: 'src',
156
+ type: 'folder',
157
+ children: [
158
+ {
159
+ name: 'write',
160
+ type: 'folder',
161
+ description: 'Command/write side',
162
+ children: [
163
+ {
164
+ name: 'commands',
165
+ type: 'folder',
166
+ children: [
167
+ { name: 'handlers', type: 'folder', description: 'Command handlers' },
168
+ { name: 'validators', type: 'folder', description: 'Command validation' }
169
+ ]
170
+ },
171
+ {
172
+ name: 'domain',
173
+ type: 'folder',
174
+ children: [
175
+ { name: 'aggregates', type: 'folder', description: 'Write model aggregates' },
176
+ { name: 'events', type: 'folder', description: 'Domain events' }
177
+ ]
178
+ },
179
+ { name: 'repositories', type: 'folder', description: 'Write repositories' }
180
+ ]
181
+ },
182
+ {
183
+ name: 'read',
184
+ type: 'folder',
185
+ description: 'Query/read side',
186
+ children: [
187
+ {
188
+ name: 'queries',
189
+ type: 'folder',
190
+ children: [
191
+ { name: 'handlers', type: 'folder', description: 'Query handlers' },
192
+ { name: 'dto', type: 'folder', description: 'Query response DTOs' }
193
+ ]
194
+ },
195
+ { name: 'models', type: 'folder', description: 'Denormalized read models' },
196
+ { name: 'projectors', type: 'folder', description: 'Build read models from events' }
197
+ ]
198
+ },
199
+ {
200
+ name: 'sync',
201
+ type: 'folder',
202
+ description: 'Write → Read synchronization'
203
+ },
204
+ {
205
+ name: 'api',
206
+ type: 'folder',
207
+ children: [
208
+ { name: 'command-endpoints', type: 'folder', description: 'POST/PUT/DELETE' },
209
+ { name: 'query-endpoints', type: 'folder', description: 'GET' }
210
+ ]
211
+ }
212
+ ]
213
+ },
214
+ commonPitfalls: [
215
+ 'Returning data from command handlers - commands return void or ID only',
216
+ 'Querying write model for reads - always use read models',
217
+ 'Missing synchronization between models - define explicit sync',
218
+ 'Over-complicating simple domains - CQRS adds complexity',
219
+ 'Expecting immediate consistency - reads can be stale',
220
+ 'Tight coupling between write and read models'
221
+ ],
222
+ aiInstructions: `When generating code for CQRS:
223
+
224
+ COMMANDS:
225
+ - Command handlers return void or command ID only
226
+ - Validate command before processing
227
+ - Emit events after successful command processing
228
+ - Commands are imperative: CreateOrder, UpdateUser
229
+
230
+ QUERIES:
231
+ - Query handlers are pure functions, no side effects
232
+ - Queries return rich, denormalized DTOs
233
+ - Optimize read models for specific query patterns
234
+ - Queries are questions: GetOrderById, ListUserOrders
235
+
236
+ SEPARATION:
237
+ - Write model: normalized, consistent, optimized for writes
238
+ - Read model: denormalized, eventually consistent, optimized for reads
239
+ - Can use different databases for each
240
+
241
+ SYNCHRONIZATION:
242
+ - Projectors listen to events from write side
243
+ - Update read models when events occur
244
+ - Handle out-of-order events gracefully
245
+ - Design for rebuild capability`
246
+ };
247
+ //# sourceMappingURL=event-driven.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-driven.js","sourceRoot":"","sources":["../../src/styles/event-driven.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,WAAW,GAAsB;IAC1C,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,6JAA6J;IAE1K,SAAS,EAAE;QACP,sDAAsD;QACtD,oDAAoD;QACpD,4CAA4C;QAC5C,qCAAqC;QACrC,iDAAiD;QACjD,uCAAuC;KAC1C;IAED,YAAY,EAAE;QACV,wCAAwC;QACxC,6CAA6C;QAC7C,sCAAsC;QACtC,mCAAmC;QACnC,wCAAwC;QACxC,uBAAuB;KAC1B;IAED,cAAc,EAAE;QACZ,gDAAgD;QAChD,0CAA0C;QAC1C,6BAA6B;QAC7B,oDAAoD;QACpD,8CAA8C;QAC9C,kCAAkC;KACrC;IAED,eAAe,EAAE;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;gBACnC,QAAQ,EAAE;oBACN,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;oBAC3E,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;oBAC7E,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;oBACnE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;iBACtE;aACJ;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aACjD;YACD;gBAC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AAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;yBACtE;qBACJ;oBACD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;oBAC3E,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;iBACvF;aACJ;YACD;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;aAC9C;YACD;gBACI,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE;oBACN,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;oBAC7E,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE;iBAClE;aACJ;SACJ;KACJ;IAED,cAAc,EAAE;QACZ,wEAAwE;QACxE,yDAAyD;QACzD,+DAA+D;QAC/D,yDAAyD;QACzD,sDAAsD;QACtD,8CAA8C;KACjD;IAED,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;gCAuBY;CAC/B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ArchitectureStyle } from '../types.js';
2
+ /**
3
+ * Hexagonal Architecture (Ports & Adapters)
4
+ * Application core surrounded by ports and adapters
5
+ */
6
+ export declare const hexagonal: ArchitectureStyle;
7
+ //# sourceMappingURL=hexagonal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagonal.d.ts","sourceRoot":"","sources":["../../src/styles/hexagonal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,iBA+IvB,CAAC"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hexagonal = void 0;
4
+ /**
5
+ * Hexagonal Architecture (Ports & Adapters)
6
+ * Application core surrounded by ports and adapters
7
+ */
8
+ exports.hexagonal = {
9
+ id: 'hexagonal',
10
+ name: 'Hexagonal Architecture',
11
+ description: 'Application core surrounded by ports (interfaces) and adapters (implementations). Core has zero dependencies on external world. Also known as Ports & Adapters.',
12
+ whenToUse: [
13
+ 'Long-lived systems requiring technology swaps',
14
+ 'Heavy external integrations (multiple DBs, APIs, queues)',
15
+ 'Test-driven development priority',
16
+ 'Complex business logic requiring isolation',
17
+ 'Need to support multiple input channels (HTTP, CLI, events)',
18
+ 'Expect infrastructure changes over system lifetime'
19
+ ],
20
+ whenNotToUse: [
21
+ 'Rapid prototyping needed - too much ceremony',
22
+ 'Simple CRUD with minimal business logic',
23
+ 'Team unfamiliar with DDD concepts',
24
+ 'Small, short-lived projects',
25
+ 'Single integration point unlikely to change'
26
+ ],
27
+ corePrinciples: [
28
+ 'Domain and application core have no external dependencies',
29
+ 'Ports define what the application needs (driven) or provides (driving)',
30
+ 'Adapters implement ports for specific technologies',
31
+ 'Dependency inversion: adapters depend on ports, not vice versa',
32
+ 'Core is testable without any infrastructure',
33
+ 'Technology decisions deferred to adapters'
34
+ ],
35
+ folderStructure: {
36
+ name: 'src',
37
+ type: 'folder',
38
+ children: [
39
+ {
40
+ name: 'core',
41
+ type: 'folder',
42
+ description: 'Framework-free application core',
43
+ children: [
44
+ {
45
+ name: 'domain',
46
+ type: 'folder',
47
+ children: [
48
+ { name: 'entities', type: 'folder', description: 'Domain entities' },
49
+ { name: 'value-objects', type: 'folder', description: 'Value objects' },
50
+ { name: 'events', type: 'folder', description: 'Domain events' },
51
+ { name: 'services', type: 'folder', description: 'Domain services' }
52
+ ]
53
+ },
54
+ {
55
+ name: 'application',
56
+ type: 'folder',
57
+ children: [
58
+ {
59
+ name: 'ports',
60
+ type: 'folder',
61
+ children: [
62
+ { name: 'inbound', type: 'folder', description: 'Driving ports (use cases)' },
63
+ { name: 'outbound', type: 'folder', description: 'Driven ports (repositories, gateways)' }
64
+ ]
65
+ },
66
+ { name: 'services', type: 'folder', description: 'Application services' },
67
+ { name: 'use-cases', type: 'folder', description: 'Use case implementations' }
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ name: 'adapters',
74
+ type: 'folder',
75
+ description: 'Technology-specific implementations',
76
+ children: [
77
+ {
78
+ name: 'inbound',
79
+ type: 'folder',
80
+ description: 'Driving adapters (entry points)',
81
+ children: [
82
+ { name: 'http', type: 'folder', description: 'REST/GraphQL controllers' },
83
+ { name: 'grpc', type: 'folder', description: 'gRPC handlers' },
84
+ { name: 'cli', type: 'folder', description: 'CLI commands' },
85
+ { name: 'events', type: 'folder', description: 'Event consumers' }
86
+ ]
87
+ },
88
+ {
89
+ name: 'outbound',
90
+ type: 'folder',
91
+ description: 'Driven adapters (external resources)',
92
+ children: [
93
+ { name: 'persistence', type: 'folder', description: 'Database repositories' },
94
+ { name: 'messaging', type: 'folder', description: 'Message queue clients' },
95
+ { name: 'external-apis', type: 'folder', description: 'Third-party API clients' }
96
+ ]
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ name: 'config',
102
+ type: 'folder',
103
+ description: 'Application configuration',
104
+ children: [
105
+ { name: 'dependency-injection', type: 'folder', description: 'DI container setup' }
106
+ ]
107
+ }
108
+ ]
109
+ },
110
+ commonPitfalls: [
111
+ 'Leaking adapter types into core - core must not import from adapters',
112
+ 'Over-engineering simple operations - not every operation needs full port/adapter',
113
+ 'Ports that mirror database schemas - ports defined by application needs',
114
+ 'Missing adapter for testing - always create in-memory adapters',
115
+ 'Putting business logic in adapters - all logic belongs in core',
116
+ 'Confusing driving and driven ports'
117
+ ],
118
+ aiInstructions: `When generating code for Hexagonal Architecture:
119
+
120
+ CORE ISOLATION:
121
+ - Core (domain + application) imports NOTHING from adapters
122
+ - Use cases implement inbound ports, call outbound ports
123
+ - All framework/library code lives in adapters
124
+ - Core is pure TypeScript/Java/Python with no frameworks
125
+
126
+ PORTS:
127
+ - Inbound ports: interfaces that USE CASES implement
128
+ - Outbound ports: interfaces that ADAPTERS implement
129
+ - Port interfaces defined by application needs, not technology
130
+ - Example outbound: UserRepository, EmailGateway, PaymentGateway
131
+
132
+ ADAPTERS:
133
+ - Inbound adapters call use cases (HTTP controller → use case)
134
+ - Outbound adapters implement ports (PostgresUserRepository implements UserRepository)
135
+ - Create in-memory adapters for testing
136
+
137
+ DEPENDENCY INJECTION:
138
+ - Wire adapters to ports in composition root
139
+ - Core knows interfaces, not implementations
140
+ - Swap adapters without changing core
141
+
142
+ TESTING:
143
+ - Test core with in-memory adapters only
144
+ - Integration tests use real adapters`
145
+ };
146
+ //# sourceMappingURL=hexagonal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagonal.js","sourceRoot":"","sources":["../../src/styles/hexagonal.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,SAAS,GAAsB;IACxC,EAAE,EAAE,WAAW;IACf,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,iKAAiK;IAE9K,SAAS,EAAE;QACP,+CAA+C;QAC/C,0DAA0D;QAC1D,kCAAkC;QAClC,4CAA4C;QAC5C,6DAA6D;QAC7D,oDAAoD;KACvD;IAED,YAAY,EAAE;QACV,8CAA8C;QAC9C,yCAAyC;QACzC,mCAAmC;QACnC,6BAA6B;QAC7B,6CAA6C;KAChD;IAED,cAAc,EAAE;QACZ,2DAA2D;QAC3D,wEAAwE;QACxE,oDAAoD;QACpD,gEAAgE;QAChE,6CAA6C;QAC7C,2CAA2C;KAC9C;IAED,eAAe,EAAE;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EA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monolith.js';
6
+ import { modularMonolith } from './modular-monolith.js';
7
+ import { hexagonal } from './hexagonal.js';
8
+ import { eventDriven, cqrs } from './event-driven.js';
9
+ import { microservicesSync, microservicesAsync } from './microservices.js';
10
+ import { serverless, readHeavy, automation } from './specialized.js';
11
+ import type { ArchitectureStyle } from '../types.js';
12
+ /**
13
+ * All available architecture styles
14
+ */
15
+ export declare const styles: Record<string, ArchitectureStyle>;
16
+ /**
17
+ * Get a style by ID
18
+ */
19
+ export declare function getStyle(id: string): ArchitectureStyle | undefined;
20
+ /**
21
+ * Get all style IDs
22
+ */
23
+ export declare function getStyleIds(): string[];
24
+ /**
25
+ * Find styles matching criteria
26
+ */
27
+ export declare function findStyles(criteria: {
28
+ teamSize?: 'small' | 'medium' | 'large';
29
+ complexity?: 'low' | 'medium' | 'high';
30
+ scalability?: 'single' | 'horizontal';
31
+ }): ArchitectureStyle[];
32
+ export { cleanMonolith, modularMonolith, hexagonal, eventDriven, cqrs, microservicesSync, microservicesAsync, serverless, readHeavy, automation, };
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAWpD,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAElE;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,WAAW,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;CACzC,GAAG,iBAAiB,EAAE,CAiBtB;AAGD,OAAO,EACH,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,UAAU,GACb,CAAC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * IronBackend Architecture Styles
4
+ * Export all architecture style definitions
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.automation = exports.readHeavy = exports.serverless = exports.microservicesAsync = exports.microservicesSync = exports.cqrs = exports.eventDriven = exports.hexagonal = exports.modularMonolith = exports.cleanMonolith = exports.styles = void 0;
8
+ exports.getStyle = getStyle;
9
+ exports.getStyleIds = getStyleIds;
10
+ exports.findStyles = findStyles;
11
+ const clean_monolith_js_1 = require("./clean-monolith.js");
12
+ Object.defineProperty(exports, "cleanMonolith", { enumerable: true, get: function () { return clean_monolith_js_1.cleanMonolith; } });
13
+ const modular_monolith_js_1 = require("./modular-monolith.js");
14
+ Object.defineProperty(exports, "modularMonolith", { enumerable: true, get: function () { return modular_monolith_js_1.modularMonolith; } });
15
+ const hexagonal_js_1 = require("./hexagonal.js");
16
+ Object.defineProperty(exports, "hexagonal", { enumerable: true, get: function () { return hexagonal_js_1.hexagonal; } });
17
+ const event_driven_js_1 = require("./event-driven.js");
18
+ Object.defineProperty(exports, "eventDriven", { enumerable: true, get: function () { return event_driven_js_1.eventDriven; } });
19
+ Object.defineProperty(exports, "cqrs", { enumerable: true, get: function () { return event_driven_js_1.cqrs; } });
20
+ const microservices_js_1 = require("./microservices.js");
21
+ Object.defineProperty(exports, "microservicesSync", { enumerable: true, get: function () { return microservices_js_1.microservicesSync; } });
22
+ Object.defineProperty(exports, "microservicesAsync", { enumerable: true, get: function () { return microservices_js_1.microservicesAsync; } });
23
+ const specialized_js_1 = require("./specialized.js");
24
+ Object.defineProperty(exports, "serverless", { enumerable: true, get: function () { return specialized_js_1.serverless; } });
25
+ Object.defineProperty(exports, "readHeavy", { enumerable: true, get: function () { return specialized_js_1.readHeavy; } });
26
+ Object.defineProperty(exports, "automation", { enumerable: true, get: function () { return specialized_js_1.automation; } });
27
+ /**
28
+ * All available architecture styles
29
+ */
30
+ exports.styles = {
31
+ 'clean-monolith': clean_monolith_js_1.cleanMonolith,
32
+ 'modular-monolith': modular_monolith_js_1.modularMonolith,
33
+ 'hexagonal': hexagonal_js_1.hexagonal,
34
+ 'event-driven': event_driven_js_1.eventDriven,
35
+ 'cqrs': event_driven_js_1.cqrs,
36
+ 'microservices-sync': microservices_js_1.microservicesSync,
37
+ 'microservices-async': microservices_js_1.microservicesAsync,
38
+ 'serverless': specialized_js_1.serverless,
39
+ 'read-heavy': specialized_js_1.readHeavy,
40
+ 'automation': specialized_js_1.automation,
41
+ };
42
+ /**
43
+ * Get a style by ID
44
+ */
45
+ function getStyle(id) {
46
+ return exports.styles[id];
47
+ }
48
+ /**
49
+ * Get all style IDs
50
+ */
51
+ function getStyleIds() {
52
+ return Object.keys(exports.styles);
53
+ }
54
+ /**
55
+ * Find styles matching criteria
56
+ */
57
+ function findStyles(criteria) {
58
+ // Simple heuristic-based filtering
59
+ return Object.values(exports.styles).filter(style => {
60
+ if (criteria.teamSize === 'small') {
61
+ return ['clean-monolith', 'serverless', 'automation'].includes(style.id);
62
+ }
63
+ if (criteria.teamSize === 'large') {
64
+ return ['modular-monolith', 'microservices-sync', 'microservices-async'].includes(style.id);
65
+ }
66
+ if (criteria.complexity === 'low') {
67
+ return ['clean-monolith', 'serverless'].includes(style.id);
68
+ }
69
+ if (criteria.complexity === 'high') {
70
+ return ['hexagonal', 'event-driven', 'cqrs'].includes(style.id);
71
+ }
72
+ return true;
73
+ });
74
+ }
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH,4BAEC;AAKD,kCAEC;AAKD,gCAqBC;AA9DD,2DAAoD;AAkEhD,8FAlEK,iCAAa,OAkEL;AAjEjB,+DAAwD;AAkEpD,gGAlEK,qCAAe,OAkEL;AAjEnB,iDAA2C;AAkEvC,0FAlEK,wBAAS,OAkEL;AAjEb,uDAAsD;AAkElD,4FAlEK,6BAAW,OAkEL;AACX,qFAnEkB,sBAAI,OAmElB;AAlER,yDAA2E;AAmEvE,kGAnEK,oCAAiB,OAmEL;AACjB,mGApEwB,qCAAkB,OAoExB;AAnEtB,qDAAqE;AAoEjE,2FApEK,2BAAU,OAoEL;AACV,0FArEiB,0BAAS,OAqEjB;AACT,2FAtE4B,2BAAU,OAsE5B;AAnEd;;GAEG;AACU,QAAA,MAAM,GAAsC;IACrD,gBAAgB,EAAE,iCAAa;IAC/B,kBAAkB,EAAE,qCAAe;IACnC,WAAW,EAAE,wBAAS;IACtB,cAAc,EAAE,6BAAW;IAC3B,MAAM,EAAE,sBAAI;IACZ,oBAAoB,EAAE,oCAAiB;IACvC,qBAAqB,EAAE,qCAAkB;IACzC,YAAY,EAAE,2BAAU;IACxB,YAAY,EAAE,0BAAS;IACvB,YAAY,EAAE,2BAAU;CAC3B,CAAC;AAEF;;GAEG;AACH,SAAgB,QAAQ,CAAC,EAAU;IAC/B,OAAO,cAAM,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW;IACvB,OAAO,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,QAI1B;IACG,mCAAmC;IACnC,OAAO,MAAM,CAAC,MAAM,CAAC,cAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACxC,IAAI,QAAQ,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAChC,OAAO,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,QAAQ,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAChC,OAAO,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAChG,CAAC;QACD,IAAI,QAAQ,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;YAChC,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,QAAQ,CAAC,UAAU,KAAK,MAAM,EAAE,CAAC;YACjC,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ArchitectureStyle } from '../types.js';
2
+ /**
3
+ * Microservices (Synchronous) Architecture
4
+ * Distributed services communicating via HTTP/gRPC
5
+ */
6
+ export declare const microservicesSync: ArchitectureStyle;
7
+ /**
8
+ * Microservices (Asynchronous) Architecture
9
+ * Services communicating via message queues and events
10
+ */
11
+ export declare const microservicesAsync: ArchitectureStyle;
12
+ //# sourceMappingURL=microservices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microservices.d.ts","sourceRoot":"","sources":["../../src/styles/microservices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAsH/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAkGhC,CAAC"}