@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.
Files changed (186) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/cli/prompts/project-setup.d.ts.map +1 -1
  3. package/dist/cli/prompts/project-setup.js +44 -9
  4. package/dist/cli/prompts/project-setup.js.map +1 -1
  5. package/dist/generators/template-generator.d.ts.map +1 -1
  6. package/dist/generators/template-generator.js +29 -2
  7. package/dist/generators/template-generator.js.map +1 -1
  8. package/dist/templates/infrastructure/kubernetes/base/template/README.md +253 -0
  9. package/dist/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
  10. package/dist/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
  11. package/dist/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
  12. package/dist/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
  13. package/dist/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
  14. package/dist/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
  15. package/dist/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
  16. package/dist/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
  17. package/dist/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
  18. package/dist/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
  19. package/dist/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
  20. package/dist/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
  21. package/dist/templates/infrastructure/terraform/aws/template/README.md +156 -0
  22. package/dist/templates/infrastructure/terraform/aws/template/main.tf +343 -0
  23. package/dist/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
  24. package/dist/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
  25. package/dist/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
  26. package/dist/templates/infrastructure/terraform/gcp/template/README.md +165 -0
  27. package/dist/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
  28. package/dist/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
  29. package/dist/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
  30. package/dist/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
  31. package/dist/templates/web/ai-platform/template/.env.example +16 -0
  32. package/dist/templates/web/ai-platform/template/README.md +84 -0
  33. package/dist/templates/web/ai-platform/template/middleware.ts +55 -0
  34. package/dist/templates/web/ai-platform/template/next.config.js +14 -0
  35. package/dist/templates/web/ai-platform/template/package.json +55 -0
  36. package/dist/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
  37. package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
  38. package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
  39. package/dist/templates/web/ai-platform/template/src/app/globals.css +34 -0
  40. package/dist/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
  41. package/dist/templates/web/ai-platform/template/src/app/page.tsx +203 -0
  42. package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
  43. package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
  44. package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
  45. package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
  46. package/dist/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
  47. package/dist/templates/web/ai-platform/template/tsconfig.json +27 -0
  48. package/dist/templates/web/iot-dashboard/template/.env.example +12 -0
  49. package/dist/templates/web/iot-dashboard/template/README.md +101 -0
  50. package/dist/templates/web/iot-dashboard/template/middleware.ts +56 -0
  51. package/dist/templates/web/iot-dashboard/template/next.config.js +14 -0
  52. package/dist/templates/web/iot-dashboard/template/package.json +49 -0
  53. package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
  54. package/dist/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
  55. package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
  56. package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
  57. package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
  58. package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
  59. package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
  60. package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
  61. package/dist/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
  62. package/dist/templates/web/iot-dashboard/template/tsconfig.json +27 -0
  63. package/dist/templates/web/marketplace/template/.env.example +12 -0
  64. package/dist/templates/web/marketplace/template/README.md +66 -0
  65. package/dist/templates/web/marketplace/template/middleware.ts +56 -0
  66. package/dist/templates/web/marketplace/template/next.config.js +14 -0
  67. package/dist/templates/web/marketplace/template/package.json +51 -0
  68. package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
  69. package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
  70. package/dist/templates/web/marketplace/template/src/app/globals.css +20 -0
  71. package/dist/templates/web/marketplace/template/src/app/layout.tsx +27 -0
  72. package/dist/templates/web/marketplace/template/src/app/page.tsx +167 -0
  73. package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
  74. package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
  75. package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
  76. package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
  77. package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
  78. package/dist/templates/web/marketplace/template/src/lib/utils.ts +19 -0
  79. package/dist/templates/web/marketplace/template/tsconfig.json +27 -0
  80. package/dist/templates/web/micro-saas/template/.env.example +10 -0
  81. package/dist/templates/web/micro-saas/template/README.md +63 -0
  82. package/dist/templates/web/micro-saas/template/middleware.ts +53 -0
  83. package/dist/templates/web/micro-saas/template/next.config.js +14 -0
  84. package/dist/templates/web/micro-saas/template/package.json +41 -0
  85. package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
  86. package/dist/templates/web/micro-saas/template/src/app/globals.css +20 -0
  87. package/dist/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
  88. package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
  89. package/dist/templates/web/micro-saas/template/src/app/page.tsx +137 -0
  90. package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
  91. package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
  92. package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
  93. package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
  94. package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
  95. package/dist/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
  96. package/dist/templates/web/micro-saas/template/tsconfig.json +27 -0
  97. package/package.json +1 -1
  98. package/src/templates/infrastructure/kubernetes/base/template/README.md +253 -0
  99. package/src/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
  100. package/src/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
  101. package/src/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
  102. package/src/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
  103. package/src/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
  104. package/src/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
  105. package/src/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
  106. package/src/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
  107. package/src/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
  108. package/src/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
  109. package/src/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
  110. package/src/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
  111. package/src/templates/infrastructure/terraform/aws/template/README.md +156 -0
  112. package/src/templates/infrastructure/terraform/aws/template/main.tf +343 -0
  113. package/src/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
  114. package/src/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
  115. package/src/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
  116. package/src/templates/infrastructure/terraform/gcp/template/README.md +165 -0
  117. package/src/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
  118. package/src/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
  119. package/src/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
  120. package/src/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
  121. package/src/templates/web/ai-platform/template/.env.example +16 -0
  122. package/src/templates/web/ai-platform/template/README.md +84 -0
  123. package/src/templates/web/ai-platform/template/middleware.ts +55 -0
  124. package/src/templates/web/ai-platform/template/next.config.js +14 -0
  125. package/src/templates/web/ai-platform/template/package.json +55 -0
  126. package/src/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
  127. package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
  128. package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
  129. package/src/templates/web/ai-platform/template/src/app/globals.css +34 -0
  130. package/src/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
  131. package/src/templates/web/ai-platform/template/src/app/page.tsx +203 -0
  132. package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
  133. package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
  134. package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
  135. package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
  136. package/src/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
  137. package/src/templates/web/ai-platform/template/tsconfig.json +27 -0
  138. package/src/templates/web/iot-dashboard/template/.env.example +12 -0
  139. package/src/templates/web/iot-dashboard/template/README.md +101 -0
  140. package/src/templates/web/iot-dashboard/template/middleware.ts +56 -0
  141. package/src/templates/web/iot-dashboard/template/next.config.js +14 -0
  142. package/src/templates/web/iot-dashboard/template/package.json +49 -0
  143. package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
  144. package/src/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
  145. package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
  146. package/src/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
  147. package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
  148. package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
  149. package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
  150. package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
  151. package/src/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
  152. package/src/templates/web/iot-dashboard/template/tsconfig.json +27 -0
  153. package/src/templates/web/marketplace/template/.env.example +12 -0
  154. package/src/templates/web/marketplace/template/README.md +66 -0
  155. package/src/templates/web/marketplace/template/middleware.ts +56 -0
  156. package/src/templates/web/marketplace/template/next.config.js +14 -0
  157. package/src/templates/web/marketplace/template/package.json +51 -0
  158. package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
  159. package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
  160. package/src/templates/web/marketplace/template/src/app/globals.css +20 -0
  161. package/src/templates/web/marketplace/template/src/app/layout.tsx +27 -0
  162. package/src/templates/web/marketplace/template/src/app/page.tsx +167 -0
  163. package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
  164. package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
  165. package/src/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
  166. package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
  167. package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
  168. package/src/templates/web/marketplace/template/src/lib/utils.ts +19 -0
  169. package/src/templates/web/marketplace/template/tsconfig.json +27 -0
  170. package/src/templates/web/micro-saas/template/.env.example +10 -0
  171. package/src/templates/web/micro-saas/template/README.md +63 -0
  172. package/src/templates/web/micro-saas/template/middleware.ts +53 -0
  173. package/src/templates/web/micro-saas/template/next.config.js +14 -0
  174. package/src/templates/web/micro-saas/template/package.json +41 -0
  175. package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
  176. package/src/templates/web/micro-saas/template/src/app/globals.css +20 -0
  177. package/src/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
  178. package/src/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
  179. package/src/templates/web/micro-saas/template/src/app/page.tsx +137 -0
  180. package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
  181. package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
  182. package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
  183. package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
  184. package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
  185. package/src/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
  186. 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
+ [![Deploy with Vercel](https://vercel.com/button)](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,14 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ reactStrictMode: true,
4
+ images: {
5
+ remotePatterns: [
6
+ {
7
+ protocol: 'https',
8
+ hostname: '**.supabase.co',
9
+ },
10
+ ],
11
+ },
12
+ }
13
+
14
+ module.exports = nextConfig
@@ -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
+ }