@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,397 @@
|
|
|
1
|
+
# {{titleCaseName}} - GCP Infrastructure
|
|
2
|
+
# Terraform configuration for deploying to Google Cloud with Vercel frontend
|
|
3
|
+
|
|
4
|
+
terraform {
|
|
5
|
+
required_version = ">= 1.0"
|
|
6
|
+
|
|
7
|
+
required_providers {
|
|
8
|
+
google = {
|
|
9
|
+
source = "hashicorp/google"
|
|
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 "gcs" {
|
|
20
|
+
# bucket = "{{projectName}}-terraform-state"
|
|
21
|
+
# prefix = "terraform/state"
|
|
22
|
+
# }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
provider "google" {
|
|
26
|
+
project = var.gcp_project_id
|
|
27
|
+
region = var.gcp_region
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
provider "vercel" {
|
|
31
|
+
api_token = var.vercel_api_token
|
|
32
|
+
team = var.vercel_team_id
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# ============================================
|
|
36
|
+
# Vercel Project
|
|
37
|
+
# ============================================
|
|
38
|
+
|
|
39
|
+
resource "vercel_project" "app" {
|
|
40
|
+
name = "{{projectName}}-${var.environment}"
|
|
41
|
+
framework = "nextjs"
|
|
42
|
+
|
|
43
|
+
git_repository = {
|
|
44
|
+
type = "github"
|
|
45
|
+
repo = var.github_repo
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
environment = [
|
|
49
|
+
{
|
|
50
|
+
key = "NEXT_PUBLIC_SUPABASE_URL"
|
|
51
|
+
value = var.supabase_url
|
|
52
|
+
target = ["production", "preview", "development"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key = "NEXT_PUBLIC_SUPABASE_ANON_KEY"
|
|
56
|
+
value = var.supabase_anon_key
|
|
57
|
+
target = ["production", "preview", "development"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key = "SUPABASE_SERVICE_ROLE_KEY"
|
|
61
|
+
value = var.supabase_service_role_key
|
|
62
|
+
target = ["production"]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key = "NEXT_PUBLIC_APP_URL"
|
|
66
|
+
value = "https://${var.domain}"
|
|
67
|
+
target = ["production"]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
resource "vercel_project_domain" "app" {
|
|
73
|
+
project_id = vercel_project.app.id
|
|
74
|
+
domain = var.domain
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
# ============================================
|
|
78
|
+
# Cloud Storage Bucket
|
|
79
|
+
# ============================================
|
|
80
|
+
|
|
81
|
+
resource "google_storage_bucket" "storage" {
|
|
82
|
+
name = "{{projectName}}-${var.environment}-storage"
|
|
83
|
+
location = var.gcp_region
|
|
84
|
+
storage_class = "STANDARD"
|
|
85
|
+
|
|
86
|
+
uniform_bucket_level_access = true
|
|
87
|
+
|
|
88
|
+
versioning {
|
|
89
|
+
enabled = true
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
lifecycle_rule {
|
|
93
|
+
action {
|
|
94
|
+
type = "Delete"
|
|
95
|
+
}
|
|
96
|
+
condition {
|
|
97
|
+
age = 365
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
cors {
|
|
102
|
+
origin = ["https://${var.domain}"]
|
|
103
|
+
method = ["GET", "PUT", "POST", "DELETE", "HEAD"]
|
|
104
|
+
response_header = ["*"]
|
|
105
|
+
max_age_seconds = 3600
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
labels = {
|
|
109
|
+
project = "{{projectName}}"
|
|
110
|
+
environment = var.environment
|
|
111
|
+
managed-by = "terraform"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
# ============================================
|
|
116
|
+
# Cloud CDN for Storage
|
|
117
|
+
# ============================================
|
|
118
|
+
|
|
119
|
+
resource "google_compute_backend_bucket" "storage_cdn" {
|
|
120
|
+
name = "{{projectName}}-${var.environment}-cdn"
|
|
121
|
+
bucket_name = google_storage_bucket.storage.name
|
|
122
|
+
enable_cdn = true
|
|
123
|
+
|
|
124
|
+
cdn_policy {
|
|
125
|
+
cache_mode = "CACHE_ALL_STATIC"
|
|
126
|
+
default_ttl = 3600
|
|
127
|
+
max_ttl = 86400
|
|
128
|
+
client_ttl = 3600
|
|
129
|
+
negative_caching = true
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
resource "google_compute_url_map" "storage_cdn" {
|
|
134
|
+
name = "{{projectName}}-${var.environment}-url-map"
|
|
135
|
+
default_service = google_compute_backend_bucket.storage_cdn.id
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
resource "google_compute_global_address" "storage_cdn" {
|
|
139
|
+
name = "{{projectName}}-${var.environment}-cdn-ip"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
resource "google_compute_global_forwarding_rule" "storage_cdn_https" {
|
|
143
|
+
name = "{{projectName}}-${var.environment}-cdn-https"
|
|
144
|
+
ip_address = google_compute_global_address.storage_cdn.address
|
|
145
|
+
ip_protocol = "TCP"
|
|
146
|
+
load_balancing_scheme = "EXTERNAL"
|
|
147
|
+
port_range = "443"
|
|
148
|
+
target = google_compute_target_https_proxy.storage_cdn.id
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
resource "google_compute_managed_ssl_certificate" "storage_cdn" {
|
|
152
|
+
name = "{{projectName}}-${var.environment}-cdn-cert"
|
|
153
|
+
|
|
154
|
+
managed {
|
|
155
|
+
domains = ["cdn.${var.domain}"]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
resource "google_compute_target_https_proxy" "storage_cdn" {
|
|
160
|
+
name = "{{projectName}}-${var.environment}-cdn-proxy"
|
|
161
|
+
url_map = google_compute_url_map.storage_cdn.id
|
|
162
|
+
ssl_certificates = [google_compute_managed_ssl_certificate.storage_cdn.id]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# ============================================
|
|
166
|
+
# Cloud Tasks (Job Queue)
|
|
167
|
+
# ============================================
|
|
168
|
+
|
|
169
|
+
resource "google_cloud_tasks_queue" "jobs" {
|
|
170
|
+
name = "{{projectName}}-${var.environment}-jobs"
|
|
171
|
+
location = var.gcp_region
|
|
172
|
+
|
|
173
|
+
rate_limits {
|
|
174
|
+
max_concurrent_dispatches = 10
|
|
175
|
+
max_dispatches_per_second = 100
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
retry_config {
|
|
179
|
+
max_attempts = 5
|
|
180
|
+
max_retry_duration = "3600s"
|
|
181
|
+
min_backoff = "1s"
|
|
182
|
+
max_backoff = "3600s"
|
|
183
|
+
max_doublings = 16
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
# ============================================
|
|
188
|
+
# Pub/Sub (Event Bus)
|
|
189
|
+
# ============================================
|
|
190
|
+
|
|
191
|
+
resource "google_pubsub_topic" "events" {
|
|
192
|
+
name = "{{projectName}}-${var.environment}-events"
|
|
193
|
+
|
|
194
|
+
labels = {
|
|
195
|
+
project = "{{projectName}}"
|
|
196
|
+
environment = var.environment
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
resource "google_pubsub_subscription" "events" {
|
|
201
|
+
name = "{{projectName}}-${var.environment}-events-sub"
|
|
202
|
+
topic = google_pubsub_topic.events.name
|
|
203
|
+
|
|
204
|
+
ack_deadline_seconds = 60
|
|
205
|
+
|
|
206
|
+
retry_policy {
|
|
207
|
+
minimum_backoff = "10s"
|
|
208
|
+
maximum_backoff = "600s"
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
dead_letter_policy {
|
|
212
|
+
dead_letter_topic = google_pubsub_topic.events_dlq.id
|
|
213
|
+
max_delivery_attempts = 5
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
resource "google_pubsub_topic" "events_dlq" {
|
|
218
|
+
name = "{{projectName}}-${var.environment}-events-dlq"
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
# ============================================
|
|
222
|
+
# Secret Manager
|
|
223
|
+
# ============================================
|
|
224
|
+
|
|
225
|
+
resource "google_secret_manager_secret" "stripe_secret_key" {
|
|
226
|
+
secret_id = "{{projectName}}-${var.environment}-stripe-secret-key"
|
|
227
|
+
|
|
228
|
+
replication {
|
|
229
|
+
auto {}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
labels = {
|
|
233
|
+
project = "{{projectName}}"
|
|
234
|
+
environment = var.environment
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
resource "google_secret_manager_secret_version" "stripe_secret_key" {
|
|
239
|
+
count = var.stripe_secret_key != "" ? 1 : 0
|
|
240
|
+
secret = google_secret_manager_secret.stripe_secret_key.id
|
|
241
|
+
secret_data = var.stripe_secret_key
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
resource "google_secret_manager_secret" "stripe_webhook_secret" {
|
|
245
|
+
secret_id = "{{projectName}}-${var.environment}-stripe-webhook-secret"
|
|
246
|
+
|
|
247
|
+
replication {
|
|
248
|
+
auto {}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
labels = {
|
|
252
|
+
project = "{{projectName}}"
|
|
253
|
+
environment = var.environment
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
resource "google_secret_manager_secret_version" "stripe_webhook_secret" {
|
|
258
|
+
count = var.stripe_webhook_secret != "" ? 1 : 0
|
|
259
|
+
secret = google_secret_manager_secret.stripe_webhook_secret.id
|
|
260
|
+
secret_data = var.stripe_webhook_secret
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
resource "google_secret_manager_secret" "openai_api_key" {
|
|
264
|
+
secret_id = "{{projectName}}-${var.environment}-openai-api-key"
|
|
265
|
+
|
|
266
|
+
replication {
|
|
267
|
+
auto {}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
labels = {
|
|
271
|
+
project = "{{projectName}}"
|
|
272
|
+
environment = var.environment
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
resource "google_secret_manager_secret_version" "openai_api_key" {
|
|
277
|
+
count = var.openai_api_key != "" ? 1 : 0
|
|
278
|
+
secret = google_secret_manager_secret.openai_api_key.id
|
|
279
|
+
secret_data = var.openai_api_key
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
# ============================================
|
|
283
|
+
# Service Account
|
|
284
|
+
# ============================================
|
|
285
|
+
|
|
286
|
+
resource "google_service_account" "app" {
|
|
287
|
+
account_id = "{{projectName}}-${var.environment}"
|
|
288
|
+
display_name = "{{titleCaseName}} ${var.environment} Service Account"
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
resource "google_project_iam_member" "app_storage" {
|
|
292
|
+
project = var.gcp_project_id
|
|
293
|
+
role = "roles/storage.objectAdmin"
|
|
294
|
+
member = "serviceAccount:${google_service_account.app.email}"
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
resource "google_project_iam_member" "app_tasks" {
|
|
298
|
+
project = var.gcp_project_id
|
|
299
|
+
role = "roles/cloudtasks.enqueuer"
|
|
300
|
+
member = "serviceAccount:${google_service_account.app.email}"
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
resource "google_project_iam_member" "app_pubsub" {
|
|
304
|
+
project = var.gcp_project_id
|
|
305
|
+
role = "roles/pubsub.publisher"
|
|
306
|
+
member = "serviceAccount:${google_service_account.app.email}"
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
resource "google_project_iam_member" "app_secrets" {
|
|
310
|
+
project = var.gcp_project_id
|
|
311
|
+
role = "roles/secretmanager.secretAccessor"
|
|
312
|
+
member = "serviceAccount:${google_service_account.app.email}"
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
resource "google_project_iam_member" "app_logging" {
|
|
316
|
+
project = var.gcp_project_id
|
|
317
|
+
role = "roles/logging.logWriter"
|
|
318
|
+
member = "serviceAccount:${google_service_account.app.email}"
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
# ============================================
|
|
322
|
+
# Cloud Logging
|
|
323
|
+
# ============================================
|
|
324
|
+
|
|
325
|
+
resource "google_logging_project_sink" "app_logs" {
|
|
326
|
+
name = "{{projectName}}-${var.environment}-logs"
|
|
327
|
+
destination = "storage.googleapis.com/${google_storage_bucket.logs.name}"
|
|
328
|
+
filter = "resource.labels.project_id=\"${var.gcp_project_id}\" AND labels.project=\"{{projectName}}\""
|
|
329
|
+
|
|
330
|
+
unique_writer_identity = true
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
resource "google_storage_bucket" "logs" {
|
|
334
|
+
name = "{{projectName}}-${var.environment}-logs"
|
|
335
|
+
location = var.gcp_region
|
|
336
|
+
storage_class = "STANDARD"
|
|
337
|
+
|
|
338
|
+
lifecycle_rule {
|
|
339
|
+
action {
|
|
340
|
+
type = "Delete"
|
|
341
|
+
}
|
|
342
|
+
condition {
|
|
343
|
+
age = 90
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
labels = {
|
|
348
|
+
project = "{{projectName}}"
|
|
349
|
+
environment = var.environment
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
resource "google_storage_bucket_iam_member" "logs_writer" {
|
|
354
|
+
bucket = google_storage_bucket.logs.name
|
|
355
|
+
role = "roles/storage.objectCreator"
|
|
356
|
+
member = google_logging_project_sink.app_logs.writer_identity
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
# ============================================
|
|
360
|
+
# Cloud Monitoring Alerts
|
|
361
|
+
# ============================================
|
|
362
|
+
|
|
363
|
+
resource "google_monitoring_notification_channel" "email" {
|
|
364
|
+
count = var.alert_email != "" ? 1 : 0
|
|
365
|
+
display_name = "{{titleCaseName}} Alerts"
|
|
366
|
+
type = "email"
|
|
367
|
+
|
|
368
|
+
labels = {
|
|
369
|
+
email_address = var.alert_email
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
resource "google_monitoring_alert_policy" "high_error_rate" {
|
|
374
|
+
count = var.alert_email != "" ? 1 : 0
|
|
375
|
+
display_name = "{{titleCaseName}} High Error Rate"
|
|
376
|
+
combiner = "OR"
|
|
377
|
+
|
|
378
|
+
conditions {
|
|
379
|
+
display_name = "Error rate > 5%"
|
|
380
|
+
condition_threshold {
|
|
381
|
+
filter = "resource.type=\"cloud_run_revision\" AND metric.type=\"run.googleapis.com/request_count\" AND metric.labels.response_code_class=\"5xx\""
|
|
382
|
+
duration = "300s"
|
|
383
|
+
comparison = "COMPARISON_GT"
|
|
384
|
+
threshold_value = 0.05
|
|
385
|
+
aggregations {
|
|
386
|
+
alignment_period = "60s"
|
|
387
|
+
per_series_aligner = "ALIGN_RATE"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
notification_channels = [google_monitoring_notification_channel.email[0].id]
|
|
393
|
+
|
|
394
|
+
alert_strategy {
|
|
395
|
+
auto_close = "86400s"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# {{titleCaseName}} - GCP 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 "storage_bucket_name" {
|
|
14
|
+
description = "Cloud Storage bucket name"
|
|
15
|
+
value = google_storage_bucket.storage.name
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
output "storage_bucket_url" {
|
|
19
|
+
description = "Cloud Storage bucket URL"
|
|
20
|
+
value = google_storage_bucket.storage.url
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
output "cdn_ip_address" {
|
|
24
|
+
description = "CDN IP address"
|
|
25
|
+
value = google_compute_global_address.storage_cdn.address
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
output "cloud_tasks_queue_name" {
|
|
29
|
+
description = "Cloud Tasks queue name"
|
|
30
|
+
value = google_cloud_tasks_queue.jobs.name
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
output "pubsub_topic_name" {
|
|
34
|
+
description = "Pub/Sub topic name"
|
|
35
|
+
value = google_pubsub_topic.events.name
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
output "pubsub_subscription_name" {
|
|
39
|
+
description = "Pub/Sub subscription name"
|
|
40
|
+
value = google_pubsub_subscription.events.name
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
output "service_account_email" {
|
|
44
|
+
description = "Service account email"
|
|
45
|
+
value = google_service_account.app.email
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
output "logs_bucket_name" {
|
|
49
|
+
description = "Logs bucket name"
|
|
50
|
+
value = google_storage_bucket.logs.name
|
|
51
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# {{titleCaseName}} - GCP Terraform Variables
|
|
2
|
+
# Copy to terraform.tfvars and fill in values
|
|
3
|
+
|
|
4
|
+
# General
|
|
5
|
+
environment = "staging"
|
|
6
|
+
gcp_project_id = "your-gcp-project-id"
|
|
7
|
+
gcp_region = "us-central1"
|
|
8
|
+
|
|
9
|
+
# Vercel
|
|
10
|
+
vercel_api_token = "your-vercel-api-token"
|
|
11
|
+
vercel_team_id = null # Optional: your-team-id
|
|
12
|
+
github_repo = "your-org/{{projectName}}"
|
|
13
|
+
domain = "{{projectName}}.com"
|
|
14
|
+
|
|
15
|
+
# Supabase
|
|
16
|
+
supabase_url = "https://xxx.supabase.co"
|
|
17
|
+
supabase_anon_key = "your-supabase-anon-key"
|
|
18
|
+
supabase_service_role_key = "your-supabase-service-role-key"
|
|
19
|
+
|
|
20
|
+
# Stripe (Optional - leave empty if not using payments)
|
|
21
|
+
stripe_secret_key = ""
|
|
22
|
+
stripe_webhook_secret = ""
|
|
23
|
+
|
|
24
|
+
# AI (Optional - leave empty if not using AI features)
|
|
25
|
+
openai_api_key = ""
|
|
26
|
+
anthropic_api_key = ""
|
|
27
|
+
|
|
28
|
+
# Monitoring
|
|
29
|
+
alert_email = "alerts@{{projectName}}.com"
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# {{titleCaseName}} - GCP Terraform Variables
|
|
2
|
+
|
|
3
|
+
# ============================================
|
|
4
|
+
# General
|
|
5
|
+
# ============================================
|
|
6
|
+
|
|
7
|
+
variable "environment" {
|
|
8
|
+
description = "Environment name (staging, production)"
|
|
9
|
+
type = string
|
|
10
|
+
default = "staging"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
variable "gcp_project_id" {
|
|
14
|
+
description = "GCP project ID"
|
|
15
|
+
type = string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
variable "gcp_region" {
|
|
19
|
+
description = "GCP region"
|
|
20
|
+
type = string
|
|
21
|
+
default = "us-central1"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# ============================================
|
|
25
|
+
# Vercel
|
|
26
|
+
# ============================================
|
|
27
|
+
|
|
28
|
+
variable "vercel_api_token" {
|
|
29
|
+
description = "Vercel API token"
|
|
30
|
+
type = string
|
|
31
|
+
sensitive = true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
variable "vercel_team_id" {
|
|
35
|
+
description = "Vercel team ID (optional)"
|
|
36
|
+
type = string
|
|
37
|
+
default = null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
variable "github_repo" {
|
|
41
|
+
description = "GitHub repository (org/repo format)"
|
|
42
|
+
type = string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
variable "domain" {
|
|
46
|
+
description = "Production domain"
|
|
47
|
+
type = string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# ============================================
|
|
51
|
+
# Supabase
|
|
52
|
+
# ============================================
|
|
53
|
+
|
|
54
|
+
variable "supabase_url" {
|
|
55
|
+
description = "Supabase project URL"
|
|
56
|
+
type = string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
variable "supabase_anon_key" {
|
|
60
|
+
description = "Supabase anonymous key"
|
|
61
|
+
type = string
|
|
62
|
+
sensitive = true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
variable "supabase_service_role_key" {
|
|
66
|
+
description = "Supabase service role key"
|
|
67
|
+
type = string
|
|
68
|
+
sensitive = true
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# ============================================
|
|
72
|
+
# Stripe (Optional)
|
|
73
|
+
# ============================================
|
|
74
|
+
|
|
75
|
+
variable "stripe_secret_key" {
|
|
76
|
+
description = "Stripe secret key"
|
|
77
|
+
type = string
|
|
78
|
+
default = ""
|
|
79
|
+
sensitive = true
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
variable "stripe_webhook_secret" {
|
|
83
|
+
description = "Stripe webhook secret"
|
|
84
|
+
type = string
|
|
85
|
+
default = ""
|
|
86
|
+
sensitive = true
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# ============================================
|
|
90
|
+
# AI (Optional)
|
|
91
|
+
# ============================================
|
|
92
|
+
|
|
93
|
+
variable "openai_api_key" {
|
|
94
|
+
description = "OpenAI API key"
|
|
95
|
+
type = string
|
|
96
|
+
default = ""
|
|
97
|
+
sensitive = true
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
variable "anthropic_api_key" {
|
|
101
|
+
description = "Anthropic API key"
|
|
102
|
+
type = string
|
|
103
|
+
default = ""
|
|
104
|
+
sensitive = true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
# ============================================
|
|
108
|
+
# Monitoring
|
|
109
|
+
# ============================================
|
|
110
|
+
|
|
111
|
+
variable "alert_email" {
|
|
112
|
+
description = "Email address for alerts"
|
|
113
|
+
type = string
|
|
114
|
+
default = ""
|
|
115
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { redirect } from 'next/navigation';
|
|
2
|
+
import { auth } from '@/auth';
|
|
3
|
+
import { AdminNav } from '@/components/admin-nav';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Admin layout with authentication guard.
|
|
7
|
+
*
|
|
8
|
+
* Protects all /admin/* routes. Requires the user to have the 'admin' role
|
|
9
|
+
* from Keycloak. Customize the role check and nav links below.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default async function AdminLayout({
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}) {
|
|
17
|
+
const session = await auth();
|
|
18
|
+
|
|
19
|
+
if (!session?.user) {
|
|
20
|
+
redirect('/api/auth/signin?callbackUrl=/admin');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const roles = (session.user as { roles?: string[] }).roles || [];
|
|
24
|
+
if (!roles.includes('admin')) {
|
|
25
|
+
redirect('/');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
|
|
30
|
+
<AdminNav />
|
|
31
|
+
<main className="mt-6">{children}</main>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { usePathname } from 'next/navigation';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Admin navigation component.
|
|
8
|
+
*
|
|
9
|
+
* Configuration-driven tab navigation with active state.
|
|
10
|
+
* Add your admin sections to the ADMIN_LINKS array below.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const ADMIN_LINKS = [
|
|
14
|
+
{ href: '/admin', label: 'Dashboard' },
|
|
15
|
+
{ href: '/admin/users', label: 'Users' },
|
|
16
|
+
{ href: '/admin/settings', label: 'Settings' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export function AdminNav() {
|
|
20
|
+
const pathname = usePathname();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<nav className="border-b border-gray-200 dark:border-gray-800">
|
|
24
|
+
<div className="flex gap-1">
|
|
25
|
+
{ADMIN_LINKS.map((link) => {
|
|
26
|
+
const isActive =
|
|
27
|
+
link.href === '/admin'
|
|
28
|
+
? pathname === '/admin'
|
|
29
|
+
: pathname.startsWith(link.href);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Link
|
|
33
|
+
key={link.href}
|
|
34
|
+
href={link.href}
|
|
35
|
+
className={`rounded-t-lg px-4 py-2.5 text-sm font-medium transition-colors ${
|
|
36
|
+
isActive
|
|
37
|
+
? 'border-b-2 border-blue-600 text-blue-600 dark:text-blue-400'
|
|
38
|
+
: 'text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200'
|
|
39
|
+
}`}
|
|
40
|
+
>
|
|
41
|
+
{link.label}
|
|
42
|
+
</Link>
|
|
43
|
+
);
|
|
44
|
+
})}
|
|
45
|
+
</div>
|
|
46
|
+
</nav>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit logging for admin/security-sensitive actions.
|
|
3
|
+
*
|
|
4
|
+
* Uses createAuditLogger from platform-core/auth. Currently console-only
|
|
5
|
+
* (structured logs to stdout). Persistence (Redis/DB) can be added later
|
|
6
|
+
* by providing a `persist` callback.
|
|
7
|
+
*/
|
|
8
|
+
import 'server-only';
|
|
9
|
+
import { createAuditLogger, StandardAuditActions } from '@digilogiclabs/platform-core/auth';
|
|
10
|
+
|
|
11
|
+
/** App-specific audit actions extending the standard set. */
|
|
12
|
+
export const AppAuditActions = {
|
|
13
|
+
...StandardAuditActions,
|
|
14
|
+
|
|
15
|
+
// Add your app-specific actions here:
|
|
16
|
+
// USER_ROLE_CHANGED: 'app.user.role_changed',
|
|
17
|
+
// SUBSCRIPTION_CREATED: 'app.subscription.created',
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Audit logger instance.
|
|
22
|
+
* Console-only persistence — logs structured events to stdout.
|
|
23
|
+
*/
|
|
24
|
+
export const audit = createAuditLogger();
|