@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,27 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { Inter } from 'next/font/google'
|
|
3
|
+
import './globals.css'
|
|
4
|
+
import { AppProviders } from '@/components/providers/app-providers'
|
|
5
|
+
|
|
6
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: '{{titleCaseName}} - AI Platform',
|
|
10
|
+
description: '{{description}}',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function RootLayout({
|
|
14
|
+
children,
|
|
15
|
+
}: {
|
|
16
|
+
children: React.ReactNode
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<html lang="en" suppressHydrationWarning>
|
|
20
|
+
<body className={inter.className}>
|
|
21
|
+
<AppProviders>
|
|
22
|
+
{children}
|
|
23
|
+
</AppProviders>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
5
|
+
import { Bot, Sparkles, Zap, MessageSquare, Code, Brain, ArrowRight, User, LogOut } from 'lucide-react'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
const FEATURES = [
|
|
9
|
+
{
|
|
10
|
+
icon: MessageSquare,
|
|
11
|
+
title: 'AI Chat',
|
|
12
|
+
description: 'Conversational AI with multiple model support',
|
|
13
|
+
color: 'blue',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
icon: Code,
|
|
17
|
+
title: 'Code Generation',
|
|
18
|
+
description: 'Generate and refactor code with AI assistance',
|
|
19
|
+
color: 'green',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
icon: Brain,
|
|
23
|
+
title: 'Custom Models',
|
|
24
|
+
description: 'Fine-tune and deploy your own AI models',
|
|
25
|
+
color: 'purple',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
icon: Zap,
|
|
29
|
+
title: 'API Access',
|
|
30
|
+
description: 'Integrate AI capabilities into your applications',
|
|
31
|
+
color: 'orange',
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
const MODELS = [
|
|
36
|
+
{ name: 'GPT-4o', provider: 'OpenAI', status: 'available' },
|
|
37
|
+
{ name: 'Claude 3.5', provider: 'Anthropic', status: 'available' },
|
|
38
|
+
{ name: 'Gemini Pro', provider: 'Google', status: 'coming_soon' },
|
|
39
|
+
{ name: 'Llama 3', provider: 'Meta', status: 'available' },
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
export default function Home() {
|
|
43
|
+
const { user, signOut, loading } = useAuth()
|
|
44
|
+
|
|
45
|
+
const projectName = "{{titleCaseName}}"
|
|
46
|
+
|
|
47
|
+
const handleSignOut = async () => {
|
|
48
|
+
try {
|
|
49
|
+
await signOut()
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.error('Sign out error:', err)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<main className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
|
|
57
|
+
{/* Header */}
|
|
58
|
+
<header className="border-b border-white/10 bg-black/20 backdrop-blur-sm sticky top-0 z-50">
|
|
59
|
+
<div className="max-w-7xl mx-auto px-4 py-4">
|
|
60
|
+
<div className="flex items-center justify-between">
|
|
61
|
+
<Link href="/" className="flex items-center gap-2">
|
|
62
|
+
<Bot className="w-8 h-8 text-purple-400" />
|
|
63
|
+
<span className="text-2xl font-bold text-white">{projectName}</span>
|
|
64
|
+
</Link>
|
|
65
|
+
|
|
66
|
+
<nav className="hidden md:flex items-center gap-6">
|
|
67
|
+
<Link href="/models" className="text-gray-300 hover:text-white transition">
|
|
68
|
+
Models
|
|
69
|
+
</Link>
|
|
70
|
+
<Link href="/playground" className="text-gray-300 hover:text-white transition">
|
|
71
|
+
Playground
|
|
72
|
+
</Link>
|
|
73
|
+
<Link href="/docs" className="text-gray-300 hover:text-white transition">
|
|
74
|
+
Docs
|
|
75
|
+
</Link>
|
|
76
|
+
</nav>
|
|
77
|
+
|
|
78
|
+
<div className="flex items-center gap-4">
|
|
79
|
+
{loading ? (
|
|
80
|
+
<div className="text-sm text-gray-400">Loading...</div>
|
|
81
|
+
) : user ? (
|
|
82
|
+
<div className="flex items-center gap-2">
|
|
83
|
+
<Link href="/dashboard">
|
|
84
|
+
<Button variant="outline" size="sm" className="border-white/20 text-white hover:bg-white/10">
|
|
85
|
+
<User className="w-4 h-4 mr-2" />
|
|
86
|
+
Dashboard
|
|
87
|
+
</Button>
|
|
88
|
+
</Link>
|
|
89
|
+
<Button variant="ghost" size="sm" onClick={handleSignOut} className="text-gray-400 hover:text-white">
|
|
90
|
+
<LogOut className="w-4 h-4" />
|
|
91
|
+
</Button>
|
|
92
|
+
</div>
|
|
93
|
+
) : (
|
|
94
|
+
<div className="flex gap-2">
|
|
95
|
+
<Link href="/login">
|
|
96
|
+
<Button variant="outline" size="sm" className="border-white/20 text-white hover:bg-white/10">
|
|
97
|
+
Sign In
|
|
98
|
+
</Button>
|
|
99
|
+
</Link>
|
|
100
|
+
<Link href="/signup">
|
|
101
|
+
<Button size="sm" className="bg-purple-600 hover:bg-purple-700">
|
|
102
|
+
Get Started
|
|
103
|
+
</Button>
|
|
104
|
+
</Link>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</header>
|
|
111
|
+
|
|
112
|
+
<div className="max-w-7xl mx-auto px-4 py-16">
|
|
113
|
+
{/* Hero */}
|
|
114
|
+
<div className="text-center mb-20">
|
|
115
|
+
<div className="inline-flex items-center px-4 py-2 rounded-full bg-purple-500/20 text-purple-300 text-sm mb-6">
|
|
116
|
+
<Sparkles className="w-4 h-4 mr-2" />
|
|
117
|
+
AI-Powered Platform
|
|
118
|
+
</div>
|
|
119
|
+
<h1 className="text-5xl md:text-7xl font-bold text-white mb-6">
|
|
120
|
+
Build with <span className="text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-400">AI</span>
|
|
121
|
+
</h1>
|
|
122
|
+
<p className="text-xl text-gray-300 max-w-2xl mx-auto mb-8">
|
|
123
|
+
Access powerful AI models, build intelligent applications, and scale effortlessly.
|
|
124
|
+
</p>
|
|
125
|
+
<div className="flex gap-4 justify-center">
|
|
126
|
+
<Link href="/chat">
|
|
127
|
+
<Button size="lg" className="bg-purple-600 hover:bg-purple-700">
|
|
128
|
+
<MessageSquare className="w-5 h-5 mr-2" />
|
|
129
|
+
Try AI Chat
|
|
130
|
+
</Button>
|
|
131
|
+
</Link>
|
|
132
|
+
<Link href="/playground">
|
|
133
|
+
<Button size="lg" variant="outline" className="border-white/20 text-white hover:bg-white/10">
|
|
134
|
+
Open Playground
|
|
135
|
+
</Button>
|
|
136
|
+
</Link>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
{/* Features */}
|
|
141
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 mb-20">
|
|
142
|
+
{FEATURES.map((feature) => (
|
|
143
|
+
<Card key={feature.title} className="p-6 bg-white/5 border-white/10 backdrop-blur-sm hover:bg-white/10 transition">
|
|
144
|
+
<div className={`w-12 h-12 rounded-lg flex items-center justify-center mb-4 bg-${feature.color}-500/20`}>
|
|
145
|
+
<feature.icon className={`w-6 h-6 text-${feature.color}-400`} />
|
|
146
|
+
</div>
|
|
147
|
+
<h3 className="text-lg font-semibold text-white mb-2">{feature.title}</h3>
|
|
148
|
+
<p className="text-gray-400 text-sm">{feature.description}</p>
|
|
149
|
+
</Card>
|
|
150
|
+
))}
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{/* Available Models */}
|
|
154
|
+
<div className="mb-20">
|
|
155
|
+
<div className="flex items-center justify-between mb-8">
|
|
156
|
+
<div>
|
|
157
|
+
<h2 className="text-3xl font-bold text-white mb-2">Available Models</h2>
|
|
158
|
+
<p className="text-gray-400">Access leading AI models from top providers</p>
|
|
159
|
+
</div>
|
|
160
|
+
<Link href="/models">
|
|
161
|
+
<Button variant="ghost" className="text-purple-400 hover:text-purple-300">
|
|
162
|
+
View All
|
|
163
|
+
<ArrowRight className="w-4 h-4 ml-2" />
|
|
164
|
+
</Button>
|
|
165
|
+
</Link>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
169
|
+
{MODELS.map((model) => (
|
|
170
|
+
<Card key={model.name} className="p-4 bg-white/5 border-white/10">
|
|
171
|
+
<div className="flex items-center justify-between mb-2">
|
|
172
|
+
<h3 className="font-semibold text-white">{model.name}</h3>
|
|
173
|
+
<span className={`text-xs px-2 py-1 rounded ${
|
|
174
|
+
model.status === 'available'
|
|
175
|
+
? 'bg-green-500/20 text-green-400'
|
|
176
|
+
: 'bg-yellow-500/20 text-yellow-400'
|
|
177
|
+
}`}>
|
|
178
|
+
{model.status === 'available' ? 'Available' : 'Coming Soon'}
|
|
179
|
+
</span>
|
|
180
|
+
</div>
|
|
181
|
+
<p className="text-sm text-gray-400">{model.provider}</p>
|
|
182
|
+
</Card>
|
|
183
|
+
))}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
{/* CTA */}
|
|
188
|
+
<Card className="p-12 bg-gradient-to-r from-purple-600 to-pink-600 border-0 text-center">
|
|
189
|
+
<h2 className="text-3xl font-bold text-white mb-4">Ready to Build?</h2>
|
|
190
|
+
<p className="text-white/80 mb-8 max-w-md mx-auto">
|
|
191
|
+
Start building AI-powered applications today. Free tier available.
|
|
192
|
+
</p>
|
|
193
|
+
<Link href="/signup">
|
|
194
|
+
<Button size="lg" variant="secondary">
|
|
195
|
+
Get Started Free
|
|
196
|
+
<ArrowRight className="w-5 h-5 ml-2" />
|
|
197
|
+
</Button>
|
|
198
|
+
</Link>
|
|
199
|
+
</Card>
|
|
200
|
+
</div>
|
|
201
|
+
</main>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { ThemeProvider } from 'next-themes'
|
|
4
|
+
import { DLLProvider } from '@digilogiclabs/app-sdk'
|
|
5
|
+
|
|
6
|
+
interface AppProvidersProps {
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function AppProviders({ children }: AppProvidersProps) {
|
|
11
|
+
return (
|
|
12
|
+
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
|
|
13
|
+
<DLLProvider
|
|
14
|
+
config={{
|
|
15
|
+
auth: {
|
|
16
|
+
provider: 'supabase',
|
|
17
|
+
},
|
|
18
|
+
payments: {
|
|
19
|
+
provider: 'stripe',
|
|
20
|
+
},
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</DLLProvider>
|
|
25
|
+
</ThemeProvider>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { redirect } from 'next/navigation'
|
|
2
|
+
import { createClient } from './supabase/server'
|
|
3
|
+
|
|
4
|
+
export interface AuthUser {
|
|
5
|
+
id: string
|
|
6
|
+
email: string | null
|
|
7
|
+
name?: string | null
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function getUser(): Promise<AuthUser | null> {
|
|
11
|
+
const supabase = await createClient()
|
|
12
|
+
const { data: { user }, error } = await supabase.auth.getUser()
|
|
13
|
+
|
|
14
|
+
if (error || !user) {
|
|
15
|
+
return null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
id: user.id,
|
|
20
|
+
email: user.email ?? null,
|
|
21
|
+
name: user.user_metadata?.name ?? user.user_metadata?.full_name ?? null,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function requireAuth(): Promise<AuthUser> {
|
|
26
|
+
const user = await getUser()
|
|
27
|
+
|
|
28
|
+
if (!user) {
|
|
29
|
+
redirect('/login')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return user
|
|
33
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createServerClient } from '@supabase/ssr'
|
|
2
|
+
import { cookies } from 'next/headers'
|
|
3
|
+
|
|
4
|
+
export async function createClient() {
|
|
5
|
+
const cookieStore = await cookies()
|
|
6
|
+
|
|
7
|
+
return createServerClient(
|
|
8
|
+
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
9
|
+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
10
|
+
{
|
|
11
|
+
cookies: {
|
|
12
|
+
getAll() {
|
|
13
|
+
return cookieStore.getAll()
|
|
14
|
+
},
|
|
15
|
+
setAll(cookiesToSet) {
|
|
16
|
+
try {
|
|
17
|
+
cookiesToSet.forEach(({ name, value, options }) =>
|
|
18
|
+
cookieStore.set(name, value, options)
|
|
19
|
+
)
|
|
20
|
+
} catch {
|
|
21
|
+
// Server Component context
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
+
"exclude": ["node_modules"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
# MQTT Configuration (optional)
|
|
7
|
+
MQTT_BROKER_URL=mqtt://localhost:1883
|
|
8
|
+
MQTT_USERNAME=
|
|
9
|
+
MQTT_PASSWORD=
|
|
10
|
+
|
|
11
|
+
# Application
|
|
12
|
+
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# {{titleCaseName}}
|
|
2
|
+
|
|
3
|
+
{{description}} - An IoT device monitoring and management dashboard.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Device Management** - Monitor and control all your IoT devices
|
|
8
|
+
- **Real-time Telemetry** - Live data streams with updates every few seconds
|
|
9
|
+
- **Smart Alerts** - Configurable notifications for critical events
|
|
10
|
+
- **Analytics** - Historical data analysis and trends
|
|
11
|
+
- **Responsive Design** - Works on desktop and mobile
|
|
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 Supabase credentials.
|
|
25
|
+
|
|
26
|
+
3. **Run the development server:**
|
|
27
|
+
```bash
|
|
28
|
+
npm run dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
4. **Open [http://localhost:3000](http://localhost:3000)**
|
|
32
|
+
|
|
33
|
+
## Tech Stack
|
|
34
|
+
|
|
35
|
+
- **Framework:** Next.js 15
|
|
36
|
+
- **Language:** TypeScript
|
|
37
|
+
- **Styling:** Tailwind CSS
|
|
38
|
+
- **Auth:** Supabase
|
|
39
|
+
- **Charts:** Recharts
|
|
40
|
+
- **UI Components:** @digilogiclabs/saas-factory-ui
|
|
41
|
+
|
|
42
|
+
## Project Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
src/
|
|
46
|
+
├── app/ # Next.js App Router pages
|
|
47
|
+
│ ├── dashboard/ # Main IoT dashboard
|
|
48
|
+
│ ├── devices/ # Device management
|
|
49
|
+
│ ├── analytics/ # Data analytics
|
|
50
|
+
│ └── alerts/ # Alert management
|
|
51
|
+
├── components/ # React components
|
|
52
|
+
│ ├── iot/ # IoT-specific components
|
|
53
|
+
│ └── providers/ # Context providers
|
|
54
|
+
└── lib/ # Utilities and helpers
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Database Schema
|
|
58
|
+
|
|
59
|
+
Set up the following tables in Supabase:
|
|
60
|
+
|
|
61
|
+
```sql
|
|
62
|
+
-- Devices table
|
|
63
|
+
create table devices (
|
|
64
|
+
id uuid primary key default gen_random_uuid(),
|
|
65
|
+
name text not null,
|
|
66
|
+
type text not null,
|
|
67
|
+
status text default 'offline',
|
|
68
|
+
last_seen timestamp with time zone,
|
|
69
|
+
metadata jsonb default '{}',
|
|
70
|
+
user_id uuid references auth.users(id),
|
|
71
|
+
created_at timestamp with time zone default now()
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
-- Telemetry table
|
|
75
|
+
create table telemetry (
|
|
76
|
+
id uuid primary key default gen_random_uuid(),
|
|
77
|
+
device_id uuid references devices(id),
|
|
78
|
+
data jsonb not null,
|
|
79
|
+
timestamp timestamp with time zone default now()
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
-- Alerts table
|
|
83
|
+
create table alerts (
|
|
84
|
+
id uuid primary key default gen_random_uuid(),
|
|
85
|
+
device_id uuid references devices(id),
|
|
86
|
+
message text not null,
|
|
87
|
+
severity text not null,
|
|
88
|
+
acknowledged boolean default false,
|
|
89
|
+
created_at timestamp with time zone default now()
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Deployment
|
|
94
|
+
|
|
95
|
+
Deploy to Vercel with one click:
|
|
96
|
+
|
|
97
|
+
[](https://vercel.com/new)
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT - Built with DLL Platform
|
|
@@ -0,0 +1,56 @@
|
|
|
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('/devices') ||
|
|
41
|
+
request.nextUrl.pathname.startsWith('/analytics') ||
|
|
42
|
+
request.nextUrl.pathname.startsWith('/alerts'))
|
|
43
|
+
) {
|
|
44
|
+
const url = request.nextUrl.clone()
|
|
45
|
+
url.pathname = '/login'
|
|
46
|
+
return NextResponse.redirect(url)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return supabaseResponse
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const config = {
|
|
53
|
+
matcher: [
|
|
54
|
+
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
|
55
|
+
],
|
|
56
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}} - IoT Dashboard",
|
|
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-ui": "^1.0.1",
|
|
23
|
+
"tailwindcss": "^4.0.0",
|
|
24
|
+
"clsx": "^2.0.0",
|
|
25
|
+
"class-variance-authority": "^0.7.0",
|
|
26
|
+
"tailwind-merge": "^2.0.0",
|
|
27
|
+
"next-themes": "^0.4.0",
|
|
28
|
+
"lucide-react": "^0.460.0",
|
|
29
|
+
"zod": "^3.22.4",
|
|
30
|
+
"zustand": "^4.5.0",
|
|
31
|
+
"recharts": "^2.13.0",
|
|
32
|
+
"date-fns": "^4.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.7.0",
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"@types/react": "^19.0.0",
|
|
38
|
+
"@types/react-dom": "^19.0.0",
|
|
39
|
+
"eslint": "^9.0.0",
|
|
40
|
+
"eslint-config-next": "^15.0.0",
|
|
41
|
+
"prettier": "^3.4.0",
|
|
42
|
+
"vitest": "^2.1.0",
|
|
43
|
+
"@testing-library/react": "^16.0.0",
|
|
44
|
+
"@testing-library/jest-dom": "^6.6.0"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|