@thunder-so/thunder 1.2.0 → 1.3.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 (3) hide show
  1. package/README.md +250 -0
  2. package/index.ts +14 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -342,6 +342,256 @@ new Astro(new Cdk.App(), 'myapp-web-prod-stack', config);
342
342
 
343
343
  ---
344
344
 
345
+ ### Serverless Frameworks
346
+
347
+ Deploy modern meta-frameworks as serverless applications with unified infrastructure - Lambda for server-side rendering and S3 for static assets, all behind CloudFront.
348
+
349
+ **Best for:** Full-stack applications with server-side rendering, API routes, and static asset optimization
350
+
351
+ **AWS Resources:**
352
+ - [Lambda Function](https://aws.amazon.com/lambda/) - SSR server with container support
353
+ - [S3 Bucket](https://aws.amazon.com/s3/) - Static assets with OAC
354
+ - [CloudFront Distribution](https://aws.amazon.com/cloudfront/) - Global CDN with custom domain
355
+ - [API Gateway](https://aws.amazon.com/api-gateway/) - HTTP API for server functions
356
+ - [Route53](https://aws.amazon.com/route53/) - DNS management (optional)
357
+ - [ACM](https://aws.amazon.com/certificate-manager/) - SSL certificates (optional)
358
+
359
+ **Supported Frameworks:**
360
+ - [TanStack Start](https://tanstack.com/start) - Type-safe full-stack React framework
361
+ - [Nuxt](https://nuxt.com/) - Vue-based full-stack framework
362
+ - [Astro](https://astro.build/) - Content-focused web framework with islands architecture
363
+ - [React Router v7](https://reactrouter.com/) - Full-stack React framework with nested routing
364
+ - [SvelteKit](https://kit.svelte.dev/) - Svelte-based full-stack framework
365
+ - [Solid Start](https://start.solidjs.com/) - SolidJS full-stack framework
366
+ - [AnalogJS](https://analogjs.org/) - Angular-based full-stack framework
367
+
368
+ #### TanStack Start
369
+
370
+ **Example:**
371
+ ```typescript
372
+ import { Cdk, TanStackStart, type TanStackStartProps } from '@thunder-so/thunder';
373
+
374
+ const config: TanStackStartProps = {
375
+ env: { account: '123456789012', region: 'us-east-1' },
376
+ application: 'myapp',
377
+ service: 'web',
378
+ environment: 'prod',
379
+ rootDir: '.',
380
+
381
+ serverProps: {
382
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
383
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
384
+ memorySize: 1792,
385
+ timeout: 10,
386
+ keepWarm: true,
387
+ variables: [{ NODE_ENV: 'production' }],
388
+ },
389
+
390
+ // Optional: Custom domain
391
+ domain: 'myapp.com',
392
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
393
+ hostedZoneId: 'Z123456789',
394
+ };
395
+
396
+ new TanStackStart(new Cdk.App(), 'myapp-web-prod-stack', config);
397
+ ```
398
+
399
+ #### Nuxt
400
+
401
+ **Example:**
402
+ ```typescript
403
+ import { Cdk, Nuxt, type NuxtProps } from '@thunder-so/thunder';
404
+
405
+ const config: NuxtProps = {
406
+ env: { account: '123456789012', region: 'us-east-1' },
407
+ application: 'myapp',
408
+ service: 'web',
409
+ environment: 'prod',
410
+ rootDir: '.',
411
+
412
+ serverProps: {
413
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
414
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
415
+ memorySize: 1792,
416
+ timeout: 10,
417
+ keepWarm: true,
418
+ streaming: true,
419
+ variables: [{ NODE_ENV: 'production' }],
420
+ secrets: [{ key: 'DATABASE_URL', resource: 'arn:aws:secretsmanager:...' }],
421
+ },
422
+
423
+ // Optional: Custom domain
424
+ domain: 'myapp.com',
425
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
426
+ hostedZoneId: 'Z123456789',
427
+ };
428
+
429
+ new Nuxt(new Cdk.App(), 'myapp-web-prod-stack', config);
430
+ ```
431
+
432
+ #### Astro
433
+
434
+ **Example:**
435
+ ```typescript
436
+ import { Cdk, Astro, type AstroProps } from '@thunder-so/thunder';
437
+
438
+ const config: AstroProps = {
439
+ env: { account: '123456789012', region: 'us-east-1' },
440
+ application: 'myapp',
441
+ service: 'web',
442
+ environment: 'prod',
443
+ rootDir: '.',
444
+
445
+ serverProps: {
446
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
447
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
448
+ memorySize: 1024,
449
+ timeout: 10,
450
+ keepWarm: true,
451
+ variables: [{ NODE_ENV: 'production' }],
452
+ },
453
+
454
+ // Optional: Custom domain
455
+ domain: 'myapp.com',
456
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
457
+ hostedZoneId: 'Z123456789',
458
+ };
459
+
460
+ new Astro(new Cdk.App(), 'myapp-web-prod-stack', config);
461
+ ```
462
+
463
+ #### React Router
464
+
465
+ Deploy [React Router v7](https://reactrouter.com/) framework mode applications with server-side rendering and API routes.
466
+
467
+ **Best for:** React applications with nested routing, server-side rendering, and modern React Router patterns
468
+
469
+ **AWS Resources:** Same as [TanStack Start](#tanstack-start)
470
+
471
+ **Example:**
472
+ ```typescript
473
+ import { Cdk, ReactRouter, type ReactRouterProps } from '@thunder-so/thunder';
474
+
475
+ const config: ReactRouterProps = {
476
+ env: { account: '123456789012', region: 'us-east-1' },
477
+ application: 'myapp',
478
+ service: 'web',
479
+ environment: 'prod',
480
+ rootDir: '.',
481
+
482
+ serverProps: {
483
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
484
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
485
+ memorySize: 1024,
486
+ timeout: 10,
487
+ keepWarm: true,
488
+ variables: [{ NODE_ENV: 'production' }],
489
+ },
490
+
491
+ // Optional: Custom domain
492
+ domain: 'myapp.com',
493
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
494
+ hostedZoneId: 'Z123456789',
495
+ };
496
+
497
+ new ReactRouter(new Cdk.App(), 'myapp-web-prod-stack', config);
498
+ ```
499
+
500
+ #### SvelteKit
501
+
502
+ **Example:**
503
+ ```typescript
504
+ import { Cdk, SvelteKit, type SvelteKitProps } from '@thunder-so/thunder';
505
+
506
+ const config: SvelteKitProps = {
507
+ env: { account: '123456789012', region: 'us-east-1' },
508
+ application: 'myapp',
509
+ service: 'web',
510
+ environment: 'prod',
511
+ rootDir: '.',
512
+
513
+ serverProps: {
514
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
515
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
516
+ memorySize: 1024,
517
+ timeout: 10,
518
+ keepWarm: true,
519
+ variables: [{ NODE_ENV: 'production' }],
520
+ },
521
+
522
+ // Optional: Custom domain
523
+ domain: 'myapp.com',
524
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
525
+ hostedZoneId: 'Z123456789',
526
+ };
527
+
528
+ new SvelteKit(new Cdk.App(), 'myapp-web-prod-stack', config);
529
+ ```
530
+
531
+ #### Solid Start
532
+
533
+ **Example:**
534
+ ```typescript
535
+ import { Cdk, SolidStart, type SolidStartProps } from '@thunder-so/thunder';
536
+
537
+ const config: SolidStartProps = {
538
+ env: { account: '123456789012', region: 'us-east-1' },
539
+ application: 'myapp',
540
+ service: 'web',
541
+ environment: 'prod',
542
+ rootDir: '.',
543
+
544
+ serverProps: {
545
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
546
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
547
+ memorySize: 1024,
548
+ timeout: 10,
549
+ keepWarm: true,
550
+ variables: [{ NODE_ENV: 'production' }],
551
+ },
552
+
553
+ // Optional: Custom domain
554
+ domain: 'myapp.com',
555
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
556
+ hostedZoneId: 'Z123456789',
557
+ };
558
+
559
+ new SolidStart(new Cdk.App(), 'myapp-web-prod-stack', config);
560
+ ```
561
+
562
+ #### AnalogJS
563
+
564
+ **Example:**
565
+ ```typescript
566
+ import { Cdk, AnalogJS, type AnalogJSProps } from '@thunder-so/thunder';
567
+
568
+ const config: AnalogJSProps = {
569
+ env: { account: '123456789012', region: 'us-east-1' },
570
+ application: 'myapp',
571
+ service: 'web',
572
+ environment: 'prod',
573
+ rootDir: '.',
574
+
575
+ serverProps: {
576
+ runtime: Cdk.aws_lambda.Runtime.NODEJS_22_X,
577
+ architecture: Cdk.aws_lambda.Architecture.ARM_64,
578
+ memorySize: 1024,
579
+ timeout: 10,
580
+ keepWarm: true,
581
+ variables: [{ NODE_ENV: 'production' }],
582
+ },
583
+
584
+ // Optional: Custom domain
585
+ domain: 'myapp.com',
586
+ globalCertificateArn: 'arn:aws:acm:us-east-1:...',
587
+ hostedZoneId: 'Z123456789',
588
+ };
589
+
590
+ new AnalogJS(new Cdk.App(), 'myapp-web-prod-stack', config);
591
+ ```
592
+
593
+ ---
594
+
345
595
  ### Template
346
596
 
347
597
  Deploy [Coolify](https://coolify.io/)-style templates on EC2. Automatically fetches and hydrates Docker Compose templates from the [Coolify templates repository](https://github.com/coollabsio/coolify).
package/index.ts CHANGED
@@ -4,9 +4,11 @@ export { Lambda } from './stacks/LambdaStack';
4
4
  export { Fargate } from './stacks/FargateStack';
5
5
  export { Ec2 } from './stacks/Ec2Stack';
6
6
  export { Template } from './stacks/TemplateStack';
7
- export { Nuxt } from './stacks/NuxtStack';
8
- export { Astro } from './stacks/AstroStack';
9
7
  export { Vpc } from './stacks/VpcStack';
8
+ export { ServerlessStack } from './stacks/ServerlessStack';
9
+
10
+ // Serverless framework stacks (new unified abstraction)
11
+ export * from './lib/serverless';
10
12
 
11
13
  // Types
12
14
  export type { StaticProps } from './types/StaticProps';
@@ -14,10 +16,17 @@ export type { LambdaProps } from './types/LambdaProps';
14
16
  export type { FargateProps } from './types/FargateProps';
15
17
  export type { Ec2Props } from './types/Ec2Props';
16
18
  export type { TemplateProps } from './types/TemplateProps';
17
- export type { NuxtProps } from './types/NuxtProps';
18
- export type { NuxtProps as AstroProps } from './types/NuxtProps';
19
19
 
20
- // Template utilities
20
+ // Serverless framework types
21
+ export type { ServerlessBaseProps as NuxtProps } from './types/ServerlessProps';
22
+ export type { ServerlessBaseProps as AstroProps } from './types/ServerlessProps';
23
+ export type { ServerlessBaseProps as TanStackStartProps } from './types/ServerlessProps';
24
+ export type { ServerlessBaseProps as SvelteKitProps } from './types/ServerlessProps';
25
+ export type { ServerlessBaseProps as SolidStartProps } from './types/ServerlessProps';
26
+ export type { ServerlessBaseProps as AnalogJSProps } from './types/ServerlessProps';
27
+ export type { ServerlessBaseProps, ServerlessServerProps, ServerlessClientProps } from './types/ServerlessProps';
28
+
29
+ // Coolify Template utilities
21
30
  export { fetchTemplate } from './lib/template/template/fetch';
22
31
  export { hydrateTemplate } from './lib/template/template/hydrate';
23
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunder-so/thunder",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "CDK library for deploying web applications on AWS",
5
5
  "keywords": [
6
6
  "aws",