@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
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { Button, Card, CardContent } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { ShoppingBag } from 'lucide-react'
|
|
6
|
+
import { useRouter } from 'next/navigation'
|
|
7
|
+
import Link from 'next/link'
|
|
8
|
+
|
|
9
|
+
export default function SignupPage() {
|
|
10
|
+
const [email, setEmail] = useState('')
|
|
11
|
+
const [password, setPassword] = useState('')
|
|
12
|
+
const [confirmPassword, setConfirmPassword] = useState('')
|
|
13
|
+
const [error, setError] = useState('')
|
|
14
|
+
const [loading, setLoading] = useState(false)
|
|
15
|
+
const router = useRouter()
|
|
16
|
+
|
|
17
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
18
|
+
e.preventDefault()
|
|
19
|
+
setError('')
|
|
20
|
+
if (password !== confirmPassword) {
|
|
21
|
+
setError('Passwords do not match')
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
setLoading(true)
|
|
25
|
+
try {
|
|
26
|
+
const res = await fetch('/api/auth', {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: { 'Content-Type': 'application/json' },
|
|
29
|
+
body: JSON.stringify({ email, password, action: 'signup' }),
|
|
30
|
+
})
|
|
31
|
+
if (!res.ok) {
|
|
32
|
+
const data = await res.json()
|
|
33
|
+
throw new Error(data.error || 'Failed to create account')
|
|
34
|
+
}
|
|
35
|
+
router.push('/dashboard')
|
|
36
|
+
router.refresh()
|
|
37
|
+
} catch (err) {
|
|
38
|
+
setError(err instanceof Error ? err.message : 'Failed to create account')
|
|
39
|
+
} finally {
|
|
40
|
+
setLoading(false)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="min-h-screen flex items-center justify-center bg-background px-4">
|
|
46
|
+
<div className="w-full max-w-md">
|
|
47
|
+
{/* Logo */}
|
|
48
|
+
<Link href="/" className="flex items-center justify-center gap-2 mb-8 hover:opacity-80 transition-opacity">
|
|
49
|
+
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-brand-from via-brand-via to-brand-to flex items-center justify-center">
|
|
50
|
+
<ShoppingBag className="w-5 h-5 text-white" />
|
|
51
|
+
</div>
|
|
52
|
+
<span className="font-bold text-xl">Marketplace</span>
|
|
53
|
+
</Link>
|
|
54
|
+
|
|
55
|
+
<Card className="border border-border">
|
|
56
|
+
<CardContent className="p-8">
|
|
57
|
+
<div className="text-center mb-8">
|
|
58
|
+
<h1 className="text-2xl font-bold">Create your account</h1>
|
|
59
|
+
<p className="text-muted-foreground mt-2">Start buying and selling today</p>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{error && (
|
|
63
|
+
<div className="bg-destructive/10 text-destructive p-3 rounded-lg mb-6 text-sm" role="alert">
|
|
64
|
+
{error}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
<form onSubmit={handleSubmit} className="space-y-4">
|
|
69
|
+
<div>
|
|
70
|
+
<label htmlFor="email" className="block text-sm font-medium mb-1.5">
|
|
71
|
+
Email
|
|
72
|
+
</label>
|
|
73
|
+
<input
|
|
74
|
+
id="email"
|
|
75
|
+
type="email"
|
|
76
|
+
value={email}
|
|
77
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
78
|
+
className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
|
|
79
|
+
placeholder="you@example.com"
|
|
80
|
+
required
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div>
|
|
85
|
+
<label htmlFor="password" className="block text-sm font-medium mb-1.5">
|
|
86
|
+
Password
|
|
87
|
+
</label>
|
|
88
|
+
<input
|
|
89
|
+
id="password"
|
|
90
|
+
type="password"
|
|
91
|
+
value={password}
|
|
92
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
93
|
+
className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
|
|
94
|
+
placeholder="Minimum 8 characters"
|
|
95
|
+
required
|
|
96
|
+
minLength={8}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div>
|
|
101
|
+
<label htmlFor="confirmPassword" className="block text-sm font-medium mb-1.5">
|
|
102
|
+
Confirm Password
|
|
103
|
+
</label>
|
|
104
|
+
<input
|
|
105
|
+
id="confirmPassword"
|
|
106
|
+
type="password"
|
|
107
|
+
value={confirmPassword}
|
|
108
|
+
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
109
|
+
className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
|
|
110
|
+
placeholder="Re-enter your password"
|
|
111
|
+
required
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<Button type="submit" className="w-full h-11 text-base cursor-pointer hover:brightness-110 active:scale-[0.98] transition-all duration-200" disabled={loading}>
|
|
116
|
+
{loading ? 'Creating account...' : 'Create Account'}
|
|
117
|
+
</Button>
|
|
118
|
+
</form>
|
|
119
|
+
|
|
120
|
+
<div className="mt-6 text-center">
|
|
121
|
+
<p className="text-muted-foreground text-sm">
|
|
122
|
+
Already have an account?{' '}
|
|
123
|
+
<Link href="/login" className="text-primary hover:underline font-medium">
|
|
124
|
+
Sign in
|
|
125
|
+
</Link>
|
|
126
|
+
</p>
|
|
127
|
+
</div>
|
|
128
|
+
</CardContent>
|
|
129
|
+
</Card>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { redirect } from 'next/navigation'
|
|
2
|
-
import {
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
1
|
+
import { redirect } from 'next/navigation'
|
|
2
|
+
import { getSession, getUser as getSessionUser } from './auth-session'
|
|
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 user = await getSessionUser()
|
|
12
|
+
|
|
13
|
+
if (!user || !user.id) {
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
id: user.id,
|
|
19
|
+
email: user.email ?? null,
|
|
20
|
+
name: user.name ?? null,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function requireAuth(): Promise<AuthUser> {
|
|
25
|
+
const user = await getUser()
|
|
26
|
+
|
|
27
|
+
if (!user) {
|
|
28
|
+
redirect('/login')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return user
|
|
32
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth session adapter — demo implementation.
|
|
3
|
+
*
|
|
4
|
+
* Replace this file with a real provider when configuring your app:
|
|
5
|
+
* - Keycloak: import { auth } from '@/auth' (Auth.js)
|
|
6
|
+
* - Supabase: import { createClient } from '@/lib/supabase/server'
|
|
7
|
+
* - Firebase: import { getServerSession } from 'next-auth'
|
|
8
|
+
*
|
|
9
|
+
* The getSession() and getUser() exports are consumed by auth-server.ts
|
|
10
|
+
* and must return the same shape regardless of provider.
|
|
11
|
+
*/
|
|
12
|
+
import 'server-only'
|
|
13
|
+
import { cookies } from 'next/headers'
|
|
14
|
+
|
|
15
|
+
type SessionUser = {
|
|
16
|
+
id?: string
|
|
17
|
+
email?: string | null
|
|
18
|
+
name?: string | null
|
|
19
|
+
roles?: string[]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Session = {
|
|
23
|
+
user?: SessionUser
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get the current session from cookies.
|
|
28
|
+
* Demo: reads a JSON cookie set at login. Replace with your auth provider.
|
|
29
|
+
*/
|
|
30
|
+
export async function getSession(): Promise<Session | null> {
|
|
31
|
+
const cookieStore = await cookies()
|
|
32
|
+
const sessionCookie = cookieStore.get('session')
|
|
33
|
+
|
|
34
|
+
if (!sessionCookie?.value) {
|
|
35
|
+
return null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const session = JSON.parse(sessionCookie.value) as Session
|
|
40
|
+
return session
|
|
41
|
+
} catch {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get the current authenticated user, or null.
|
|
48
|
+
*/
|
|
49
|
+
export async function getUser(): Promise<SessionUser | null> {
|
|
50
|
+
const session = await getSession()
|
|
51
|
+
return session?.user ?? null
|
|
52
|
+
}
|
|
@@ -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
|
|
@@ -11,22 +11,23 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"next": "^15.
|
|
14
|
+
"next": "^15.5.0",
|
|
15
15
|
"react": "^19.0.0",
|
|
16
16
|
"react-dom": "^19.0.0",
|
|
17
|
-
"@digilogiclabs/platform-core": "^1.
|
|
18
|
-
"@digilogiclabs/app-sdk": "^1.
|
|
19
|
-
"@digilogiclabs/saas-factory-ui": "^1.
|
|
20
|
-
"tailwindcss": "^4.
|
|
21
|
-
"
|
|
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",
|
|
22
23
|
"class-variance-authority": "^0.7.0",
|
|
23
|
-
"tailwind-merge": "^2.
|
|
24
|
+
"tailwind-merge": "^2.6.0",
|
|
24
25
|
"next-themes": "^0.4.0",
|
|
25
26
|
"lucide-react": "^0.460.0",
|
|
26
27
|
"zod": "^4.1.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"typescript": "^5.
|
|
30
|
+
"typescript": "^5.8.0",
|
|
30
31
|
"@types/node": "^22.0.0",
|
|
31
32
|
"@types/react": "^19.0.0",
|
|
32
33
|
"@types/react-dom": "^19.0.0",
|
|
@@ -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
|
+
}
|
|
@@ -1,117 +1,145 @@
|
|
|
1
|
-
import { Suspense } from 'react'
|
|
2
|
-
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
3
|
-
import { User, Settings, Activity, Home, BarChart } from 'lucide-react'
|
|
4
|
-
import { requireAuth } from '@/lib/auth-server'
|
|
5
|
-
import Link from 'next/link'
|
|
6
|
-
|
|
7
|
-
async function getStats(userId: string) {
|
|
8
|
-
await new Promise(resolve => setTimeout(resolve, 100))
|
|
9
|
-
return {
|
|
10
|
-
activeUsers: 42,
|
|
11
|
-
totalActions: 1337,
|
|
12
|
-
weeklyGrowth: '+12%',
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function StatCard({ title, value, icon: Icon }: {
|
|
17
|
-
title: string
|
|
18
|
-
value: string | number
|
|
19
|
-
icon: React.ComponentType<{ className?: string }>
|
|
20
|
-
}) {
|
|
21
|
-
return (
|
|
22
|
-
<Card className="
|
|
23
|
-
<
|
|
24
|
-
<div>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<Link href="/">
|
|
78
|
-
<
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
</
|
|
82
|
-
</Link>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
import { Suspense } from 'react'
|
|
2
|
+
import { Button, Card, CardContent } from '@digilogiclabs/saas-factory-ui'
|
|
3
|
+
import { User, Settings, Activity, Home, BarChart, Zap } from 'lucide-react'
|
|
4
|
+
import { requireAuth } from '@/lib/auth-server'
|
|
5
|
+
import Link from 'next/link'
|
|
6
|
+
|
|
7
|
+
async function getStats(userId: string) {
|
|
8
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
9
|
+
return {
|
|
10
|
+
activeUsers: 42,
|
|
11
|
+
totalActions: 1337,
|
|
12
|
+
weeklyGrowth: '+12%',
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function StatCard({ title, value, icon: Icon }: {
|
|
17
|
+
title: string
|
|
18
|
+
value: string | number
|
|
19
|
+
icon: React.ComponentType<{ className?: string }>
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<Card className="hover:shadow-md hover:-translate-y-0.5 transition-all duration-200">
|
|
23
|
+
<CardContent className="p-6">
|
|
24
|
+
<div className="flex items-center justify-between">
|
|
25
|
+
<div>
|
|
26
|
+
<p className="text-sm font-medium text-muted-foreground">{title}</p>
|
|
27
|
+
<p className="text-2xl font-bold mt-1">{value}</p>
|
|
28
|
+
</div>
|
|
29
|
+
<div className="w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center">
|
|
30
|
+
<Icon className="h-6 w-6 text-primary" />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</CardContent>
|
|
34
|
+
</Card>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function Stats({ userId }: { userId: string }) {
|
|
39
|
+
const stats = await getStats(userId)
|
|
40
|
+
return (
|
|
41
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 mb-8">
|
|
42
|
+
<StatCard title="Active Users" value={stats.activeUsers} icon={User} />
|
|
43
|
+
<StatCard title="Total Actions" value={stats.totalActions.toLocaleString()} icon={Activity} />
|
|
44
|
+
<StatCard title="Weekly Growth" value={stats.weeklyGrowth} icon={BarChart} />
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function StatsSkeleton() {
|
|
50
|
+
return (
|
|
51
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 mb-8">
|
|
52
|
+
{[1, 2, 3].map((i) => (
|
|
53
|
+
<Card key={i}>
|
|
54
|
+
<CardContent className="p-6">
|
|
55
|
+
<div className="flex items-center justify-between">
|
|
56
|
+
<div className="space-y-2">
|
|
57
|
+
<div className="h-4 w-20 rounded bg-muted animate-pulse" />
|
|
58
|
+
<div className="h-7 w-16 rounded bg-muted animate-pulse" />
|
|
59
|
+
</div>
|
|
60
|
+
<div className="w-12 h-12 rounded-xl bg-muted animate-pulse" />
|
|
61
|
+
</div>
|
|
62
|
+
</CardContent>
|
|
63
|
+
</Card>
|
|
64
|
+
))}
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default async function DashboardPage() {
|
|
70
|
+
const user = await requireAuth()
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className="min-h-screen bg-background">
|
|
74
|
+
{/* Nav */}
|
|
75
|
+
<nav className="sticky top-0 z-50 border-b border-border bg-background/80 backdrop-blur-lg">
|
|
76
|
+
<div className="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between">
|
|
77
|
+
<Link href="/" className="flex items-center gap-2 hover:opacity-80 transition-opacity">
|
|
78
|
+
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-brand-from via-brand-via to-brand-to flex items-center justify-center">
|
|
79
|
+
<Zap className="w-4 h-4 text-white" />
|
|
80
|
+
</div>
|
|
81
|
+
<span className="font-bold text-lg">Micro Saas</span>
|
|
82
|
+
</Link>
|
|
83
|
+
<Link href="/">
|
|
84
|
+
<Button variant="outline" size="sm" className="hover:bg-accent active:scale-95 transition-all duration-200 cursor-pointer">
|
|
85
|
+
<Home className="w-4 h-4 mr-2" />
|
|
86
|
+
Home
|
|
87
|
+
</Button>
|
|
88
|
+
</Link>
|
|
89
|
+
</div>
|
|
90
|
+
</nav>
|
|
91
|
+
|
|
92
|
+
<div className="max-w-6xl mx-auto px-4 sm:px-6 py-8">
|
|
93
|
+
{/* Header */}
|
|
94
|
+
<div className="mb-8">
|
|
95
|
+
<h1 className="text-3xl font-bold">Dashboard</h1>
|
|
96
|
+
<p className="text-muted-foreground mt-1">
|
|
97
|
+
Welcome back, {user.name || user.email}
|
|
98
|
+
</p>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
{/* Stats */}
|
|
102
|
+
<Suspense fallback={<StatsSkeleton />}>
|
|
103
|
+
<Stats userId={user.id} />
|
|
104
|
+
</Suspense>
|
|
105
|
+
|
|
106
|
+
{/* Quick Actions */}
|
|
107
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
|
|
108
|
+
<Card className="group hover:shadow-md hover:-translate-y-0.5 hover:border-primary/20 transition-all duration-200">
|
|
109
|
+
<CardContent className="p-6">
|
|
110
|
+
<div className="flex items-center mb-4">
|
|
111
|
+
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mr-3">
|
|
112
|
+
<User className="h-5 w-5 text-primary" />
|
|
113
|
+
</div>
|
|
114
|
+
<h3 className="text-lg font-semibold group-hover:text-primary transition-colors">Your Profile</h3>
|
|
115
|
+
</div>
|
|
116
|
+
<p className="text-muted-foreground mb-4">
|
|
117
|
+
Manage your account settings and preferences.
|
|
118
|
+
</p>
|
|
119
|
+
<Button className="w-full cursor-pointer hover:brightness-110 active:scale-[0.98] transition-all duration-200">
|
|
120
|
+
Edit Profile
|
|
121
|
+
</Button>
|
|
122
|
+
</CardContent>
|
|
123
|
+
</Card>
|
|
124
|
+
|
|
125
|
+
<Card className="group hover:shadow-md hover:-translate-y-0.5 hover:border-primary/20 transition-all duration-200">
|
|
126
|
+
<CardContent className="p-6">
|
|
127
|
+
<div className="flex items-center mb-4">
|
|
128
|
+
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mr-3">
|
|
129
|
+
<Settings className="h-5 w-5 text-primary" />
|
|
130
|
+
</div>
|
|
131
|
+
<h3 className="text-lg font-semibold group-hover:text-primary transition-colors">Settings</h3>
|
|
132
|
+
</div>
|
|
133
|
+
<p className="text-muted-foreground mb-4">
|
|
134
|
+
Configure your application preferences.
|
|
135
|
+
</p>
|
|
136
|
+
<Button variant="outline" className="w-full cursor-pointer hover:bg-accent active:scale-[0.98] transition-all duration-200">
|
|
137
|
+
Open Settings
|
|
138
|
+
</Button>
|
|
139
|
+
</CardContent>
|
|
140
|
+
</Card>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
)
|
|
145
|
+
}
|