@digilogiclabs/create-saas-app 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- 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/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +15 -8
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/dist/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/dist/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/dist/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/dist/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/dist/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/dist/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/dist/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/dist/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/dist/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/dist/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/dist/templates/shared/mock/web/.env.local +55 -0
- package/dist/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/dist/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/dist/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/dist/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/dist/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/dist/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- 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/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-session.ts +52 -0
- package/dist/templates/web/base/template/eslint.config.mjs +14 -0
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/dist/templates/web/base/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/dist/templates/web/base/template/src/app/page.tsx +97 -193
- package/dist/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/dist/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/base/template/src/components/shared/header.tsx +229 -63
- 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/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/login/page.tsx +112 -0
- 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-session.ts +52 -0
- package/dist/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- 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/products/[id]/page.tsx +218 -0
- 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-session.ts +52 -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/login/page.tsx +14 -3
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
- package/dist/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/dist/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/dist/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/dist/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/dist/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/dist/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/dist/templates/web/ui-package-test/template/package.json +19 -23
- package/dist/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/dist/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/package.json +1 -1
- package/src/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/src/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/src/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/src/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/src/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/src/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/src/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/src/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/src/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/src/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/src/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/src/templates/shared/mock/web/.env.local +55 -0
- package/src/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/src/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/src/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/src/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/src/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/src/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- 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/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-session.ts +52 -0
- package/src/templates/web/base/template/eslint.config.mjs +14 -0
- package/src/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/src/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/src/templates/web/base/template/src/app/layout.tsx +40 -38
- package/src/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/src/templates/web/base/template/src/app/page.tsx +97 -193
- package/src/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/src/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/base/template/src/components/shared/header.tsx +229 -63
- 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/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/login/page.tsx +112 -0
- 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-session.ts +52 -0
- package/src/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- 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/products/[id]/page.tsx +218 -0
- 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-session.ts +52 -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/login/page.tsx +14 -3
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
- package/src/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/src/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/src/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/src/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/src/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/src/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/src/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/src/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/src/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/src/templates/web/ui-package-test/template/package.json +19 -23
- package/src/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/src/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/src/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/dist/templates/web/base/template/.eslintrc.js +0 -8
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/base/template/src/test/setup.ts +0 -74
- package/dist/templates/web/base/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/src/templates/web/base/template/.eslintrc.js +0 -8
- package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/base/template/src/test/setup.ts +0 -74
- package/src/templates/web/base/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-only/template/vitest.config.ts +0 -17
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
# Getting Started with AI Knowledge Platform
|
|
2
|
-
|
|
3
|
-
This guide will help you set up and customize your RAG-powered AI knowledge platform in under 10 minutes.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- **Node.js 18+**: [Download here](https://nodejs.org/)
|
|
8
|
-
- **Supabase Account**: [Sign up for free](https://supabase.com/)
|
|
9
|
-
- **OpenAI API Key**: [Get your API key](https://platform.openai.com/api-keys)
|
|
10
|
-
- **Git**: For version control
|
|
11
|
-
|
|
12
|
-
## 🚀 1-Minute Quick Start
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
# Create project
|
|
16
|
-
npm create saas-app my-ai-platform --template=web-ai-rag
|
|
17
|
-
cd my-ai-platform
|
|
18
|
-
|
|
19
|
-
# Setup environment
|
|
20
|
-
cp .env.example .env.local
|
|
21
|
-
# Edit .env.local with your API keys
|
|
22
|
-
|
|
23
|
-
# Initialize RAG system
|
|
24
|
-
npm run setup:rag
|
|
25
|
-
|
|
26
|
-
# Seed with sample data
|
|
27
|
-
npm run seed:knowledge
|
|
28
|
-
|
|
29
|
-
# Start development
|
|
30
|
-
npm run dev
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
🎉 **Done!** Visit `http://localhost:3000/ai` to start chatting with your AI assistant.
|
|
34
|
-
|
|
35
|
-
## 📝 Detailed Setup
|
|
36
|
-
|
|
37
|
-
### Step 1: Environment Configuration
|
|
38
|
-
|
|
39
|
-
Create and configure your `.env.local` file:
|
|
40
|
-
|
|
41
|
-
```env
|
|
42
|
-
# Supabase Database
|
|
43
|
-
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
|
|
44
|
-
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ0eXAi...your-anon-key
|
|
45
|
-
SUPABASE_SERVICE_ROLE_KEY=eyJ0eXAi...your-service-role-key
|
|
46
|
-
|
|
47
|
-
# OpenAI API
|
|
48
|
-
OPENAI_API_KEY=sk-...your-openai-api-key
|
|
49
|
-
|
|
50
|
-
# Optional Configuration
|
|
51
|
-
NEXT_PUBLIC_APP_NAME=My AI Platform
|
|
52
|
-
NODE_ENV=development
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Getting Your Keys:**
|
|
56
|
-
|
|
57
|
-
1. **Supabase**:
|
|
58
|
-
- Create project at [supabase.com](https://supabase.com/)
|
|
59
|
-
- Go to Settings → API to find your keys
|
|
60
|
-
- Copy the URL and both keys
|
|
61
|
-
|
|
62
|
-
2. **OpenAI**:
|
|
63
|
-
- Sign up at [platform.openai.com](https://platform.openai.com/)
|
|
64
|
-
- Go to API keys section
|
|
65
|
-
- Create a new secret key
|
|
66
|
-
|
|
67
|
-
### Step 2: Database Setup
|
|
68
|
-
|
|
69
|
-
The `setup:rag` script creates all necessary database tables and functions:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm run setup:rag
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
This creates:
|
|
76
|
-
- **Knowledge base table** with vector embeddings
|
|
77
|
-
- **Search functions** for similarity and hybrid search
|
|
78
|
-
- **Analytics functions** for usage tracking
|
|
79
|
-
- **RLS policies** for security
|
|
80
|
-
- **Sample data** to test with
|
|
81
|
-
|
|
82
|
-
**Manual Setup (if script fails):**
|
|
83
|
-
```bash
|
|
84
|
-
# Connect to your Supabase project
|
|
85
|
-
supabase login
|
|
86
|
-
supabase link --project-ref your-project-ref
|
|
87
|
-
|
|
88
|
-
# Apply migrations
|
|
89
|
-
supabase db push
|
|
90
|
-
|
|
91
|
-
# Generate TypeScript types
|
|
92
|
-
npm run db:types
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Step 3: First Test
|
|
96
|
-
|
|
97
|
-
1. Start the development server:
|
|
98
|
-
```bash
|
|
99
|
-
npm run dev
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
2. Open your browser to `http://localhost:3000/ai`
|
|
103
|
-
|
|
104
|
-
3. Try asking:
|
|
105
|
-
- "How do I get started?"
|
|
106
|
-
- "What features are available?"
|
|
107
|
-
- "Help me set up my knowledge base"
|
|
108
|
-
|
|
109
|
-
You should see AI responses with source citations from your knowledge base.
|
|
110
|
-
|
|
111
|
-
## 🎯 Domain Configuration
|
|
112
|
-
|
|
113
|
-
Choose your domain focus to optimize the AI responses:
|
|
114
|
-
|
|
115
|
-
### Generic Assistant (Default)
|
|
116
|
-
```typescript
|
|
117
|
-
// No changes needed - works out of the box
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Plant Care Platform
|
|
121
|
-
```typescript
|
|
122
|
-
// lib/rag/config.ts
|
|
123
|
-
export const ragConfig = getRAGConfigForDomain('plants')
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Update your knowledge base with plant-related content:
|
|
127
|
-
```bash
|
|
128
|
-
# Replace generic samples with plant knowledge
|
|
129
|
-
npm run seed:knowledge -- --domain=plants
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### E-commerce Assistant
|
|
133
|
-
```typescript
|
|
134
|
-
// lib/rag/config.ts
|
|
135
|
-
export const ragConfig = getRAGConfigForDomain('ecommerce')
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Education Platform
|
|
139
|
-
```typescript
|
|
140
|
-
// lib/rag/config.ts
|
|
141
|
-
export const ragConfig = getRAGConfigForDomain('education')
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## 📚 Adding Your First Knowledge
|
|
145
|
-
|
|
146
|
-
### Via Web Interface
|
|
147
|
-
|
|
148
|
-
1. Go to `http://localhost:3000/ai` → Knowledge tab
|
|
149
|
-
2. Click "Add Document"
|
|
150
|
-
3. Fill in:
|
|
151
|
-
- **Title**: "Company Overview"
|
|
152
|
-
- **Category**: "general"
|
|
153
|
-
- **Content**: Your company information
|
|
154
|
-
4. Save and test by asking "Tell me about the company"
|
|
155
|
-
|
|
156
|
-
### Via API
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
curl -X POST http://localhost:3000/api/knowledge \
|
|
160
|
-
-H "Content-Type: application/json" \
|
|
161
|
-
-d '{
|
|
162
|
-
"content": "Our company was founded in 2023...",
|
|
163
|
-
"category": "company-info",
|
|
164
|
-
"fields": {
|
|
165
|
-
"title": "Company History",
|
|
166
|
-
"tags": ["company", "history"]
|
|
167
|
-
}
|
|
168
|
-
}'
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Bulk Import
|
|
172
|
-
|
|
173
|
-
```javascript
|
|
174
|
-
// scripts/import-knowledge.js
|
|
175
|
-
const documents = [
|
|
176
|
-
{
|
|
177
|
-
content: "FAQ: How to reset password...",
|
|
178
|
-
category: "faq",
|
|
179
|
-
fields: { title: "Password Reset Guide" }
|
|
180
|
-
},
|
|
181
|
-
// ... more documents
|
|
182
|
-
]
|
|
183
|
-
|
|
184
|
-
await ragSystem.bulkAddKnowledge(documents)
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Run: `node scripts/import-knowledge.js`
|
|
188
|
-
|
|
189
|
-
## 🔧 Customization Guide
|
|
190
|
-
|
|
191
|
-
### 1. Branding & Styling
|
|
192
|
-
|
|
193
|
-
Update your brand colors in `tailwind.config.js`:
|
|
194
|
-
|
|
195
|
-
```javascript
|
|
196
|
-
module.exports = {
|
|
197
|
-
theme: {
|
|
198
|
-
extend: {
|
|
199
|
-
colors: {
|
|
200
|
-
brand: {
|
|
201
|
-
50: '#eff6ff',
|
|
202
|
-
500: '#3b82f6', // Your primary color
|
|
203
|
-
900: '#1e3a8a'
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### 2. AI Personality
|
|
212
|
-
|
|
213
|
-
Customize the AI's personality in `lib/rag/config.ts`:
|
|
214
|
-
|
|
215
|
-
```typescript
|
|
216
|
-
generation: {
|
|
217
|
-
systemPrompt: `You are a helpful assistant for [Your Company].
|
|
218
|
-
Always be friendly and professional.
|
|
219
|
-
When you don't know something, admit it and offer to help find the answer.
|
|
220
|
-
Use a conversational tone and provide actionable advice.`,
|
|
221
|
-
temperature: 0.3, // Lower = more consistent, Higher = more creative
|
|
222
|
-
maxTokens: 800,
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### 3. Search Behavior
|
|
227
|
-
|
|
228
|
-
Adjust search sensitivity:
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
retrieval: {
|
|
232
|
-
topK: 8, // Number of documents to retrieve
|
|
233
|
-
confidenceThreshold: 0.75, // Minimum similarity score
|
|
234
|
-
hybridSearchWeight: {
|
|
235
|
-
vector: 0.7, // Semantic similarity weight
|
|
236
|
-
text: 0.3 // Keyword matching weight
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### 4. UI Components
|
|
242
|
-
|
|
243
|
-
Replace the default chat interface:
|
|
244
|
-
|
|
245
|
-
```typescript
|
|
246
|
-
// app/ai/page.tsx
|
|
247
|
-
import { MyCustomChatInterface } from '@/components/MyCustomChatInterface'
|
|
248
|
-
|
|
249
|
-
export default function AIPage() {
|
|
250
|
-
return (
|
|
251
|
-
<MyCustomChatInterface
|
|
252
|
-
ragSystem={ragSystem}
|
|
253
|
-
theme="dark"
|
|
254
|
-
showWelcomeMessage={true}
|
|
255
|
-
customActions={['export', 'share', 'feedback']}
|
|
256
|
-
/>
|
|
257
|
-
)
|
|
258
|
-
}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## 📊 Monitoring & Analytics
|
|
262
|
-
|
|
263
|
-
### View Built-in Analytics
|
|
264
|
-
|
|
265
|
-
Navigate to `http://localhost:3000/ai` → Analytics tab to see:
|
|
266
|
-
|
|
267
|
-
- Query volume and trends
|
|
268
|
-
- Response confidence scores
|
|
269
|
-
- Popular questions
|
|
270
|
-
- Knowledge base growth
|
|
271
|
-
- User satisfaction metrics
|
|
272
|
-
|
|
273
|
-
### Custom Analytics
|
|
274
|
-
|
|
275
|
-
```typescript
|
|
276
|
-
// Get detailed analytics data
|
|
277
|
-
const analytics = await ragSystem.getAnalytics('30d')
|
|
278
|
-
|
|
279
|
-
console.log('Analytics Overview:', {
|
|
280
|
-
totalQueries: analytics.usage.totalQueries,
|
|
281
|
-
averageResponseTime: analytics.usage.averageResponseTime,
|
|
282
|
-
topQueries: analytics.performance.popularQueries.slice(0, 5),
|
|
283
|
-
knowledgeGrowth: analytics.knowledge.documentsAdded
|
|
284
|
-
})
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Export Analytics
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
# Built-in export functionality
|
|
291
|
-
curl http://localhost:3000/api/analytics/export?timeRange=7d > analytics.json
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
## 🚀 Production Deployment
|
|
295
|
-
|
|
296
|
-
### Deploy to Vercel (Recommended)
|
|
297
|
-
|
|
298
|
-
1. **Push to GitHub**:
|
|
299
|
-
```bash
|
|
300
|
-
git add .
|
|
301
|
-
git commit -m "Initial AI platform setup"
|
|
302
|
-
git push origin main
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
2. **Connect to Vercel**:
|
|
306
|
-
- Go to [vercel.com](https://vercel.com/)
|
|
307
|
-
- Import your GitHub repository
|
|
308
|
-
- Add environment variables in Vercel dashboard
|
|
309
|
-
|
|
310
|
-
3. **Configure Environment Variables**:
|
|
311
|
-
```bash
|
|
312
|
-
vercel env add OPENAI_API_KEY production
|
|
313
|
-
vercel env add SUPABASE_SERVICE_ROLE_KEY production
|
|
314
|
-
vercel env add NEXT_PUBLIC_SUPABASE_URL production
|
|
315
|
-
vercel env add NEXT_PUBLIC_SUPABASE_ANON_KEY production
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
4. **Deploy**:
|
|
319
|
-
```bash
|
|
320
|
-
vercel --prod
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### Production Checklist
|
|
324
|
-
|
|
325
|
-
- [ ] Environment variables configured
|
|
326
|
-
- [ ] Database migrations applied to production
|
|
327
|
-
- [ ] Rate limiting enabled
|
|
328
|
-
- [ ] Analytics tracking set up
|
|
329
|
-
- [ ] Error monitoring configured
|
|
330
|
-
- [ ] Backup strategy implemented
|
|
331
|
-
- [ ] SSL certificate active
|
|
332
|
-
- [ ] Domain configured
|
|
333
|
-
|
|
334
|
-
## 🔒 Security Best Practices
|
|
335
|
-
|
|
336
|
-
### API Security
|
|
337
|
-
|
|
338
|
-
1. **Rate Limiting**: Prevent API abuse
|
|
339
|
-
```typescript
|
|
340
|
-
// middleware.ts
|
|
341
|
-
export async function middleware(request: NextRequest) {
|
|
342
|
-
const rateLimiter = new RateLimiter({
|
|
343
|
-
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
344
|
-
max: 100 // requests per window
|
|
345
|
-
})
|
|
346
|
-
|
|
347
|
-
return rateLimiter.check(request)
|
|
348
|
-
}
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
2. **Input Validation**: Sanitize user inputs
|
|
352
|
-
```typescript
|
|
353
|
-
import { z } from 'zod'
|
|
354
|
-
|
|
355
|
-
const querySchema = z.object({
|
|
356
|
-
query: z.string().min(1).max(500),
|
|
357
|
-
category: z.string().optional()
|
|
358
|
-
})
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
3. **Database Security**: Enable RLS policies
|
|
362
|
-
```sql
|
|
363
|
-
-- Already included in setup script
|
|
364
|
-
ALTER TABLE rag_knowledge_base ENABLE ROW LEVEL SECURITY;
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Data Privacy
|
|
368
|
-
|
|
369
|
-
- **Audit Logging**: Track all knowledge operations
|
|
370
|
-
- **Data Retention**: Implement data cleanup policies
|
|
371
|
-
- **User Consent**: Add privacy controls for user data
|
|
372
|
-
- **Encryption**: Use HTTPS and encrypt sensitive data
|
|
373
|
-
|
|
374
|
-
## 🛠️ Troubleshooting
|
|
375
|
-
|
|
376
|
-
### Common Issues
|
|
377
|
-
|
|
378
|
-
**1. "RAG system not initialized" error**
|
|
379
|
-
```bash
|
|
380
|
-
# Check environment variables
|
|
381
|
-
cat .env.local | grep -E "(SUPABASE|OPENAI)"
|
|
382
|
-
|
|
383
|
-
# Re-run setup
|
|
384
|
-
npm run setup:rag
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
**2. Empty search results**
|
|
388
|
-
```bash
|
|
389
|
-
# Check if knowledge base has data
|
|
390
|
-
npm run seed:knowledge
|
|
391
|
-
|
|
392
|
-
# Verify embeddings are generated
|
|
393
|
-
# Check Supabase dashboard → rag_knowledge_base table
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
**3. Slow response times**
|
|
397
|
-
```typescript
|
|
398
|
-
// Adjust configuration for better performance
|
|
399
|
-
const ragConfig = {
|
|
400
|
-
retrieval: {
|
|
401
|
-
topK: 5, // Reduce from default 8
|
|
402
|
-
confidenceThreshold: 0.8 // Increase for more precise results
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
**4. Build errors**
|
|
408
|
-
```bash
|
|
409
|
-
# Clear Next.js cache
|
|
410
|
-
rm -rf .next
|
|
411
|
-
|
|
412
|
-
# Reinstall dependencies
|
|
413
|
-
rm -rf node_modules package-lock.json
|
|
414
|
-
npm install
|
|
415
|
-
|
|
416
|
-
# Regenerate types
|
|
417
|
-
npm run db:types
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
### Getting Help
|
|
421
|
-
|
|
422
|
-
1. **Check the logs**:
|
|
423
|
-
- Browser console for client errors
|
|
424
|
-
- Terminal for server errors
|
|
425
|
-
- Supabase logs for database issues
|
|
426
|
-
|
|
427
|
-
2. **Debug mode**:
|
|
428
|
-
```env
|
|
429
|
-
# .env.local
|
|
430
|
-
NODE_ENV=development
|
|
431
|
-
DEBUG=rag:*
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
3. **Community support**:
|
|
435
|
-
- GitHub Issues
|
|
436
|
-
- Discord community
|
|
437
|
-
- Stack Overflow with `rag-system` tag
|
|
438
|
-
|
|
439
|
-
## 🎯 Next Steps
|
|
440
|
-
|
|
441
|
-
Now that your AI knowledge platform is running:
|
|
442
|
-
|
|
443
|
-
1. **Add Your Content**: Import your existing documentation, FAQs, and knowledge
|
|
444
|
-
2. **Customize the UI**: Match your brand and user experience needs
|
|
445
|
-
3. **Monitor Usage**: Use built-in analytics to understand user behavior
|
|
446
|
-
4. **Optimize Performance**: Tune RAG parameters based on your content
|
|
447
|
-
5. **Scale Up**: Consider production deployment and advanced features
|
|
448
|
-
|
|
449
|
-
### Advanced Features to Explore
|
|
450
|
-
|
|
451
|
-
- **Multi-language Support**: Configure for international users
|
|
452
|
-
- **Knowledge Versioning**: Track changes and maintain history
|
|
453
|
-
- **Advanced Analytics**: Implement custom tracking and insights
|
|
454
|
-
- **API Integration**: Connect with existing systems
|
|
455
|
-
- **Mobile App**: Deploy the companion React Native app
|
|
456
|
-
|
|
457
|
-
Happy building! 🚀
|