@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,229 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect } from 'react'
|
|
4
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { Cpu, Activity, Signal, Bell, AlertTriangle, CheckCircle, Clock, ThermometerSun, Gauge, Wifi, Plus } from 'lucide-react'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
// Simulated real-time data
|
|
9
|
+
const generateTelemetryData = () => ({
|
|
10
|
+
temperature: (20 + Math.random() * 10).toFixed(1),
|
|
11
|
+
pressure: (100 + Math.random() * 20).toFixed(1),
|
|
12
|
+
humidity: (40 + Math.random() * 30).toFixed(0),
|
|
13
|
+
signalStrength: (-50 - Math.random() * 40).toFixed(0),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const DEVICES = [
|
|
17
|
+
{ id: 1, name: 'Sensor Hub A1', type: 'Gateway', status: 'online', lastSeen: '2 min ago' },
|
|
18
|
+
{ id: 2, name: 'Temp Sensor T-001', type: 'Temperature', status: 'online', lastSeen: '1 min ago' },
|
|
19
|
+
{ id: 3, name: 'Pressure Gauge P-001', type: 'Pressure', status: 'online', lastSeen: '3 min ago' },
|
|
20
|
+
{ id: 4, name: 'Motion Detector M-001', type: 'Motion', status: 'offline', lastSeen: '15 min ago' },
|
|
21
|
+
{ id: 5, name: 'Humidity Sensor H-001', type: 'Humidity', status: 'online', lastSeen: '30 sec ago' },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const RECENT_ALERTS = [
|
|
25
|
+
{ id: 1, message: 'Temperature threshold exceeded on T-001', severity: 'warning', time: '5 min ago' },
|
|
26
|
+
{ id: 2, message: 'Motion Detector M-001 offline', severity: 'error', time: '15 min ago' },
|
|
27
|
+
{ id: 3, message: 'System backup completed', severity: 'info', time: '1 hour ago' },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
export default function DashboardPage() {
|
|
31
|
+
const [telemetry, setTelemetry] = useState(generateTelemetryData())
|
|
32
|
+
|
|
33
|
+
// Simulate real-time updates
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const interval = setInterval(() => {
|
|
36
|
+
setTelemetry(generateTelemetryData())
|
|
37
|
+
}, 3000)
|
|
38
|
+
return () => clearInterval(interval)
|
|
39
|
+
}, [])
|
|
40
|
+
|
|
41
|
+
const onlineDevices = DEVICES.filter(d => d.status === 'online').length
|
|
42
|
+
const offlineDevices = DEVICES.filter(d => d.status === 'offline').length
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="min-h-screen bg-slate-50 dark:bg-slate-900">
|
|
46
|
+
{/* Header */}
|
|
47
|
+
<header className="bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4">
|
|
48
|
+
<div className="flex items-center justify-between">
|
|
49
|
+
<div>
|
|
50
|
+
<h1 className="text-2xl font-bold text-slate-900 dark:text-white">Dashboard</h1>
|
|
51
|
+
<p className="text-slate-600 dark:text-slate-400 text-sm">Real-time IoT monitoring</p>
|
|
52
|
+
</div>
|
|
53
|
+
<Link href="/devices/new">
|
|
54
|
+
<Button className="bg-emerald-600 hover:bg-emerald-700">
|
|
55
|
+
<Plus className="w-4 h-4 mr-2" />
|
|
56
|
+
Add Device
|
|
57
|
+
</Button>
|
|
58
|
+
</Link>
|
|
59
|
+
</div>
|
|
60
|
+
</header>
|
|
61
|
+
|
|
62
|
+
<div className="p-6">
|
|
63
|
+
{/* Stats */}
|
|
64
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
65
|
+
<Card className="p-6">
|
|
66
|
+
<div className="flex items-center justify-between">
|
|
67
|
+
<div>
|
|
68
|
+
<p className="text-sm text-slate-600 dark:text-slate-400">Total Devices</p>
|
|
69
|
+
<p className="text-3xl font-bold text-slate-900 dark:text-white">{DEVICES.length}</p>
|
|
70
|
+
</div>
|
|
71
|
+
<div className="w-12 h-12 bg-emerald-100 dark:bg-emerald-900/30 rounded-lg flex items-center justify-center">
|
|
72
|
+
<Cpu className="w-6 h-6 text-emerald-600" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</Card>
|
|
76
|
+
|
|
77
|
+
<Card className="p-6">
|
|
78
|
+
<div className="flex items-center justify-between">
|
|
79
|
+
<div>
|
|
80
|
+
<p className="text-sm text-slate-600 dark:text-slate-400">Online</p>
|
|
81
|
+
<p className="text-3xl font-bold text-green-600">{onlineDevices}</p>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="w-12 h-12 bg-green-100 dark:bg-green-900/30 rounded-lg flex items-center justify-center">
|
|
84
|
+
<CheckCircle className="w-6 h-6 text-green-600" />
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</Card>
|
|
88
|
+
|
|
89
|
+
<Card className="p-6">
|
|
90
|
+
<div className="flex items-center justify-between">
|
|
91
|
+
<div>
|
|
92
|
+
<p className="text-sm text-slate-600 dark:text-slate-400">Offline</p>
|
|
93
|
+
<p className="text-3xl font-bold text-red-600">{offlineDevices}</p>
|
|
94
|
+
</div>
|
|
95
|
+
<div className="w-12 h-12 bg-red-100 dark:bg-red-900/30 rounded-lg flex items-center justify-center">
|
|
96
|
+
<AlertTriangle className="w-6 h-6 text-red-600" />
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</Card>
|
|
100
|
+
|
|
101
|
+
<Card className="p-6">
|
|
102
|
+
<div className="flex items-center justify-between">
|
|
103
|
+
<div>
|
|
104
|
+
<p className="text-sm text-slate-600 dark:text-slate-400">Active Alerts</p>
|
|
105
|
+
<p className="text-3xl font-bold text-amber-600">{RECENT_ALERTS.length}</p>
|
|
106
|
+
</div>
|
|
107
|
+
<div className="w-12 h-12 bg-amber-100 dark:bg-amber-900/30 rounded-lg flex items-center justify-center">
|
|
108
|
+
<Bell className="w-6 h-6 text-amber-600" />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</Card>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
{/* Live Telemetry */}
|
|
115
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
|
|
116
|
+
<Card className="p-6">
|
|
117
|
+
<h2 className="text-lg font-semibold text-slate-900 dark:text-white mb-6 flex items-center">
|
|
118
|
+
<Activity className="w-5 h-5 mr-2 text-emerald-600" />
|
|
119
|
+
Live Telemetry
|
|
120
|
+
</h2>
|
|
121
|
+
<div className="grid grid-cols-2 gap-4">
|
|
122
|
+
<div className="p-4 bg-slate-100 dark:bg-slate-700/50 rounded-lg">
|
|
123
|
+
<div className="flex items-center gap-2 mb-2">
|
|
124
|
+
<ThermometerSun className="w-4 h-4 text-orange-500" />
|
|
125
|
+
<span className="text-sm text-slate-600 dark:text-slate-400">Temperature</span>
|
|
126
|
+
</div>
|
|
127
|
+
<p className="text-2xl font-bold text-slate-900 dark:text-white">{telemetry.temperature}°C</p>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="p-4 bg-slate-100 dark:bg-slate-700/50 rounded-lg">
|
|
130
|
+
<div className="flex items-center gap-2 mb-2">
|
|
131
|
+
<Gauge className="w-4 h-4 text-blue-500" />
|
|
132
|
+
<span className="text-sm text-slate-600 dark:text-slate-400">Pressure</span>
|
|
133
|
+
</div>
|
|
134
|
+
<p className="text-2xl font-bold text-slate-900 dark:text-white">{telemetry.pressure} kPa</p>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="p-4 bg-slate-100 dark:bg-slate-700/50 rounded-lg">
|
|
137
|
+
<div className="flex items-center gap-2 mb-2">
|
|
138
|
+
<Activity className="w-4 h-4 text-cyan-500" />
|
|
139
|
+
<span className="text-sm text-slate-600 dark:text-slate-400">Humidity</span>
|
|
140
|
+
</div>
|
|
141
|
+
<p className="text-2xl font-bold text-slate-900 dark:text-white">{telemetry.humidity}%</p>
|
|
142
|
+
</div>
|
|
143
|
+
<div className="p-4 bg-slate-100 dark:bg-slate-700/50 rounded-lg">
|
|
144
|
+
<div className="flex items-center gap-2 mb-2">
|
|
145
|
+
<Signal className="w-4 h-4 text-purple-500" />
|
|
146
|
+
<span className="text-sm text-slate-600 dark:text-slate-400">Signal</span>
|
|
147
|
+
</div>
|
|
148
|
+
<p className="text-2xl font-bold text-slate-900 dark:text-white">{telemetry.signalStrength} dBm</p>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</Card>
|
|
152
|
+
|
|
153
|
+
<Card className="p-6">
|
|
154
|
+
<h2 className="text-lg font-semibold text-slate-900 dark:text-white mb-6 flex items-center">
|
|
155
|
+
<Bell className="w-5 h-5 mr-2 text-amber-600" />
|
|
156
|
+
Recent Alerts
|
|
157
|
+
</h2>
|
|
158
|
+
<div className="space-y-4">
|
|
159
|
+
{RECENT_ALERTS.map((alert) => (
|
|
160
|
+
<div key={alert.id} className="flex items-start gap-3 p-3 bg-slate-100 dark:bg-slate-700/50 rounded-lg">
|
|
161
|
+
<div className={`w-2 h-2 rounded-full mt-2 ${
|
|
162
|
+
alert.severity === 'error' ? 'bg-red-500' :
|
|
163
|
+
alert.severity === 'warning' ? 'bg-amber-500' :
|
|
164
|
+
'bg-blue-500'
|
|
165
|
+
}`} />
|
|
166
|
+
<div className="flex-1">
|
|
167
|
+
<p className="text-sm text-slate-900 dark:text-white">{alert.message}</p>
|
|
168
|
+
<p className="text-xs text-slate-500 mt-1">{alert.time}</p>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
))}
|
|
172
|
+
</div>
|
|
173
|
+
</Card>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
{/* Device List */}
|
|
177
|
+
<Card className="p-6">
|
|
178
|
+
<div className="flex items-center justify-between mb-6">
|
|
179
|
+
<h2 className="text-lg font-semibold text-slate-900 dark:text-white flex items-center">
|
|
180
|
+
<Cpu className="w-5 h-5 mr-2 text-emerald-600" />
|
|
181
|
+
Devices
|
|
182
|
+
</h2>
|
|
183
|
+
<Link href="/devices">
|
|
184
|
+
<Button variant="outline" size="sm">View All</Button>
|
|
185
|
+
</Link>
|
|
186
|
+
</div>
|
|
187
|
+
<div className="overflow-x-auto">
|
|
188
|
+
<table className="w-full">
|
|
189
|
+
<thead>
|
|
190
|
+
<tr className="border-b border-slate-200 dark:border-slate-700">
|
|
191
|
+
<th className="text-left py-3 px-4 text-sm font-medium text-slate-600 dark:text-slate-400">Name</th>
|
|
192
|
+
<th className="text-left py-3 px-4 text-sm font-medium text-slate-600 dark:text-slate-400">Type</th>
|
|
193
|
+
<th className="text-left py-3 px-4 text-sm font-medium text-slate-600 dark:text-slate-400">Status</th>
|
|
194
|
+
<th className="text-left py-3 px-4 text-sm font-medium text-slate-600 dark:text-slate-400">Last Seen</th>
|
|
195
|
+
</tr>
|
|
196
|
+
</thead>
|
|
197
|
+
<tbody>
|
|
198
|
+
{DEVICES.map((device) => (
|
|
199
|
+
<tr key={device.id} className="border-b border-slate-100 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800/50">
|
|
200
|
+
<td className="py-3 px-4">
|
|
201
|
+
<span className="font-medium text-slate-900 dark:text-white">{device.name}</span>
|
|
202
|
+
</td>
|
|
203
|
+
<td className="py-3 px-4 text-slate-600 dark:text-slate-400">{device.type}</td>
|
|
204
|
+
<td className="py-3 px-4">
|
|
205
|
+
<span className={`inline-flex items-center px-2 py-1 rounded-full text-xs ${
|
|
206
|
+
device.status === 'online'
|
|
207
|
+
? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400'
|
|
208
|
+
: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400'
|
|
209
|
+
}`}>
|
|
210
|
+
<span className={`w-1.5 h-1.5 rounded-full mr-1.5 ${
|
|
211
|
+
device.status === 'online' ? 'bg-green-500' : 'bg-red-500'
|
|
212
|
+
}`} />
|
|
213
|
+
{device.status}
|
|
214
|
+
</span>
|
|
215
|
+
</td>
|
|
216
|
+
<td className="py-3 px-4 text-slate-600 dark:text-slate-400 flex items-center">
|
|
217
|
+
<Clock className="w-3 h-3 mr-1" />
|
|
218
|
+
{device.lastSeen}
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
))}
|
|
222
|
+
</tbody>
|
|
223
|
+
</table>
|
|
224
|
+
</div>
|
|
225
|
+
</Card>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--color-primary: oklch(55% 0.18 160);
|
|
5
|
+
--color-background: oklch(98% 0.01 256);
|
|
6
|
+
--color-foreground: oklch(15% 0.02 256);
|
|
7
|
+
--font-sans: 'Inter', system-ui, sans-serif;
|
|
8
|
+
--radius: 0.5rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dark {
|
|
12
|
+
--color-background: oklch(15% 0.02 256);
|
|
13
|
+
--color-foreground: oklch(95% 0 0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
font-family: var(--font-sans);
|
|
18
|
+
background-color: var(--color-background);
|
|
19
|
+
color: var(--color-foreground);
|
|
20
|
+
}
|
|
@@ -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}} - IoT Dashboard',
|
|
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,191 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
5
|
+
import { Cpu, Activity, Signal, Bell, Settings, ArrowRight, User, LogOut, Wifi, ThermometerSun, Gauge, Shield } from 'lucide-react'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
const FEATURES = [
|
|
9
|
+
{
|
|
10
|
+
icon: Cpu,
|
|
11
|
+
title: 'Device Management',
|
|
12
|
+
description: 'Monitor and control all your IoT devices from one dashboard',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
icon: Activity,
|
|
16
|
+
title: 'Real-time Telemetry',
|
|
17
|
+
description: 'Live data streams with historical analysis and trends',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
icon: Bell,
|
|
21
|
+
title: 'Smart Alerts',
|
|
22
|
+
description: 'Configurable alerts and notifications for critical events',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
icon: Shield,
|
|
26
|
+
title: 'Secure & Scalable',
|
|
27
|
+
description: 'Enterprise-grade security for your connected devices',
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const DEVICE_TYPES = [
|
|
32
|
+
{ name: 'Temperature Sensors', count: 24, icon: ThermometerSun, status: 'online' },
|
|
33
|
+
{ name: 'Pressure Gauges', count: 12, icon: Gauge, status: 'online' },
|
|
34
|
+
{ name: 'Network Gateways', count: 8, icon: Wifi, status: 'online' },
|
|
35
|
+
{ name: 'Motion Sensors', count: 18, icon: Signal, status: 'partial' },
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
export default function Home() {
|
|
39
|
+
const { user, signOut, loading } = useAuth()
|
|
40
|
+
|
|
41
|
+
const projectName = "{{titleCaseName}}"
|
|
42
|
+
|
|
43
|
+
const handleSignOut = async () => {
|
|
44
|
+
try {
|
|
45
|
+
await signOut()
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.error('Sign out error:', err)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<main className="min-h-screen bg-slate-50 dark:bg-slate-900">
|
|
53
|
+
{/* Header */}
|
|
54
|
+
<header className="bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 sticky top-0 z-50">
|
|
55
|
+
<div className="max-w-7xl mx-auto px-4 py-4">
|
|
56
|
+
<div className="flex items-center justify-between">
|
|
57
|
+
<Link href="/" className="flex items-center gap-2">
|
|
58
|
+
<div className="w-8 h-8 bg-emerald-600 rounded-lg flex items-center justify-center">
|
|
59
|
+
<Cpu className="w-5 h-5 text-white" />
|
|
60
|
+
</div>
|
|
61
|
+
<span className="text-2xl font-bold text-slate-900 dark:text-white">{projectName}</span>
|
|
62
|
+
</Link>
|
|
63
|
+
|
|
64
|
+
<nav className="hidden md:flex items-center gap-6">
|
|
65
|
+
<Link href="/devices" className="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition">
|
|
66
|
+
Devices
|
|
67
|
+
</Link>
|
|
68
|
+
<Link href="/analytics" className="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition">
|
|
69
|
+
Analytics
|
|
70
|
+
</Link>
|
|
71
|
+
<Link href="/alerts" className="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition">
|
|
72
|
+
Alerts
|
|
73
|
+
</Link>
|
|
74
|
+
</nav>
|
|
75
|
+
|
|
76
|
+
<div className="flex items-center gap-4">
|
|
77
|
+
{loading ? (
|
|
78
|
+
<div className="text-sm text-slate-600">Loading...</div>
|
|
79
|
+
) : user ? (
|
|
80
|
+
<div className="flex items-center gap-2">
|
|
81
|
+
<Link href="/dashboard">
|
|
82
|
+
<Button variant="outline" size="sm">
|
|
83
|
+
<User className="w-4 h-4 mr-2" />
|
|
84
|
+
Dashboard
|
|
85
|
+
</Button>
|
|
86
|
+
</Link>
|
|
87
|
+
<Button variant="ghost" size="sm" onClick={handleSignOut}>
|
|
88
|
+
<LogOut className="w-4 h-4" />
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
) : (
|
|
92
|
+
<div className="flex gap-2">
|
|
93
|
+
<Link href="/login">
|
|
94
|
+
<Button variant="outline" size="sm">Sign In</Button>
|
|
95
|
+
</Link>
|
|
96
|
+
<Link href="/signup">
|
|
97
|
+
<Button size="sm" className="bg-emerald-600 hover:bg-emerald-700">Get Started</Button>
|
|
98
|
+
</Link>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</header>
|
|
105
|
+
|
|
106
|
+
<div className="max-w-7xl mx-auto px-4 py-16">
|
|
107
|
+
{/* Hero */}
|
|
108
|
+
<div className="text-center mb-16">
|
|
109
|
+
<div className="inline-flex items-center px-4 py-2 rounded-full bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-400 text-sm mb-6">
|
|
110
|
+
<Signal className="w-4 h-4 mr-2" />
|
|
111
|
+
IoT Management Platform
|
|
112
|
+
</div>
|
|
113
|
+
<h1 className="text-5xl font-bold text-slate-900 dark:text-white mb-6">
|
|
114
|
+
Monitor Your <span className="text-emerald-600">Connected Devices</span>
|
|
115
|
+
</h1>
|
|
116
|
+
<p className="text-xl text-slate-600 dark:text-slate-300 max-w-2xl mx-auto mb-8">
|
|
117
|
+
Real-time monitoring, analytics, and control for your IoT infrastructure.
|
|
118
|
+
Built for scale, designed for simplicity.
|
|
119
|
+
</p>
|
|
120
|
+
<div className="flex gap-4 justify-center">
|
|
121
|
+
<Link href="/dashboard">
|
|
122
|
+
<Button size="lg" className="bg-emerald-600 hover:bg-emerald-700">
|
|
123
|
+
<Activity className="w-5 h-5 mr-2" />
|
|
124
|
+
View Dashboard
|
|
125
|
+
</Button>
|
|
126
|
+
</Link>
|
|
127
|
+
<Link href="/devices">
|
|
128
|
+
<Button size="lg" variant="outline">
|
|
129
|
+
Manage Devices
|
|
130
|
+
</Button>
|
|
131
|
+
</Link>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
{/* Device Overview */}
|
|
136
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-4 mb-16">
|
|
137
|
+
{DEVICE_TYPES.map((device) => (
|
|
138
|
+
<Card key={device.name} className="p-6">
|
|
139
|
+
<div className="flex items-center justify-between mb-3">
|
|
140
|
+
<div className="w-10 h-10 bg-emerald-100 dark:bg-emerald-900/30 rounded-lg flex items-center justify-center">
|
|
141
|
+
<device.icon className="w-5 h-5 text-emerald-600" />
|
|
142
|
+
</div>
|
|
143
|
+
<span className={`text-xs px-2 py-1 rounded-full ${
|
|
144
|
+
device.status === 'online'
|
|
145
|
+
? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400'
|
|
146
|
+
: 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400'
|
|
147
|
+
}`}>
|
|
148
|
+
{device.status === 'online' ? 'All Online' : 'Partial'}
|
|
149
|
+
</span>
|
|
150
|
+
</div>
|
|
151
|
+
<h3 className="font-semibold text-slate-900 dark:text-white">{device.name}</h3>
|
|
152
|
+
<p className="text-2xl font-bold text-emerald-600">{device.count}</p>
|
|
153
|
+
</Card>
|
|
154
|
+
))}
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
{/* Features */}
|
|
158
|
+
<div className="mb-16">
|
|
159
|
+
<h2 className="text-3xl font-bold text-slate-900 dark:text-white text-center mb-12">
|
|
160
|
+
Everything You Need
|
|
161
|
+
</h2>
|
|
162
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
163
|
+
{FEATURES.map((feature) => (
|
|
164
|
+
<Card key={feature.title} className="p-6 text-center">
|
|
165
|
+
<div className="w-12 h-12 bg-emerald-100 dark:bg-emerald-900/30 rounded-lg flex items-center justify-center mx-auto mb-4">
|
|
166
|
+
<feature.icon className="w-6 h-6 text-emerald-600" />
|
|
167
|
+
</div>
|
|
168
|
+
<h3 className="text-lg font-semibold text-slate-900 dark:text-white mb-2">{feature.title}</h3>
|
|
169
|
+
<p className="text-slate-600 dark:text-slate-400 text-sm">{feature.description}</p>
|
|
170
|
+
</Card>
|
|
171
|
+
))}
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
{/* CTA */}
|
|
176
|
+
<Card className="p-12 bg-gradient-to-r from-emerald-600 to-teal-600 text-white text-center">
|
|
177
|
+
<h2 className="text-3xl font-bold mb-4">Ready to Connect?</h2>
|
|
178
|
+
<p className="text-white/80 mb-8 max-w-md mx-auto">
|
|
179
|
+
Start monitoring your IoT devices in minutes. Free tier available for up to 10 devices.
|
|
180
|
+
</p>
|
|
181
|
+
<Link href="/signup">
|
|
182
|
+
<Button size="lg" variant="secondary">
|
|
183
|
+
Get Started Free
|
|
184
|
+
<ArrowRight className="w-5 h-5 ml-2" />
|
|
185
|
+
</Button>
|
|
186
|
+
</Link>
|
|
187
|
+
</Card>
|
|
188
|
+
</div>
|
|
189
|
+
</main>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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="system" enableSystem>
|
|
13
|
+
<DLLProvider
|
|
14
|
+
config={{
|
|
15
|
+
auth: {
|
|
16
|
+
provider: 'supabase',
|
|
17
|
+
},
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</DLLProvider>
|
|
22
|
+
</ThemeProvider>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -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,25 @@
|
|
|
1
|
+
import { clsx, type ClassValue } from 'clsx'
|
|
2
|
+
import { twMerge } from 'tailwind-merge'
|
|
3
|
+
|
|
4
|
+
export function cn(...inputs: ClassValue[]) {
|
|
5
|
+
return twMerge(clsx(inputs))
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function formatTimestamp(date: Date | string) {
|
|
9
|
+
return new Intl.DateTimeFormat('en-US', {
|
|
10
|
+
dateStyle: 'medium',
|
|
11
|
+
timeStyle: 'short',
|
|
12
|
+
}).format(new Date(date))
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function formatRelativeTime(date: Date | string) {
|
|
16
|
+
const now = new Date()
|
|
17
|
+
const then = new Date(date)
|
|
18
|
+
const diffMs = now.getTime() - then.getTime()
|
|
19
|
+
const diffMins = Math.floor(diffMs / 60000)
|
|
20
|
+
|
|
21
|
+
if (diffMins < 1) return 'Just now'
|
|
22
|
+
if (diffMins < 60) return `${diffMins} min ago`
|
|
23
|
+
if (diffMins < 1440) return `${Math.floor(diffMins / 60)} hours ago`
|
|
24
|
+
return `${Math.floor(diffMins / 1440)} days ago`
|
|
25
|
+
}
|
|
@@ -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
|
+
# Stripe Configuration
|
|
7
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
|
|
8
|
+
STRIPE_SECRET_KEY=sk_test_xxx
|
|
9
|
+
STRIPE_WEBHOOK_SECRET=whsec_xxx
|
|
10
|
+
|
|
11
|
+
# Application
|
|
12
|
+
NEXT_PUBLIC_APP_URL=http://localhost:3000
|