@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.
- package/LICENSE +21 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/index.d.ts +36 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +505 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/security/index.d.ts +15 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +243 -0
- package/dist/security/index.js.map +1 -0
- package/dist/stacks/index.d.ts +38 -0
- package/dist/stacks/index.d.ts.map +1 -0
- package/dist/stacks/index.js +193 -0
- package/dist/stacks/index.js.map +1 -0
- package/dist/styles/clean-monolith.d.ts +7 -0
- package/dist/styles/clean-monolith.d.ts.map +1 -0
- package/dist/styles/clean-monolith.js +124 -0
- package/dist/styles/clean-monolith.js.map +1 -0
- package/dist/styles/event-driven.d.ts +12 -0
- package/dist/styles/event-driven.d.ts.map +1 -0
- package/dist/styles/event-driven.js +247 -0
- package/dist/styles/event-driven.js.map +1 -0
- package/dist/styles/hexagonal.d.ts +7 -0
- package/dist/styles/hexagonal.d.ts.map +1 -0
- package/dist/styles/hexagonal.js +146 -0
- package/dist/styles/hexagonal.js.map +1 -0
- package/dist/styles/index.d.ts +33 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +75 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/microservices.d.ts +12 -0
- package/dist/styles/microservices.d.ts.map +1 -0
- package/dist/styles/microservices.js +218 -0
- package/dist/styles/microservices.js.map +1 -0
- package/dist/styles/modular-monolith.d.ts +7 -0
- package/dist/styles/modular-monolith.d.ts.map +1 -0
- package/dist/styles/modular-monolith.js +131 -0
- package/dist/styles/modular-monolith.js.map +1 -0
- package/dist/styles/specialized.d.ts +17 -0
- package/dist/styles/specialized.d.ts.map +1 -0
- package/dist/styles/specialized.js +379 -0
- package/dist/styles/specialized.js.map +1 -0
- package/dist/types.d.ts +143 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBackend Security & Reliability Playbooks
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.securityPlaybook = exports.authStrategies = void 0;
|
|
7
|
+
exports.getAuthStrategy = getAuthStrategy;
|
|
8
|
+
exports.formatSecurityForPrompt = formatSecurityForPrompt;
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Authentication Strategies
|
|
11
|
+
// ============================================================================
|
|
12
|
+
exports.authStrategies = [
|
|
13
|
+
{
|
|
14
|
+
strategy: 'JWT',
|
|
15
|
+
useWhen: [
|
|
16
|
+
'Stateless APIs',
|
|
17
|
+
'Microservices architecture',
|
|
18
|
+
'Mobile/SPA clients',
|
|
19
|
+
'Need to embed claims in token'
|
|
20
|
+
],
|
|
21
|
+
implementation: [
|
|
22
|
+
'Short-lived access tokens (15-30 minutes)',
|
|
23
|
+
'Longer-lived refresh tokens (7-30 days)',
|
|
24
|
+
'Store refresh tokens securely (httpOnly cookie or secure storage)',
|
|
25
|
+
'Include essential claims only (user ID, roles)',
|
|
26
|
+
'Use RS256 for production, HS256 for development',
|
|
27
|
+
'Implement token revocation via blacklist or short expiry'
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
strategy: 'SESSION',
|
|
32
|
+
useWhen: [
|
|
33
|
+
'Traditional web applications',
|
|
34
|
+
'Server-side rendering',
|
|
35
|
+
'Need immediate session invalidation',
|
|
36
|
+
'Simpler security model preferred'
|
|
37
|
+
],
|
|
38
|
+
implementation: [
|
|
39
|
+
'Store sessions in Redis or similar (not in-memory)',
|
|
40
|
+
'Use secure, httpOnly, sameSite cookies',
|
|
41
|
+
'Regenerate session ID on login',
|
|
42
|
+
'Set appropriate session timeout',
|
|
43
|
+
'Implement CSRF protection'
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
strategy: 'API_KEY',
|
|
48
|
+
useWhen: [
|
|
49
|
+
'Service-to-service communication',
|
|
50
|
+
'Third-party integrations',
|
|
51
|
+
'Public API access',
|
|
52
|
+
'Simple authentication sufficient'
|
|
53
|
+
],
|
|
54
|
+
implementation: [
|
|
55
|
+
'Hash API keys before storage',
|
|
56
|
+
'Implement key rotation mechanism',
|
|
57
|
+
'Scope keys to specific permissions',
|
|
58
|
+
'Rate limit per key',
|
|
59
|
+
'Log all key usage for audit'
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
strategy: 'OAUTH2',
|
|
64
|
+
useWhen: [
|
|
65
|
+
'Third-party login (Google, GitHub, etc.)',
|
|
66
|
+
'Delegated access to resources',
|
|
67
|
+
'Enterprise SSO integration',
|
|
68
|
+
'Need to access third-party APIs on behalf of user'
|
|
69
|
+
],
|
|
70
|
+
implementation: [
|
|
71
|
+
'Use Authorization Code flow for web apps',
|
|
72
|
+
'Use PKCE for mobile/SPA apps',
|
|
73
|
+
'Validate tokens with provider',
|
|
74
|
+
'Store provider tokens securely',
|
|
75
|
+
'Handle token refresh automatically'
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
strategy: 'MTLS',
|
|
80
|
+
useWhen: [
|
|
81
|
+
'Internal service mesh',
|
|
82
|
+
'Zero-trust architecture',
|
|
83
|
+
'High-security environments',
|
|
84
|
+
'Need mutual authentication'
|
|
85
|
+
],
|
|
86
|
+
implementation: [
|
|
87
|
+
'Use organization PKI',
|
|
88
|
+
'Automate certificate rotation',
|
|
89
|
+
'Implement certificate revocation',
|
|
90
|
+
'Monitor certificate expiry'
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
// ============================================================================
|
|
95
|
+
// Security Playbook
|
|
96
|
+
// ============================================================================
|
|
97
|
+
exports.securityPlaybook = {
|
|
98
|
+
authentication: exports.authStrategies,
|
|
99
|
+
authorization: {
|
|
100
|
+
rbac: {
|
|
101
|
+
description: 'Role-Based Access Control. Assign roles to users, roles have permissions.',
|
|
102
|
+
checkPattern: 'user.roles.some(role => requiredRoles.includes(role))',
|
|
103
|
+
goodFor: [
|
|
104
|
+
'Static, well-defined permission structures',
|
|
105
|
+
'Simple user hierarchies (admin, user, guest)',
|
|
106
|
+
'Quick to implement and audit'
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
abac: {
|
|
110
|
+
description: 'Attribute-Based Access Control. Policies based on attributes of user, resource, action, and environment.',
|
|
111
|
+
checkPattern: 'policy.evaluate({ user, resource, action, context })',
|
|
112
|
+
goodFor: [
|
|
113
|
+
'Dynamic, fine-grained access control',
|
|
114
|
+
'Complex permission requirements',
|
|
115
|
+
'Context-aware decisions (time, location, etc.)'
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
decisionMatrix: {
|
|
119
|
+
'Simplicity': { rbac: '✅ Simple', abac: '❌ Complex' },
|
|
120
|
+
'Flexibility': { rbac: '❌ Limited', abac: '✅ High' },
|
|
121
|
+
'Performance': { rbac: '✅ Fast', abac: '⚠️ Depends on policy' },
|
|
122
|
+
'Auditability': { rbac: '✅ Easy', abac: '⚠️ Policy-dependent' }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
rateLimiting: {
|
|
126
|
+
windowType: 'Sliding window (more accurate than fixed window)',
|
|
127
|
+
defaultLimit: '100 requests/minute per authenticated user',
|
|
128
|
+
anonymousLimit: '20 requests/minute per IP',
|
|
129
|
+
headers: [
|
|
130
|
+
'X-RateLimit-Limit: Maximum requests allowed',
|
|
131
|
+
'X-RateLimit-Remaining: Requests remaining in window',
|
|
132
|
+
'X-RateLimit-Reset: Unix timestamp when limit resets'
|
|
133
|
+
],
|
|
134
|
+
responseCode: 429
|
|
135
|
+
},
|
|
136
|
+
idempotency: {
|
|
137
|
+
headerName: 'Idempotency-Key',
|
|
138
|
+
keyFormat: 'UUID v4, client-generated',
|
|
139
|
+
storageDuration: '24 hours',
|
|
140
|
+
implementation: [
|
|
141
|
+
'1. Check if Idempotency-Key exists in store',
|
|
142
|
+
'2. If exists: return stored response',
|
|
143
|
+
'3. If not: process request, store response with key',
|
|
144
|
+
'4. Cleanup keys older than 24 hours (background job)',
|
|
145
|
+
'5. Handle concurrent requests with same key (locking)'
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
retryStrategy: {
|
|
149
|
+
baseDelay: '100ms',
|
|
150
|
+
multiplier: 2,
|
|
151
|
+
maxRetries: 3,
|
|
152
|
+
maxDelay: '10s',
|
|
153
|
+
jitter: '±10%',
|
|
154
|
+
retryOn: [408, 429, 500, 502, 503, 504],
|
|
155
|
+
doNotRetryOn: [400, 401, 403, 404, 409, 422]
|
|
156
|
+
},
|
|
157
|
+
circuitBreaker: {
|
|
158
|
+
states: [
|
|
159
|
+
'CLOSED: Normal operation, requests pass through',
|
|
160
|
+
'OPEN: Failing, requests immediately rejected with fallback',
|
|
161
|
+
'HALF_OPEN: Testing, limited requests allowed to probe'
|
|
162
|
+
],
|
|
163
|
+
failureThreshold: 5,
|
|
164
|
+
successThreshold: 3,
|
|
165
|
+
timeout: '30s',
|
|
166
|
+
monitoringWindow: '60s'
|
|
167
|
+
},
|
|
168
|
+
auditLogging: {
|
|
169
|
+
requiredEvents: [
|
|
170
|
+
'AUTH_LOGIN_SUCCESS',
|
|
171
|
+
'AUTH_LOGIN_FAILURE',
|
|
172
|
+
'AUTH_LOGOUT',
|
|
173
|
+
'AUTH_TOKEN_REFRESH',
|
|
174
|
+
'AUTHZ_ACCESS_GRANTED',
|
|
175
|
+
'AUTHZ_ACCESS_DENIED',
|
|
176
|
+
'DATA_CREATE',
|
|
177
|
+
'DATA_UPDATE',
|
|
178
|
+
'DATA_DELETE',
|
|
179
|
+
'ADMIN_CONFIG_CHANGE',
|
|
180
|
+
'ADMIN_USER_MANAGEMENT',
|
|
181
|
+
'SECURITY_RATE_LIMIT_HIT',
|
|
182
|
+
'SECURITY_BLOCKED_REQUEST'
|
|
183
|
+
],
|
|
184
|
+
logFormat: {
|
|
185
|
+
'timestamp': 'ISO8601 format',
|
|
186
|
+
'eventType': 'Event type from requiredEvents',
|
|
187
|
+
'actorId': 'User or service ID',
|
|
188
|
+
'actorType': 'USER, SERVICE, SYSTEM',
|
|
189
|
+
'resourceType': 'Type of resource affected',
|
|
190
|
+
'resourceId': 'ID of resource affected',
|
|
191
|
+
'action': 'CREATE, READ, UPDATE, DELETE',
|
|
192
|
+
'outcome': 'SUCCESS, FAILURE',
|
|
193
|
+
'metadata': 'Additional context',
|
|
194
|
+
'ipAddress': 'Client IP',
|
|
195
|
+
'userAgent': 'Client user agent',
|
|
196
|
+
'correlationId': 'Request correlation ID'
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
failurePhilosophy: [
|
|
200
|
+
'FAIL FAST: Validate early, reject invalid requests immediately at boundaries',
|
|
201
|
+
'FAIL GRACEFULLY: Always return meaningful errors, never crash or hang',
|
|
202
|
+
'FAIL ISOLATED: One component failure should not cascade to others',
|
|
203
|
+
'FAIL OBSERVABLE: Every failure must be logged with full context',
|
|
204
|
+
'FAIL RECOVERABLE: Design for retry, implement compensation for failures'
|
|
205
|
+
]
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Get authentication strategy by type
|
|
209
|
+
*/
|
|
210
|
+
function getAuthStrategy(strategy) {
|
|
211
|
+
return exports.authStrategies.find(auth => auth.strategy === strategy);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Format security playbook section for prompt
|
|
215
|
+
*/
|
|
216
|
+
function formatSecurityForPrompt() {
|
|
217
|
+
return `
|
|
218
|
+
## Authentication
|
|
219
|
+
${exports.authStrategies.map(auth => `
|
|
220
|
+
### ${auth.strategy}
|
|
221
|
+
Use when: ${auth.useWhen.join(', ')}
|
|
222
|
+
Implementation:
|
|
223
|
+
${auth.implementation.map(impl => `- ${impl}`).join('\n')}
|
|
224
|
+
`).join('\n')}
|
|
225
|
+
|
|
226
|
+
## Rate Limiting
|
|
227
|
+
- Window: ${exports.securityPlaybook.rateLimiting.windowType}
|
|
228
|
+
- Default: ${exports.securityPlaybook.rateLimiting.defaultLimit}
|
|
229
|
+
- Anonymous: ${exports.securityPlaybook.rateLimiting.anonymousLimit}
|
|
230
|
+
- Response: HTTP ${exports.securityPlaybook.rateLimiting.responseCode} with Retry-After header
|
|
231
|
+
|
|
232
|
+
## Retry Strategy
|
|
233
|
+
- Base delay: ${exports.securityPlaybook.retryStrategy.baseDelay}
|
|
234
|
+
- Multiplier: ${exports.securityPlaybook.retryStrategy.multiplier}x
|
|
235
|
+
- Max retries: ${exports.securityPlaybook.retryStrategy.maxRetries}
|
|
236
|
+
- Retry on: ${exports.securityPlaybook.retryStrategy.retryOn.join(', ')}
|
|
237
|
+
- Do NOT retry: ${exports.securityPlaybook.retryStrategy.doNotRetryOn.join(', ')}
|
|
238
|
+
|
|
239
|
+
## Failure Philosophy
|
|
240
|
+
${exports.securityPlaybook.failurePhilosophy.map(p => `- ${p}`).join('\n')}
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAwNH,0CAEC;AAKD,0DA0BC;AArPD,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAElE,QAAA,cAAc,GAAiB;IACxC;QACI,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE;YACL,gBAAgB;YAChB,4BAA4B;YAC5B,oBAAoB;YACpB,+BAA+B;SAClC;QACD,cAAc,EAAE;YACZ,2CAA2C;YAC3C,yCAAyC;YACzC,mEAAmE;YAC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C,IAAI,CAAC;CACxD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;YAGD,wBAAgB,CAAC,YAAY,CAAC,UAAU;aACvC,wBAAgB,CAAC,YAAY,CAAC,YAAY;eACxC,wBAAgB,CAAC,YAAY,CAAC,cAAc;mBACxC,wBAAgB,CAAC,YAAY,CAAC,YAAY;;;gBAG7C,wBAAgB,CAAC,aAAa,CAAC,SAAS;gBACxC,wBAAgB,CAAC,aAAa,CAAC,UAAU;iBACxC,wBAAgB,CAAC,aAAa,CAAC,UAAU;cAC5C,wBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;kBAC7C,wBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;;EAGtE,wBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;CACjE,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IronBackend Tech Stack Presets
|
|
3
|
+
* Pre-configured technology stack definitions
|
|
4
|
+
*/
|
|
5
|
+
import type { TechStack } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Node.js + NestJS + PostgreSQL Stack
|
|
8
|
+
*/
|
|
9
|
+
export declare const nodeNestjs: TechStack;
|
|
10
|
+
/**
|
|
11
|
+
* Java + Spring Boot Stack
|
|
12
|
+
*/
|
|
13
|
+
export declare const javaSpring: TechStack;
|
|
14
|
+
/**
|
|
15
|
+
* .NET + ASP.NET Core Stack
|
|
16
|
+
*/
|
|
17
|
+
export declare const dotnetAspnetcore: TechStack;
|
|
18
|
+
/**
|
|
19
|
+
* Python + FastAPI Stack
|
|
20
|
+
*/
|
|
21
|
+
export declare const pythonFastapi: TechStack;
|
|
22
|
+
/**
|
|
23
|
+
* All available stacks
|
|
24
|
+
*/
|
|
25
|
+
export declare const stacks: Record<string, TechStack>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a stack by ID
|
|
28
|
+
*/
|
|
29
|
+
export declare function getStack(id: string): TechStack | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Get all stack IDs
|
|
32
|
+
*/
|
|
33
|
+
export declare function getStackIds(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Find stacks by language
|
|
36
|
+
*/
|
|
37
|
+
export declare function findStacksByLanguage(language: string): TechStack[];
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,SAiCxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,SAmCxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAmC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAmC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAK5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE1D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CAKlE"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBackend Tech Stack Presets
|
|
4
|
+
* Pre-configured technology stack definitions
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.stacks = exports.pythonFastapi = exports.dotnetAspnetcore = exports.javaSpring = exports.nodeNestjs = void 0;
|
|
8
|
+
exports.getStack = getStack;
|
|
9
|
+
exports.getStackIds = getStackIds;
|
|
10
|
+
exports.findStacksByLanguage = findStacksByLanguage;
|
|
11
|
+
/**
|
|
12
|
+
* Node.js + NestJS + PostgreSQL Stack
|
|
13
|
+
*/
|
|
14
|
+
exports.nodeNestjs = {
|
|
15
|
+
id: 'node-nestjs',
|
|
16
|
+
name: 'Node.js + NestJS + PostgreSQL',
|
|
17
|
+
language: 'TypeScript',
|
|
18
|
+
languageVersion: '5.3+',
|
|
19
|
+
framework: 'NestJS',
|
|
20
|
+
frameworkVersion: '10.x',
|
|
21
|
+
database: {
|
|
22
|
+
type: 'PostgreSQL',
|
|
23
|
+
orm: 'Prisma',
|
|
24
|
+
driver: 'pg'
|
|
25
|
+
},
|
|
26
|
+
messaging: {
|
|
27
|
+
type: 'Queue',
|
|
28
|
+
provider: 'BullMQ (Redis-backed)'
|
|
29
|
+
},
|
|
30
|
+
authentication: 'Passport.js + JWT',
|
|
31
|
+
logging: 'Pino (structured JSON)',
|
|
32
|
+
testing: {
|
|
33
|
+
unit: 'Jest',
|
|
34
|
+
integration: 'Supertest',
|
|
35
|
+
e2e: 'Jest + Supertest',
|
|
36
|
+
coverageTarget: 80
|
|
37
|
+
},
|
|
38
|
+
deployment: ['Docker', 'Kubernetes'],
|
|
39
|
+
conventions: [
|
|
40
|
+
'Use NestJS modules for feature boundaries',
|
|
41
|
+
'DTOs with class-validator decorators',
|
|
42
|
+
'Repositories as providers, not raw Prisma in services',
|
|
43
|
+
'Custom exceptions extending HttpException',
|
|
44
|
+
'Guards for authentication, interceptors for logging',
|
|
45
|
+
'ConfigService for environment variables'
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Java + Spring Boot Stack
|
|
50
|
+
*/
|
|
51
|
+
exports.javaSpring = {
|
|
52
|
+
id: 'java-spring',
|
|
53
|
+
name: 'Java + Spring Boot',
|
|
54
|
+
language: 'Java',
|
|
55
|
+
languageVersion: '21 (LTS)',
|
|
56
|
+
framework: 'Spring Boot',
|
|
57
|
+
frameworkVersion: '3.x',
|
|
58
|
+
database: {
|
|
59
|
+
type: 'PostgreSQL',
|
|
60
|
+
orm: 'Spring Data JPA',
|
|
61
|
+
driver: 'HikariCP'
|
|
62
|
+
},
|
|
63
|
+
messaging: {
|
|
64
|
+
type: 'AMQP/Kafka',
|
|
65
|
+
provider: 'Spring AMQP (RabbitMQ) or Spring Kafka'
|
|
66
|
+
},
|
|
67
|
+
authentication: 'Spring Security + OAuth2',
|
|
68
|
+
logging: 'SLF4J + Logback',
|
|
69
|
+
testing: {
|
|
70
|
+
unit: 'JUnit 5',
|
|
71
|
+
integration: 'Testcontainers',
|
|
72
|
+
e2e: 'Spring MockMvc',
|
|
73
|
+
coverageTarget: 80
|
|
74
|
+
},
|
|
75
|
+
deployment: ['Docker', 'Kubernetes'],
|
|
76
|
+
conventions: [
|
|
77
|
+
'Use records for DTOs (Java 16+)',
|
|
78
|
+
'Repositories extend JpaRepository',
|
|
79
|
+
'Services annotated with @Service',
|
|
80
|
+
'Controllers use @RestController',
|
|
81
|
+
'Validation via @Valid and jakarta.validation',
|
|
82
|
+
'Configuration properties with @ConfigurationProperties',
|
|
83
|
+
'Use Optional for nullable returns',
|
|
84
|
+
'Prefer constructor injection over field injection'
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* .NET + ASP.NET Core Stack
|
|
89
|
+
*/
|
|
90
|
+
exports.dotnetAspnetcore = {
|
|
91
|
+
id: 'dotnet-aspnetcore',
|
|
92
|
+
name: '.NET + ASP.NET Core',
|
|
93
|
+
language: 'C#',
|
|
94
|
+
languageVersion: '12 / .NET 8',
|
|
95
|
+
framework: 'ASP.NET Core',
|
|
96
|
+
frameworkVersion: '8.0',
|
|
97
|
+
database: {
|
|
98
|
+
type: 'PostgreSQL',
|
|
99
|
+
orm: 'Entity Framework Core',
|
|
100
|
+
driver: 'Npgsql'
|
|
101
|
+
},
|
|
102
|
+
messaging: {
|
|
103
|
+
type: 'Queue',
|
|
104
|
+
provider: 'MassTransit (RabbitMQ or Azure Service Bus)'
|
|
105
|
+
},
|
|
106
|
+
authentication: 'ASP.NET Identity + JWT Bearer',
|
|
107
|
+
logging: 'Serilog',
|
|
108
|
+
testing: {
|
|
109
|
+
unit: 'xUnit',
|
|
110
|
+
integration: 'WebApplicationFactory',
|
|
111
|
+
e2e: 'xUnit + WireMock',
|
|
112
|
+
coverageTarget: 80
|
|
113
|
+
},
|
|
114
|
+
deployment: ['Docker', 'Kubernetes', 'Azure App Service'],
|
|
115
|
+
conventions: [
|
|
116
|
+
'Use Minimal APIs or Controllers based on complexity',
|
|
117
|
+
'Record types for DTOs',
|
|
118
|
+
'Repository pattern with EF Core',
|
|
119
|
+
'MediatR for CQRS when needed',
|
|
120
|
+
'FluentValidation for input validation',
|
|
121
|
+
'Options pattern for configuration',
|
|
122
|
+
'Dependency injection via built-in container',
|
|
123
|
+
'Use nullable reference types'
|
|
124
|
+
]
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Python + FastAPI Stack
|
|
128
|
+
*/
|
|
129
|
+
exports.pythonFastapi = {
|
|
130
|
+
id: 'python-fastapi',
|
|
131
|
+
name: 'Python + FastAPI',
|
|
132
|
+
language: 'Python',
|
|
133
|
+
languageVersion: '3.11+',
|
|
134
|
+
framework: 'FastAPI',
|
|
135
|
+
frameworkVersion: '0.100+',
|
|
136
|
+
database: {
|
|
137
|
+
type: 'PostgreSQL',
|
|
138
|
+
orm: 'SQLAlchemy 2.0',
|
|
139
|
+
driver: 'asyncpg'
|
|
140
|
+
},
|
|
141
|
+
messaging: {
|
|
142
|
+
type: 'Queue',
|
|
143
|
+
provider: 'Celery (Redis) or arq'
|
|
144
|
+
},
|
|
145
|
+
authentication: 'FastAPI Security + python-jose',
|
|
146
|
+
logging: 'structlog',
|
|
147
|
+
testing: {
|
|
148
|
+
unit: 'pytest',
|
|
149
|
+
integration: 'pytest + httpx',
|
|
150
|
+
e2e: 'pytest-asyncio',
|
|
151
|
+
coverageTarget: 80
|
|
152
|
+
},
|
|
153
|
+
deployment: ['Docker', 'Kubernetes'],
|
|
154
|
+
conventions: [
|
|
155
|
+
'Pydantic models for request/response schemas',
|
|
156
|
+
'Async endpoints by default',
|
|
157
|
+
'Dependency injection via FastAPI Depends',
|
|
158
|
+
'SQLAlchemy models separate from Pydantic schemas',
|
|
159
|
+
'Use dataclasses for domain entities',
|
|
160
|
+
'Type hints everywhere',
|
|
161
|
+
'Alembic for database migrations',
|
|
162
|
+
'Virtual environments with poetry or uv'
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* All available stacks
|
|
167
|
+
*/
|
|
168
|
+
exports.stacks = {
|
|
169
|
+
'node-nestjs': exports.nodeNestjs,
|
|
170
|
+
'java-spring': exports.javaSpring,
|
|
171
|
+
'dotnet-aspnetcore': exports.dotnetAspnetcore,
|
|
172
|
+
'python-fastapi': exports.pythonFastapi,
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Get a stack by ID
|
|
176
|
+
*/
|
|
177
|
+
function getStack(id) {
|
|
178
|
+
return exports.stacks[id];
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get all stack IDs
|
|
182
|
+
*/
|
|
183
|
+
function getStackIds() {
|
|
184
|
+
return Object.keys(exports.stacks);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Find stacks by language
|
|
188
|
+
*/
|
|
189
|
+
function findStacksByLanguage(language) {
|
|
190
|
+
const normalizedLang = language.toLowerCase();
|
|
191
|
+
return Object.values(exports.stacks).filter(stack => stack.language.toLowerCase().includes(normalizedLang));
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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 -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-monolith.d.ts","sourceRoot":"","sources":["../../src/styles/clean-monolith.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,iBAyH3B,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanMonolith = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Clean Monolith Architecture Style
|
|
6
|
+
* Single deployable unit with clean internal boundaries
|
|
7
|
+
*/
|
|
8
|
+
exports.cleanMonolith = {
|
|
9
|
+
id: 'clean-monolith',
|
|
10
|
+
name: 'Clean Monolith',
|
|
11
|
+
description: 'Single deployable unit with clean internal boundaries. Domain logic isolated from infrastructure. Well-suited for small to medium teams that value deployment simplicity.',
|
|
12
|
+
whenToUse: [
|
|
13
|
+
'Team size < 15 developers',
|
|
14
|
+
'Single database is sufficient',
|
|
15
|
+
'Deployment simplicity is priority',
|
|
16
|
+
'Startup or early-stage product',
|
|
17
|
+
'Unclear domain boundaries initially',
|
|
18
|
+
'Rapid iteration required'
|
|
19
|
+
],
|
|
20
|
+
whenNotToUse: [
|
|
21
|
+
'Multiple teams need independent deployments',
|
|
22
|
+
'Different scaling requirements per component',
|
|
23
|
+
'Regulatory isolation required',
|
|
24
|
+
'Polyglot persistence needed',
|
|
25
|
+
'Team exceeds 15-20 developers'
|
|
26
|
+
],
|
|
27
|
+
corePrinciples: [
|
|
28
|
+
'Layered architecture: Controller → Service → Repository → Domain',
|
|
29
|
+
'Domain logic must not depend on frameworks',
|
|
30
|
+
'Dependency injection for all external resources',
|
|
31
|
+
'Single source of truth for business rules',
|
|
32
|
+
'Clear separation between I/O and pure logic',
|
|
33
|
+
'Infrastructure concerns at the edges only'
|
|
34
|
+
],
|
|
35
|
+
folderStructure: {
|
|
36
|
+
name: 'src',
|
|
37
|
+
type: 'folder',
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
name: 'api',
|
|
41
|
+
type: 'folder',
|
|
42
|
+
description: 'HTTP controllers, middleware, routes',
|
|
43
|
+
children: [
|
|
44
|
+
{ name: 'controllers', type: 'folder', description: 'HTTP request handlers' },
|
|
45
|
+
{ name: 'middleware', type: 'folder', description: 'Request/response interceptors' },
|
|
46
|
+
{ name: 'routes', type: 'folder', description: 'Route definitions' }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'application',
|
|
51
|
+
type: 'folder',
|
|
52
|
+
description: 'Use cases, DTOs, application services',
|
|
53
|
+
children: [
|
|
54
|
+
{ name: 'services', type: 'folder', description: 'Application services orchestrating domain' },
|
|
55
|
+
{ name: 'dto', type: 'folder', description: 'Data transfer objects' },
|
|
56
|
+
{ name: 'mappers', type: 'folder', description: 'Entity ↔ DTO mappers' }
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'domain',
|
|
61
|
+
type: 'folder',
|
|
62
|
+
description: 'Entities, value objects, domain services',
|
|
63
|
+
children: [
|
|
64
|
+
{ name: 'entities', type: 'folder', description: 'Domain entities with identity' },
|
|
65
|
+
{ name: 'value-objects', type: 'folder', description: 'Immutable domain concepts' },
|
|
66
|
+
{ name: 'services', type: 'folder', description: 'Domain services for cross-entity logic' },
|
|
67
|
+
{ name: 'interfaces', type: 'folder', description: 'Repository and gateway interfaces' }
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'infrastructure',
|
|
72
|
+
type: 'folder',
|
|
73
|
+
description: 'Database, external APIs, messaging',
|
|
74
|
+
children: [
|
|
75
|
+
{ name: 'database', type: 'folder', description: 'Repository implementations, migrations' },
|
|
76
|
+
{ name: 'external', type: 'folder', description: 'External API clients' },
|
|
77
|
+
{ name: 'config', type: 'folder', description: 'Configuration loading' }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'shared',
|
|
82
|
+
type: 'folder',
|
|
83
|
+
description: 'Cross-cutting concerns',
|
|
84
|
+
children: [
|
|
85
|
+
{ name: 'errors', type: 'folder', description: 'Custom error types' },
|
|
86
|
+
{ name: 'utils', type: 'folder', description: 'Utility functions' },
|
|
87
|
+
{ name: 'types', type: 'folder', description: 'Shared type definitions' }
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
commonPitfalls: [
|
|
93
|
+
'Mixing domain logic in controllers - controllers should only handle HTTP concerns',
|
|
94
|
+
'Direct database access from application layer - always go through repositories',
|
|
95
|
+
'Circular dependencies between layers - dependencies flow inward only',
|
|
96
|
+
'Framework-specific code in domain layer - domain must be framework-agnostic',
|
|
97
|
+
'Anemic domain model - entities should have behavior, not just data',
|
|
98
|
+
'Fat services that do everything - keep services focused on orchestration'
|
|
99
|
+
],
|
|
100
|
+
aiInstructions: `When generating code for Clean Monolith architecture:
|
|
101
|
+
|
|
102
|
+
STRUCTURE:
|
|
103
|
+
- Controllers handle HTTP only, delegate to application services
|
|
104
|
+
- Application services orchestrate domain logic, never access DB directly
|
|
105
|
+
- Repositories implement domain interfaces defined in domain layer
|
|
106
|
+
- Domain entities have no framework annotations or decorators
|
|
107
|
+
|
|
108
|
+
DEPENDENCIES:
|
|
109
|
+
- api → application → domain ← infrastructure
|
|
110
|
+
- Never import from infrastructure in domain
|
|
111
|
+
- All external dependencies injected via interfaces
|
|
112
|
+
|
|
113
|
+
PATTERNS:
|
|
114
|
+
- Use constructor injection for all dependencies
|
|
115
|
+
- Return domain entities from repositories, not database records
|
|
116
|
+
- Map to DTOs only at API boundaries
|
|
117
|
+
- Validate input at controller level, invariants in domain
|
|
118
|
+
|
|
119
|
+
TESTING:
|
|
120
|
+
- Unit test domain logic in isolation
|
|
121
|
+
- Mock repositories for application service tests
|
|
122
|
+
- Integration test API endpoints with real database`
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=clean-monolith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-monolith.js","sourceRoot":"","sources":["../../src/styles/clean-monolith.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,aAAa,GAAsB;IAC5C,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,2KAA2K;IAExL,SAAS,EAAE;QACP,2BAA2B;QAC3B,+BAA+B;QAC/B,mCAAmC;QACnC,gCAAgC;QAChC,qCAAqC;QACrC,0BAA0B;KAC7B;IAED,YAAY,EAAE;QACV,6CAA6C;QAC7C,8CAA8C;QAC9C,+BAA+B;QAC/B,6BAA6B;QAC7B,+BAA+B;KAClC;IAED,cAAc,EAAE;QACZ,kEAAkE;QAClE,4CAA4C;QAC5C,iDAAiD;QACjD,2CAA2C;QAC3C,6CAA6C;QAC7C,2CAA2C;KAC9C;IAED,eAAe,EAAE;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC;gBACnD,QAAQ,EAAE;oBACN,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;oBAC7E,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;oBACpF,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;iBACvE;aACJ;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE;oBACN,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EA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AAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;oBACrE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;oBACnE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;iBAC5E;aACJ;SACJ;KACJ;IAED,cAAc,EAAE;QACZ,mFAAmF;QACnF,gFAAgF;QAChF,sEAAsE;QACtE,6EAA6E;QAC7E,oEAAoE;QACpE,0EAA0E;KAC7E;IAED,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;oDAsBgC;CACnD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ArchitectureStyle } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Event-Driven Backend Architecture
|
|
4
|
+
* Components communicate through events, asynchronously
|
|
5
|
+
*/
|
|
6
|
+
export declare const eventDriven: ArchitectureStyle;
|
|
7
|
+
/**
|
|
8
|
+
* CQRS Architecture Style
|
|
9
|
+
* Separate models for reading and writing data
|
|
10
|
+
*/
|
|
11
|
+
export declare const cqrs: ArchitectureStyle;
|
|
12
|
+
//# sourceMappingURL=event-driven.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-driven.d.ts","sourceRoot":"","sources":["../../src/styles/event-driven.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,iBAwHzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,iBA6HlB,CAAC"}
|