@digilogiclabs/create-saas-app 2.9.0 → 2.10.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/dist/.tsbuildinfo +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/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/page.tsx +249 -155
- package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/dashboard/page.tsx +224 -224
- 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/page.tsx +266 -189
- package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- 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/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/page.tsx +370 -169
- package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- 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/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 +101 -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 +122 -108
- package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +20 -26
- 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/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/page.tsx +249 -155
- package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/dashboard/page.tsx +224 -224
- 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/page.tsx +266 -189
- package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- 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/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/page.tsx +370 -169
- package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- 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/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 +101 -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 +122 -108
- package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +5 -2
- 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/src/components/providers/app-providers.tsx +20 -26
- 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,147 +1,147 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react'
|
|
4
|
-
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
-
import { Trash2, Plus, Minus, ShoppingBag, ArrowRight } from 'lucide-react'
|
|
6
|
-
import Link from 'next/link'
|
|
7
|
-
|
|
8
|
-
interface CartItem {
|
|
9
|
-
id: number
|
|
10
|
-
name: string
|
|
11
|
-
price: number
|
|
12
|
-
vendor: string
|
|
13
|
-
quantity: number
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const INITIAL_CART: CartItem[] = [
|
|
17
|
-
{ id: 1, name: 'Premium Widget Pro', price: 49.99, vendor: 'TechCo', quantity: 1 },
|
|
18
|
-
{ id: 2, name: 'Developer Toolkit', price: 129.99, vendor: 'DevTools', quantity: 1 },
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
export default function CartPage() {
|
|
22
|
-
const [cartItems, setCartItems] = useState<CartItem[]>(INITIAL_CART)
|
|
23
|
-
|
|
24
|
-
const updateQuantity = (id: number, delta: number) => {
|
|
25
|
-
setCartItems(items =>
|
|
26
|
-
items.map(item =>
|
|
27
|
-
item.id === id
|
|
28
|
-
? { ...item, quantity: Math.max(1, item.quantity + delta) }
|
|
29
|
-
: item
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const removeItem = (id: number) => {
|
|
35
|
-
setCartItems(items => items.filter(item => item.id !== id))
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const subtotal = cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0)
|
|
39
|
-
const platformFee = subtotal * 0.05
|
|
40
|
-
const total = subtotal + platformFee
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="min-h-screen bg-
|
|
44
|
-
<div className="max-w-4xl mx-auto px-4 py-8">
|
|
45
|
-
<div className="flex items-center justify-between mb-8">
|
|
46
|
-
<h1 className="text-3xl font-bold text-
|
|
47
|
-
<Link href="/products">
|
|
48
|
-
<Button variant="outline" size="sm">Continue Shopping</Button>
|
|
49
|
-
</Link>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
{cartItems.length === 0 ? (
|
|
53
|
-
<Card className="p-12 text-center">
|
|
54
|
-
<ShoppingBag className="w-16 h-16 mx-auto mb-4 text-
|
|
55
|
-
<h2 className="text-xl font-semibold text-
|
|
56
|
-
Your cart is empty
|
|
57
|
-
</h2>
|
|
58
|
-
<p className="text-
|
|
59
|
-
Browse our products and add items to your cart.
|
|
60
|
-
</p>
|
|
61
|
-
<Link href="/products">
|
|
62
|
-
<Button>Browse Products</Button>
|
|
63
|
-
</Link>
|
|
64
|
-
</Card>
|
|
65
|
-
) : (
|
|
66
|
-
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
67
|
-
{/* Cart Items */}
|
|
68
|
-
<div className="lg:col-span-2 space-y-4">
|
|
69
|
-
{cartItems.map((item) => (
|
|
70
|
-
<Card key={item.id} className="p-4">
|
|
71
|
-
<div className="flex items-center gap-4">
|
|
72
|
-
<div className="w-20 h-20 bg-
|
|
73
|
-
<div className="flex-1">
|
|
74
|
-
<h3 className="font-semibold text-
|
|
75
|
-
<p className="text-sm text-
|
|
76
|
-
<p className="text-lg font-bold text-
|
|
77
|
-
</div>
|
|
78
|
-
<div className="flex items-center gap-2">
|
|
79
|
-
<Button
|
|
80
|
-
variant="outline"
|
|
81
|
-
size="sm"
|
|
82
|
-
onClick={() => updateQuantity(item.id, -1)}
|
|
83
|
-
>
|
|
84
|
-
<Minus className="w-4 h-4" />
|
|
85
|
-
</Button>
|
|
86
|
-
<span className="w-8 text-center">{item.quantity}</span>
|
|
87
|
-
<Button
|
|
88
|
-
variant="outline"
|
|
89
|
-
size="sm"
|
|
90
|
-
onClick={() => updateQuantity(item.id, 1)}
|
|
91
|
-
>
|
|
92
|
-
<Plus className="w-4 h-4" />
|
|
93
|
-
</Button>
|
|
94
|
-
</div>
|
|
95
|
-
<Button
|
|
96
|
-
variant="ghost"
|
|
97
|
-
size="sm"
|
|
98
|
-
onClick={() => removeItem(item.id)}
|
|
99
|
-
className="text-
|
|
100
|
-
>
|
|
101
|
-
<Trash2 className="w-4 h-4" />
|
|
102
|
-
</Button>
|
|
103
|
-
</div>
|
|
104
|
-
</Card>
|
|
105
|
-
))}
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
{/* Order Summary */}
|
|
109
|
-
<div className="lg:col-span-1">
|
|
110
|
-
<Card className="p-6 sticky top-24">
|
|
111
|
-
<h2 className="text-lg font-semibold text-
|
|
112
|
-
Order Summary
|
|
113
|
-
</h2>
|
|
114
|
-
|
|
115
|
-
<div className="space-y-3 mb-6">
|
|
116
|
-
<div className="flex justify-between text-
|
|
117
|
-
<span>Subtotal</span>
|
|
118
|
-
<span>${subtotal.toFixed(2)}</span>
|
|
119
|
-
</div>
|
|
120
|
-
<div className="flex justify-between text-
|
|
121
|
-
<span>Platform Fee (5%)</span>
|
|
122
|
-
<span>${platformFee.toFixed(2)}</span>
|
|
123
|
-
</div>
|
|
124
|
-
<div className="border-t border-
|
|
125
|
-
<div className="flex justify-between font-bold text-
|
|
126
|
-
<span>Total</span>
|
|
127
|
-
<span>${total.toFixed(2)}</span>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<Button className="w-full" size="lg">
|
|
133
|
-
Checkout
|
|
134
|
-
<ArrowRight className="w-4 h-4 ml-2" />
|
|
135
|
-
</Button>
|
|
136
|
-
|
|
137
|
-
<p className="text-xs text-
|
|
138
|
-
Secure checkout powered by Stripe
|
|
139
|
-
</p>
|
|
140
|
-
</Card>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
)}
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { Trash2, Plus, Minus, ShoppingBag, ArrowRight } from 'lucide-react'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
interface CartItem {
|
|
9
|
+
id: number
|
|
10
|
+
name: string
|
|
11
|
+
price: number
|
|
12
|
+
vendor: string
|
|
13
|
+
quantity: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const INITIAL_CART: CartItem[] = [
|
|
17
|
+
{ id: 1, name: 'Premium Widget Pro', price: 49.99, vendor: 'TechCo', quantity: 1 },
|
|
18
|
+
{ id: 2, name: 'Developer Toolkit', price: 129.99, vendor: 'DevTools', quantity: 1 },
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
export default function CartPage() {
|
|
22
|
+
const [cartItems, setCartItems] = useState<CartItem[]>(INITIAL_CART)
|
|
23
|
+
|
|
24
|
+
const updateQuantity = (id: number, delta: number) => {
|
|
25
|
+
setCartItems(items =>
|
|
26
|
+
items.map(item =>
|
|
27
|
+
item.id === id
|
|
28
|
+
? { ...item, quantity: Math.max(1, item.quantity + delta) }
|
|
29
|
+
: item
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const removeItem = (id: number) => {
|
|
35
|
+
setCartItems(items => items.filter(item => item.id !== id))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const subtotal = cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0)
|
|
39
|
+
const platformFee = subtotal * 0.05
|
|
40
|
+
const total = subtotal + platformFee
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="min-h-screen bg-background">
|
|
44
|
+
<div className="max-w-4xl mx-auto px-4 py-8">
|
|
45
|
+
<div className="flex items-center justify-between mb-8">
|
|
46
|
+
<h1 className="text-3xl font-bold text-foreground">Shopping Cart</h1>
|
|
47
|
+
<Link href="/products">
|
|
48
|
+
<Button variant="outline" size="sm">Continue Shopping</Button>
|
|
49
|
+
</Link>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
{cartItems.length === 0 ? (
|
|
53
|
+
<Card className="p-12 text-center">
|
|
54
|
+
<ShoppingBag className="w-16 h-16 mx-auto mb-4 text-muted-foreground" />
|
|
55
|
+
<h2 className="text-xl font-semibold text-foreground mb-2">
|
|
56
|
+
Your cart is empty
|
|
57
|
+
</h2>
|
|
58
|
+
<p className="text-muted-foreground mb-6">
|
|
59
|
+
Browse our products and add items to your cart.
|
|
60
|
+
</p>
|
|
61
|
+
<Link href="/products">
|
|
62
|
+
<Button>Browse Products</Button>
|
|
63
|
+
</Link>
|
|
64
|
+
</Card>
|
|
65
|
+
) : (
|
|
66
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
67
|
+
{/* Cart Items */}
|
|
68
|
+
<div className="lg:col-span-2 space-y-4">
|
|
69
|
+
{cartItems.map((item) => (
|
|
70
|
+
<Card key={item.id} className="p-4">
|
|
71
|
+
<div className="flex items-center gap-4">
|
|
72
|
+
<div className="w-20 h-20 bg-muted rounded-lg flex-shrink-0" />
|
|
73
|
+
<div className="flex-1">
|
|
74
|
+
<h3 className="font-semibold text-foreground">{item.name}</h3>
|
|
75
|
+
<p className="text-sm text-muted-foreground">by {item.vendor}</p>
|
|
76
|
+
<p className="text-lg font-bold text-primary mt-1">${item.price}</p>
|
|
77
|
+
</div>
|
|
78
|
+
<div className="flex items-center gap-2">
|
|
79
|
+
<Button
|
|
80
|
+
variant="outline"
|
|
81
|
+
size="sm"
|
|
82
|
+
onClick={() => updateQuantity(item.id, -1)}
|
|
83
|
+
>
|
|
84
|
+
<Minus className="w-4 h-4" />
|
|
85
|
+
</Button>
|
|
86
|
+
<span className="w-8 text-center">{item.quantity}</span>
|
|
87
|
+
<Button
|
|
88
|
+
variant="outline"
|
|
89
|
+
size="sm"
|
|
90
|
+
onClick={() => updateQuantity(item.id, 1)}
|
|
91
|
+
>
|
|
92
|
+
<Plus className="w-4 h-4" />
|
|
93
|
+
</Button>
|
|
94
|
+
</div>
|
|
95
|
+
<Button
|
|
96
|
+
variant="ghost"
|
|
97
|
+
size="sm"
|
|
98
|
+
onClick={() => removeItem(item.id)}
|
|
99
|
+
className="text-destructive hover:text-destructive/80"
|
|
100
|
+
>
|
|
101
|
+
<Trash2 className="w-4 h-4" />
|
|
102
|
+
</Button>
|
|
103
|
+
</div>
|
|
104
|
+
</Card>
|
|
105
|
+
))}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{/* Order Summary */}
|
|
109
|
+
<div className="lg:col-span-1">
|
|
110
|
+
<Card className="p-6 sticky top-24">
|
|
111
|
+
<h2 className="text-lg font-semibold text-foreground mb-4">
|
|
112
|
+
Order Summary
|
|
113
|
+
</h2>
|
|
114
|
+
|
|
115
|
+
<div className="space-y-3 mb-6">
|
|
116
|
+
<div className="flex justify-between text-muted-foreground">
|
|
117
|
+
<span>Subtotal</span>
|
|
118
|
+
<span>${subtotal.toFixed(2)}</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div className="flex justify-between text-muted-foreground">
|
|
121
|
+
<span>Platform Fee (5%)</span>
|
|
122
|
+
<span>${platformFee.toFixed(2)}</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="border-t border-border pt-3">
|
|
125
|
+
<div className="flex justify-between font-bold text-foreground">
|
|
126
|
+
<span>Total</span>
|
|
127
|
+
<span>${total.toFixed(2)}</span>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<Button className="w-full" size="lg">
|
|
133
|
+
Checkout
|
|
134
|
+
<ArrowRight className="w-4 h-4 ml-2" />
|
|
135
|
+
</Button>
|
|
136
|
+
|
|
137
|
+
<p className="text-xs text-muted-foreground text-center mt-4">
|
|
138
|
+
Secure checkout powered by Stripe
|
|
139
|
+
</p>
|
|
140
|
+
</Card>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import { Suspense } from 'react'
|
|
2
|
-
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
3
|
-
import { Package, DollarSign, ShoppingBag, TrendingUp, Plus } from 'lucide-react'
|
|
4
|
-
import { requireAuth } from '@/lib/auth-server'
|
|
5
|
-
import Link from 'next/link'
|
|
6
|
-
|
|
7
|
-
async function getSellerStats(userId: string) {
|
|
8
|
-
await new Promise(resolve => setTimeout(resolve, 100))
|
|
9
|
-
return {
|
|
10
|
-
totalProducts: 12,
|
|
11
|
-
totalSales: 45,
|
|
12
|
-
revenue: 2340.50,
|
|
13
|
-
views: 1520,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function StatCard({ title, value, icon: Icon, trend }: {
|
|
18
|
-
title: string
|
|
19
|
-
value: string | number
|
|
20
|
-
icon: React.ComponentType<{ className?: string }>
|
|
21
|
-
trend?: string
|
|
22
|
-
}) {
|
|
23
|
-
return (
|
|
24
|
-
<Card className="p-6">
|
|
25
|
-
<div className="flex items-center justify-between">
|
|
26
|
-
<div>
|
|
27
|
-
<p className="text-sm font-medium text-
|
|
28
|
-
<p className="text-2xl font-bold text-
|
|
29
|
-
{trend && <p className="text-sm text-green-600 mt-1">{trend}</p>}
|
|
30
|
-
</div>
|
|
31
|
-
<div className="w-12 h-12 bg-
|
|
32
|
-
<Icon className="h-6 w-6 text-
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</Card>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async function SellerStats({ userId }: { userId: string }) {
|
|
40
|
-
const stats = await getSellerStats(userId)
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
44
|
-
<StatCard title="Total Products" value={stats.totalProducts} icon={Package} />
|
|
45
|
-
<StatCard title="Total Sales" value={stats.totalSales} icon={ShoppingBag} trend="+12% this week" />
|
|
46
|
-
<StatCard title="Revenue" value={`$${stats.revenue.toFixed(2)}`} icon={DollarSign} trend="+8% this month" />
|
|
47
|
-
<StatCard title="Product Views" value={stats.views.toLocaleString()} icon={TrendingUp} />
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function StatsSkeleton() {
|
|
53
|
-
return (
|
|
54
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
55
|
-
{[...Array(4)].map((_, i) => (
|
|
56
|
-
<Card key={i} className="p-6">
|
|
57
|
-
<div className="animate-pulse">
|
|
58
|
-
<div className="h-4 bg-
|
|
59
|
-
<div className="h-8 bg-
|
|
60
|
-
</div>
|
|
61
|
-
</Card>
|
|
62
|
-
))}
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default async function DashboardPage() {
|
|
68
|
-
const user = await requireAuth()
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<div className="min-h-screen bg-
|
|
72
|
-
<div className="max-w-7xl mx-auto px-4 py-8">
|
|
73
|
-
{/* Header */}
|
|
74
|
-
<div className="flex items-center justify-between mb-8">
|
|
75
|
-
<div>
|
|
76
|
-
<h1 className="text-3xl font-bold text-
|
|
77
|
-
Seller Dashboard
|
|
78
|
-
</h1>
|
|
79
|
-
<p className="text-
|
|
80
|
-
Welcome back, {user.name || user.email}
|
|
81
|
-
</p>
|
|
82
|
-
</div>
|
|
83
|
-
<Link href="/products/new">
|
|
84
|
-
<Button>
|
|
85
|
-
<Plus className="w-4 h-4 mr-2" />
|
|
86
|
-
Add Product
|
|
87
|
-
</Button>
|
|
88
|
-
</Link>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
{/* Stats */}
|
|
92
|
-
<Suspense fallback={<StatsSkeleton />}>
|
|
93
|
-
<SellerStats userId={user.id} />
|
|
94
|
-
</Suspense>
|
|
95
|
-
|
|
96
|
-
{/* Quick Actions */}
|
|
97
|
-
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
|
|
98
|
-
<Card className="p-6">
|
|
99
|
-
<div className="flex items-center mb-4">
|
|
100
|
-
<Package className="h-6 w-6 text-
|
|
101
|
-
<h3 className="text-lg font-semibold">My Products</h3>
|
|
102
|
-
</div>
|
|
103
|
-
<p className="text-
|
|
104
|
-
Manage your product listings and inventory.
|
|
105
|
-
</p>
|
|
106
|
-
<Link href="/products/manage">
|
|
107
|
-
<Button className="w-full">View Products</Button>
|
|
108
|
-
</Link>
|
|
109
|
-
</Card>
|
|
110
|
-
|
|
111
|
-
<Card className="p-6">
|
|
112
|
-
<div className="flex items-center mb-4">
|
|
113
|
-
<ShoppingBag className="h-6 w-6 text-
|
|
114
|
-
<h3 className="text-lg font-semibold">Orders</h3>
|
|
115
|
-
</div>
|
|
116
|
-
<p className="text-
|
|
117
|
-
View and manage customer orders.
|
|
118
|
-
</p>
|
|
119
|
-
<Link href="/orders">
|
|
120
|
-
<Button variant="outline" className="w-full">View Orders</Button>
|
|
121
|
-
</Link>
|
|
122
|
-
</Card>
|
|
123
|
-
|
|
124
|
-
<Card className="p-6">
|
|
125
|
-
<div className="flex items-center mb-4">
|
|
126
|
-
<DollarSign className="h-6 w-6 text-
|
|
127
|
-
<h3 className="text-lg font-semibold">Payouts</h3>
|
|
128
|
-
</div>
|
|
129
|
-
<p className="text-
|
|
130
|
-
View earnings and payout history.
|
|
131
|
-
</p>
|
|
132
|
-
<Link href="/payouts">
|
|
133
|
-
<Button variant="outline" className="w-full">View Payouts</Button>
|
|
134
|
-
</Link>
|
|
135
|
-
</Card>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
{/* Recent Orders */}
|
|
139
|
-
<Card className="p-6">
|
|
140
|
-
<h3 className="text-lg font-semibold mb-4">Recent Orders</h3>
|
|
141
|
-
<div className="text-center py-8 text-
|
|
142
|
-
<ShoppingBag className="w-12 h-12 mx-auto mb-4 opacity-50" />
|
|
143
|
-
<p>No orders yet. Share your products to start selling!</p>
|
|
144
|
-
</div>
|
|
145
|
-
</Card>
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
)
|
|
149
|
-
}
|
|
1
|
+
import { Suspense } from 'react'
|
|
2
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
3
|
+
import { Package, DollarSign, ShoppingBag, TrendingUp, Plus } from 'lucide-react'
|
|
4
|
+
import { requireAuth } from '@/lib/auth-server'
|
|
5
|
+
import Link from 'next/link'
|
|
6
|
+
|
|
7
|
+
async function getSellerStats(userId: string) {
|
|
8
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
9
|
+
return {
|
|
10
|
+
totalProducts: 12,
|
|
11
|
+
totalSales: 45,
|
|
12
|
+
revenue: 2340.50,
|
|
13
|
+
views: 1520,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function StatCard({ title, value, icon: Icon, trend }: {
|
|
18
|
+
title: string
|
|
19
|
+
value: string | number
|
|
20
|
+
icon: React.ComponentType<{ className?: string }>
|
|
21
|
+
trend?: string
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<Card className="p-6">
|
|
25
|
+
<div className="flex items-center justify-between">
|
|
26
|
+
<div>
|
|
27
|
+
<p className="text-sm font-medium text-muted-foreground">{title}</p>
|
|
28
|
+
<p className="text-2xl font-bold text-foreground">{value}</p>
|
|
29
|
+
{trend && <p className="text-sm text-green-600 mt-1">{trend}</p>}
|
|
30
|
+
</div>
|
|
31
|
+
<div className="w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center">
|
|
32
|
+
<Icon className="h-6 w-6 text-primary" />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</Card>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function SellerStats({ userId }: { userId: string }) {
|
|
40
|
+
const stats = await getSellerStats(userId)
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
44
|
+
<StatCard title="Total Products" value={stats.totalProducts} icon={Package} />
|
|
45
|
+
<StatCard title="Total Sales" value={stats.totalSales} icon={ShoppingBag} trend="+12% this week" />
|
|
46
|
+
<StatCard title="Revenue" value={`$${stats.revenue.toFixed(2)}`} icon={DollarSign} trend="+8% this month" />
|
|
47
|
+
<StatCard title="Product Views" value={stats.views.toLocaleString()} icon={TrendingUp} />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function StatsSkeleton() {
|
|
53
|
+
return (
|
|
54
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
55
|
+
{[...Array(4)].map((_, i) => (
|
|
56
|
+
<Card key={i} className="p-6">
|
|
57
|
+
<div className="animate-pulse">
|
|
58
|
+
<div className="h-4 bg-muted rounded w-1/2 mb-2"></div>
|
|
59
|
+
<div className="h-8 bg-muted rounded w-1/3"></div>
|
|
60
|
+
</div>
|
|
61
|
+
</Card>
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default async function DashboardPage() {
|
|
68
|
+
const user = await requireAuth()
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div className="min-h-screen bg-background">
|
|
72
|
+
<div className="max-w-7xl mx-auto px-4 py-8">
|
|
73
|
+
{/* Header */}
|
|
74
|
+
<div className="flex items-center justify-between mb-8">
|
|
75
|
+
<div>
|
|
76
|
+
<h1 className="text-3xl font-bold text-foreground">
|
|
77
|
+
Seller Dashboard
|
|
78
|
+
</h1>
|
|
79
|
+
<p className="text-muted-foreground mt-1">
|
|
80
|
+
Welcome back, {user.name || user.email}
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
<Link href="/products/new">
|
|
84
|
+
<Button>
|
|
85
|
+
<Plus className="w-4 h-4 mr-2" />
|
|
86
|
+
Add Product
|
|
87
|
+
</Button>
|
|
88
|
+
</Link>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
{/* Stats */}
|
|
92
|
+
<Suspense fallback={<StatsSkeleton />}>
|
|
93
|
+
<SellerStats userId={user.id} />
|
|
94
|
+
</Suspense>
|
|
95
|
+
|
|
96
|
+
{/* Quick Actions */}
|
|
97
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
|
|
98
|
+
<Card className="p-6">
|
|
99
|
+
<div className="flex items-center mb-4">
|
|
100
|
+
<Package className="h-6 w-6 text-primary mr-3" />
|
|
101
|
+
<h3 className="text-lg font-semibold">My Products</h3>
|
|
102
|
+
</div>
|
|
103
|
+
<p className="text-muted-foreground mb-4">
|
|
104
|
+
Manage your product listings and inventory.
|
|
105
|
+
</p>
|
|
106
|
+
<Link href="/products/manage">
|
|
107
|
+
<Button className="w-full">View Products</Button>
|
|
108
|
+
</Link>
|
|
109
|
+
</Card>
|
|
110
|
+
|
|
111
|
+
<Card className="p-6">
|
|
112
|
+
<div className="flex items-center mb-4">
|
|
113
|
+
<ShoppingBag className="h-6 w-6 text-primary mr-3" />
|
|
114
|
+
<h3 className="text-lg font-semibold">Orders</h3>
|
|
115
|
+
</div>
|
|
116
|
+
<p className="text-muted-foreground mb-4">
|
|
117
|
+
View and manage customer orders.
|
|
118
|
+
</p>
|
|
119
|
+
<Link href="/orders">
|
|
120
|
+
<Button variant="outline" className="w-full">View Orders</Button>
|
|
121
|
+
</Link>
|
|
122
|
+
</Card>
|
|
123
|
+
|
|
124
|
+
<Card className="p-6">
|
|
125
|
+
<div className="flex items-center mb-4">
|
|
126
|
+
<DollarSign className="h-6 w-6 text-primary mr-3" />
|
|
127
|
+
<h3 className="text-lg font-semibold">Payouts</h3>
|
|
128
|
+
</div>
|
|
129
|
+
<p className="text-muted-foreground mb-4">
|
|
130
|
+
View earnings and payout history.
|
|
131
|
+
</p>
|
|
132
|
+
<Link href="/payouts">
|
|
133
|
+
<Button variant="outline" className="w-full">View Payouts</Button>
|
|
134
|
+
</Link>
|
|
135
|
+
</Card>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{/* Recent Orders */}
|
|
139
|
+
<Card className="p-6">
|
|
140
|
+
<h3 className="text-lg font-semibold mb-4">Recent Orders</h3>
|
|
141
|
+
<div className="text-center py-8 text-muted-foreground">
|
|
142
|
+
<ShoppingBag className="w-12 h-12 mx-auto mb-4 opacity-50" />
|
|
143
|
+
<p>No orders yet. Share your products to start selling!</p>
|
|
144
|
+
</div>
|
|
145
|
+
</Card>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
@@ -16,27 +16,27 @@ export default function Error({ error, reset }: ErrorProps) {
|
|
|
16
16
|
}, [error])
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<div className="min-h-screen bg-
|
|
19
|
+
<div className="min-h-screen bg-background flex items-center justify-center p-4">
|
|
20
20
|
<Card className="p-8 max-w-lg w-full">
|
|
21
21
|
<div className="flex flex-col items-center space-y-6 text-center">
|
|
22
|
-
<div className="w-16 h-16 bg-
|
|
23
|
-
<AlertTriangle className="w-8 h-8 text-
|
|
22
|
+
<div className="w-16 h-16 bg-destructive/10 rounded-full flex items-center justify-center">
|
|
23
|
+
<AlertTriangle className="w-8 h-8 text-destructive" />
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div>
|
|
27
|
-
<h1 className="text-2xl font-bold text-
|
|
27
|
+
<h1 className="text-2xl font-bold text-foreground mb-2">
|
|
28
28
|
Something went wrong!
|
|
29
29
|
</h1>
|
|
30
|
-
<p className="text-
|
|
30
|
+
<p className="text-muted-foreground mb-4">
|
|
31
31
|
We encountered an unexpected error. This has been logged and our team will look into it.
|
|
32
32
|
</p>
|
|
33
33
|
|
|
34
34
|
{process.env.NODE_ENV === 'development' && (
|
|
35
35
|
<details className="mt-4 text-left">
|
|
36
|
-
<summary className="cursor-pointer text-sm text-
|
|
36
|
+
<summary className="cursor-pointer text-sm text-muted-foreground hover:text-foreground">
|
|
37
37
|
Error details (development only)
|
|
38
38
|
</summary>
|
|
39
|
-
<div className="mt-2 p-3 bg-
|
|
39
|
+
<div className="mt-2 p-3 bg-muted rounded text-xs font-mono text-muted-foreground overflow-auto max-h-40">
|
|
40
40
|
<div className="mb-2">
|
|
41
41
|
<strong>Message:</strong> {error.message}
|
|
42
42
|
</div>
|