@digilogiclabs/create-saas-app 2.0.0 → 2.1.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/dist/.tsbuildinfo +1 -1
- package/dist/cli/prompts/project-setup.d.ts.map +1 -1
- package/dist/cli/prompts/project-setup.js +44 -9
- package/dist/cli/prompts/project-setup.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +29 -2
- package/dist/generators/template-generator.js.map +1 -1
- 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/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 +1 -1
- 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/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
|
@@ -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,16 @@
|
|
|
1
|
+
# Supabase Configuration
|
|
2
|
+
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
|
|
3
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
|
|
4
|
+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
|
|
5
|
+
|
|
6
|
+
# AI Provider API Keys
|
|
7
|
+
OPENAI_API_KEY=sk-xxx
|
|
8
|
+
ANTHROPIC_API_KEY=sk-ant-xxx
|
|
9
|
+
|
|
10
|
+
# Stripe Configuration
|
|
11
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
|
|
12
|
+
STRIPE_SECRET_KEY=sk_test_xxx
|
|
13
|
+
STRIPE_WEBHOOK_SECRET=whsec_xxx
|
|
14
|
+
|
|
15
|
+
# Application
|
|
16
|
+
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# {{titleCaseName}}
|
|
2
|
+
|
|
3
|
+
{{description}} - An AI-powered platform for building intelligent applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **AI Chat** - Conversational AI with multiple model support
|
|
8
|
+
- **Model Selection** - Choose from GPT-4o, Claude, and more
|
|
9
|
+
- **API Access** - Programmatic access to AI models
|
|
10
|
+
- **Usage Dashboard** - Track API calls and token usage
|
|
11
|
+
- **Subscription Billing** - Stripe-powered payments
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
1. **Install dependencies:**
|
|
16
|
+
```bash
|
|
17
|
+
npm install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. **Set up environment variables:**
|
|
21
|
+
```bash
|
|
22
|
+
cp .env.example .env.local
|
|
23
|
+
```
|
|
24
|
+
Update with your API keys:
|
|
25
|
+
- Supabase credentials
|
|
26
|
+
- OpenAI and/or Anthropic API keys
|
|
27
|
+
- Stripe keys (optional)
|
|
28
|
+
|
|
29
|
+
3. **Run the development server:**
|
|
30
|
+
```bash
|
|
31
|
+
npm run dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
4. **Open [http://localhost:3000](http://localhost:3000)**
|
|
35
|
+
|
|
36
|
+
## Tech Stack
|
|
37
|
+
|
|
38
|
+
- **Framework:** Next.js 15
|
|
39
|
+
- **Language:** TypeScript
|
|
40
|
+
- **Styling:** Tailwind CSS
|
|
41
|
+
- **Auth:** Supabase
|
|
42
|
+
- **AI:** Vercel AI SDK
|
|
43
|
+
- **Payments:** Stripe
|
|
44
|
+
- **UI Components:** @digilogiclabs/saas-factory-ui
|
|
45
|
+
|
|
46
|
+
## Project Structure
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
src/
|
|
50
|
+
├── app/ # Next.js App Router pages
|
|
51
|
+
│ ├── api/chat/ # Chat API route
|
|
52
|
+
│ ├── chat/ # AI chat interface
|
|
53
|
+
│ ├── dashboard/ # User dashboard
|
|
54
|
+
│ └── playground/ # AI playground
|
|
55
|
+
├── components/ # React components
|
|
56
|
+
│ ├── ai/ # AI-specific components
|
|
57
|
+
│ └── providers/ # Context providers
|
|
58
|
+
└── lib/ # Utilities and helpers
|
|
59
|
+
└── ai/ # AI utilities
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Adding AI Providers
|
|
63
|
+
|
|
64
|
+
To enable AI functionality, add your API keys to `.env.local`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# OpenAI
|
|
68
|
+
OPENAI_API_KEY=sk-xxx
|
|
69
|
+
|
|
70
|
+
# Anthropic
|
|
71
|
+
ANTHROPIC_API_KEY=sk-ant-xxx
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then update `src/app/api/chat/route.ts` to use the AI SDK.
|
|
75
|
+
|
|
76
|
+
## Deployment
|
|
77
|
+
|
|
78
|
+
Deploy to Vercel with one click:
|
|
79
|
+
|
|
80
|
+
[](https://vercel.com/new)
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT - Built with DLL Platform
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createServerClient } from '@supabase/ssr'
|
|
2
|
+
import { NextResponse, type NextRequest } from 'next/server'
|
|
3
|
+
|
|
4
|
+
export async function middleware(request: NextRequest) {
|
|
5
|
+
let supabaseResponse = NextResponse.next({
|
|
6
|
+
request,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const supabase = createServerClient(
|
|
10
|
+
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
11
|
+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
12
|
+
{
|
|
13
|
+
cookies: {
|
|
14
|
+
getAll() {
|
|
15
|
+
return request.cookies.getAll()
|
|
16
|
+
},
|
|
17
|
+
setAll(cookiesToSet) {
|
|
18
|
+
cookiesToSet.forEach(({ name, value }) =>
|
|
19
|
+
request.cookies.set(name, value)
|
|
20
|
+
)
|
|
21
|
+
supabaseResponse = NextResponse.next({
|
|
22
|
+
request,
|
|
23
|
+
})
|
|
24
|
+
cookiesToSet.forEach(({ name, value, options }) =>
|
|
25
|
+
supabaseResponse.cookies.set(name, value, options)
|
|
26
|
+
)
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
data: { user },
|
|
34
|
+
} = await supabase.auth.getUser()
|
|
35
|
+
|
|
36
|
+
// Redirect to login if accessing protected route without auth
|
|
37
|
+
if (
|
|
38
|
+
!user &&
|
|
39
|
+
(request.nextUrl.pathname.startsWith('/dashboard') ||
|
|
40
|
+
request.nextUrl.pathname.startsWith('/chat') ||
|
|
41
|
+
request.nextUrl.pathname.startsWith('/playground'))
|
|
42
|
+
) {
|
|
43
|
+
const url = request.nextUrl.clone()
|
|
44
|
+
url.pathname = '/login'
|
|
45
|
+
return NextResponse.redirect(url)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return supabaseResponse
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const config = {
|
|
52
|
+
matcher: [
|
|
53
|
+
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
|
54
|
+
],
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}} - AI Platform",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"type-check": "tsc --noEmit",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"test:run": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"next": "^15.0.0",
|
|
17
|
+
"react": "^19.0.0",
|
|
18
|
+
"react-dom": "^19.0.0",
|
|
19
|
+
"@digilogiclabs/platform-core": "^1.1.0",
|
|
20
|
+
"@digilogiclabs/app-sdk": "^1.0.0",
|
|
21
|
+
"@digilogiclabs/saas-factory-auth": "^1.0.7",
|
|
22
|
+
"@digilogiclabs/saas-factory-payments": "^1.2.9",
|
|
23
|
+
"@digilogiclabs/saas-factory-ai": "^1.0.0",
|
|
24
|
+
"@digilogiclabs/saas-factory-ui": "^1.0.1",
|
|
25
|
+
"ai": "^3.4.0",
|
|
26
|
+
"@ai-sdk/openai": "^0.0.70",
|
|
27
|
+
"@ai-sdk/anthropic": "^0.0.57",
|
|
28
|
+
"stripe": "^16.12.0",
|
|
29
|
+
"@stripe/react-stripe-js": "^2.8.0",
|
|
30
|
+
"@stripe/stripe-js": "^4.10.0",
|
|
31
|
+
"tailwindcss": "^4.0.0",
|
|
32
|
+
"clsx": "^2.0.0",
|
|
33
|
+
"class-variance-authority": "^0.7.0",
|
|
34
|
+
"tailwind-merge": "^2.0.0",
|
|
35
|
+
"next-themes": "^0.4.0",
|
|
36
|
+
"lucide-react": "^0.460.0",
|
|
37
|
+
"zod": "^3.22.4",
|
|
38
|
+
"zustand": "^4.5.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"typescript": "^5.7.0",
|
|
42
|
+
"@types/node": "^22.0.0",
|
|
43
|
+
"@types/react": "^19.0.0",
|
|
44
|
+
"@types/react-dom": "^19.0.0",
|
|
45
|
+
"eslint": "^9.0.0",
|
|
46
|
+
"eslint-config-next": "^15.0.0",
|
|
47
|
+
"prettier": "^3.4.0",
|
|
48
|
+
"vitest": "^2.1.0",
|
|
49
|
+
"@testing-library/react": "^16.0.0",
|
|
50
|
+
"@testing-library/jest-dom": "^6.6.0"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=20.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
|
|
3
|
+
// Note: In production, you would use the AI SDK here
|
|
4
|
+
// import { openai } from '@ai-sdk/openai'
|
|
5
|
+
// import { generateText } from 'ai'
|
|
6
|
+
|
|
7
|
+
export async function POST(request: NextRequest) {
|
|
8
|
+
try {
|
|
9
|
+
const { messages, model } = await request.json()
|
|
10
|
+
|
|
11
|
+
// Demo response - replace with actual AI SDK integration
|
|
12
|
+
// In production:
|
|
13
|
+
// const { text } = await generateText({
|
|
14
|
+
// model: openai(model),
|
|
15
|
+
// messages,
|
|
16
|
+
// })
|
|
17
|
+
|
|
18
|
+
// Simulated response for demo
|
|
19
|
+
const lastMessage = messages[messages.length - 1]?.content || ''
|
|
20
|
+
|
|
21
|
+
// Simple demo responses
|
|
22
|
+
let response = "I'm an AI assistant. How can I help you today?"
|
|
23
|
+
|
|
24
|
+
if (lastMessage.toLowerCase().includes('hello') || lastMessage.toLowerCase().includes('hi')) {
|
|
25
|
+
response = "Hello! I'm your AI assistant. I can help you with coding, writing, analysis, and much more. What would you like to explore today?"
|
|
26
|
+
} else if (lastMessage.toLowerCase().includes('code') || lastMessage.toLowerCase().includes('python')) {
|
|
27
|
+
response = `Here's a simple Python example:
|
|
28
|
+
|
|
29
|
+
\`\`\`python
|
|
30
|
+
def greet(name: str) -> str:
|
|
31
|
+
"""Return a greeting message."""
|
|
32
|
+
return f"Hello, {name}! Welcome to AI Platform."
|
|
33
|
+
|
|
34
|
+
# Usage
|
|
35
|
+
print(greet("Developer"))
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
Would you like me to explain this code or help with something more specific?`
|
|
39
|
+
} else if (lastMessage.toLowerCase().includes('explain')) {
|
|
40
|
+
response = "I'd be happy to explain! Could you provide more details about what concept or topic you'd like me to clarify?"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return NextResponse.json({
|
|
44
|
+
content: response,
|
|
45
|
+
model,
|
|
46
|
+
})
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Chat API error:', error)
|
|
49
|
+
return NextResponse.json(
|
|
50
|
+
{ error: 'Failed to process request' },
|
|
51
|
+
{ status: 500 }
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|