@digilogiclabs/create-saas-app 2.0.0 → 2.2.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/CHANGELOG.md +7 -0
- package/README.md +975 -891
- package/dist/.tsbuildinfo +1 -1
- package/dist/generators/template-generator.d.ts +11 -0
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +389 -18
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/index.js +1837 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/infrastructure/kubernetes/base/template/README.md +253 -0
- package/dist/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
- package/dist/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
- package/dist/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
- package/dist/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
- package/dist/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
- package/dist/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
- package/dist/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
- package/dist/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
- package/dist/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
- package/dist/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
- package/dist/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
- package/dist/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
- package/dist/templates/infrastructure/terraform/aws/template/README.md +156 -0
- package/dist/templates/infrastructure/terraform/aws/template/main.tf +343 -0
- package/dist/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
- package/dist/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
- package/dist/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
- package/dist/templates/infrastructure/terraform/gcp/template/README.md +165 -0
- package/dist/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
- package/dist/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
- package/dist/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
- package/dist/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
- package/dist/templates/shared/admin/web/app/admin/layout.tsx +34 -0
- package/dist/templates/shared/admin/web/components/admin-nav.tsx +48 -0
- package/dist/templates/shared/audit/web/lib/audit.ts +24 -0
- package/dist/templates/shared/auth/keycloak/web/app/api/auth/federated-logout/route.ts +173 -0
- package/dist/templates/shared/auth/keycloak/web/auth.config.ts +84 -0
- package/dist/templates/shared/auth/keycloak/web/auth.ts +26 -0
- package/dist/templates/shared/beta/web/app/api/beta-settings/route.ts +25 -0
- package/dist/templates/shared/beta/web/app/api/validate-beta-code/route.ts +67 -0
- package/dist/templates/shared/beta/web/lib/beta/settings.ts +31 -0
- package/dist/templates/shared/cache/web/lib/cache.ts +44 -0
- package/dist/templates/shared/config/web/lib/config.ts +112 -0
- package/dist/templates/shared/config/web/next.config.mjs +62 -0
- package/dist/templates/shared/contact/web/app/api/contact/route.ts +113 -0
- package/dist/templates/shared/contact/web/app/contact/page.tsx +195 -0
- package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +54 -0
- package/dist/templates/shared/database/postgresql/web/drizzle.config.ts +16 -0
- package/dist/templates/shared/database/postgresql/web/lib/db/drizzle.ts +39 -0
- package/dist/templates/shared/database/postgresql/web/lib/db/schema.ts +33 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/client.ts +12 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/server.ts +31 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/service.ts +15 -0
- package/dist/templates/shared/email/web/lib/email/branding.ts +18 -0
- package/dist/templates/shared/email/web/lib/email/client.ts +96 -0
- package/dist/templates/shared/error-pages/web/app/error.tsx +70 -0
- package/dist/templates/shared/error-pages/web/app/global-error.tsx +102 -0
- package/dist/templates/shared/error-pages/web/app/not-found.tsx +39 -0
- package/dist/templates/shared/health/web/app/api/health/route.ts +68 -0
- package/dist/templates/shared/legal/web/app/(legal)/privacy/page.tsx +205 -0
- package/dist/templates/shared/legal/web/app/(legal)/terms/page.tsx +154 -0
- package/dist/templates/shared/legal/web/lib/legal-config.ts +50 -0
- package/dist/templates/shared/loading/web/app/loading.tsx +5 -0
- package/dist/templates/shared/loading/web/components/skeleton.tsx +95 -0
- package/dist/templates/shared/middleware/web/middleware.ts +68 -0
- package/dist/templates/shared/observability/web/lib/observability.ts +135 -0
- package/dist/templates/shared/payments/web/app/api/webhooks/stripe/route.ts +109 -0
- package/dist/templates/shared/platform/web/lib/platform.ts +37 -0
- package/dist/templates/shared/redis/web/lib/rate-limit-store.ts +18 -0
- package/dist/templates/shared/redis/web/lib/redis.ts +48 -0
- package/dist/templates/shared/security/web/lib/api-security.ts +318 -0
- package/dist/templates/shared/seo/web/app/api/og/route.tsx +97 -0
- package/dist/templates/shared/seo/web/app/robots.ts +53 -0
- package/dist/templates/shared/seo/web/app/sitemap.ts +53 -0
- package/dist/templates/shared/utils/web/lib/api-response.ts +71 -0
- package/dist/templates/shared/utils/web/lib/utils.ts +85 -0
- package/dist/templates/web/ai-platform/template/.env.example +16 -0
- package/dist/templates/web/ai-platform/template/README.md +84 -0
- package/dist/templates/web/ai-platform/template/middleware.ts +55 -0
- package/dist/templates/web/ai-platform/template/next.config.js +14 -0
- package/dist/templates/web/ai-platform/template/package.json +55 -0
- package/dist/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
- package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
- package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
- package/dist/templates/web/ai-platform/template/src/app/globals.css +34 -0
- package/dist/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +203 -0
- package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
- package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
- package/dist/templates/web/ai-platform/template/tsconfig.json +27 -0
- package/dist/templates/web/iot-dashboard/template/.env.example +12 -0
- package/dist/templates/web/iot-dashboard/template/README.md +101 -0
- package/dist/templates/web/iot-dashboard/template/middleware.ts +56 -0
- package/dist/templates/web/iot-dashboard/template/next.config.js +14 -0
- package/dist/templates/web/iot-dashboard/template/package.json +49 -0
- package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
- package/dist/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
- package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
- package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
- package/dist/templates/web/iot-dashboard/template/tsconfig.json +27 -0
- package/dist/templates/web/marketplace/template/.env.example +12 -0
- package/dist/templates/web/marketplace/template/README.md +66 -0
- package/dist/templates/web/marketplace/template/middleware.ts +56 -0
- package/dist/templates/web/marketplace/template/next.config.js +14 -0
- package/dist/templates/web/marketplace/template/package.json +51 -0
- package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
- package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
- package/dist/templates/web/marketplace/template/src/app/globals.css +20 -0
- package/dist/templates/web/marketplace/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/marketplace/template/src/app/page.tsx +167 -0
- package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
- package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
- package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/marketplace/template/src/lib/utils.ts +19 -0
- package/dist/templates/web/marketplace/template/tsconfig.json +27 -0
- package/dist/templates/web/micro-saas/template/.env.example +10 -0
- package/dist/templates/web/micro-saas/template/README.md +63 -0
- package/dist/templates/web/micro-saas/template/middleware.ts +53 -0
- package/dist/templates/web/micro-saas/template/next.config.js +14 -0
- package/dist/templates/web/micro-saas/template/package.json +41 -0
- package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
- package/dist/templates/web/micro-saas/template/src/app/globals.css +20 -0
- package/dist/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
- package/dist/templates/web/micro-saas/template/src/app/page.tsx +137 -0
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
- package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
- package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
- package/dist/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
- package/dist/templates/web/micro-saas/template/tsconfig.json +27 -0
- package/package.json +5 -4
- package/src/templates/infrastructure/kubernetes/base/template/README.md +253 -0
- package/src/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
- package/src/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
- package/src/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
- package/src/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
- package/src/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
- package/src/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
- package/src/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
- package/src/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
- package/src/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
- package/src/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
- package/src/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
- package/src/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
- package/src/templates/infrastructure/terraform/aws/template/README.md +156 -0
- package/src/templates/infrastructure/terraform/aws/template/main.tf +343 -0
- package/src/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
- package/src/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
- package/src/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
- package/src/templates/infrastructure/terraform/gcp/template/README.md +165 -0
- package/src/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
- package/src/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
- package/src/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
- package/src/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
- package/src/templates/shared/admin/web/app/admin/layout.tsx +34 -0
- package/src/templates/shared/admin/web/components/admin-nav.tsx +48 -0
- package/src/templates/shared/audit/web/lib/audit.ts +24 -0
- package/src/templates/shared/auth/keycloak/web/app/api/auth/federated-logout/route.ts +173 -0
- package/src/templates/shared/auth/keycloak/web/auth.config.ts +84 -0
- package/src/templates/shared/auth/keycloak/web/auth.ts +26 -0
- package/src/templates/shared/beta/web/app/api/beta-settings/route.ts +25 -0
- package/src/templates/shared/beta/web/app/api/validate-beta-code/route.ts +67 -0
- package/src/templates/shared/beta/web/lib/beta/settings.ts +31 -0
- package/src/templates/shared/cache/web/lib/cache.ts +44 -0
- package/src/templates/shared/config/web/lib/config.ts +112 -0
- package/src/templates/shared/config/web/next.config.mjs +62 -0
- package/src/templates/shared/contact/web/app/api/contact/route.ts +113 -0
- package/src/templates/shared/contact/web/app/contact/page.tsx +195 -0
- package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +54 -0
- package/src/templates/shared/database/postgresql/web/drizzle.config.ts +16 -0
- package/src/templates/shared/database/postgresql/web/lib/db/drizzle.ts +39 -0
- package/src/templates/shared/database/postgresql/web/lib/db/schema.ts +33 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/client.ts +12 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/server.ts +31 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/service.ts +15 -0
- package/src/templates/shared/email/web/lib/email/branding.ts +18 -0
- package/src/templates/shared/email/web/lib/email/client.ts +96 -0
- package/src/templates/shared/error-pages/web/app/error.tsx +70 -0
- package/src/templates/shared/error-pages/web/app/global-error.tsx +102 -0
- package/src/templates/shared/error-pages/web/app/not-found.tsx +39 -0
- package/src/templates/shared/health/web/app/api/health/route.ts +68 -0
- package/src/templates/shared/legal/web/app/(legal)/privacy/page.tsx +205 -0
- package/src/templates/shared/legal/web/app/(legal)/terms/page.tsx +154 -0
- package/src/templates/shared/legal/web/lib/legal-config.ts +50 -0
- package/src/templates/shared/loading/web/app/loading.tsx +5 -0
- package/src/templates/shared/loading/web/components/skeleton.tsx +95 -0
- package/src/templates/shared/middleware/web/middleware.ts +68 -0
- package/src/templates/shared/observability/web/lib/observability.ts +135 -0
- package/src/templates/shared/payments/web/app/api/webhooks/stripe/route.ts +109 -0
- package/src/templates/shared/platform/web/lib/platform.ts +37 -0
- package/src/templates/shared/redis/web/lib/rate-limit-store.ts +18 -0
- package/src/templates/shared/redis/web/lib/redis.ts +48 -0
- package/src/templates/shared/security/web/lib/api-security.ts +318 -0
- package/src/templates/shared/seo/web/app/api/og/route.tsx +97 -0
- package/src/templates/shared/seo/web/app/robots.ts +53 -0
- package/src/templates/shared/seo/web/app/sitemap.ts +53 -0
- package/src/templates/shared/utils/web/lib/api-response.ts +71 -0
- package/src/templates/shared/utils/web/lib/utils.ts +85 -0
- package/src/templates/web/ai-platform/template/.env.example +16 -0
- package/src/templates/web/ai-platform/template/README.md +84 -0
- package/src/templates/web/ai-platform/template/middleware.ts +55 -0
- package/src/templates/web/ai-platform/template/next.config.js +14 -0
- package/src/templates/web/ai-platform/template/package.json +55 -0
- package/src/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
- package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
- package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
- package/src/templates/web/ai-platform/template/src/app/globals.css +34 -0
- package/src/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
- package/src/templates/web/ai-platform/template/src/app/page.tsx +203 -0
- package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
- package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
- package/src/templates/web/ai-platform/template/tsconfig.json +27 -0
- package/src/templates/web/iot-dashboard/template/.env.example +12 -0
- package/src/templates/web/iot-dashboard/template/README.md +101 -0
- package/src/templates/web/iot-dashboard/template/middleware.ts +56 -0
- package/src/templates/web/iot-dashboard/template/next.config.js +14 -0
- package/src/templates/web/iot-dashboard/template/package.json +49 -0
- package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
- package/src/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
- package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
- package/src/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
- package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
- package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
- package/src/templates/web/iot-dashboard/template/tsconfig.json +27 -0
- package/src/templates/web/marketplace/template/.env.example +12 -0
- package/src/templates/web/marketplace/template/README.md +66 -0
- package/src/templates/web/marketplace/template/middleware.ts +56 -0
- package/src/templates/web/marketplace/template/next.config.js +14 -0
- package/src/templates/web/marketplace/template/package.json +51 -0
- package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
- package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
- package/src/templates/web/marketplace/template/src/app/globals.css +20 -0
- package/src/templates/web/marketplace/template/src/app/layout.tsx +27 -0
- package/src/templates/web/marketplace/template/src/app/page.tsx +167 -0
- package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
- package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
- package/src/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/marketplace/template/src/lib/utils.ts +19 -0
- package/src/templates/web/marketplace/template/tsconfig.json +27 -0
- package/src/templates/web/micro-saas/template/.env.example +10 -0
- package/src/templates/web/micro-saas/template/README.md +63 -0
- package/src/templates/web/micro-saas/template/middleware.ts +53 -0
- package/src/templates/web/micro-saas/template/next.config.js +14 -0
- package/src/templates/web/micro-saas/template/package.json +41 -0
- package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
- package/src/templates/web/micro-saas/template/src/app/globals.css +20 -0
- package/src/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
- package/src/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
- package/src/templates/web/micro-saas/template/src/app/page.tsx +137 -0
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
- package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
- package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
- package/src/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
- package/src/templates/web/micro-saas/template/tsconfig.json +27 -0
- package/dist/cli/commands/add.d.ts +0 -6
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -39
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/create.d.ts +0 -45
- package/dist/cli/commands/create.d.ts.map +0 -1
- package/dist/cli/commands/create.js +0 -175
- package/dist/cli/commands/create.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -4
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -20
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -6
- package/dist/cli/commands/update.d.ts.map +0 -1
- package/dist/cli/commands/update.js +0 -68
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -61
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/prompts/index.d.ts +0 -2
- package/dist/cli/prompts/index.d.ts.map +0 -1
- package/dist/cli/prompts/index.js +0 -18
- package/dist/cli/prompts/index.js.map +0 -1
- package/dist/cli/prompts/project-setup.d.ts +0 -5
- package/dist/cli/prompts/project-setup.d.ts.map +0 -1
- package/dist/cli/prompts/project-setup.js +0 -316
- package/dist/cli/prompts/project-setup.js.map +0 -1
- package/dist/cli/utils/git.d.ts +0 -9
- package/dist/cli/utils/git.d.ts.map +0 -1
- package/dist/cli/utils/git.js +0 -77
- package/dist/cli/utils/git.js.map +0 -1
- package/dist/cli/utils/index.d.ts +0 -5
- package/dist/cli/utils/index.d.ts.map +0 -1
- package/dist/cli/utils/index.js +0 -21
- package/dist/cli/utils/index.js.map +0 -1
- package/dist/cli/utils/logger.d.ts +0 -16
- package/dist/cli/utils/logger.d.ts.map +0 -1
- package/dist/cli/utils/logger.js +0 -55
- package/dist/cli/utils/logger.js.map +0 -1
- package/dist/cli/utils/package-manager.d.ts +0 -8
- package/dist/cli/utils/package-manager.d.ts.map +0 -1
- package/dist/cli/utils/package-manager.js +0 -92
- package/dist/cli/utils/package-manager.js.map +0 -1
- package/dist/cli/utils/spinner.d.ts +0 -7
- package/dist/cli/utils/spinner.d.ts.map +0 -1
- package/dist/cli/utils/spinner.js +0 -48
- package/dist/cli/utils/spinner.js.map +0 -1
- package/dist/cli/validators/dependencies.d.ts +0 -15
- package/dist/cli/validators/dependencies.d.ts.map +0 -1
- package/dist/cli/validators/dependencies.js +0 -108
- package/dist/cli/validators/dependencies.js.map +0 -1
- package/dist/cli/validators/index.d.ts +0 -3
- package/dist/cli/validators/index.d.ts.map +0 -1
- package/dist/cli/validators/index.js +0 -19
- package/dist/cli/validators/index.js.map +0 -1
- package/dist/cli/validators/project-name.d.ts +0 -5
- package/dist/cli/validators/project-name.d.ts.map +0 -1
- package/dist/cli/validators/project-name.js +0 -151
- package/dist/cli/validators/project-name.js.map +0 -1
- package/dist/generators/file-processor.d.ts +0 -28
- package/dist/generators/file-processor.d.ts.map +0 -1
- package/dist/generators/file-processor.js +0 -224
- package/dist/generators/file-processor.js.map +0 -1
- package/dist/generators/index.d.ts +0 -4
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js +0 -20
- package/dist/generators/index.js.map +0 -1
- package/dist/generators/package-installer.d.ts +0 -29
- package/dist/generators/package-installer.d.ts.map +0 -1
- package/dist/generators/package-installer.js +0 -177
- package/dist/generators/package-installer.js.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# {{titleCaseName}} - Production Overlay
|
|
2
|
+
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
3
|
+
kind: Kustomization
|
|
4
|
+
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{projectName}}-production
|
|
7
|
+
|
|
8
|
+
namespace: {{projectName}}-production
|
|
9
|
+
|
|
10
|
+
resources:
|
|
11
|
+
- ../../base/template
|
|
12
|
+
|
|
13
|
+
nameSuffix: ""
|
|
14
|
+
|
|
15
|
+
commonLabels:
|
|
16
|
+
app.kubernetes.io/environment: production
|
|
17
|
+
|
|
18
|
+
# Production-specific image
|
|
19
|
+
images:
|
|
20
|
+
- name: {{projectName}}
|
|
21
|
+
newName: ghcr.io/your-org/{{projectName}}
|
|
22
|
+
newTag: production
|
|
23
|
+
|
|
24
|
+
# Production patches
|
|
25
|
+
patches:
|
|
26
|
+
# Increase replicas
|
|
27
|
+
- target:
|
|
28
|
+
kind: Deployment
|
|
29
|
+
name: {{projectName}}
|
|
30
|
+
patch: |-
|
|
31
|
+
- op: replace
|
|
32
|
+
path: /spec/replicas
|
|
33
|
+
value: 3
|
|
34
|
+
|
|
35
|
+
# Increase resources
|
|
36
|
+
- target:
|
|
37
|
+
kind: Deployment
|
|
38
|
+
name: {{projectName}}
|
|
39
|
+
patch: |-
|
|
40
|
+
- op: replace
|
|
41
|
+
path: /spec/template/spec/containers/0/resources
|
|
42
|
+
value:
|
|
43
|
+
requests:
|
|
44
|
+
cpu: 250m
|
|
45
|
+
memory: 512Mi
|
|
46
|
+
limits:
|
|
47
|
+
cpu: 1000m
|
|
48
|
+
memory: 1Gi
|
|
49
|
+
|
|
50
|
+
# Update HPA for production
|
|
51
|
+
- target:
|
|
52
|
+
kind: HorizontalPodAutoscaler
|
|
53
|
+
name: {{projectName}}
|
|
54
|
+
patch: |-
|
|
55
|
+
- op: replace
|
|
56
|
+
path: /spec/minReplicas
|
|
57
|
+
value: 3
|
|
58
|
+
- op: replace
|
|
59
|
+
path: /spec/maxReplicas
|
|
60
|
+
value: 20
|
|
61
|
+
|
|
62
|
+
# Update PDB for production
|
|
63
|
+
- target:
|
|
64
|
+
kind: PodDisruptionBudget
|
|
65
|
+
name: {{projectName}}
|
|
66
|
+
patch: |-
|
|
67
|
+
- op: replace
|
|
68
|
+
path: /spec/minAvailable
|
|
69
|
+
value: 2
|
|
70
|
+
|
|
71
|
+
# Update ingress host for production
|
|
72
|
+
- target:
|
|
73
|
+
kind: Ingress
|
|
74
|
+
name: {{projectName}}
|
|
75
|
+
patch: |-
|
|
76
|
+
- op: replace
|
|
77
|
+
path: /spec/tls/0/hosts/0
|
|
78
|
+
value: "{{projectName}}.com"
|
|
79
|
+
- op: replace
|
|
80
|
+
path: /spec/tls/0/secretName
|
|
81
|
+
value: {{projectName}}-production-tls
|
|
82
|
+
- op: replace
|
|
83
|
+
path: /spec/rules/0/host
|
|
84
|
+
value: "{{projectName}}.com"
|
|
85
|
+
|
|
86
|
+
# Production ConfigMap overrides
|
|
87
|
+
configMapGenerator:
|
|
88
|
+
- name: {{projectName}}-config
|
|
89
|
+
behavior: merge
|
|
90
|
+
literals:
|
|
91
|
+
- APP_URL=https://{{projectName}}.com
|
|
92
|
+
- LOG_LEVEL=warn
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# {{titleCaseName}} - AWS Infrastructure
|
|
2
|
+
|
|
3
|
+
Terraform configuration for deploying {{titleCaseName}} to AWS with Vercel frontend.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
9
|
+
│ Internet │
|
|
10
|
+
└─────────────────────────────────────────────────────────────┘
|
|
11
|
+
│
|
|
12
|
+
┌───────────────┼───────────────┐
|
|
13
|
+
▼ ▼ ▼
|
|
14
|
+
┌──────────┐ ┌───────────┐ ┌───────────┐
|
|
15
|
+
│ Vercel │ │ CloudFront│ │ Supabase │
|
|
16
|
+
│ (App) │ │ (CDN) │ │ (Auth/DB) │
|
|
17
|
+
└──────────┘ └───────────┘ └───────────┘
|
|
18
|
+
│
|
|
19
|
+
▼
|
|
20
|
+
┌───────────┐
|
|
21
|
+
│ S3 │
|
|
22
|
+
│ (Storage) │
|
|
23
|
+
└───────────┘
|
|
24
|
+
|
|
25
|
+
┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
26
|
+
│ SQS │ │ Secrets │ │CloudWatch │
|
|
27
|
+
│ (Queue) │ │ Manager │ │ (Logs) │
|
|
28
|
+
└───────────┘ └───────────┘ └───────────┘
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Prerequisites
|
|
32
|
+
|
|
33
|
+
1. **AWS Account** with appropriate permissions
|
|
34
|
+
2. **Vercel Account** with API token
|
|
35
|
+
3. **Supabase Project** created
|
|
36
|
+
4. **Terraform** >= 1.0 installed
|
|
37
|
+
5. **AWS CLI** configured with credentials
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
1. **Initialize Terraform:**
|
|
42
|
+
```bash
|
|
43
|
+
terraform init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. **Create variables file:**
|
|
47
|
+
```bash
|
|
48
|
+
cp terraform.tfvars.example terraform.tfvars
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. **Update variables:**
|
|
52
|
+
Edit `terraform.tfvars` with your values.
|
|
53
|
+
|
|
54
|
+
4. **Plan changes:**
|
|
55
|
+
```bash
|
|
56
|
+
terraform plan
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
5. **Apply changes:**
|
|
60
|
+
```bash
|
|
61
|
+
terraform apply
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Resources Created
|
|
65
|
+
|
|
66
|
+
| Resource | Purpose |
|
|
67
|
+
|----------|---------|
|
|
68
|
+
| Vercel Project | Frontend hosting with automatic deployments |
|
|
69
|
+
| S3 Bucket | File storage with versioning and encryption |
|
|
70
|
+
| CloudFront Distribution | CDN for S3 content |
|
|
71
|
+
| SQS Queues | Background job processing (main + DLQ) |
|
|
72
|
+
| Secrets Manager | Secure storage for API keys |
|
|
73
|
+
| IAM Role | Execution role for Lambda/ECS |
|
|
74
|
+
| CloudWatch Log Group | Centralized logging |
|
|
75
|
+
| SNS Topic | Alert notifications |
|
|
76
|
+
|
|
77
|
+
## Environments
|
|
78
|
+
|
|
79
|
+
### Staging
|
|
80
|
+
```bash
|
|
81
|
+
terraform workspace new staging
|
|
82
|
+
terraform apply -var="environment=staging"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Production
|
|
86
|
+
```bash
|
|
87
|
+
terraform workspace new production
|
|
88
|
+
terraform apply -var="environment=production"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Remote State (Recommended for Teams)
|
|
92
|
+
|
|
93
|
+
1. Create S3 bucket and DynamoDB table:
|
|
94
|
+
```bash
|
|
95
|
+
aws s3 mb s3://{{projectName}}-terraform-state
|
|
96
|
+
aws dynamodb create-table \
|
|
97
|
+
--table-name {{projectName}}-terraform-locks \
|
|
98
|
+
--attribute-definitions AttributeName=LockID,AttributeType=S \
|
|
99
|
+
--key-schema AttributeName=LockID,KeyType=HASH \
|
|
100
|
+
--billing-mode PAY_PER_REQUEST
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
2. Uncomment backend configuration in `main.tf`
|
|
104
|
+
|
|
105
|
+
3. Re-initialize:
|
|
106
|
+
```bash
|
|
107
|
+
terraform init -migrate-state
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Security Notes
|
|
111
|
+
|
|
112
|
+
- All S3 buckets have public access blocked
|
|
113
|
+
- Encryption enabled at rest (AES256)
|
|
114
|
+
- Secrets stored in Secrets Manager
|
|
115
|
+
- IAM follows least-privilege principle
|
|
116
|
+
- CloudFront uses HTTPS only
|
|
117
|
+
|
|
118
|
+
## Cost Estimation
|
|
119
|
+
|
|
120
|
+
| Resource | Estimated Monthly Cost |
|
|
121
|
+
|----------|----------------------|
|
|
122
|
+
| Vercel | Free - $20 (Hobby/Pro) |
|
|
123
|
+
| S3 | ~$5 (50GB storage) |
|
|
124
|
+
| CloudFront | ~$10 (100GB transfer) |
|
|
125
|
+
| SQS | ~$1 (1M requests) |
|
|
126
|
+
| Secrets Manager | ~$1 (4 secrets) |
|
|
127
|
+
| CloudWatch | ~$5 (10GB logs) |
|
|
128
|
+
| **Total** | **~$22-42/month** |
|
|
129
|
+
|
|
130
|
+
## Cleanup
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
terraform destroy
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Troubleshooting
|
|
137
|
+
|
|
138
|
+
### Vercel API Token
|
|
139
|
+
Generate at: https://vercel.com/account/tokens
|
|
140
|
+
|
|
141
|
+
### AWS Credentials
|
|
142
|
+
```bash
|
|
143
|
+
aws configure
|
|
144
|
+
# Or use environment variables:
|
|
145
|
+
export AWS_ACCESS_KEY_ID="xxx"
|
|
146
|
+
export AWS_SECRET_ACCESS_KEY="xxx"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### State Lock Issues
|
|
150
|
+
```bash
|
|
151
|
+
terraform force-unlock LOCK_ID
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT - Built with DLL Platform
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# {{titleCaseName}} - AWS Infrastructure
|
|
2
|
+
# Terraform configuration for deploying to AWS with Vercel frontend
|
|
3
|
+
|
|
4
|
+
terraform {
|
|
5
|
+
required_version = ">= 1.0"
|
|
6
|
+
|
|
7
|
+
required_providers {
|
|
8
|
+
aws = {
|
|
9
|
+
source = "hashicorp/aws"
|
|
10
|
+
version = "~> 5.0"
|
|
11
|
+
}
|
|
12
|
+
vercel = {
|
|
13
|
+
source = "vercel/vercel"
|
|
14
|
+
version = "~> 1.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# Uncomment for remote state storage
|
|
19
|
+
# backend "s3" {
|
|
20
|
+
# bucket = "{{projectName}}-terraform-state"
|
|
21
|
+
# key = "terraform.tfstate"
|
|
22
|
+
# region = "us-east-1"
|
|
23
|
+
# dynamodb_table = "{{projectName}}-terraform-locks"
|
|
24
|
+
# encrypt = true
|
|
25
|
+
# }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
provider "aws" {
|
|
29
|
+
region = var.aws_region
|
|
30
|
+
|
|
31
|
+
default_tags {
|
|
32
|
+
tags = {
|
|
33
|
+
Project = "{{projectName}}"
|
|
34
|
+
Environment = var.environment
|
|
35
|
+
ManagedBy = "Terraform"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
provider "vercel" {
|
|
41
|
+
api_token = var.vercel_api_token
|
|
42
|
+
team = var.vercel_team_id
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# ============================================
|
|
46
|
+
# Vercel Project
|
|
47
|
+
# ============================================
|
|
48
|
+
|
|
49
|
+
resource "vercel_project" "app" {
|
|
50
|
+
name = "{{projectName}}-${var.environment}"
|
|
51
|
+
framework = "nextjs"
|
|
52
|
+
|
|
53
|
+
git_repository = {
|
|
54
|
+
type = "github"
|
|
55
|
+
repo = var.github_repo
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
environment = [
|
|
59
|
+
{
|
|
60
|
+
key = "NEXT_PUBLIC_SUPABASE_URL"
|
|
61
|
+
value = var.supabase_url
|
|
62
|
+
target = ["production", "preview", "development"]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key = "NEXT_PUBLIC_SUPABASE_ANON_KEY"
|
|
66
|
+
value = var.supabase_anon_key
|
|
67
|
+
target = ["production", "preview", "development"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key = "SUPABASE_SERVICE_ROLE_KEY"
|
|
71
|
+
value = var.supabase_service_role_key
|
|
72
|
+
target = ["production"]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key = "NEXT_PUBLIC_APP_URL"
|
|
76
|
+
value = "https://${var.domain}"
|
|
77
|
+
target = ["production"]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
resource "vercel_project_domain" "app" {
|
|
83
|
+
project_id = vercel_project.app.id
|
|
84
|
+
domain = var.domain
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# ============================================
|
|
88
|
+
# S3 Bucket for File Storage
|
|
89
|
+
# ============================================
|
|
90
|
+
|
|
91
|
+
resource "aws_s3_bucket" "storage" {
|
|
92
|
+
bucket = "{{projectName}}-${var.environment}-storage"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
resource "aws_s3_bucket_versioning" "storage" {
|
|
96
|
+
bucket = aws_s3_bucket.storage.id
|
|
97
|
+
versioning_configuration {
|
|
98
|
+
status = "Enabled"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
resource "aws_s3_bucket_server_side_encryption_configuration" "storage" {
|
|
103
|
+
bucket = aws_s3_bucket.storage.id
|
|
104
|
+
|
|
105
|
+
rule {
|
|
106
|
+
apply_server_side_encryption_by_default {
|
|
107
|
+
sse_algorithm = "AES256"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
resource "aws_s3_bucket_public_access_block" "storage" {
|
|
113
|
+
bucket = aws_s3_bucket.storage.id
|
|
114
|
+
|
|
115
|
+
block_public_acls = true
|
|
116
|
+
block_public_policy = true
|
|
117
|
+
ignore_public_acls = true
|
|
118
|
+
restrict_public_buckets = true
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
resource "aws_s3_bucket_cors_configuration" "storage" {
|
|
122
|
+
bucket = aws_s3_bucket.storage.id
|
|
123
|
+
|
|
124
|
+
cors_rule {
|
|
125
|
+
allowed_headers = ["*"]
|
|
126
|
+
allowed_methods = ["GET", "PUT", "POST", "DELETE", "HEAD"]
|
|
127
|
+
allowed_origins = ["https://${var.domain}"]
|
|
128
|
+
expose_headers = ["ETag"]
|
|
129
|
+
max_age_seconds = 3000
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
# ============================================
|
|
134
|
+
# CloudFront CDN for S3
|
|
135
|
+
# ============================================
|
|
136
|
+
|
|
137
|
+
resource "aws_cloudfront_origin_access_control" "storage" {
|
|
138
|
+
name = "{{projectName}}-${var.environment}-oac"
|
|
139
|
+
origin_access_control_origin_type = "s3"
|
|
140
|
+
signing_behavior = "always"
|
|
141
|
+
signing_protocol = "sigv4"
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
resource "aws_cloudfront_distribution" "storage" {
|
|
145
|
+
enabled = true
|
|
146
|
+
is_ipv6_enabled = true
|
|
147
|
+
comment = "{{titleCaseName}} Storage CDN"
|
|
148
|
+
default_root_object = "index.html"
|
|
149
|
+
price_class = "PriceClass_100"
|
|
150
|
+
|
|
151
|
+
origin {
|
|
152
|
+
domain_name = aws_s3_bucket.storage.bucket_regional_domain_name
|
|
153
|
+
origin_id = "S3-${aws_s3_bucket.storage.id}"
|
|
154
|
+
origin_access_control_id = aws_cloudfront_origin_access_control.storage.id
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
default_cache_behavior {
|
|
158
|
+
allowed_methods = ["GET", "HEAD", "OPTIONS"]
|
|
159
|
+
cached_methods = ["GET", "HEAD"]
|
|
160
|
+
target_origin_id = "S3-${aws_s3_bucket.storage.id}"
|
|
161
|
+
|
|
162
|
+
forwarded_values {
|
|
163
|
+
query_string = false
|
|
164
|
+
cookies {
|
|
165
|
+
forward = "none"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
viewer_protocol_policy = "redirect-to-https"
|
|
170
|
+
min_ttl = 0
|
|
171
|
+
default_ttl = 3600
|
|
172
|
+
max_ttl = 86400
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
restrictions {
|
|
176
|
+
geo_restriction {
|
|
177
|
+
restriction_type = "none"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
viewer_certificate {
|
|
182
|
+
cloudfront_default_certificate = true
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
resource "aws_s3_bucket_policy" "storage" {
|
|
187
|
+
bucket = aws_s3_bucket.storage.id
|
|
188
|
+
policy = jsonencode({
|
|
189
|
+
Version = "2012-10-17"
|
|
190
|
+
Statement = [
|
|
191
|
+
{
|
|
192
|
+
Sid = "AllowCloudFrontAccess"
|
|
193
|
+
Effect = "Allow"
|
|
194
|
+
Principal = {
|
|
195
|
+
Service = "cloudfront.amazonaws.com"
|
|
196
|
+
}
|
|
197
|
+
Action = "s3:GetObject"
|
|
198
|
+
Resource = "${aws_s3_bucket.storage.arn}/*"
|
|
199
|
+
Condition = {
|
|
200
|
+
StringEquals = {
|
|
201
|
+
"AWS:SourceArn" = aws_cloudfront_distribution.storage.arn
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
# ============================================
|
|
210
|
+
# SQS Queue for Background Jobs
|
|
211
|
+
# ============================================
|
|
212
|
+
|
|
213
|
+
resource "aws_sqs_queue" "jobs" {
|
|
214
|
+
name = "{{projectName}}-${var.environment}-jobs"
|
|
215
|
+
delay_seconds = 0
|
|
216
|
+
max_message_size = 262144
|
|
217
|
+
message_retention_seconds = 1209600
|
|
218
|
+
receive_wait_time_seconds = 10
|
|
219
|
+
visibility_timeout_seconds = 300
|
|
220
|
+
|
|
221
|
+
redrive_policy = jsonencode({
|
|
222
|
+
deadLetterTargetArn = aws_sqs_queue.jobs_dlq.arn
|
|
223
|
+
maxReceiveCount = 3
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
resource "aws_sqs_queue" "jobs_dlq" {
|
|
228
|
+
name = "{{projectName}}-${var.environment}-jobs-dlq"
|
|
229
|
+
message_retention_seconds = 1209600
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
# ============================================
|
|
233
|
+
# Secrets Manager
|
|
234
|
+
# ============================================
|
|
235
|
+
|
|
236
|
+
resource "aws_secretsmanager_secret" "app_secrets" {
|
|
237
|
+
name = "{{projectName}}/${var.environment}/app"
|
|
238
|
+
description = "Application secrets for {{titleCaseName}}"
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
resource "aws_secretsmanager_secret_version" "app_secrets" {
|
|
242
|
+
secret_id = aws_secretsmanager_secret.app_secrets.id
|
|
243
|
+
secret_string = jsonencode({
|
|
244
|
+
STRIPE_SECRET_KEY = var.stripe_secret_key
|
|
245
|
+
STRIPE_WEBHOOK_SECRET = var.stripe_webhook_secret
|
|
246
|
+
OPENAI_API_KEY = var.openai_api_key
|
|
247
|
+
ANTHROPIC_API_KEY = var.anthropic_api_key
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
# ============================================
|
|
252
|
+
# IAM Role for Lambda/ECS
|
|
253
|
+
# ============================================
|
|
254
|
+
|
|
255
|
+
resource "aws_iam_role" "app_execution" {
|
|
256
|
+
name = "{{projectName}}-${var.environment}-execution"
|
|
257
|
+
|
|
258
|
+
assume_role_policy = jsonencode({
|
|
259
|
+
Version = "2012-10-17"
|
|
260
|
+
Statement = [
|
|
261
|
+
{
|
|
262
|
+
Action = "sts:AssumeRole"
|
|
263
|
+
Effect = "Allow"
|
|
264
|
+
Principal = {
|
|
265
|
+
Service = ["lambda.amazonaws.com", "ecs-tasks.amazonaws.com"]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
resource "aws_iam_role_policy" "app_execution" {
|
|
273
|
+
name = "{{projectName}}-${var.environment}-execution-policy"
|
|
274
|
+
role = aws_iam_role.app_execution.id
|
|
275
|
+
|
|
276
|
+
policy = jsonencode({
|
|
277
|
+
Version = "2012-10-17"
|
|
278
|
+
Statement = [
|
|
279
|
+
{
|
|
280
|
+
Effect = "Allow"
|
|
281
|
+
Action = [
|
|
282
|
+
"s3:GetObject",
|
|
283
|
+
"s3:PutObject",
|
|
284
|
+
"s3:DeleteObject"
|
|
285
|
+
]
|
|
286
|
+
Resource = "${aws_s3_bucket.storage.arn}/*"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
Effect = "Allow"
|
|
290
|
+
Action = [
|
|
291
|
+
"sqs:SendMessage",
|
|
292
|
+
"sqs:ReceiveMessage",
|
|
293
|
+
"sqs:DeleteMessage",
|
|
294
|
+
"sqs:GetQueueAttributes"
|
|
295
|
+
]
|
|
296
|
+
Resource = [
|
|
297
|
+
aws_sqs_queue.jobs.arn,
|
|
298
|
+
aws_sqs_queue.jobs_dlq.arn
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
Effect = "Allow"
|
|
303
|
+
Action = [
|
|
304
|
+
"secretsmanager:GetSecretValue"
|
|
305
|
+
]
|
|
306
|
+
Resource = aws_secretsmanager_secret.app_secrets.arn
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
Effect = "Allow"
|
|
310
|
+
Action = [
|
|
311
|
+
"logs:CreateLogGroup",
|
|
312
|
+
"logs:CreateLogStream",
|
|
313
|
+
"logs:PutLogEvents"
|
|
314
|
+
]
|
|
315
|
+
Resource = "*"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
})
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
# ============================================
|
|
322
|
+
# CloudWatch Log Group
|
|
323
|
+
# ============================================
|
|
324
|
+
|
|
325
|
+
resource "aws_cloudwatch_log_group" "app" {
|
|
326
|
+
name = "/{{projectName}}/${var.environment}"
|
|
327
|
+
retention_in_days = 30
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
# ============================================
|
|
331
|
+
# SNS Topic for Alerts
|
|
332
|
+
# ============================================
|
|
333
|
+
|
|
334
|
+
resource "aws_sns_topic" "alerts" {
|
|
335
|
+
name = "{{projectName}}-${var.environment}-alerts"
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
resource "aws_sns_topic_subscription" "alerts_email" {
|
|
339
|
+
count = var.alert_email != "" ? 1 : 0
|
|
340
|
+
topic_arn = aws_sns_topic.alerts.arn
|
|
341
|
+
protocol = "email"
|
|
342
|
+
endpoint = var.alert_email
|
|
343
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# {{titleCaseName}} - Terraform Outputs
|
|
2
|
+
|
|
3
|
+
output "vercel_project_id" {
|
|
4
|
+
description = "Vercel project ID"
|
|
5
|
+
value = vercel_project.app.id
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
output "vercel_domains" {
|
|
9
|
+
description = "Vercel project domains"
|
|
10
|
+
value = [var.domain]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
output "s3_bucket_name" {
|
|
14
|
+
description = "S3 storage bucket name"
|
|
15
|
+
value = aws_s3_bucket.storage.id
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
output "s3_bucket_arn" {
|
|
19
|
+
description = "S3 storage bucket ARN"
|
|
20
|
+
value = aws_s3_bucket.storage.arn
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
output "cloudfront_distribution_id" {
|
|
24
|
+
description = "CloudFront distribution ID"
|
|
25
|
+
value = aws_cloudfront_distribution.storage.id
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
output "cloudfront_domain" {
|
|
29
|
+
description = "CloudFront distribution domain"
|
|
30
|
+
value = aws_cloudfront_distribution.storage.domain_name
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
output "sqs_queue_url" {
|
|
34
|
+
description = "SQS jobs queue URL"
|
|
35
|
+
value = aws_sqs_queue.jobs.url
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
output "sqs_queue_arn" {
|
|
39
|
+
description = "SQS jobs queue ARN"
|
|
40
|
+
value = aws_sqs_queue.jobs.arn
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
output "sqs_dlq_url" {
|
|
44
|
+
description = "SQS dead letter queue URL"
|
|
45
|
+
value = aws_sqs_queue.jobs_dlq.url
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
output "secrets_arn" {
|
|
49
|
+
description = "Secrets Manager secret ARN"
|
|
50
|
+
value = aws_secretsmanager_secret.app_secrets.arn
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
output "execution_role_arn" {
|
|
54
|
+
description = "IAM execution role ARN"
|
|
55
|
+
value = aws_iam_role.app_execution.arn
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
output "log_group_name" {
|
|
59
|
+
description = "CloudWatch log group name"
|
|
60
|
+
value = aws_cloudwatch_log_group.app.name
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
output "sns_alerts_topic_arn" {
|
|
64
|
+
description = "SNS alerts topic ARN"
|
|
65
|
+
value = aws_sns_topic.alerts.arn
|
|
66
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# {{titleCaseName}} - Terraform Variables
|
|
2
|
+
# Copy to terraform.tfvars and fill in values
|
|
3
|
+
|
|
4
|
+
# General
|
|
5
|
+
environment = "staging"
|
|
6
|
+
aws_region = "us-east-1"
|
|
7
|
+
|
|
8
|
+
# Vercel
|
|
9
|
+
vercel_api_token = "your-vercel-api-token"
|
|
10
|
+
vercel_team_id = null # Optional: your-team-id
|
|
11
|
+
github_repo = "your-org/{{projectName}}"
|
|
12
|
+
domain = "{{projectName}}.com"
|
|
13
|
+
|
|
14
|
+
# Supabase
|
|
15
|
+
supabase_url = "https://xxx.supabase.co"
|
|
16
|
+
supabase_anon_key = "your-supabase-anon-key"
|
|
17
|
+
supabase_service_role_key = "your-supabase-service-role-key"
|
|
18
|
+
|
|
19
|
+
# Stripe (Optional - leave empty if not using payments)
|
|
20
|
+
stripe_secret_key = ""
|
|
21
|
+
stripe_webhook_secret = ""
|
|
22
|
+
|
|
23
|
+
# AI (Optional - leave empty if not using AI features)
|
|
24
|
+
openai_api_key = ""
|
|
25
|
+
anthropic_api_key = ""
|
|
26
|
+
|
|
27
|
+
# Monitoring
|
|
28
|
+
alert_email = "alerts@{{projectName}}.com"
|