@digilogiclabs/create-saas-app 2.9.1 → 2.11.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/README.md +153 -113
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/create.d.ts.map +1 -1
- package/dist/cli/commands/create.js +2 -6
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +6 -3
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
- package/dist/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
- package/dist/templates/shared/design/web/src/config/design.config.ts +14 -14
- package/dist/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
- package/dist/templates/shared/security/web/src/lib/api-security.ts +2 -2
- package/dist/templates/web/ai-platform/template/next.config.js +14 -14
- package/dist/templates/web/ai-platform/template/package.json +11 -22
- package/dist/templates/web/ai-platform/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
- package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
- package/dist/templates/web/ai-platform/template/src/app/error.tsx +13 -13
- package/dist/templates/web/ai-platform/template/src/app/globals.css +97 -34
- package/dist/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
- package/dist/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +248 -154
- package/dist/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
- package/dist/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
- package/dist/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/base/template/next.config.js +14 -15
- package/dist/templates/web/base/template/package.json +16 -31
- package/dist/templates/web/base/template/postcss.config.mjs +8 -0
- package/dist/templates/web/base/template/src/app/error.tsx +97 -97
- package/dist/templates/web/base/template/src/app/globals.css +87 -148
- package/dist/templates/web/base/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/base/template/src/app/loading.tsx +52 -52
- package/dist/templates/web/base/template/tsconfig.json +27 -33
- package/dist/templates/web/iot-dashboard/template/next.config.js +14 -14
- package/dist/templates/web/iot-dashboard/template/package.json +12 -16
- package/dist/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
- package/dist/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
- package/dist/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
- package/dist/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
- package/dist/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
- package/dist/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
- package/dist/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
- package/dist/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
- package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
- package/dist/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
- package/dist/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
- package/dist/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/marketplace/template/next.config.js +14 -14
- package/dist/templates/web/marketplace/template/package.json +11 -18
- package/dist/templates/web/marketplace/template/postcss.config.mjs +8 -0
- package/dist/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
- package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
- package/dist/templates/web/marketplace/template/src/app/error.tsx +7 -7
- package/dist/templates/web/marketplace/template/src/app/globals.css +97 -20
- package/dist/templates/web/marketplace/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/marketplace/template/src/app/loading.tsx +5 -5
- package/dist/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
- package/dist/templates/web/marketplace/template/src/app/page.tsx +370 -169
- package/dist/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
- package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/dist/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
- package/dist/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/micro-saas/template/next.config.js +14 -14
- package/dist/templates/web/micro-saas/template/package.json +9 -8
- package/dist/templates/web/micro-saas/template/postcss.config.mjs +8 -0
- package/dist/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
- package/dist/templates/web/micro-saas/template/src/app/error.tsx +7 -7
- package/dist/templates/web/micro-saas/template/src/app/globals.css +97 -20
- package/dist/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
- package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +112 -87
- package/dist/templates/web/micro-saas/template/src/app/page.tsx +227 -137
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +133 -108
- package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/ui-auth/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth/template/package.json +16 -26
- package/dist/templates/web/ui-auth/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth/template/src/app/globals.css +85 -84
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
- package/dist/templates/web/ui-auth/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-ai/template/next.config.js +15 -13
- package/dist/templates/web/ui-auth-ai/template/package.json +25 -21
- package/dist/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
- package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
- package/dist/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
- package/dist/templates/web/ui-auth-payments/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments/template/package.json +16 -29
- package/dist/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-ai/template/package.json +17 -33
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +17 -30
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-video/template/package.json +17 -30
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-only/template/next.config.js +14 -12
- package/dist/templates/web/ui-only/template/package.json +15 -25
- package/dist/templates/web/ui-only/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-only/template/src/app/globals.css +85 -31
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-only/template/tsconfig.json +27 -33
- package/package.json +1 -1
- package/src/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
- package/src/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
- package/src/templates/shared/design/web/src/config/design.config.ts +14 -14
- package/src/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
- package/src/templates/shared/security/web/src/lib/api-security.ts +2 -2
- package/src/templates/web/ai-platform/template/next.config.js +14 -14
- package/src/templates/web/ai-platform/template/package.json +11 -22
- package/src/templates/web/ai-platform/template/postcss.config.mjs +8 -0
- package/src/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
- package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
- package/src/templates/web/ai-platform/template/src/app/error.tsx +13 -13
- package/src/templates/web/ai-platform/template/src/app/globals.css +97 -34
- package/src/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
- package/src/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
- package/src/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
- package/src/templates/web/ai-platform/template/src/app/page.tsx +248 -154
- package/src/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
- package/src/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
- package/src/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/base/template/next.config.js +14 -15
- package/src/templates/web/base/template/package.json +16 -31
- package/src/templates/web/base/template/postcss.config.mjs +8 -0
- package/src/templates/web/base/template/src/app/error.tsx +97 -97
- package/src/templates/web/base/template/src/app/globals.css +87 -148
- package/src/templates/web/base/template/src/app/layout.tsx +4 -1
- package/src/templates/web/base/template/src/app/loading.tsx +52 -52
- package/src/templates/web/base/template/tsconfig.json +27 -33
- package/src/templates/web/iot-dashboard/template/next.config.js +14 -14
- package/src/templates/web/iot-dashboard/template/package.json +12 -16
- package/src/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
- package/src/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
- package/src/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
- package/src/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
- package/src/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
- package/src/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
- package/src/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
- package/src/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
- package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
- package/src/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
- package/src/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
- package/src/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
- package/src/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/marketplace/template/next.config.js +14 -14
- package/src/templates/web/marketplace/template/package.json +11 -18
- package/src/templates/web/marketplace/template/postcss.config.mjs +8 -0
- package/src/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
- package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
- package/src/templates/web/marketplace/template/src/app/error.tsx +7 -7
- package/src/templates/web/marketplace/template/src/app/globals.css +97 -20
- package/src/templates/web/marketplace/template/src/app/layout.tsx +3 -0
- package/src/templates/web/marketplace/template/src/app/loading.tsx +5 -5
- package/src/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
- package/src/templates/web/marketplace/template/src/app/page.tsx +370 -169
- package/src/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
- package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/src/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
- package/src/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/micro-saas/template/next.config.js +14 -14
- package/src/templates/web/micro-saas/template/package.json +9 -8
- package/src/templates/web/micro-saas/template/postcss.config.mjs +8 -0
- package/src/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
- package/src/templates/web/micro-saas/template/src/app/error.tsx +7 -7
- package/src/templates/web/micro-saas/template/src/app/globals.css +97 -20
- package/src/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
- package/src/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
- package/src/templates/web/micro-saas/template/src/app/login/page.tsx +112 -87
- package/src/templates/web/micro-saas/template/src/app/page.tsx +227 -137
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +133 -108
- package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/ui-auth/template/next.config.js +14 -12
- package/src/templates/web/ui-auth/template/package.json +16 -26
- package/src/templates/web/ui-auth/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth/template/src/app/globals.css +85 -84
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
- package/src/templates/web/ui-auth/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-ai/template/next.config.js +15 -13
- package/src/templates/web/ui-auth-ai/template/package.json +25 -21
- package/src/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
- package/src/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
- package/src/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
- package/src/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
- package/src/templates/web/ui-auth-payments/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments/template/package.json +16 -29
- package/src/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-ai/template/package.json +17 -33
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-audio/template/package.json +17 -30
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-video/template/package.json +17 -30
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
- package/src/templates/web/ui-only/template/next.config.js +14 -12
- package/src/templates/web/ui-only/template/package.json +15 -25
- package/src/templates/web/ui-only/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-only/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-only/template/src/app/globals.css +85 -31
- package/src/templates/web/ui-only/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-only/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-only/template/tsconfig.json +27 -33
- package/dist/templates/web/ai-platform/template/middleware.ts +0 -55
- package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/base/template/postcss.config.js +0 -7
- package/dist/templates/web/base/template/tailwind.config.js +0 -77
- package/dist/templates/web/iot-dashboard/template/middleware.ts +0 -56
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/marketplace/template/middleware.ts +0 -56
- package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/micro-saas/template/middleware.ts +0 -53
- package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
- package/dist/templates/web/ui-auth/template/.claude +0 -21
- package/dist/templates/web/ui-auth/template/context.md +0 -105
- package/dist/templates/web/ui-auth/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
- package/dist/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
- package/dist/templates/web/ui-auth-payments/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-ai/template/.claude +0 -21
- package/dist/templates/web/ui-auth-payments-ai/template/context.md +0 -169
- package/dist/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-only/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-only/template/tailwind.config.js +0 -77
- package/src/templates/web/ai-platform/template/middleware.ts +0 -55
- package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/base/template/postcss.config.js +0 -7
- package/src/templates/web/base/template/tailwind.config.js +0 -77
- package/src/templates/web/iot-dashboard/template/middleware.ts +0 -56
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/marketplace/template/middleware.ts +0 -56
- package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/micro-saas/template/middleware.ts +0 -53
- package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
- package/src/templates/web/ui-auth/template/.claude +0 -21
- package/src/templates/web/ui-auth/template/context.md +0 -105
- package/src/templates/web/ui-auth/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
- package/src/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
- package/src/templates/web/ui-auth-payments/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
- package/src/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-ai/template/.claude +0 -21
- package/src/templates/web/ui-auth-payments-ai/template/context.md +0 -169
- package/src/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-only/template/postcss.config.js +0 -7
- package/src/templates/web/ui-only/template/tailwind.config.js +0 -77
- /package/dist/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
- /package/dist/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
- /package/dist/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
- /package/dist/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
- /package/src/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
- /package/src/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
- /package/src/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
- /package/src/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { Card, SkeletonCard, SkeletonText } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
-
|
|
3
|
-
export default function Loading() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="min-h-screen bg-
|
|
6
|
-
<div className="container mx-auto px-4 py-8">
|
|
7
|
-
{/* Header skeleton */}
|
|
8
|
-
<div className="mb-8">
|
|
9
|
-
<SkeletonText className="h-8 w-64 mb-4" />
|
|
10
|
-
<SkeletonText className="h-4 w-96" />
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
{/* Cards grid skeleton */}
|
|
14
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
|
|
15
|
-
{Array.from({ length: 6 }).map((_, i) => (
|
|
16
|
-
<SkeletonCard key={i} />
|
|
17
|
-
))}
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
{/* Centered loading spinner */}
|
|
21
|
-
<div className="flex justify-center">
|
|
22
|
-
<Card className="p-8 max-w-sm w-full mx-4">
|
|
23
|
-
<div className="flex flex-col items-center space-y-4">
|
|
24
|
-
{/* Animated spinner */}
|
|
25
|
-
<div className="relative">
|
|
26
|
-
<div className="w-12 h-12 border-4 border-
|
|
27
|
-
<div className="absolute top-0 left-0 w-12 h-12 border-4 border-
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
{/* Loading text */}
|
|
31
|
-
<div className="text-center">
|
|
32
|
-
<h2 className="text-lg font-semibold text-
|
|
33
|
-
Loading...
|
|
34
|
-
</h2>
|
|
35
|
-
<p className="text-sm text-
|
|
36
|
-
Please wait while we prepare your content
|
|
37
|
-
</p>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
{/* Pulsing dots */}
|
|
41
|
-
<div className="flex space-x-1">
|
|
42
|
-
<div className="w-2 h-2 bg-
|
|
43
|
-
<div className="w-2 h-2 bg-
|
|
44
|
-
<div className="w-2 h-2 bg-
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</Card>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
1
|
+
import { Card, SkeletonCard, SkeletonText } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
+
|
|
3
|
+
export default function Loading() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="min-h-screen bg-background">
|
|
6
|
+
<div className="container mx-auto px-4 py-8">
|
|
7
|
+
{/* Header skeleton */}
|
|
8
|
+
<div className="mb-8">
|
|
9
|
+
<SkeletonText className="h-8 w-64 mb-4" />
|
|
10
|
+
<SkeletonText className="h-4 w-96" />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
{/* Cards grid skeleton */}
|
|
14
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
|
|
15
|
+
{Array.from({ length: 6 }).map((_, i) => (
|
|
16
|
+
<SkeletonCard key={i} />
|
|
17
|
+
))}
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{/* Centered loading spinner */}
|
|
21
|
+
<div className="flex justify-center">
|
|
22
|
+
<Card className="p-8 max-w-sm w-full mx-4">
|
|
23
|
+
<div className="flex flex-col items-center space-y-4">
|
|
24
|
+
{/* Animated spinner */}
|
|
25
|
+
<div className="relative">
|
|
26
|
+
<div className="w-12 h-12 border-4 border-border rounded-full animate-spin"></div>
|
|
27
|
+
<div className="absolute top-0 left-0 w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin"></div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
{/* Loading text */}
|
|
31
|
+
<div className="text-center">
|
|
32
|
+
<h2 className="text-lg font-semibold text-foreground mb-2">
|
|
33
|
+
Loading...
|
|
34
|
+
</h2>
|
|
35
|
+
<p className="text-sm text-muted-foreground">
|
|
36
|
+
Please wait while we prepare your content
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
{/* Pulsing dots */}
|
|
41
|
+
<div className="flex space-x-1">
|
|
42
|
+
<div className="w-2 h-2 bg-primary rounded-full animate-pulse"></div>
|
|
43
|
+
<div className="w-2 h-2 bg-primary rounded-full animate-pulse" style={{ animationDelay: '0.2s' }}></div>
|
|
44
|
+
<div className="w-2 h-2 bg-primary rounded-full animate-pulse" style={{ animationDelay: '0.4s' }}></div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</Card>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"lib": ["dom", "dom.iterable", "
|
|
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
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
31
|
-
"exclude": ["node_modules"]
|
|
32
|
-
}
|
|
33
|
-
|
|
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
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/** @type {import('next').NextConfig} */
|
|
2
|
-
const nextConfig = {
|
|
3
|
-
reactStrictMode: true,
|
|
4
|
-
images: {
|
|
5
|
-
remotePatterns: [
|
|
6
|
-
{
|
|
7
|
-
protocol: 'https',
|
|
8
|
-
hostname: '
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = nextConfig
|
|
1
|
+
/** @type {import('next').NextConfig} */
|
|
2
|
+
const nextConfig = {
|
|
3
|
+
reactStrictMode: true,
|
|
4
|
+
images: {
|
|
5
|
+
remotePatterns: [
|
|
6
|
+
{
|
|
7
|
+
protocol: 'https',
|
|
8
|
+
hostname: '**',
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = nextConfig
|
|
@@ -8,39 +8,35 @@
|
|
|
8
8
|
"build": "next build",
|
|
9
9
|
"start": "next start",
|
|
10
10
|
"lint": "next lint",
|
|
11
|
-
"type-check": "tsc --noEmit"
|
|
12
|
-
"test": "vitest",
|
|
13
|
-
"test:run": "vitest run"
|
|
11
|
+
"type-check": "tsc --noEmit"
|
|
14
12
|
},
|
|
15
13
|
"dependencies": {
|
|
16
|
-
"next": "^15.
|
|
14
|
+
"next": "^15.5.0",
|
|
17
15
|
"react": "^19.0.0",
|
|
18
16
|
"react-dom": "^19.0.0",
|
|
19
|
-
"@digilogiclabs/platform-core": "^1.
|
|
20
|
-
"@digilogiclabs/app-sdk": "^1.
|
|
21
|
-
"@digilogiclabs/saas-factory-ui": "^1.
|
|
22
|
-
"tailwindcss": "^4.
|
|
23
|
-
"
|
|
17
|
+
"@digilogiclabs/platform-core": "^1.14.0",
|
|
18
|
+
"@digilogiclabs/app-sdk": "^1.1.0",
|
|
19
|
+
"@digilogiclabs/saas-factory-ui": "^1.8.1",
|
|
20
|
+
"tailwindcss": "^4.1.0",
|
|
21
|
+
"@tailwindcss/postcss": "^4.1.0",
|
|
22
|
+
"clsx": "^2.1.0",
|
|
24
23
|
"class-variance-authority": "^0.7.0",
|
|
25
|
-
"tailwind-merge": "^2.
|
|
24
|
+
"tailwind-merge": "^2.6.0",
|
|
26
25
|
"next-themes": "^0.4.0",
|
|
27
26
|
"lucide-react": "^0.460.0",
|
|
28
27
|
"zod": "^4.1.0",
|
|
29
28
|
"zustand": "^4.5.0",
|
|
30
|
-
"recharts": "^2.
|
|
29
|
+
"recharts": "^2.14.0",
|
|
31
30
|
"date-fns": "^4.1.0"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"typescript": "^5.
|
|
33
|
+
"typescript": "^5.8.0",
|
|
35
34
|
"@types/node": "^22.0.0",
|
|
36
35
|
"@types/react": "^19.0.0",
|
|
37
36
|
"@types/react-dom": "^19.0.0",
|
|
38
37
|
"eslint": "^9.0.0",
|
|
39
38
|
"eslint-config-next": "^15.0.0",
|
|
40
|
-
"prettier": "^3.4.0"
|
|
41
|
-
"vitest": "^2.1.0",
|
|
42
|
-
"@testing-library/react": "^16.0.0",
|
|
43
|
-
"@testing-library/jest-dom": "^6.6.0"
|
|
39
|
+
"prettier": "^3.4.0"
|
|
44
40
|
},
|
|
45
41
|
"engines": {
|
|
46
42
|
"node": ">=20.0.0"
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { Bell, CheckCircle } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
type Severity = 'critical' | 'warning' | 'info'
|
|
8
|
+
type AlertStatus = 'active' | 'acknowledged'
|
|
9
|
+
|
|
10
|
+
interface Alert {
|
|
11
|
+
id: number
|
|
12
|
+
severity: Severity
|
|
13
|
+
message: string
|
|
14
|
+
device: string
|
|
15
|
+
timestamp: string
|
|
16
|
+
status: AlertStatus
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ALERTS: Alert[] = [
|
|
20
|
+
{ id: 1, severity: 'critical', message: 'Temperature exceeded 45°C threshold', device: 'Temp Sensor T-001', timestamp: '2 min ago', status: 'active' },
|
|
21
|
+
{ id: 2, severity: 'critical', message: 'Device unresponsive for 10+ minutes', device: 'Motion Detector M-001', timestamp: '15 min ago', status: 'active' },
|
|
22
|
+
{ id: 3, severity: 'warning', message: 'Signal strength below -80 dBm', device: 'Gateway B2', timestamp: '28 min ago', status: 'active' },
|
|
23
|
+
{ id: 4, severity: 'warning', message: 'Firmware update available (v2.5.0)', device: 'Sensor Hub A1', timestamp: '1 hour ago', status: 'active' },
|
|
24
|
+
{ id: 5, severity: 'info', message: 'Scheduled maintenance window approaching', device: 'All Devices', timestamp: '2 hours ago', status: 'active' },
|
|
25
|
+
{ id: 6, severity: 'warning', message: 'Battery level below 20%', device: 'Humidity Sensor H-001', timestamp: '3 hours ago', status: 'acknowledged' },
|
|
26
|
+
{ id: 7, severity: 'critical', message: 'Pressure reading outside safe range', device: 'Pressure Gauge P-001', timestamp: '4 hours ago', status: 'acknowledged' },
|
|
27
|
+
{ id: 8, severity: 'info', message: 'New device registered successfully', device: 'Temp Sensor T-002', timestamp: '5 hours ago', status: 'acknowledged' },
|
|
28
|
+
{ id: 9, severity: 'warning', message: 'High packet loss detected on network', device: 'Gateway B2', timestamp: '6 hours ago', status: 'active' },
|
|
29
|
+
{ id: 10, severity: 'info', message: 'Daily telemetry summary generated', device: 'System', timestamp: '8 hours ago', status: 'acknowledged' },
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
const SEVERITY_OPTIONS = ['All', 'Critical', 'Warning', 'Info']
|
|
33
|
+
const STATUS_OPTIONS = ['All', 'Active', 'Acknowledged']
|
|
34
|
+
|
|
35
|
+
function severityDotColor(severity: Severity): string {
|
|
36
|
+
switch (severity) {
|
|
37
|
+
case 'critical': return 'bg-red-500'
|
|
38
|
+
case 'warning': return 'bg-amber-500'
|
|
39
|
+
case 'info': return 'bg-blue-500'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function severityLabel(severity: Severity): string {
|
|
44
|
+
return severity.charAt(0).toUpperCase() + severity.slice(1)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function AlertsPage() {
|
|
48
|
+
const [severityFilter, setSeverityFilter] = useState('All')
|
|
49
|
+
const [statusFilter, setStatusFilter] = useState('All')
|
|
50
|
+
const [alerts, setAlerts] = useState(ALERTS)
|
|
51
|
+
|
|
52
|
+
const filtered = alerts.filter((a) => {
|
|
53
|
+
if (severityFilter !== 'All' && a.severity !== severityFilter.toLowerCase()) return false
|
|
54
|
+
if (statusFilter !== 'All' && a.status !== statusFilter.toLowerCase()) return false
|
|
55
|
+
return true
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const activeCount = alerts.filter((a) => a.status === 'active').length
|
|
59
|
+
|
|
60
|
+
const handleAcknowledge = (id: number) => {
|
|
61
|
+
setAlerts((prev) =>
|
|
62
|
+
prev.map((a) => (a.id === id ? { ...a, status: 'acknowledged' as AlertStatus } : a))
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className="min-h-screen bg-background">
|
|
68
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 py-8">
|
|
69
|
+
{/* Header */}
|
|
70
|
+
<div className="mb-8">
|
|
71
|
+
<h1 className="text-2xl font-bold text-foreground">Alerts</h1>
|
|
72
|
+
<p className="text-sm text-muted-foreground">{activeCount} active alert{activeCount !== 1 ? 's' : ''}</p>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{/* Filter Bar */}
|
|
76
|
+
<Card className="p-4 mb-6">
|
|
77
|
+
<div className="flex flex-col sm:flex-row gap-3">
|
|
78
|
+
<select
|
|
79
|
+
value={severityFilter}
|
|
80
|
+
onChange={(e) => setSeverityFilter(e.target.value)}
|
|
81
|
+
className="px-3 py-2 rounded-md border border-input bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
82
|
+
>
|
|
83
|
+
{SEVERITY_OPTIONS.map((s) => (
|
|
84
|
+
<option key={s} value={s}>{s === 'All' ? 'All Severities' : s}</option>
|
|
85
|
+
))}
|
|
86
|
+
</select>
|
|
87
|
+
<select
|
|
88
|
+
value={statusFilter}
|
|
89
|
+
onChange={(e) => setStatusFilter(e.target.value)}
|
|
90
|
+
className="px-3 py-2 rounded-md border border-input bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
91
|
+
>
|
|
92
|
+
{STATUS_OPTIONS.map((s) => (
|
|
93
|
+
<option key={s} value={s}>{s === 'All' ? 'All Statuses' : s}</option>
|
|
94
|
+
))}
|
|
95
|
+
</select>
|
|
96
|
+
</div>
|
|
97
|
+
</Card>
|
|
98
|
+
|
|
99
|
+
{/* Alert List */}
|
|
100
|
+
{filtered.length === 0 ? (
|
|
101
|
+
<Card className="p-0">
|
|
102
|
+
<div className="flex flex-col items-center justify-center py-16 px-4">
|
|
103
|
+
<div className="w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4">
|
|
104
|
+
<Bell className="w-8 h-8 text-muted-foreground" />
|
|
105
|
+
</div>
|
|
106
|
+
<p className="text-foreground font-medium mb-1">No alerts found</p>
|
|
107
|
+
<p className="text-sm text-muted-foreground">Try adjusting your filters.</p>
|
|
108
|
+
</div>
|
|
109
|
+
</Card>
|
|
110
|
+
) : (
|
|
111
|
+
<div className="space-y-3">
|
|
112
|
+
{filtered.map((alert) => (
|
|
113
|
+
<Card key={alert.id} className="p-4">
|
|
114
|
+
<div className="flex items-start gap-3">
|
|
115
|
+
<div className={`w-2.5 h-2.5 rounded-full mt-1.5 shrink-0 ${severityDotColor(alert.severity)}`} />
|
|
116
|
+
<div className="flex-1 min-w-0">
|
|
117
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2">
|
|
118
|
+
<div>
|
|
119
|
+
<p className="text-sm font-medium text-foreground">{alert.message}</p>
|
|
120
|
+
<div className="flex items-center gap-3 mt-1">
|
|
121
|
+
<span className="text-xs text-muted-foreground">{alert.device}</span>
|
|
122
|
+
<span className="text-xs text-muted-foreground">{alert.timestamp}</span>
|
|
123
|
+
<span className={`text-xs px-1.5 py-0.5 rounded ${
|
|
124
|
+
alert.severity === 'critical'
|
|
125
|
+
? 'bg-red-500/10 text-red-600'
|
|
126
|
+
: alert.severity === 'warning'
|
|
127
|
+
? 'bg-amber-500/10 text-amber-600'
|
|
128
|
+
: 'bg-blue-500/10 text-blue-600'
|
|
129
|
+
}`}>
|
|
130
|
+
{severityLabel(alert.severity)}
|
|
131
|
+
</span>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
{alert.status === 'active' ? (
|
|
135
|
+
<Button
|
|
136
|
+
variant="outline"
|
|
137
|
+
size="sm"
|
|
138
|
+
onClick={() => handleAcknowledge(alert.id)}
|
|
139
|
+
className="shrink-0"
|
|
140
|
+
>
|
|
141
|
+
<CheckCircle className="w-4 h-4 mr-1" />
|
|
142
|
+
Acknowledge
|
|
143
|
+
</Button>
|
|
144
|
+
) : (
|
|
145
|
+
<span className="text-xs text-muted-foreground italic shrink-0">Acknowledged</span>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</Card>
|
|
151
|
+
))}
|
|
152
|
+
</div>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Demo auth API routes.
|
|
3
|
+
*
|
|
4
|
+
* POST /api/auth — Login or Signup
|
|
5
|
+
* DELETE /api/auth — Logout
|
|
6
|
+
*
|
|
7
|
+
* Replace with your real auth provider (Auth.js, Supabase Auth, etc.)
|
|
8
|
+
* when configuring your app for production.
|
|
9
|
+
*/
|
|
10
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
11
|
+
import { cookies } from 'next/headers'
|
|
12
|
+
|
|
13
|
+
export async function POST(request: NextRequest) {
|
|
14
|
+
try {
|
|
15
|
+
const body = await request.json()
|
|
16
|
+
const { email, password, action } = body
|
|
17
|
+
|
|
18
|
+
if (!email || !password) {
|
|
19
|
+
return NextResponse.json(
|
|
20
|
+
{ error: 'Email and password are required' },
|
|
21
|
+
{ status: 400 }
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Demo: accept any email/password combination.
|
|
26
|
+
// Replace with real authentication (database lookup, bcrypt compare, etc.)
|
|
27
|
+
const user = {
|
|
28
|
+
id: crypto.randomUUID(),
|
|
29
|
+
email,
|
|
30
|
+
name: email.split('@')[0],
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const session = JSON.stringify({ user })
|
|
34
|
+
const cookieStore = await cookies()
|
|
35
|
+
|
|
36
|
+
cookieStore.set('session', session, {
|
|
37
|
+
httpOnly: true,
|
|
38
|
+
secure: process.env.NODE_ENV === 'production',
|
|
39
|
+
sameSite: 'lax',
|
|
40
|
+
path: '/',
|
|
41
|
+
maxAge: 60 * 60 * 24 * 7, // 7 days
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
return NextResponse.json({ user })
|
|
45
|
+
} catch {
|
|
46
|
+
return NextResponse.json(
|
|
47
|
+
{ error: 'Authentication failed' },
|
|
48
|
+
{ status: 500 }
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function DELETE() {
|
|
54
|
+
const cookieStore = await cookies()
|
|
55
|
+
cookieStore.delete('session')
|
|
56
|
+
return NextResponse.json({ success: true })
|
|
57
|
+
}
|