create-qa-architect 5.0.7 → 5.3.1

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.
@@ -1,1513 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Create SaaS Monetization - Bootstrap complete revenue system for any project
5
- *
6
- * Usage: npx create-saas-monetization@latest
7
- *
8
- * Implements:
9
- * - Stripe payment infrastructure
10
- * - License key system with CLI activation
11
- * - Billing dashboard and customer portal
12
- * - Legal compliance (Privacy, Terms, Copyright, Disclaimers)
13
- * - Conversion landing page
14
- * - Beta user email campaigns
15
- * - Upgrade prompts and messaging
16
- *
17
- * Roadmap / Future Ideas:
18
- * - Extract licensing to shared npm package (@vibebuildlab/licensing)
19
- * - Single source of truth across all Vibe Lab products
20
- * - Central license server with one API for all products
21
- * - Device/activation limits (optional enforcement)
22
- * - License revocation for chargebacks
23
- * - Team/seat-based licensing with org management
24
- * - SSO/SAML integration for Enterprise tier
25
- * - Usage-based billing option (metered pricing)
26
- */
27
-
28
- 'use strict'
29
-
30
- const fs = require('fs')
31
- const path = require('path')
32
- const readline = require('readline')
33
-
34
- // Default pricing constants (can be overridden in interactive setup)
35
- const PRO_PRICE = '49'
36
- const ENTERPRISE_PRICE = '149'
37
- const FOUNDER_PRO_PRICE = '24.50'
38
- const FOUNDER_ENTERPRISE_PRICE = '74.50'
39
-
40
- class SaaSMonetizationBootstrap {
41
- constructor() {
42
- this.projectRoot = path.resolve(process.cwd())
43
- this.config = {}
44
- this.templates = {
45
- stripe: this.getStripeTemplate(),
46
- licensing: this.getLicensingTemplate(),
47
- legal: this.getLegalTemplates(),
48
- marketing: this.getMarketingTemplates(),
49
- billing: this.getBillingTemplate(),
50
- }
51
- }
52
-
53
- resolveProjectPath(relativePath) {
54
- const normalizedRoot = this.projectRoot.endsWith(path.sep)
55
- ? this.projectRoot
56
- : `${this.projectRoot}${path.sep}`
57
- const resolvedPath = path.resolve(this.projectRoot, relativePath)
58
-
59
- if (
60
- resolvedPath !== this.projectRoot &&
61
- !resolvedPath.startsWith(normalizedRoot)
62
- ) {
63
- throw new Error(
64
- `Refusing to access path outside project root: ${relativePath}`
65
- )
66
- }
67
-
68
- return resolvedPath
69
- }
70
-
71
- ensureDir(relativePath) {
72
- const target = this.resolveProjectPath(relativePath)
73
- // Path is constrained to the project root before touching the filesystem
74
- // eslint-disable-next-line security/detect-non-literal-fs-filename
75
- if (!fs.existsSync(target)) {
76
- // eslint-disable-next-line security/detect-non-literal-fs-filename
77
- fs.mkdirSync(target, { recursive: true })
78
- }
79
- return target
80
- }
81
-
82
- writeProjectFile(relativePath, content) {
83
- const target = this.resolveProjectPath(relativePath)
84
- // Path is constrained to the project root before touching the filesystem
85
- // eslint-disable-next-line security/detect-non-literal-fs-filename
86
- fs.writeFileSync(target, content)
87
- }
88
-
89
- readProjectFile(relativePath) {
90
- const target = this.resolveProjectPath(relativePath)
91
- // Path is constrained to the project root before touching the filesystem
92
- // eslint-disable-next-line security/detect-non-literal-fs-filename
93
- return fs.readFileSync(target, 'utf8')
94
- }
95
-
96
- projectFileExists(relativePath) {
97
- const target = this.resolveProjectPath(relativePath)
98
- // Path is constrained to the project root before touching the filesystem
99
- // eslint-disable-next-line security/detect-non-literal-fs-filename
100
- return fs.existsSync(target)
101
- }
102
-
103
- async run() {
104
- console.log('🚀 Create SaaS Monetization')
105
- console.log('═══════════════════════════════════')
106
- console.log('Bootstrap complete revenue system for your project\n')
107
-
108
- // Collect project configuration
109
- await this.collectConfiguration()
110
-
111
- // Create directory structure
112
- this.createDirectoryStructure()
113
-
114
- // Generate all components
115
- await this.generateStripeIntegration()
116
- await this.generateLicensingSystem()
117
- await this.generateLegalPages()
118
- await this.generateMarketingAssets()
119
- await this.generateBillingDashboard()
120
- await this.updatePackageJson()
121
- await this.generateEnvironmentTemplate()
122
- await this.generateDeploymentGuide()
123
-
124
- console.log('\n🎉 SaaS Monetization System Created!')
125
- console.log('═══════════════════════════════════════')
126
- console.log('\nWhat was generated:')
127
- console.log('📁 lib/monetization/ - Complete payment infrastructure')
128
- console.log('📁 legal/ - GDPR/CCPA compliant legal pages')
129
- console.log('📁 marketing/ - Landing pages and email campaigns')
130
- console.log('📁 billing/ - Customer dashboard and portal')
131
- console.log('📄 .env.template - Environment configuration')
132
- console.log('📄 MONETIZATION_GUIDE.md - Complete setup instructions')
133
-
134
- console.log('\n📋 Next Steps:')
135
- console.log('1. Copy .env.template to .env and configure Stripe keys')
136
- console.log('2. Deploy legal pages to your domain')
137
- console.log('3. Set up Stripe products and pricing')
138
- console.log('4. Launch beta user email campaign')
139
- console.log('5. Read MONETIZATION_GUIDE.md for detailed instructions')
140
-
141
- console.log('\n💰 Revenue Potential: $1,500-5,000/month recurring')
142
- }
143
-
144
- async collectConfiguration() {
145
- const rl = readline.createInterface({
146
- input: process.stdin,
147
- output: process.stdout,
148
- })
149
-
150
- const question = query =>
151
- new Promise(resolve => rl.question(query, resolve))
152
-
153
- try {
154
- console.log('📋 Project Configuration')
155
- console.log('─────────────────────────')
156
-
157
- this.config.projectName =
158
- (await question('Project name: ')) || path.basename(this.projectRoot)
159
- this.config.description =
160
- (await question('Project description: ')) ||
161
- `${this.config.projectName} - Professional SaaS platform`
162
- this.config.domain =
163
- (await question('Domain (e.g. yoursite.com): ')) || 'yoursite.com'
164
- this.config.companyName =
165
- (await question('Company/Author name: ')) || 'Your Company'
166
- this.config.supportEmail =
167
- (await question('Support email: ')) || 'support@yoursite.com'
168
-
169
- console.log('\n💰 Pricing Configuration')
170
- console.log('─────────────────────────')
171
- this.config.starterPrice =
172
- (await question('Starter tier monthly price (default $19): ')) || '19'
173
- this.config.proPrice =
174
- (await question('Pro tier monthly price (default $49): ')) || '49'
175
- this.config.enterprisePrice =
176
- (await question('Enterprise tier monthly price (default $149): ')) ||
177
- '149'
178
- this.config.founderDiscount =
179
- (await question('Founder discount % (default 50): ')) || '50'
180
-
181
- console.log('\n🎯 Feature Configuration')
182
- console.log('─────────────────────────')
183
- this.config.premiumFeatures =
184
- (await question('Premium features (comma-separated): ')) ||
185
- 'Advanced Analytics,Priority Support,Custom Integrations'
186
- this.config.freeTierFeatures =
187
- (await question('Free tier features (comma-separated): ')) ||
188
- 'Basic Features,Community Support'
189
- } finally {
190
- rl.close()
191
- }
192
-
193
- // Calculate derived values
194
- this.config.founderStarterPrice = (
195
- parseFloat(this.config.starterPrice) *
196
- (1 - parseFloat(this.config.founderDiscount) / 100)
197
- ).toFixed(2)
198
- this.config.founderProPrice = (
199
- parseFloat(this.config.proPrice) *
200
- (1 - parseFloat(this.config.founderDiscount) / 100)
201
- ).toFixed(2)
202
- this.config.founderEnterprisePrice = (
203
- parseFloat(this.config.enterprisePrice) *
204
- (1 - parseFloat(this.config.founderDiscount) / 100)
205
- ).toFixed(2)
206
- }
207
-
208
- createDirectoryStructure() {
209
- const dirs = ['lib/monetization', 'legal', 'marketing', 'billing']
210
-
211
- dirs.forEach(dir => {
212
- this.ensureDir(dir)
213
- })
214
- }
215
-
216
- async generateStripeIntegration() {
217
- const stripeCode = this.templates.stripe
218
- .replace(/{{PROJECT_NAME}}/g, this.config.projectName)
219
- .replace(/{{PRO_PRICE}}/g, this.config.proPrice)
220
- .replace(/{{ENTERPRISE_PRICE}}/g, this.config.enterprisePrice)
221
-
222
- this.writeProjectFile(
223
- path.join('lib/monetization', 'stripe-integration.js'),
224
- stripeCode
225
- )
226
- }
227
-
228
- async generateLicensingSystem() {
229
- const licensingCode = this.templates.licensing
230
- .replace(/{{PROJECT_NAME}}/g, this.config.projectName)
231
- .replace(/{{PREMIUM_FEATURES}}/g, this.config.premiumFeatures)
232
- .replace(/{{FREE_FEATURES}}/g, this.config.freeTierFeatures)
233
- .replace(/{{PRO_PRICE}}/g, this.config.proPrice)
234
- .replace(/{{ENTERPRISE_PRICE}}/g, this.config.enterprisePrice)
235
- .replace(/{{FOUNDER_PRO_PRICE}}/g, this.config.founderProPrice)
236
- .replace(/{{DOMAIN}}/g, this.config.domain)
237
-
238
- this.writeProjectFile(
239
- path.join('lib/monetization', 'licensing.js'),
240
- licensingCode
241
- )
242
- }
243
-
244
- async generateLegalPages() {
245
- for (const [filename, template] of Object.entries(this.templates.legal)) {
246
- const content = template
247
- .replace(/{{PROJECT_NAME}}/g, this.config.projectName)
248
- .replace(/{{COMPANY_NAME}}/g, this.config.companyName)
249
- .replace(/{{DOMAIN}}/g, this.config.domain)
250
- .replace(/{{SUPPORT_EMAIL}}/g, this.config.supportEmail)
251
- .replace(/{{DESCRIPTION}}/g, this.config.description)
252
- .replace(/{{DATE}}/g, new Date().toISOString().split('T')[0])
253
-
254
- this.writeProjectFile(path.join('legal', filename), content)
255
- }
256
- }
257
-
258
- async generateMarketingAssets() {
259
- for (const [filename, template] of Object.entries(
260
- this.templates.marketing
261
- )) {
262
- const content = template
263
- .replace(/{{PROJECT_NAME}}/g, this.config.projectName)
264
- .replace(/{{DESCRIPTION}}/g, this.config.description)
265
- .replace(/{{DOMAIN}}/g, this.config.domain)
266
- .replace(/{{PRO_PRICE}}/g, this.config.proPrice)
267
- .replace(/{{ENTERPRISE_PRICE}}/g, this.config.enterprisePrice)
268
- .replace(/{{FOUNDER_PRO_PRICE}}/g, this.config.founderProPrice)
269
- .replace(
270
- /{{FOUNDER_ENTERPRISE_PRICE}}/g,
271
- this.config.founderEnterprisePrice
272
- )
273
- .replace(/{{FOUNDER_DISCOUNT}}/g, this.config.founderDiscount)
274
- .replace(
275
- /{{PREMIUM_FEATURES}}/g,
276
- this.config.premiumFeatures
277
- .split(',')
278
- .map(f => f.trim())
279
- .join(', ')
280
- )
281
- .replace(/{{SUPPORT_EMAIL}}/g, this.config.supportEmail)
282
-
283
- this.writeProjectFile(path.join('marketing', filename), content)
284
- }
285
- }
286
-
287
- async generateBillingDashboard() {
288
- const billingCode = this.templates.billing
289
- .replace(/{{PROJECT_NAME}}/g, this.config.projectName)
290
- .replace(/{{PRO_PRICE}}/g, this.config.proPrice)
291
- .replace(/{{ENTERPRISE_PRICE}}/g, this.config.enterprisePrice)
292
- .replace(/{{FOUNDER_PRO_PRICE}}/g, this.config.founderProPrice)
293
- .replace(
294
- /{{FOUNDER_ENTERPRISE_PRICE}}/g,
295
- this.config.founderEnterprisePrice
296
- )
297
- .replace(/{{PREMIUM_FEATURES}}/g, this.config.premiumFeatures)
298
-
299
- this.writeProjectFile(path.join('billing', 'dashboard.html'), billingCode)
300
- }
301
-
302
- async updatePackageJson() {
303
- const packagePath = 'package.json'
304
-
305
- if (this.projectFileExists(packagePath)) {
306
- const pkg = JSON.parse(this.readProjectFile(packagePath))
307
-
308
- // Add monetization scripts
309
- pkg.scripts = pkg.scripts || {}
310
- pkg.scripts['activate-license'] =
311
- 'node lib/monetization/cli-activation.js'
312
- pkg.scripts['license-status'] = 'node lib/monetization/license-status.js'
313
- pkg.scripts['billing-webhook'] = 'node lib/monetization/stripe-webhook.js'
314
-
315
- // Add monetization dependencies
316
- pkg.dependencies = pkg.dependencies || {}
317
- pkg.dependencies.stripe = '^14.15.0'
318
- pkg.dependencies.crypto = '^1.0.1'
319
-
320
- this.writeProjectFile(packagePath, JSON.stringify(pkg, null, 2))
321
- }
322
- }
323
-
324
- async generateEnvironmentTemplate() {
325
- const envTemplate = `# ${this.config.projectName} - SaaS Monetization Environment Variables
326
-
327
- # Stripe Configuration
328
- STRIPE_SECRET_KEY=sk_test_your_test_key_here
329
- STRIPE_PUBLISHABLE_KEY=pk_test_your_test_key_here
330
- STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
331
-
332
- # Stripe Price IDs (create in Stripe Dashboard)
333
- STRIPE_PRICE_ID_PRO=price_your_pro_monthly_id
334
- STRIPE_PRICE_ID_ENTERPRISE=price_your_enterprise_monthly_id
335
- STRIPE_PRICE_ID_PRO_FOUNDER=price_your_pro_founder_id
336
- STRIPE_PRICE_ID_ENTERPRISE_FOUNDER=price_your_enterprise_founder_id
337
-
338
- # License Security
339
- LICENSE_SIGNING_SECRET=your_secure_random_string_here
340
-
341
- # Application Configuration
342
- APP_DOMAIN=${this.config.domain}
343
- SUPPORT_EMAIL=${this.config.supportEmail}
344
- COMPANY_NAME=${this.config.companyName}
345
-
346
- # Production Override (uncomment for live environment)
347
- # STRIPE_SECRET_KEY=sk_live_your_live_key_here
348
- # STRIPE_PUBLISHABLE_KEY=pk_live_your_live_key_here
349
- `
350
-
351
- this.writeProjectFile('.env.template', envTemplate)
352
- }
353
-
354
- async generateDeploymentGuide() {
355
- const guide = `# ${this.config.projectName} - Monetization Setup Guide
356
-
357
- ## 🚀 Complete SaaS Revenue System
358
-
359
- This guide walks you through setting up the complete monetization infrastructure for ${this.config.projectName}.
360
-
361
- ## 📁 Generated Files
362
-
363
- ### Payment Infrastructure
364
- - \`lib/monetization/stripe-integration.js\` - Complete Stripe payment processing
365
- - \`lib/monetization/licensing.js\` - License key validation and management
366
- - \`billing/dashboard.html\` - Customer subscription management UI
367
-
368
- ### Legal Compliance
369
- - \`legal/privacy-policy.md\` - GDPR/CCPA compliant privacy policy
370
- - \`legal/terms-of-service.md\` - Comprehensive terms and liability protection
371
- - \`legal/copyright.md\` - IP and trademark protection
372
- - \`legal/disclaimer.md\` - Software liability disclaimers
373
-
374
- ### Marketing Assets
375
- - \`marketing/landing-page.html\` - Conversion-optimized sales page
376
- - \`marketing/beta-email-campaign.md\` - 5-email drip sequence
377
- - \`marketing/upgrade-prompts.md\` - CLI and UI upgrade messaging
378
-
379
- ## 💰 Revenue Configuration
380
-
381
- **Pricing Tiers:**
382
- - 🆓 Free: ${this.config.freeTierFeatures}
383
- - 💎 Pro: $${this.config.proPrice}/month (${this.config.premiumFeatures})
384
- - 🏢 Enterprise: $${this.config.enterprisePrice}/month (Everything + priority support)
385
-
386
- **Founder Pricing:**
387
- - 💎 Pro: $${this.config.founderProPrice}/month (${this.config.founderDiscount}% off forever)
388
- - 🏢 Enterprise: $${this.config.founderEnterprisePrice}/month (${this.config.founderDiscount}% off forever)
389
-
390
- ## 🔧 Setup Instructions
391
-
392
- ### 1. Stripe Configuration (15 minutes)
393
-
394
- 1. **Create Stripe Account**: https://dashboard.stripe.com/register
395
- 2. **Create Products**:
396
- - Pro Monthly: $${this.config.proPrice}/month
397
- - Enterprise Monthly: $${this.config.enterprisePrice}/month
398
- - Pro Founder: $${this.config.founderProPrice}/month
399
- - Enterprise Founder: $${this.config.founderEnterprisePrice}/month
400
-
401
- 3. **Configure Environment**:
402
- \`\`\`bash
403
- cp .env.template .env
404
- # Edit .env with your Stripe keys
405
- \`\`\`
406
-
407
- 4. **Set up Webhooks**:
408
- - URL: \`https://${this.config.domain}/api/stripe-webhook\`
409
- - Events: \`checkout.session.completed\`, \`customer.subscription.deleted\`
410
-
411
- ### 2. Legal Pages Deployment (5 minutes)
412
-
413
- Upload legal pages to your website:
414
- - \`https://${this.config.domain}/legal/privacy-policy.html\` (Required for LinkedIn, GDPR)
415
- - \`https://${this.config.domain}/legal/terms-of-service.html\`
416
- - \`https://${this.config.domain}/legal/copyright.html\`
417
- - \`https://${this.config.domain}/legal/disclaimer.html\`
418
-
419
- ### 3. Marketing Assets Deployment (10 minutes)
420
-
421
- 1. **Landing Page**:
422
- - Upload \`marketing/landing-page.html\` to \`https://${this.config.domain}/upgrade\`
423
- - Test conversion flow end-to-end
424
-
425
- 2. **Email Campaign**:
426
- - Use \`marketing/beta-email-campaign.md\` templates
427
- - Set up drip sequence in your email platform
428
-
429
- ### 4. Integration with Your App (20 minutes)
430
-
431
- 1. **Add License Enforcement**:
432
- \`\`\`javascript
433
- const { getLicenseInfo } = require('./lib/monetization/licensing')
434
-
435
- const license = getLicenseInfo()
436
- if (license.tier === 'FREE') {
437
- // Show upgrade prompt for premium features
438
- }
439
- \`\`\`
440
-
441
- 2. **Add CLI Commands**:
442
- \`\`\`javascript
443
- // Add to your CLI argument parsing
444
- const isActivateLicenseMode = args.includes('--activate-license')
445
- const isLicenseStatusMode = args.includes('--license-status')
446
- \`\`\`
447
-
448
- ### 5. Testing (5 minutes)
449
-
450
- \`\`\`bash
451
- # Test license system
452
- npm run license-status
453
-
454
- # Test activation flow
455
- npm run activate-license
456
-
457
- # Test Stripe webhook (use Stripe CLI)
458
- stripe listen --forward-to localhost:3000/api/stripe-webhook
459
- \`\`\`
460
-
461
- ## 📊 Revenue Tracking
462
-
463
- ### Key Metrics to Monitor:
464
- - Monthly Recurring Revenue (MRR)
465
- - Customer Acquisition Cost (CAC)
466
- - Lifetime Value (CLV)
467
- - Conversion rates (free → paid)
468
- - Churn rate (target: <5% monthly)
469
-
470
- ### Success Targets:
471
- - **Month 1**: 10-20 beta user conversions = $${this.config.founderProPrice * 15}/month
472
- - **Month 3**: 50-100 total subscribers = $${this.config.founderProPrice * 75}/month
473
- - **Month 6**: 100-200 subscribers = $${this.config.proPrice * 150}/month
474
- - **Year 1**: 300-500 subscribers = $${this.config.proPrice * 400}/month
475
-
476
- ## 🛠️ Customization
477
-
478
- ### Modify Pricing:
479
- Edit \`lib/monetization/licensing.js\` and update:
480
- - Feature definitions
481
- - Pricing display
482
- - Upgrade URLs
483
-
484
- ### Add Features:
485
- 1. Update feature definitions in licensing system
486
- 2. Add feature gates in your application code
487
- 3. Update marketing materials
488
-
489
- ### Change Messaging:
490
- - Landing page: \`marketing/landing-page.html\`
491
- - Email campaigns: \`marketing/beta-email-campaign.md\`
492
- - CLI prompts: \`lib/monetization/licensing.js\`
493
-
494
- ## 🚨 Security Checklist
495
-
496
- - [ ] Stripe keys are in environment variables (not code)
497
- - [ ] Webhook endpoints verify signatures
498
- - [ ] License validation uses crypto-secure methods
499
- - [ ] Legal pages are deployed and accessible
500
- - [ ] Privacy policy includes data collection details
501
- - [ ] Terms of service include liability limitations
502
-
503
- ## 🎯 Launch Checklist
504
-
505
- - [ ] Stripe configured with test and live keys
506
- - [ ] Legal pages deployed to domain
507
- - [ ] Landing page deployed and tested
508
- - [ ] Email campaign templates ready
509
- - [ ] License activation tested end-to-end
510
- - [ ] Webhook endpoints responding correctly
511
- - [ ] Premium features properly gated
512
- - [ ] Pricing displayed correctly throughout app
513
-
514
- ## 📞 Support
515
-
516
- For implementation questions:
517
- - Email: ${this.config.supportEmail}
518
- - Documentation: https://${this.config.domain}/docs/monetization
519
-
520
- ---
521
-
522
- **Revenue System Generated**: $(date)
523
- **Estimated Setup Time**: 1 hour
524
- **Revenue Potential**: $1,500-5,000/month recurring
525
- `
526
-
527
- this.writeProjectFile('MONETIZATION_GUIDE.md', guide)
528
- }
529
-
530
- // Template methods (condensed versions of our implementations)
531
- getStripeTemplate() {
532
- return `'use strict'
533
-
534
- /**
535
- * Stripe Integration for {{PROJECT_NAME}}
536
- * Complete SaaS payment infrastructure
537
- */
538
-
539
- const crypto = require('crypto')
540
- const fs = require('fs')
541
- const path = require('path')
542
- const os = require('os')
543
-
544
- class StripeIntegration {
545
- constructor() {
546
- this.stripe = null
547
- this.webhookSecret = process.env.STRIPE_WEBHOOK_SECRET
548
- this.priceIds = {
549
- PRO_MONTHLY: process.env.STRIPE_PRICE_ID_PRO,
550
- ENTERPRISE_MONTHLY: process.env.STRIPE_PRICE_ID_ENTERPRISE,
551
- PRO_FOUNDER: process.env.STRIPE_PRICE_ID_PRO_FOUNDER,
552
- ENTERPRISE_FOUNDER: process.env.STRIPE_PRICE_ID_ENTERPRISE_FOUNDER
553
- }
554
- this.licenseDir = path.join(os.homedir(), '.{{PROJECT_NAME}}')
555
- }
556
-
557
- async initialize() {
558
- if (!process.env.STRIPE_SECRET_KEY) {
559
- throw new Error('STRIPE_SECRET_KEY environment variable required')
560
- }
561
-
562
- const { default: Stripe } = await import('stripe')
563
- this.stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
564
- apiVersion: '2023-10-16'
565
- })
566
- return true
567
- }
568
-
569
- async createCheckoutSession({ tier, isFounder = false, customerEmail, successUrl, cancelUrl, metadata = {} }) {
570
- await this.initialize()
571
-
572
- const priceId = this.getPriceId(tier, isFounder)
573
-
574
- const session = await this.stripe.checkout.sessions.create({
575
- mode: 'subscription',
576
- payment_method_types: ['card'],
577
- line_items: [{ price: priceId, quantity: 1 }],
578
- customer_email: customerEmail,
579
- success_url: successUrl,
580
- cancel_url: cancelUrl,
581
- allow_promotion_codes: true,
582
- subscription_data: {
583
- metadata: { tier, isFounder: isFounder.toString(), ...metadata }
584
- }
585
- })
586
-
587
- return { sessionId: session.id, url: session.url }
588
- }
589
-
590
- getPriceId(tier, isFounder = false) {
591
- if (tier === 'PRO') {
592
- return isFounder ? this.priceIds.PRO_FOUNDER : this.priceIds.PRO_MONTHLY
593
- }
594
- if (tier === 'ENTERPRISE') {
595
- return isFounder ? this.priceIds.ENTERPRISE_FOUNDER : this.priceIds.ENTERPRISE_MONTHLY
596
- }
597
- throw new Error(\`Invalid tier: \${tier}\`)
598
- }
599
-
600
- generateLicenseKey(customerId, tier, isFounder = false) {
601
- const payload = { customerId, tier, isFounder, issued: Date.now(), version: '1.0' }
602
-
603
- const hash = crypto.createHash('sha256')
604
- .update(\`\${customerId}:\${tier}:\${isFounder}:{{PROJECT_NAME}}-license-v1\`)
605
- .digest('hex')
606
-
607
- const keyParts = hash.slice(0, 16).match(/.{4}/g)
608
- const licenseKey = \`{{PROJECT_NAME}}-\${keyParts.join('-').toUpperCase()}\`
609
-
610
- return {
611
- licenseKey,
612
- payload,
613
- signature: this.signLicensePayload(payload)
614
- }
615
- }
616
-
617
- signLicensePayload(payload) {
618
- const secret = process.env.LICENSE_SIGNING_SECRET || '{{PROJECT_NAME}}-dev-secret'
619
- return crypto.createHmac('sha256', secret)
620
- .update(JSON.stringify(payload))
621
- .digest('hex')
622
- }
623
-
624
- async handleWebhook(body, signature) {
625
- await this.initialize()
626
-
627
- const event = this.stripe.webhooks.constructEvent(body, signature, this.webhookSecret)
628
-
629
- switch (event.type) {
630
- case 'checkout.session.completed':
631
- return await this.handleCheckoutCompleted(event.data.object)
632
- case 'customer.subscription.deleted':
633
- return await this.handleSubscriptionCanceled(event.data.object)
634
- default:
635
- return { success: true }
636
- }
637
- }
638
-
639
- async handleCheckoutCompleted(session) {
640
- const { tier, isFounder } = session.metadata
641
- const customerId = session.customer
642
- const purchaseEmail = session.customer_email || session.customer_details?.email
643
-
644
- const licenseData = this.generateLicenseKey(customerId, tier, isFounder === 'true')
645
-
646
- // Store license in legitimate license database
647
- await this.addLegitimateKey(
648
- licenseData.licenseKey,
649
- customerId,
650
- tier,
651
- isFounder === 'true',
652
- purchaseEmail
653
- )
654
-
655
- // Send license key to customer via email (implement email sending)
656
-
657
- return { success: true, licenseKey: licenseData.licenseKey }
658
- }
659
-
660
- async addLegitimateKey(licenseKey, customerId, tier, isFounder = false, purchaseEmail = null) {
661
- const licenseDir = path.join(os.homedir(), '.{{PROJECT_NAME}}')
662
- const legitimateDBFile = path.join(licenseDir, 'legitimate-licenses.json')
663
-
664
- // Ensure directory exists
665
- if (!fs.existsSync(licenseDir)) {
666
- fs.mkdirSync(licenseDir, { recursive: true })
667
- }
668
-
669
- // Load existing database
670
- let database = {}
671
- if (fs.existsSync(legitimateDBFile)) {
672
- try {
673
- database = JSON.parse(fs.readFileSync(legitimateDBFile, 'utf8'))
674
- } catch (error) {
675
- console.error('Warning: Could not parse existing database, creating new one')
676
- }
677
- }
678
-
679
- // Initialize metadata if needed
680
- if (!database._metadata) {
681
- database._metadata = {
682
- version: '1.0',
683
- created: new Date().toISOString(),
684
- description: 'Legitimate license database - populated by webhook'
685
- }
686
- }
687
-
688
- // Add license
689
- database[licenseKey] = {
690
- customerId,
691
- tier,
692
- isFounder,
693
- email: purchaseEmail,
694
- addedDate: new Date().toISOString(),
695
- addedBy: 'stripe_webhook'
696
- }
697
-
698
- // Update metadata
699
- database._metadata.lastUpdate = new Date().toISOString()
700
- database._metadata.totalLicenses = Object.keys(database).length - 1 // Exclude metadata
701
-
702
- // ⚠️ CRITICAL: Calculate SHA256 checksum for integrity verification (MANDATORY)
703
- // The license validator requires this and will reject databases without it
704
- const { _metadata, ...licensesOnly } = database
705
- const sha256 = crypto
706
- .createHash('sha256')
707
- .update(JSON.stringify(licensesOnly))
708
- .digest('hex')
709
- database._metadata.sha256 = sha256
710
-
711
- // Save database
712
- fs.writeFileSync(legitimateDBFile, JSON.stringify(database, null, 2))
713
-
714
- console.log(\`✅ Added legitimate license: \${licenseKey}\`)
715
- console.log(\` Customer: \${customerId}\`)
716
- console.log(\` Tier: \${tier}\`)
717
- console.log(\` Founder: \${isFounder ? 'Yes' : 'No'}\`)
718
- if (purchaseEmail) {
719
- console.log(\` Purchase Email: \${purchaseEmail}\`)
720
- }
721
-
722
- return { success: true }
723
- }
724
- }
725
-
726
- module.exports = { StripeIntegration }
727
- `
728
- }
729
-
730
- getLicensingTemplate() {
731
- return `'use strict'
732
-
733
- /**
734
- * Licensing System for {{PROJECT_NAME}}
735
- * Handles free/pro/enterprise tier validation
736
- *
737
- * ⚠️ SECURITY WARNING: This is a template file!
738
- * For production use, copy from create-qa-architect v4.1.1+ which includes:
739
- * - Cryptographic signature verification
740
- * - Secure Stripe integration
741
- * - License tampering prevention
742
- * - Legitimate license database system
743
- * - Admin tools for license management
744
- *
745
- * Do NOT use this template as-is in production!
746
- */
747
-
748
- const fs = require('fs')
749
- const path = require('path')
750
- const os = require('os')
751
-
752
- const LICENSE_DIR = path.join(os.homedir(), '.{{PROJECT_NAME}}')
753
- const LICENSE_FILE = path.join(LICENSE_DIR, 'license.json')
754
-
755
- const LICENSE_TIERS = {
756
- FREE: 'FREE',
757
- PRO: 'PRO',
758
- ENTERPRISE: 'ENTERPRISE',
759
- }
760
-
761
- const FEATURES = {
762
- [LICENSE_TIERS.FREE]: {
763
- features: [{{FREE_FEATURES}}],
764
- limits: { users: 1, projects: 3 }
765
- },
766
- [LICENSE_TIERS.PRO]: {
767
- features: [{{PREMIUM_FEATURES}}],
768
- limits: { users: 10, projects: 50 }
769
- },
770
- [LICENSE_TIERS.ENTERPRISE]: {
771
- features: [{{PREMIUM_FEATURES}}, 'Priority Support', 'Custom Integrations'],
772
- limits: { users: 'unlimited', projects: 'unlimited' }
773
- }
774
- }
775
-
776
- function getLicenseInfo() {
777
- try {
778
- if (!fs.existsSync(LICENSE_FILE)) {
779
- return { tier: LICENSE_TIERS.FREE, valid: true }
780
- }
781
-
782
- const licenseData = JSON.parse(fs.readFileSync(LICENSE_FILE, 'utf8'))
783
-
784
- if (!licenseData.tier || !licenseData.licenseKey) {
785
- return { tier: LICENSE_TIERS.FREE, valid: true, error: 'Invalid license format' }
786
- }
787
-
788
- if (validateLicenseKey(licenseData.licenseKey, licenseData.tier)) {
789
- return {
790
- tier: licenseData.tier,
791
- valid: true,
792
- email: licenseData.email,
793
- expires: licenseData.expires,
794
- }
795
- }
796
-
797
- return { tier: LICENSE_TIERS.FREE, valid: true, error: 'Invalid license key' }
798
- } catch (error) {
799
- return { tier: LICENSE_TIERS.FREE, valid: true, error: \`License read error: \${error.message}\` }
800
- }
801
- }
802
-
803
- function validateLicenseKey(key, tier) {
804
- const stripeFormat = /^{{PROJECT_NAME}}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}$/
805
- return stripeFormat.test(key)
806
- }
807
-
808
- function hasFeature(featureName) {
809
- const license = getLicenseInfo()
810
- const tierFeatures = FEATURES[license.tier] || FEATURES[LICENSE_TIERS.FREE]
811
- return tierFeatures.features.includes(featureName)
812
- }
813
-
814
- function showUpgradeMessage(feature) {
815
- const license = getLicenseInfo()
816
-
817
- console.log(\`\\n🔒 \${feature} is a premium feature\`)
818
- console.log(\`📊 Current license: \${license.tier.toUpperCase()}\`)
819
-
820
- if (license.tier === LICENSE_TIERS.FREE) {
821
- console.log('\\n💎 Upgrade to Pro for premium features:')
822
- console.log(' • {{PREMIUM_FEATURES}}')
823
- console.log('\\n💰 Pricing:')
824
- console.log(' • Pro: ${{ PRO_PRICE }}/month')
825
- console.log(' • Limited-time founder pricing: ${{ FOUNDER_PRO_PRICE }}/month')
826
- console.log('\\n🚀 Upgrade now: https://{{DOMAIN}}/upgrade')
827
- console.log('🔑 Activate license: npx {{PROJECT_NAME}}@latest --activate-license')
828
- }
829
- }
830
-
831
- async function activateLicense(licenseKey, email) {
832
- try {
833
- if (!licenseKey.match(/^{{PROJECT_NAME}}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$/)) {
834
- return { success: false, error: 'Invalid license key format' }
835
- }
836
-
837
- // ⚠️ PRODUCTION SETUP REQUIRED:
838
- // 1. Copy complete licensing system from create-qa-architect v4.1.1+:
839
- // - lib/stripe-integration.js (Stripe API + secure validation)
840
- // - lib/licensing.js (License management + activation)
841
- // - admin-license.js (Admin tool for adding purchased licenses)
842
- //
843
- // 2. Set up legitimate license database:
844
- // node admin-license.js <license-key> <customer-id> <tier> [founder] [email]
845
- //
846
- // 3. Configure Stripe environment variables:
847
- // STRIPE_SECRET_KEY=sk_live_...
848
- // LICENSE_SIGNING_SECRET=your-secure-secret
849
- //
850
- // 4. Replace this template function with secure implementation
851
-
852
- console.log('⚠️ License activation not configured for production')
853
- console.log('📋 This is a template - see comments above for setup instructions')
854
- console.log('📞 Contact support for license activation assistance')
855
-
856
- return {
857
- success: false,
858
- error: 'License activation requires production setup. Contact support for assistance.'
859
- }
860
- } catch (error) {
861
- return { success: false, error: error.message }
862
- }
863
- }
864
-
865
- function saveLicense(tier, key, email, expires = null) {
866
- try {
867
- if (!fs.existsSync(LICENSE_DIR)) {
868
- fs.mkdirSync(LICENSE_DIR, { recursive: true })
869
- }
870
-
871
- const licenseData = {
872
- tier,
873
- licenseKey: key, // ✅ Updated to match v4.1.1+ field structure
874
- email,
875
- expires,
876
- activated: new Date().toISOString(),
877
- }
878
-
879
- fs.writeFileSync(LICENSE_FILE, JSON.stringify(licenseData, null, 2))
880
- return { success: true }
881
- } catch (error) {
882
- return { success: false, error: error.message }
883
- }
884
- }
885
-
886
- function showLicenseStatus() {
887
- const license = getLicenseInfo()
888
-
889
- console.log('\\n📋 License Status:')
890
- console.log(\` Tier: \${license.tier.toUpperCase()}\`)
891
-
892
- if (license.email) console.log(\` Email: \${license.email}\`)
893
- if (license.expires) console.log(\` Expires: \${license.expires}\`)
894
- if (license.error) console.log(\` ⚠️ Issue: \${license.error}\`)
895
-
896
- console.log('\\n🎯 Available Features:')
897
- const features = FEATURES[license.tier] || FEATURES[LICENSE_TIERS.FREE]
898
- features.features.forEach(feature => console.log(\` ✅ \${feature}\`))
899
- }
900
-
901
- module.exports = {
902
- LICENSE_TIERS,
903
- FEATURES,
904
- getLicenseInfo,
905
- hasFeature,
906
- showUpgradeMessage,
907
- activateLicense,
908
- saveLicense,
909
- showLicenseStatus,
910
- }
911
- `
912
- }
913
-
914
- getLegalTemplates() {
915
- return {
916
- 'privacy-policy.md': `# Privacy Policy
917
-
918
- **Effective Date:** {{DATE}}
919
- **Last Updated:** {{DATE}}
920
-
921
- ## Introduction
922
-
923
- {{PROJECT_NAME}} ("we," "our," or "us") respects your privacy and is committed to protecting your personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our software and related services.
924
-
925
- **Contact Information:**
926
- - **Service Provider:** {{COMPANY_NAME}}
927
- - **Email:** {{SUPPORT_EMAIL}}
928
- - **Website:** https://{{DOMAIN}}
929
-
930
- ## Information We Collect
931
-
932
- ### 1. Information You Provide Directly
933
- - **Account Information:** Email address, name, company details (for Pro/Enterprise tiers)
934
- - **Payment Information:** Billing details processed securely through Stripe
935
- - **Support Communications:** Messages, bug reports, feature requests
936
-
937
- ### 2. Information Collected Automatically
938
- - **Usage Analytics:** Commands run, features used, error logs (anonymized)
939
- - **Technical Data:** Operating system, software version, project structure (no source code)
940
- - **Installation Data:** Package downloads, CLI usage frequency
941
-
942
- ### 3. Information We Do NOT Collect
943
- - **Source Code:** We never read, store, or transmit your actual code
944
- - **Repository Contents:** No access to your repository contents or commit messages
945
- - **Environment Variables:** No collection of secrets, API keys, or sensitive data
946
- - **File Contents:** Only file paths and structure, never file contents
947
-
948
- ## How We Use Your Information
949
-
950
- ### Primary Purposes
951
- 1. **Service Delivery:** Provide software tools and features
952
- 2. **License Validation:** Verify Pro/Enterprise tier access and usage limits
953
- 3. **Support:** Respond to questions, issues, and feature requests
954
- 4. **Improvement:** Analyze usage patterns to enhance our tools (anonymized)
955
-
956
- ## Data Sharing and Disclosure
957
-
958
- ### We Share Information With:
959
- - **Payment Processors:** Stripe for subscription billing (Pro/Enterprise tiers)
960
- - **Cloud Providers:** AWS/Vercel for service hosting (encrypted data only)
961
- - **Analytics Services:** Anonymous usage statistics only
962
-
963
- ### We Do NOT Share:
964
- - **Personal data with advertisers** or data brokers
965
- - **Project details or technical information** with third parties
966
- - **Any data for marketing purposes** without explicit consent
967
-
968
- ## Your Privacy Rights
969
-
970
- ### Rights Available to All Users
971
- - **Access:** Request copy of your personal data
972
- - **Correction:** Update inaccurate or incomplete information
973
- - **Deletion:** Request account and data deletion
974
- - **Portability:** Export your data in machine-readable format
975
- - **Opt-out:** Unsubscribe from marketing communications
976
-
977
- ### How to Exercise Rights
978
- Email your request to **{{SUPPORT_EMAIL}}** with subject "Privacy Request"
979
-
980
- **Response Time:** 30 days maximum, typically within 5 business days
981
-
982
- ## Data Security and Storage
983
-
984
- ### Security Measures
985
- - **Encryption:** All data encrypted in transit (TLS 1.3) and at rest (AES-256)
986
- - **Access Controls:** Strict authentication and authorization protocols
987
- - **Regular Audits:** Quarterly security assessments and vulnerability scans
988
- - **Incident Response:** 24-hour breach notification procedures
989
-
990
- ### Data Retention
991
- - **Account Data:** Retained while account is active plus 30 days after cancellation
992
- - **Usage Analytics:** Aggregated and anonymized, retained for 2 years maximum
993
- - **Support Data:** Deleted 1 year after case closure
994
-
995
- ## Changes to This Policy
996
-
997
- We may update this Privacy Policy to reflect changes in our practices or applicable law. Material changes will receive 30-day advance notice via email.
998
-
999
- ## Contact Us
1000
-
1001
- For privacy questions, concerns, or requests:
1002
- - **Email:** {{SUPPORT_EMAIL}}
1003
- - **Subject Line:** "Privacy Policy Inquiry"
1004
- - **Response Time:** 5 business days maximum
1005
-
1006
- ---
1007
-
1008
- *This Privacy Policy is designed to comply with GDPR, CCPA, and other applicable privacy laws. Last reviewed on {{DATE}}.*`,
1009
-
1010
- 'terms-of-service.md': `# Terms of Service
1011
-
1012
- **Effective Date:** {{DATE}}
1013
- **Last Updated:** {{DATE}}
1014
-
1015
- ## 1. Acceptance of Terms
1016
-
1017
- By installing, accessing, or using {{PROJECT_NAME}} ("Service"), you ("User," "you," or "your") agree to be bound by these Terms of Service ("Terms"). If you do not agree to these Terms, do not use the Service.
1018
-
1019
- **Service Provider:** {{COMPANY_NAME}}
1020
- **Contact:** {{SUPPORT_EMAIL}}
1021
-
1022
- ## 2. Description of Service
1023
-
1024
- {{PROJECT_NAME}} is a software tool that provides: {{DESCRIPTION}}
1025
-
1026
- ## 3. License and Intellectual Property
1027
-
1028
- ### 3.1 License Grant
1029
- We grant you a limited, non-exclusive, non-transferable, revocable license to use the Service in accordance with these Terms and your subscription plan (Free, Pro, or Enterprise).
1030
-
1031
- ### 3.2 Intellectual Property Rights
1032
- - **Our Rights:** All software, documentation, trademarks, and proprietary methods remain our exclusive property
1033
- - **Your Rights:** You retain all rights to your source code and project files
1034
- - **Restrictions:** You may not reverse engineer, decompile, or create derivative works of our Service
1035
-
1036
- ## 4. Subscription Plans and Payment
1037
-
1038
- ### 4.1 Subscription Tiers
1039
- - **Free Tier:** Basic features as described in our documentation
1040
- - **Pro Tier:** ${{ PRO_PRICE }}/month with advanced features
1041
- - **Enterprise Tier:** ${{ ENTERPRISE_PRICE }}/month with premium support and features
1042
-
1043
- ### 4.2 Payment Terms
1044
- - **Billing Cycle:** Monthly subscription charges
1045
- - **Payment Method:** Processed securely through Stripe
1046
- - **Auto-Renewal:** Subscriptions automatically renew unless cancelled
1047
- - **Price Changes:** 30-day advance notice for subscription price increases
1048
-
1049
- ### 4.3 Refunds and Cancellation
1050
- - **Cancellation:** You may cancel anytime through your account settings
1051
- - **Effective Date:** Cancellation effective at end of current billing cycle
1052
- - **No Refunds:** All payments are non-refundable except as required by law
1053
-
1054
- ## 5. DISCLAIMERS AND LIMITATION OF LIABILITY
1055
-
1056
- ### 5.1 SERVICE WARRANTIES DISCLAIMED
1057
- THE SERVICE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED.
1058
-
1059
- ### 5.2 LIMITATION OF LIABILITY
1060
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL WE BE LIABLE FOR ANY DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES.
1061
-
1062
- ### 5.3 MAXIMUM LIABILITY
1063
- OUR TOTAL LIABILITY TO YOU FOR ALL CLAIMS SHALL NOT EXCEED THE TOTAL AMOUNT YOU PAID US IN THE 12 MONTHS IMMEDIATELY PRECEDING THE EVENT GIVING RISE TO LIABILITY.
1064
-
1065
- ## 6. Indemnification
1066
-
1067
- You agree to indemnify, defend, and hold harmless {{COMPANY_NAME}} from and against any and all claims, damages, losses, costs, and expenses arising from or relating to your use or misuse of the Service.
1068
-
1069
- ## 7. Termination
1070
-
1071
- ### 7.1 Termination by You
1072
- You may terminate your account at any time by cancelling your subscription.
1073
-
1074
- ### 7.2 Termination by Us
1075
- We may terminate or suspend your access immediately, without prior notice, if you breach these Terms or engage in fraudulent or illegal activities.
1076
-
1077
- ## 8. General Provisions
1078
-
1079
- ### 8.1 Governing Law
1080
- These Terms are governed by the laws of [Your Jurisdiction], without regard to conflict of law principles.
1081
-
1082
- ### 8.2 Entire Agreement
1083
- These Terms, together with our Privacy Policy, constitute the entire agreement between you and us.
1084
-
1085
- ## 9. Contact Information
1086
-
1087
- For questions about these Terms:
1088
- - **Email:** {{SUPPORT_EMAIL}}
1089
- - **Subject:** "Terms of Service Inquiry"
1090
- - **Response Time:** 5 business days
1091
-
1092
- ---
1093
-
1094
- *These Terms of Service provide comprehensive legal protection and comply with standard SaaS industry practices. Last reviewed on {{DATE}}.*`,
1095
-
1096
- 'copyright.md': `# Copyright Notice
1097
-
1098
- **© {{DATE}} {{COMPANY_NAME}}. All rights reserved.**
1099
-
1100
- ## Intellectual Property Protection
1101
-
1102
- ### Software Copyright
1103
- {{PROJECT_NAME}}, including all source code, documentation, design, graphics, and related materials, is protected by copyright law and international treaties. All rights are reserved.
1104
-
1105
- ### Trademarks
1106
- - **"{{PROJECT_NAME}}"** is a trademark of {{COMPANY_NAME}}
1107
- - All other trademarks, service marks, and trade names are the property of their respective owners
1108
-
1109
- ## Permitted Uses
1110
-
1111
- ### What You May Do
1112
- - Use the software in accordance with your subscription license
1113
- - Create derivative configurations for your own projects
1114
- - Reference our documentation in compliance discussions
1115
-
1116
- ### What You May NOT Do
1117
- - Copy, modify, or distribute our proprietary source code
1118
- - Create competing products based on our software
1119
- - Remove or modify copyright notices
1120
- - Use our trademarks without written permission
1121
-
1122
- ## DMCA Compliance
1123
-
1124
- ### Copyright Infringement Claims
1125
- If you believe our software infringes your copyright, send a DMCA notice to:
1126
-
1127
- **DMCA Agent:** {{COMPANY_NAME}}
1128
- **Email:** {{SUPPORT_EMAIL}}
1129
- **Subject:** "DMCA Takedown Notice"
1130
-
1131
- ## Contact for Licensing
1132
-
1133
- For licensing inquiries or permission to use copyrighted materials:
1134
- - **Email:** {{SUPPORT_EMAIL}}
1135
- - **Subject:** "Copyright Licensing Inquiry"
1136
-
1137
- ---
1138
-
1139
- *This copyright notice was last updated on {{DATE}}.*`,
1140
-
1141
- 'disclaimer.md': `# Disclaimer
1142
-
1143
- **Last Updated:** {{DATE}}
1144
-
1145
- ## IMPORTANT LEGAL NOTICE
1146
-
1147
- The information and software provided by {{PROJECT_NAME}} is subject to the following disclaimers. By using our Service, you acknowledge and agree to these limitations.
1148
-
1149
- ## 1. Software Tool Disclaimer
1150
-
1151
- ### 1.1 No Guarantee of Results
1152
- - **Effectiveness:** While our tool aims to improve software development workflows, we make no guarantees about the effectiveness of our recommendations
1153
- - **Project Outcomes:** We are not responsible for any project delays, failures, or issues that may arise from using our tool
1154
- - **Compatibility:** We cannot guarantee compatibility with all development environments, frameworks, or tools
1155
-
1156
- ### 1.2 User Responsibility
1157
- - **Testing:** You are solely responsible for testing all changes made by our tool in your development environment
1158
- - **Backup:** Always backup your code before running automated tools
1159
- - **Review:** Carefully review all automated changes before committing to production
1160
-
1161
- ## 2. Security Disclaimer
1162
-
1163
- ### 2.1 Security Tool Limitations
1164
- - **Detection Accuracy:** Security scanning tools may produce false positives and false negatives
1165
- - **Coverage Limitations:** No security tool can detect 100% of potential vulnerabilities
1166
- - **Evolving Threats:** New security threats emerge constantly that may not be detected by current tools
1167
-
1168
- ### 2.2 Security Responsibility
1169
- - **Professional Assessment:** Complex security issues require professional security assessment
1170
- - **Regular Updates:** Security tools and databases must be regularly updated
1171
- - **Defense in Depth:** Use multiple layers of security protection
1172
-
1173
- ## 3. Service Availability Disclaimer
1174
-
1175
- ### 3.1 Uptime and Reliability
1176
- - **No Uptime Guarantee:** We make no guarantees about service availability or uptime
1177
- - **Third-Party Dependencies:** Our service depends on external services that may experience outages
1178
- - **Maintenance Windows:** Scheduled maintenance may temporarily interrupt service
1179
-
1180
- ### 3.2 Data and Backup
1181
- - **No Backup Service:** We do not provide backup services for your project data
1182
- - **Data Loss Risk:** Technical failures could result in loss of configuration or usage data
1183
- - **Recovery Limitations:** Our ability to recover lost data is limited
1184
-
1185
- ## 4. Professional Advice Disclaimer
1186
-
1187
- ### 4.1 Not Professional Advice
1188
- - **Development Practices:** Our recommendations are general guidance, not professional consulting
1189
- - **Legal Compliance:** We do not provide legal advice regarding software licensing or compliance
1190
- - **Business Decisions:** Tool recommendations should not be the sole basis for business-critical decisions
1191
-
1192
- ### 4.2 Expert Consultation
1193
- - **Complex Scenarios:** Consult with qualified professionals for complex development, security, or legal issues
1194
- - **Industry Standards:** Verify that our recommendations align with your industry's specific standards
1195
- - **Regulatory Compliance:** Ensure compliance with applicable regulations in your jurisdiction
1196
-
1197
- ## 5. Financial and Business Disclaimer
1198
-
1199
- ### 5.1 No Business Guarantees
1200
- - **ROI Claims:** We make no guarantees about return on investment or cost savings
1201
- - **Productivity Claims:** Individual results may vary regarding development productivity
1202
- - **Business Outcomes:** We are not responsible for business decisions made based on our tool's output
1203
-
1204
- ### 5.2 Subscription and Billing
1205
- - **Service Changes:** We may modify features or pricing with appropriate notice
1206
- - **Refund Limitations:** Refunds are limited as specified in our Terms of Service
1207
- - **Tax Responsibility:** You are responsible for any applicable taxes on your subscription
1208
-
1209
- ## 6. Contact Information
1210
-
1211
- For questions about this disclaimer:
1212
- - **Email:** {{SUPPORT_EMAIL}}
1213
- - **Subject:** "Disclaimer Inquiry"
1214
-
1215
- ---
1216
-
1217
- **ACKNOWLEDGMENT:** By using {{PROJECT_NAME}}, you acknowledge that you have read, understood, and agree to be bound by this Disclaimer and accept all associated risks and limitations.
1218
-
1219
- *Last reviewed on {{DATE}}.*`,
1220
- }
1221
- }
1222
-
1223
- getMarketingTemplates() {
1224
- return {
1225
- 'landing-page.html': `<!DOCTYPE html>
1226
- <html lang="en">
1227
- <head>
1228
- <meta charset="UTF-8">
1229
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
1230
- <title>{{PROJECT_NAME}} Pro - {{DESCRIPTION}}</title>
1231
- <meta name="description" content="{{DESCRIPTION}} - Upgrade to Pro for premium features.">
1232
- <style>
1233
- * { margin: 0; padding: 0; box-sizing: border-box; }
1234
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #333; }
1235
- .hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 80px 20px; text-align: center; }
1236
- .hero h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; line-height: 1.2; }
1237
- .hero .subtitle { font-size: 1.5rem; margin-bottom: 15px; opacity: 0.9; }
1238
- .hero .problem { font-size: 1.2rem; margin-bottom: 40px; opacity: 0.8; }
1239
- .cta-button { background: #ff6b6b; color: white; padding: 20px 40px; font-size: 1.3rem; font-weight: bold; border: none; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; text-decoration: none; display: inline-block; margin: 10px; }
1240
- .cta-button:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3); }
1241
- .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
1242
- .section { padding: 80px 20px; }
1243
- .pricing-section { background: #f8f9fa; text-align: center; }
1244
- .pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 800px; margin: 0 auto; }
1245
- .pricing-card { background: white; border-radius: 12px; padding: 40px; position: relative; border: 2px solid #e9ecef; }
1246
- .pricing-card.popular { border-color: #667eea; transform: scale(1.05); }
1247
- .pricing-card h3 { font-size: 1.8rem; margin-bottom: 10px; }
1248
- .price { font-size: 3rem; font-weight: bold; color: #667eea; margin-bottom: 10px; }
1249
- .founder-badge { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; padding: 10px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; margin: 15px 0; display: inline-block; }
1250
- </style>
1251
- </head>
1252
- <body>
1253
- <section class="hero">
1254
- <div class="container">
1255
- <h1>Unlock {{PROJECT_NAME}} Pro</h1>
1256
- <p class="subtitle">{{DESCRIPTION}}</p>
1257
- <p class="problem">Get access to premium features and priority support.</p>
1258
- <a href="https://{{DOMAIN}}/checkout?tier=pro&founder=true" class="cta-button">Start Pro - ${{ FOUNDER_PRO_PRICE }}/month</a>
1259
- </div>
1260
- </section>
1261
-
1262
- <section class="section pricing-section">
1263
- <div class="container">
1264
- <h2>Choose Your Plan</h2>
1265
- <div class="pricing-cards">
1266
- <div class="pricing-card popular">
1267
- <h3>Pro</h3>
1268
- <div class="price">${{ PRO_PRICE }}<span style="font-size: 1rem; color: #666;">/month</span></div>
1269
- <div class="founder-badge">🎁 Founder: ${{ FOUNDER_PRO_PRICE }}/month ({{FOUNDER_DISCOUNT}}% off forever)</div>
1270
- <ul style="text-align: left; margin: 30px 0;">
1271
- <li style="padding: 8px 0;">{{PREMIUM_FEATURES}}</li>
1272
- </ul>
1273
- <a href="https://{{DOMAIN}}/checkout?tier=pro&founder=true" class="cta-button">Start Pro</a>
1274
- </div>
1275
-
1276
- <div class="pricing-card">
1277
- <h3>Enterprise</h3>
1278
- <div class="price">${{ ENTERPRISE_PRICE }}<span style="font-size: 1rem; color: #666;">/month</span></div>
1279
- <div class="founder-badge">🎁 Founder: ${{ FOUNDER_ENTERPRISE_PRICE }}/month ({{FOUNDER_DISCOUNT}}% off forever)</div>
1280
- <ul style="text-align: left; margin: 30px 0;">
1281
- <li style="padding: 8px 0;">Everything in Pro</li>
1282
- <li style="padding: 8px 0;">Priority Support</li>
1283
- <li style="padding: 8px 0;">Custom Integrations</li>
1284
- </ul>
1285
- <a href="https://{{DOMAIN}}/checkout?tier=enterprise&founder=true" class="cta-button">Start Enterprise</a>
1286
- </div>
1287
- </div>
1288
- </div>
1289
- </section>
1290
- </body>
1291
- </html>`,
1292
-
1293
- 'beta-email-campaign.md': `# Beta User Email Campaign - {{PROJECT_NAME}}
1294
-
1295
- ## Email 1: Founder Pricing Announcement
1296
-
1297
- **Subject:** 🎉 Thanks for beta testing - Your founder discount awaits!
1298
-
1299
- **Body:**
1300
- Hi [Name],
1301
-
1302
- Thanks for being an early adopter of {{PROJECT_NAME}}! Your feedback helped us build {{DESCRIPTION}}.
1303
-
1304
- ## 🚨 What's Changing
1305
- Our beta period has ended. Premium features now require a Pro subscription.
1306
-
1307
- ## 🎁 Your Exclusive Founder Pricing
1308
- **{{FOUNDER_DISCOUNT}}% off for life** as a thank you:
1309
- ✅ **Pro Tier**: ${{ FOUNDER_PRO_PRICE }}/month (normally ${{ PRO_PRICE }})
1310
- ✅ **Enterprise Tier**: ${{ FOUNDER_ENTERPRISE_PRICE }}/month (normally ${{ ENTERPRISE_PRICE }})
1311
-
1312
- ## 🚀 What You Get with Pro
1313
- • {{PREMIUM_FEATURES}}
1314
- • Priority email support
1315
- • All future premium features
1316
-
1317
- [**🎯 Claim Founder Pricing**](https://{{DOMAIN}}/upgrade?code=FOUNDER{{FOUNDER_DISCOUNT}})
1318
-
1319
- Questions? Reply to this email.
1320
-
1321
- Best,
1322
- {{COMPANY_NAME}}
1323
-
1324
- ---
1325
-
1326
- ## Email 2: Urgency Reminder (Send 3 days before expiration)
1327
-
1328
- **Subject:** ⏰ Final call: Founder pricing expires soon
1329
-
1330
- **Body:**
1331
- Hi [Name],
1332
-
1333
- This is your final reminder - founder pricing expires in 3 days.
1334
-
1335
- After that, Pro tier goes to full price (${{ PRO_PRICE }}/month).
1336
-
1337
- **Don't miss out:**
1338
- ✅ ${{ FOUNDER_PRO_PRICE }}/month forever (vs ${{ PRO_PRICE }}/month)
1339
- ✅ All premium features
1340
- ✅ Priority support
1341
-
1342
- [**🚀 Secure Founder Pricing Now**](https://{{DOMAIN}}/upgrade?code=FOUNDER{{FOUNDER_DISCOUNT}})
1343
-
1344
- Best,
1345
- {{COMPANY_NAME}}
1346
-
1347
- ---
1348
-
1349
- ## Email 3: Welcome + Onboarding (For customers who upgrade)
1350
-
1351
- **Subject:** 🎉 Welcome to Pro! Here's how to activate
1352
-
1353
- **Body:**
1354
- Hi [Name],
1355
-
1356
- Welcome to {{PROJECT_NAME}} Pro! 🎉
1357
-
1358
- ## 🔑 Activate Your License
1359
- Run this command with your license key:
1360
- \`\`\`
1361
- npx {{PROJECT_NAME}}@latest --activate-license
1362
- \`\`\`
1363
-
1364
- ## 💬 Priority Support
1365
- Questions? Reply to this email for priority support.
1366
-
1367
- Thanks for supporting {{PROJECT_NAME}}!
1368
-
1369
- Best,
1370
- {{COMPANY_NAME}}`,
1371
-
1372
- 'upgrade-prompts.md': `# Upgrade Prompts for {{PROJECT_NAME}}
1373
-
1374
- ## CLI Upgrade Messages
1375
-
1376
- ### When free user encounters premium feature:
1377
- \`\`\`
1378
- 🔒 [Feature Name] is a premium feature
1379
- 📊 Current license: FREE
1380
-
1381
- 💎 Upgrade to Pro for premium features:
1382
- • {{PREMIUM_FEATURES}}
1383
-
1384
- 💰 Pricing:
1385
- • Pro: ${{ PRO_PRICE }}/month
1386
- • Limited-time founder pricing: ${{ FOUNDER_PRO_PRICE }}/month
1387
-
1388
- 🚀 Upgrade now: https://{{DOMAIN}}/upgrade
1389
- 🔑 Activate license: npx {{PROJECT_NAME}}@latest --activate-license
1390
- \`\`\`
1391
-
1392
- ### License activation success:
1393
- \`\`\`
1394
- ✅ License activated successfully!
1395
- 📋 Tier: PRO
1396
- 🎁 Founder: Yes
1397
- 📧 Email: user@example.com
1398
-
1399
- 🎉 Premium features are now available!
1400
- \`\`\`
1401
-
1402
- ### License activation failure:
1403
- \`\`\`
1404
- ❌ License activation failed.
1405
- • Check your license key format
1406
- • Verify your email address
1407
- • Contact support: {{SUPPORT_EMAIL}}
1408
- \`\`\``,
1409
- }
1410
- }
1411
-
1412
- getBillingTemplate() {
1413
- return `<!DOCTYPE html>
1414
- <html lang="en">
1415
- <head>
1416
- <meta charset="UTF-8">
1417
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
1418
- <title>{{PROJECT_NAME}} - Billing Dashboard</title>
1419
- <style>
1420
- * { margin: 0; padding: 0; box-sizing: border-box; }
1421
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; color: #333; }
1422
- .container { max-width: 900px; margin: 0 auto; padding: 20px; }
1423
- .header { text-align: center; color: white; margin-bottom: 40px; }
1424
- .header h1 { font-size: 2.5rem; margin-bottom: 10px; }
1425
- .dashboard-card { background: white; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); padding: 30px; margin-bottom: 30px; }
1426
- .tier-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
1427
- .tier-card { border: 2px solid #e1e5e9; border-radius: 12px; padding: 25px; text-align: center; cursor: pointer; transition: all 0.3s ease; }
1428
- .tier-card:hover { border-color: #667eea; transform: translateY(-5px); box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15); }
1429
- .tier-card.selected { border-color: #667eea; background: linear-gradient(135deg, #667eea10, #764ba210); }
1430
- .tier-card.popular::before { content: "MOST POPULAR"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }
1431
- .tier-name { font-size: 1.5rem; font-weight: bold; margin-bottom: 10px; color: #333; }
1432
- .tier-price { font-size: 2rem; font-weight: bold; color: #667eea; margin-bottom: 15px; }
1433
- .checkout-btn { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border: none; padding: 15px 30px; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer; width: 100%; transition: all 0.3s ease; }
1434
- .checkout-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); }
1435
- </style>
1436
- </head>
1437
- <body>
1438
- <div class="container">
1439
- <div class="header">
1440
- <h1>{{PROJECT_NAME}}</h1>
1441
- <p>Choose your plan and upgrade to premium features</p>
1442
- </div>
1443
-
1444
- <div class="dashboard-card">
1445
- <h2>🚀 Choose Your Plan</h2>
1446
-
1447
- <div class="tier-selector">
1448
- <div class="tier-card popular" data-tier="pro" onclick="selectTier('pro')">
1449
- <div class="tier-name">Pro</div>
1450
- <div class="tier-price">${{ PRO_PRICE }}<span style="font-size: 1rem; color: #666;">/month</span></div>
1451
- <div style="background: linear-gradient(135deg, #f093fb, #f5576c); color: white; padding: 10px; border-radius: 8px; margin: 15px 0; font-weight: bold;">
1452
- 🎁 Founder: ${{ FOUNDER_PRO_PRICE }}/month
1453
- </div>
1454
- <ul style="text-align: left; margin: 20px 0;">
1455
- <li style="padding: 5px 0;">{{PREMIUM_FEATURES}}</li>
1456
- </ul>
1457
- </div>
1458
-
1459
- <div class="tier-card" data-tier="enterprise" onclick="selectTier('enterprise')">
1460
- <div class="tier-name">Enterprise</div>
1461
- <div class="tier-price">${{ ENTERPRISE_PRICE }}<span style="font-size: 1rem; color: #666;">/month</span></div>
1462
- <div style="background: linear-gradient(135deg, #f093fb, #f5576c); color: white; padding: 10px; border-radius: 8px; margin: 15px 0; font-weight: bold;">
1463
- 🎁 Founder: ${{ FOUNDER_ENTERPRISE_PRICE }}/month
1464
- </div>
1465
- <ul style="text-align: left; margin: 20px 0;">
1466
- <li style="padding: 5px 0;">Everything in Pro</li>
1467
- <li style="padding: 5px 0;">Priority Support (24h)</li>
1468
- <li style="padding: 5px 0;">Custom Integrations</li>
1469
- </ul>
1470
- </div>
1471
- </div>
1472
-
1473
- <button class="checkout-btn" onclick="startCheckout()" id="checkout-btn" disabled>
1474
- Select a plan above
1475
- </button>
1476
- </div>
1477
- </div>
1478
-
1479
- <script>
1480
- let selectedTier = null;
1481
-
1482
- function selectTier(tier) {
1483
- selectedTier = tier;
1484
- document.querySelectorAll('.tier-card').forEach(card => card.classList.remove('selected'));
1485
- document.querySelector(\`[data-tier="\${tier}"]\`).classList.add('selected');
1486
-
1487
- const checkoutBtn = document.getElementById('checkout-btn');
1488
- checkoutBtn.disabled = false;
1489
- checkoutBtn.textContent = tier === 'pro' ?
1490
- 'Start Pro Subscription - ${{ FOUNDER_PRO_PRICE }}/month' :
1491
- 'Start Enterprise Subscription - ${{ FOUNDER_ENTERPRISE_PRICE }}/month';
1492
- }
1493
-
1494
- function startCheckout() {
1495
- if (!selectedTier) return;
1496
- window.location.href = \`https://{{DOMAIN}}/api/checkout?tier=\${selectedTier}&founder=true\`;
1497
- }
1498
-
1499
- // Pre-select Pro tier
1500
- selectTier('pro');
1501
- </script>
1502
- </body>
1503
- </html>`
1504
- }
1505
- }
1506
-
1507
- // Run the bootstrap if this file is executed directly
1508
- if (require.main === module) {
1509
- const bootstrap = new SaaSMonetizationBootstrap()
1510
- bootstrap.run().catch(console.error)
1511
- }
1512
-
1513
- module.exports = { SaaSMonetizationBootstrap }