@digilogiclabs/create-saas-app 1.0.1
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 +42 -0
- package/README.md +891 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/cli/commands/add.d.ts +6 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +39 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/create.d.ts +35 -0
- package/dist/cli/commands/create.d.ts.map +1 -0
- package/dist/cli/commands/create.js +165 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +20 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +68 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +61 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/prompts/index.d.ts +2 -0
- package/dist/cli/prompts/index.d.ts.map +1 -0
- package/dist/cli/prompts/index.js +18 -0
- package/dist/cli/prompts/index.js.map +1 -0
- package/dist/cli/prompts/project-setup.d.ts +5 -0
- package/dist/cli/prompts/project-setup.d.ts.map +1 -0
- package/dist/cli/prompts/project-setup.js +288 -0
- package/dist/cli/prompts/project-setup.js.map +1 -0
- package/dist/cli/utils/git.d.ts +9 -0
- package/dist/cli/utils/git.d.ts.map +1 -0
- package/dist/cli/utils/git.js +77 -0
- package/dist/cli/utils/git.js.map +1 -0
- package/dist/cli/utils/index.d.ts +5 -0
- package/dist/cli/utils/index.d.ts.map +1 -0
- package/dist/cli/utils/index.js +21 -0
- package/dist/cli/utils/index.js.map +1 -0
- package/dist/cli/utils/logger.d.ts +16 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +55 -0
- package/dist/cli/utils/logger.js.map +1 -0
- package/dist/cli/utils/package-manager.d.ts +8 -0
- package/dist/cli/utils/package-manager.d.ts.map +1 -0
- package/dist/cli/utils/package-manager.js +92 -0
- package/dist/cli/utils/package-manager.js.map +1 -0
- package/dist/cli/utils/spinner.d.ts +7 -0
- package/dist/cli/utils/spinner.d.ts.map +1 -0
- package/dist/cli/utils/spinner.js +48 -0
- package/dist/cli/utils/spinner.js.map +1 -0
- package/dist/cli/validators/dependencies.d.ts +15 -0
- package/dist/cli/validators/dependencies.d.ts.map +1 -0
- package/dist/cli/validators/dependencies.js +108 -0
- package/dist/cli/validators/dependencies.js.map +1 -0
- package/dist/cli/validators/index.d.ts +3 -0
- package/dist/cli/validators/index.d.ts.map +1 -0
- package/dist/cli/validators/index.js +19 -0
- package/dist/cli/validators/index.js.map +1 -0
- package/dist/cli/validators/project-name.d.ts +5 -0
- package/dist/cli/validators/project-name.d.ts.map +1 -0
- package/dist/cli/validators/project-name.js +151 -0
- package/dist/cli/validators/project-name.js.map +1 -0
- package/dist/generators/file-processor.d.ts +28 -0
- package/dist/generators/file-processor.d.ts.map +1 -0
- package/dist/generators/file-processor.js +224 -0
- package/dist/generators/file-processor.js.map +1 -0
- package/dist/generators/index.d.ts +4 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +20 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/package-installer.d.ts +29 -0
- package/dist/generators/package-installer.d.ts.map +1 -0
- package/dist/generators/package-installer.js +177 -0
- package/dist/generators/package-installer.js.map +1 -0
- package/dist/generators/template-generator.d.ts +61 -0
- package/dist/generators/template-generator.d.ts.map +1 -0
- package/dist/generators/template-generator.js +457 -0
- package/dist/generators/template-generator.js.map +1 -0
- package/dist/templates/mobile/base/template/.env.example +15 -0
- package/dist/templates/mobile/base/template/App.tsx +186 -0
- package/dist/templates/mobile/base/template/app/(auth)/login.tsx +44 -0
- package/dist/templates/mobile/base/template/app/(auth)/signup.tsx +43 -0
- package/dist/templates/mobile/base/template/app/checkout.tsx +20 -0
- package/dist/templates/mobile/base/template/app.json +44 -0
- package/dist/templates/mobile/base/template/babel.config.js +6 -0
- package/dist/templates/mobile/base/template/eas.json +19 -0
- package/dist/templates/mobile/base/template/package.json +54 -0
- package/dist/templates/mobile/ui-auth-payments/template/.env.example +20 -0
- package/dist/templates/mobile/ui-auth-payments/template/README.md +218 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +757 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +134 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
- package/dist/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
- package/dist/templates/mobile/ui-auth-payments/template/app.json +94 -0
- package/dist/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
- package/dist/templates/mobile/ui-auth-payments/template/eas.json +45 -0
- package/dist/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
- package/dist/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
- package/dist/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
- package/dist/templates/mobile/ui-auth-payments/template/package.json +117 -0
- package/dist/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +134 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/app.json +94 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/package.json +119 -0
- package/dist/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +655 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +683 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +134 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +74 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +25 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +787 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +25 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +3 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +346 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +37 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +180 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +11 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +124 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +599 -0
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +32 -0
- package/dist/templates/shared/auth/firebase/web/config.ts +23 -0
- package/dist/templates/shared/auth/supabase/web/config.ts +8 -0
- package/dist/templates/web/base/template/.env.example +15 -0
- package/dist/templates/web/base/template/.eslintrc.js +8 -0
- package/dist/templates/web/base/template/README.md +68 -0
- package/dist/templates/web/base/template/next.config.js +15 -0
- package/dist/templates/web/base/template/package.json +59 -0
- package/dist/templates/web/base/template/postcss.config.js +7 -0
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +18 -0
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +119 -0
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +366 -0
- package/dist/templates/web/base/template/src/app/error.tsx +97 -0
- package/dist/templates/web/base/template/src/app/globals.css +157 -0
- package/dist/templates/web/base/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/base/template/src/app/loading.tsx +52 -0
- package/dist/templates/web/base/template/src/app/login/page.tsx +67 -0
- package/dist/templates/web/base/template/src/app/page.tsx +193 -0
- package/dist/templates/web/base/template/src/app/signup/page.tsx +67 -0
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +35 -0
- package/dist/templates/web/base/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/base/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/base/template/src/components/shared/header.tsx +63 -0
- package/dist/templates/web/base/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/base/template/src/components/ui/button.tsx +56 -0
- package/dist/templates/web/base/template/src/components/ui/card.tsx +71 -0
- package/dist/templates/web/base/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/base/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/base/template/src/lib/env.ts +46 -0
- package/dist/templates/web/base/template/src/lib/platform.ts +146 -0
- package/dist/templates/web/base/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/base/template/src/test/setup.ts +79 -0
- package/dist/templates/web/base/template/tailwind.config.js +77 -0
- package/dist/templates/web/base/template/tsconfig.json +33 -0
- package/dist/templates/web/base/template/vitest.config.ts +17 -0
- package/dist/templates/web/base/template.backup/.env.example +15 -0
- package/dist/templates/web/base/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-auth/template/.claude +21 -0
- package/dist/templates/web/ui-auth/template/.env.example +15 -0
- package/dist/templates/web/ui-auth/template/.eslintrc.js +8 -0
- package/dist/templates/web/ui-auth/template/README.md +68 -0
- package/dist/templates/web/ui-auth/template/context.md +105 -0
- package/dist/templates/web/ui-auth/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth/template/package.json +51 -0
- package/dist/templates/web/ui-auth/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +25 -0
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth/template/src/app/globals.css +95 -0
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +38 -0
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +305 -0
- package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +403 -0
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +31 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +94 -0
- package/dist/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth/template/src/lib/platform.ts +137 -0
- package/dist/templates/web/ui-auth/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth/template.backup/.env.example +15 -0
- package/dist/templates/web/ui-auth/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-auth-ai/template/.env.example +18 -0
- package/dist/templates/web/ui-auth-ai/template/README.md +170 -0
- package/dist/templates/web/ui-auth-ai/template/next.config.js +13 -0
- package/dist/templates/web/ui-auth-ai/template/package.json +39 -0
- package/dist/templates/web/ui-auth-ai/template/postcss.config.js +6 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +40 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +41 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +193 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +141 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +158 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +106 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +44 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +24 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/label.tsx +21 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +37 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +23 -0
- package/dist/templates/web/ui-auth-ai/template/src/hooks/useAuth.ts +1 -0
- package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +8 -0
- package/dist/templates/web/ui-auth-ai/template/src/lib/utils.ts +5 -0
- package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +55 -0
- package/dist/templates/web/ui-auth-ai/template/tailwind.config.js +22 -0
- package/dist/templates/web/ui-auth-ai/template/tsconfig.json +28 -0
- package/dist/templates/web/ui-auth-payments/template/.env.example +51 -0
- package/dist/templates/web/ui-auth-payments/template/README.md +165 -0
- package/dist/templates/web/ui-auth-payments/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments/template/package-lock.json +12240 -0
- package/dist/templates/web/ui-auth-payments/template/package.json +55 -0
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +318 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +235 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +211 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +38 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +507 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +50 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +68 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +34 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +230 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +340 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/platform.ts +146 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-ai/template/.claude +21 -0
- package/dist/templates/web/ui-auth-payments-ai/template/.env.example +60 -0
- package/dist/templates/web/ui-auth-payments-ai/template/README.md +207 -0
- package/dist/templates/web/ui-auth-payments-ai/template/context.md +169 -0
- package/dist/templates/web/ui-auth-payments-ai/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments-ai/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-ai/template/package-lock.json +12241 -0
- package/dist/templates/web/ui-auth-payments-ai/template/package.json +58 -0
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +310 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/audio/route.ts +56 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/chat/route.ts +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/text/route.ts +64 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/video/route.ts +73 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +422 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +236 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +96 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/login/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +394 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.backup +391 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.bak +391 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +645 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/signup/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +163 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +201 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +38 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/theme-provider.tsx +96 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +252 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/index.ts +14 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/platform.ts +155 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/supabase/server.ts +72 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +434 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +642 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +466 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +393 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +457 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +478 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +250 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +76 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +622 -0
- package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +396 -0
- package/dist/templates/web/ui-auth-payments-audio/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments-audio/template/README.md +207 -0
- package/dist/templates/web/ui-auth-payments-audio/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-audio/template/package-lock.json +12241 -0
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +55 -0
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +237 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +96 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +403 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.backup +391 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.bak +391 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +345 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +38 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +96 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +252 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/index.ts +14 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-video/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments-video/template/README.md +190 -0
- package/dist/templates/web/ui-auth-payments-video/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-video/template/package.json +55 -0
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +228 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +395 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +351 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +246 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-only/template/.env.example +15 -0
- package/dist/templates/web/ui-only/template/.eslintrc.js +8 -0
- package/dist/templates/web/ui-only/template/README.md +68 -0
- package/dist/templates/web/ui-only/template/next.config.js +12 -0
- package/dist/templates/web/ui-only/template/package.json +49 -0
- package/dist/templates/web/ui-only/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +25 -0
- package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-only/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
- package/dist/templates/web/ui-only/template/src/app/page.tsx +91 -0
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +26 -0
- package/dist/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-only/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +53 -0
- package/dist/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-only/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-only/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-only/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-only/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-only/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-only/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-only/template.backup/.env.example +15 -0
- package/dist/templates/web/ui-only/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-package-test/template/next-env.d.ts +5 -0
- package/dist/templates/web/ui-package-test/template/package.json +42 -0
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +106 -0
- package/dist/templates/web/ui-package-test/template/tsconfig.json +41 -0
- package/package.json +106 -0
- package/src/templates/mobile/base/template/.env.example +15 -0
- package/src/templates/mobile/base/template/App.tsx +186 -0
- package/src/templates/mobile/base/template/app/(auth)/login.tsx +44 -0
- package/src/templates/mobile/base/template/app/(auth)/signup.tsx +43 -0
- package/src/templates/mobile/base/template/app/checkout.tsx +20 -0
- package/src/templates/mobile/base/template/app.json +44 -0
- package/src/templates/mobile/base/template/babel.config.js +6 -0
- package/src/templates/mobile/base/template/eas.json +19 -0
- package/src/templates/mobile/base/template/package.json +54 -0
- package/src/templates/mobile/ui-auth-payments/template/.env.example +20 -0
- package/src/templates/mobile/ui-auth-payments/template/README.md +218 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +757 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
- package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +134 -0
- package/src/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
- package/src/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
- package/src/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
- package/src/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
- package/src/templates/mobile/ui-auth-payments/template/app.json +94 -0
- package/src/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
- package/src/templates/mobile/ui-auth-payments/template/eas.json +45 -0
- package/src/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
- package/src/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
- package/src/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
- package/src/templates/mobile/ui-auth-payments/template/package.json +117 -0
- package/src/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +134 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/app.json +94 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/package.json +119 -0
- package/src/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +655 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +683 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +134 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +74 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +25 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +787 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +25 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +3 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +346 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +37 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +180 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +11 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +124 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +599 -0
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +32 -0
- package/src/templates/shared/auth/firebase/web/config.ts +23 -0
- package/src/templates/shared/auth/supabase/web/config.ts +8 -0
- package/src/templates/web/base/template/.env.example +15 -0
- package/src/templates/web/base/template/.eslintrc.js +8 -0
- package/src/templates/web/base/template/README.md +68 -0
- package/src/templates/web/base/template/next.config.js +15 -0
- package/src/templates/web/base/template/package.json +59 -0
- package/src/templates/web/base/template/postcss.config.js +7 -0
- package/src/templates/web/base/template/src/app/auth/callback/route.ts +18 -0
- package/src/templates/web/base/template/src/app/checkout/page.tsx +119 -0
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +366 -0
- package/src/templates/web/base/template/src/app/error.tsx +97 -0
- package/src/templates/web/base/template/src/app/globals.css +157 -0
- package/src/templates/web/base/template/src/app/layout.tsx +35 -0
- package/src/templates/web/base/template/src/app/loading.tsx +52 -0
- package/src/templates/web/base/template/src/app/login/page.tsx +67 -0
- package/src/templates/web/base/template/src/app/page.tsx +193 -0
- package/src/templates/web/base/template/src/app/signup/page.tsx +67 -0
- package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +35 -0
- package/src/templates/web/base/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/base/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/base/template/src/components/shared/header.tsx +63 -0
- package/src/templates/web/base/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/base/template/src/components/ui/button.tsx +56 -0
- package/src/templates/web/base/template/src/components/ui/card.tsx +71 -0
- package/src/templates/web/base/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/base/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/base/template/src/lib/env.ts +46 -0
- package/src/templates/web/base/template/src/lib/platform.ts +146 -0
- package/src/templates/web/base/template/src/lib/utils.ts +140 -0
- package/src/templates/web/base/template/src/test/setup.ts +79 -0
- package/src/templates/web/base/template/tailwind.config.js +77 -0
- package/src/templates/web/base/template/tsconfig.json +33 -0
- package/src/templates/web/base/template/vitest.config.ts +17 -0
- package/src/templates/web/base/template.backup/.env.example +15 -0
- package/src/templates/web/base/template.backup.20250817/.env.example +15 -0
- package/src/templates/web/ui-auth/template/.claude +21 -0
- package/src/templates/web/ui-auth/template/.env.example +15 -0
- package/src/templates/web/ui-auth/template/.eslintrc.js +8 -0
- package/src/templates/web/ui-auth/template/README.md +68 -0
- package/src/templates/web/ui-auth/template/context.md +105 -0
- package/src/templates/web/ui-auth/template/next.config.js +12 -0
- package/src/templates/web/ui-auth/template/package.json +51 -0
- package/src/templates/web/ui-auth/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +25 -0
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth/template/src/app/globals.css +95 -0
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +33 -0
- package/src/templates/web/ui-auth/template/src/app/loading.tsx +38 -0
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth/template/src/app/page.tsx +305 -0
- package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +403 -0
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +31 -0
- package/src/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +94 -0
- package/src/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth/template/src/lib/platform.ts +137 -0
- package/src/templates/web/ui-auth/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth/template.backup/.env.example +15 -0
- package/src/templates/web/ui-auth/template.backup.20250817/.env.example +15 -0
- package/src/templates/web/ui-auth-ai/template/.env.example +18 -0
- package/src/templates/web/ui-auth-ai/template/README.md +170 -0
- package/src/templates/web/ui-auth-ai/template/next.config.js +13 -0
- package/src/templates/web/ui-auth-ai/template/package.json +39 -0
- package/src/templates/web/ui-auth-ai/template/postcss.config.js +6 -0
- package/src/templates/web/ui-auth-ai/template/src/app/globals.css +40 -0
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +41 -0
- package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +193 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +141 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +158 -0
- package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +106 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +44 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +24 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/label.tsx +21 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +37 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +23 -0
- package/src/templates/web/ui-auth-ai/template/src/hooks/useAuth.ts +1 -0
- package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +8 -0
- package/src/templates/web/ui-auth-ai/template/src/lib/utils.ts +5 -0
- package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +55 -0
- package/src/templates/web/ui-auth-ai/template/tailwind.config.js +22 -0
- package/src/templates/web/ui-auth-ai/template/tsconfig.json +28 -0
- package/src/templates/web/ui-auth-payments/template/.env.example +51 -0
- package/src/templates/web/ui-auth-payments/template/README.md +165 -0
- package/src/templates/web/ui-auth-payments/template/middleware.ts +68 -0
- package/src/templates/web/ui-auth-payments/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments/template/package-lock.json +12240 -0
- package/src/templates/web/ui-auth-payments/template/package.json +55 -0
- package/src/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +318 -0
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/layout.tsx +22 -0
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +235 -0
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +211 -0
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +33 -0
- package/src/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +38 -0
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -0
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +507 -0
- package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +50 -0
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +52 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +144 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +68 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +185 -0
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +34 -0
- package/src/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +230 -0
- package/src/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +246 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +340 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/platform.ts +146 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +1 -0
- package/src/templates/web/ui-auth-payments/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-ai/template/.claude +21 -0
- package/src/templates/web/ui-auth-payments-ai/template/.env.example +60 -0
- package/src/templates/web/ui-auth-payments-ai/template/README.md +207 -0
- package/src/templates/web/ui-auth-payments-ai/template/context.md +169 -0
- package/src/templates/web/ui-auth-payments-ai/template/middleware.ts +68 -0
- package/src/templates/web/ui-auth-payments-ai/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-ai/template/package-lock.json +12241 -0
- package/src/templates/web/ui-auth-payments-ai/template/package.json +58 -0
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +310 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/audio/route.ts +56 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/chat/route.ts +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/text/route.ts +64 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/video/route.ts +73 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +422 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/layout.tsx +22 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +236 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +96 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +35 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/login/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +394 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.backup +391 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.bak +391 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +645 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/signup/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +52 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +163 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +201 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +38 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/theme-provider.tsx +96 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +252 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +246 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/index.ts +14 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/platform.ts +155 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/supabase/server.ts +72 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-ai/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +1 -0
- package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +434 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +642 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +466 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +393 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +457 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +478 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +250 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +76 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +622 -0
- package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +396 -0
- package/src/templates/web/ui-auth-payments-audio/template/.env.example +15 -0
- package/src/templates/web/ui-auth-payments-audio/template/README.md +207 -0
- package/src/templates/web/ui-auth-payments-audio/template/middleware.ts +68 -0
- package/src/templates/web/ui-auth-payments-audio/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-audio/template/package-lock.json +12241 -0
- package/src/templates/web/ui-auth-payments-audio/template/package.json +55 -0
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/layout.tsx +22 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +237 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +96 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +35 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +403 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.backup +391 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.bak +391 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +345 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +52 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +144 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +185 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +38 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +96 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +252 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +246 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/index.ts +14 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +1 -0
- package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-video/template/.env.example +15 -0
- package/src/templates/web/ui-auth-payments-video/template/README.md +190 -0
- package/src/templates/web/ui-auth-payments-video/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-video/template/package.json +55 -0
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +228 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +33 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +395 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +351 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +34 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +246 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-video/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-only/template/.env.example +15 -0
- package/src/templates/web/ui-only/template/.eslintrc.js +8 -0
- package/src/templates/web/ui-only/template/README.md +68 -0
- package/src/templates/web/ui-only/template/next.config.js +12 -0
- package/src/templates/web/ui-only/template/package.json +49 -0
- package/src/templates/web/ui-only/template/postcss.config.js +7 -0
- package/src/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +25 -0
- package/src/templates/web/ui-only/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-only/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-only/template/src/app/layout.tsx +33 -0
- package/src/templates/web/ui-only/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
- package/src/templates/web/ui-only/template/src/app/page.tsx +91 -0
- package/src/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
- package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +26 -0
- package/src/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-only/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +53 -0
- package/src/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-only/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-only/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-only/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-only/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-only/template/tsconfig.json +33 -0
- package/src/templates/web/ui-only/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-only/template.backup/.env.example +15 -0
- package/src/templates/web/ui-only/template.backup.20250817/.env.example +15 -0
- package/src/templates/web/ui-package-test/template/next-env.d.ts +5 -0
- package/src/templates/web/ui-package-test/template/package.json +42 -0
- package/src/templates/web/ui-package-test/template/src/app/page.tsx +106 -0
- package/src/templates/web/ui-package-test/template/tsconfig.json +41 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const { execSync } = require('child_process')
|
|
6
|
+
|
|
7
|
+
console.log('š Setting up RAG Knowledge System...\n')
|
|
8
|
+
|
|
9
|
+
// Colors for console output
|
|
10
|
+
const colors = {
|
|
11
|
+
red: '\x1b[31m',
|
|
12
|
+
green: '\x1b[32m',
|
|
13
|
+
yellow: '\x1b[33m',
|
|
14
|
+
blue: '\x1b[34m',
|
|
15
|
+
magenta: '\x1b[35m',
|
|
16
|
+
cyan: '\x1b[36m',
|
|
17
|
+
white: '\x1b[37m',
|
|
18
|
+
reset: '\x1b[0m'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function log(message, color = 'white') {
|
|
22
|
+
console.log(`${colors[color]}${message}${colors.reset}`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function step(number, message) {
|
|
26
|
+
log(`\nš Step ${number}: ${message}`, 'cyan')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function success(message) {
|
|
30
|
+
log(`ā
${message}`, 'green')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function warning(message) {
|
|
34
|
+
log(`ā ļø ${message}`, 'yellow')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function error(message) {
|
|
38
|
+
log(`ā ${message}`, 'red')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function checkRequirements() {
|
|
42
|
+
step(1, 'Checking requirements')
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
// Check if we're in a Next.js project
|
|
46
|
+
if (!fs.existsSync('package.json')) {
|
|
47
|
+
throw new Error('package.json not found. Please run this script from your project root.')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'))
|
|
51
|
+
|
|
52
|
+
if (!packageJson.dependencies?.next) {
|
|
53
|
+
throw new Error('This appears to be not a Next.js project. RAG templates require Next.js.')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
success('Next.js project detected')
|
|
57
|
+
|
|
58
|
+
// Check for required dependencies
|
|
59
|
+
const requiredDeps = [
|
|
60
|
+
'@digilogiclabs/saas-factory-ai',
|
|
61
|
+
'@digilogiclabs/saas-factory-ai-types',
|
|
62
|
+
'@supabase/supabase-js'
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
const missingDeps = requiredDeps.filter(dep => !packageJson.dependencies?.[dep])
|
|
66
|
+
|
|
67
|
+
if (missingDeps.length > 0) {
|
|
68
|
+
warning(`Missing dependencies: ${missingDeps.join(', ')}`)
|
|
69
|
+
log('Installing missing dependencies...')
|
|
70
|
+
execSync(`npm install ${missingDeps.join(' ')}`, { stdio: 'inherit' })
|
|
71
|
+
success('Dependencies installed')
|
|
72
|
+
} else {
|
|
73
|
+
success('All required dependencies found')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
} catch (err) {
|
|
77
|
+
error(err.message)
|
|
78
|
+
process.exit(1)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function checkEnvironmentVariables() {
|
|
83
|
+
step(2, 'Checking environment variables')
|
|
84
|
+
|
|
85
|
+
const requiredEnvVars = [
|
|
86
|
+
'NEXT_PUBLIC_SUPABASE_URL',
|
|
87
|
+
'NEXT_PUBLIC_SUPABASE_ANON_KEY',
|
|
88
|
+
'OPENAI_API_KEY'
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
const missingVars = []
|
|
92
|
+
const envFiles = ['.env.local', '.env']
|
|
93
|
+
let envFileExists = false
|
|
94
|
+
|
|
95
|
+
for (const envFile of envFiles) {
|
|
96
|
+
if (fs.existsSync(envFile)) {
|
|
97
|
+
envFileExists = true
|
|
98
|
+
const envContent = fs.readFileSync(envFile, 'utf8')
|
|
99
|
+
|
|
100
|
+
for (const varName of requiredEnvVars) {
|
|
101
|
+
if (!envContent.includes(varName) || envContent.includes(`${varName}=`)) {
|
|
102
|
+
missingVars.push(varName)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
break
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!envFileExists) {
|
|
110
|
+
warning('No environment file found. Creating .env.local...')
|
|
111
|
+
|
|
112
|
+
const envTemplate = `# RAG Knowledge System Configuration
|
|
113
|
+
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url_here
|
|
114
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here
|
|
115
|
+
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key_here
|
|
116
|
+
|
|
117
|
+
# OpenAI Configuration
|
|
118
|
+
OPENAI_API_KEY=your_openai_api_key_here
|
|
119
|
+
|
|
120
|
+
# Optional: App Configuration
|
|
121
|
+
NEXT_PUBLIC_APP_NAME={{packageName}}
|
|
122
|
+
NODE_ENV=development
|
|
123
|
+
`
|
|
124
|
+
|
|
125
|
+
fs.writeFileSync('.env.local', envTemplate)
|
|
126
|
+
success('Created .env.local template')
|
|
127
|
+
warning('Please update .env.local with your actual API keys before proceeding')
|
|
128
|
+
} else if (missingVars.length > 0) {
|
|
129
|
+
warning(`Missing environment variables: ${missingVars.join(', ')}`)
|
|
130
|
+
warning('Please add these to your .env.local file')
|
|
131
|
+
} else {
|
|
132
|
+
success('Environment variables configured')
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function setupDatabaseMigrations() {
|
|
137
|
+
step(3, 'Setting up database migrations')
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
// Check if Supabase CLI is available
|
|
141
|
+
try {
|
|
142
|
+
execSync('supabase --version', { stdio: 'pipe' })
|
|
143
|
+
success('Supabase CLI found')
|
|
144
|
+
} catch {
|
|
145
|
+
warning('Supabase CLI not found. Please install it: npm install -g supabase')
|
|
146
|
+
log('You can also run migrations manually using the SQL files in supabase/migrations/')
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Check if supabase is initialized
|
|
151
|
+
if (!fs.existsSync('supabase')) {
|
|
152
|
+
log('Initializing Supabase project...')
|
|
153
|
+
execSync('supabase init', { stdio: 'inherit' })
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Create migrations directory if it doesn't exist
|
|
157
|
+
const migrationsDir = 'supabase/migrations'
|
|
158
|
+
if (!fs.existsSync(migrationsDir)) {
|
|
159
|
+
fs.mkdirSync(migrationsDir, { recursive: true })
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Create RAG migration file
|
|
163
|
+
const migrationContent = `-- RAG Knowledge Base Tables
|
|
164
|
+
-- This migration creates the necessary tables for the RAG system
|
|
165
|
+
|
|
166
|
+
-- Enable the vector extension for embeddings
|
|
167
|
+
CREATE EXTENSION IF NOT EXISTS vector;
|
|
168
|
+
|
|
169
|
+
-- Create the main knowledge base table
|
|
170
|
+
CREATE TABLE IF NOT EXISTS rag_knowledge_base (
|
|
171
|
+
id TEXT PRIMARY KEY DEFAULT gen_random_uuid()::text,
|
|
172
|
+
namespace TEXT NOT NULL DEFAULT 'default',
|
|
173
|
+
category TEXT NOT NULL DEFAULT 'general',
|
|
174
|
+
content TEXT NOT NULL,
|
|
175
|
+
fields JSONB DEFAULT '{}'::jsonb,
|
|
176
|
+
metadata JSONB DEFAULT '{}'::jsonb,
|
|
177
|
+
source JSONB DEFAULT '{}'::jsonb,
|
|
178
|
+
embedding vector(1536),
|
|
179
|
+
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
180
|
+
updated_at TIMESTAMPTZ DEFAULT NOW(),
|
|
181
|
+
version INTEGER DEFAULT 1,
|
|
182
|
+
|
|
183
|
+
-- Indexes for performance
|
|
184
|
+
CONSTRAINT rag_knowledge_base_content_check CHECK (length(content) > 0)
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
-- Create indexes
|
|
188
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_namespace ON rag_knowledge_base(namespace);
|
|
189
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_category ON rag_knowledge_base(category);
|
|
190
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_created_at ON rag_knowledge_base(created_at);
|
|
191
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_updated_at ON rag_knowledge_base(updated_at);
|
|
192
|
+
|
|
193
|
+
-- Vector similarity search index
|
|
194
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_embedding ON rag_knowledge_base
|
|
195
|
+
USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100);
|
|
196
|
+
|
|
197
|
+
-- Full-text search index
|
|
198
|
+
CREATE INDEX IF NOT EXISTS idx_rag_knowledge_content_fts ON rag_knowledge_base
|
|
199
|
+
USING gin(to_tsvector('english', content));
|
|
200
|
+
|
|
201
|
+
-- Create search functions
|
|
202
|
+
CREATE OR REPLACE FUNCTION rag_similarity_search(
|
|
203
|
+
query_embedding vector(1536),
|
|
204
|
+
search_namespace text DEFAULT 'default',
|
|
205
|
+
search_category text DEFAULT NULL,
|
|
206
|
+
similarity_threshold float DEFAULT 0.5,
|
|
207
|
+
max_results int DEFAULT 10
|
|
208
|
+
)
|
|
209
|
+
RETURNS TABLE (
|
|
210
|
+
id text,
|
|
211
|
+
content text,
|
|
212
|
+
category text,
|
|
213
|
+
fields jsonb,
|
|
214
|
+
metadata jsonb,
|
|
215
|
+
similarity float
|
|
216
|
+
) AS $$
|
|
217
|
+
BEGIN
|
|
218
|
+
RETURN QUERY
|
|
219
|
+
SELECT
|
|
220
|
+
kb.id,
|
|
221
|
+
kb.content,
|
|
222
|
+
kb.category,
|
|
223
|
+
kb.fields,
|
|
224
|
+
kb.metadata,
|
|
225
|
+
1 - (kb.embedding <=> query_embedding) as similarity
|
|
226
|
+
FROM rag_knowledge_base kb
|
|
227
|
+
WHERE
|
|
228
|
+
kb.namespace = search_namespace
|
|
229
|
+
AND (search_category IS NULL OR kb.category = search_category)
|
|
230
|
+
AND kb.embedding IS NOT NULL
|
|
231
|
+
AND 1 - (kb.embedding <=> query_embedding) > similarity_threshold
|
|
232
|
+
ORDER BY similarity DESC
|
|
233
|
+
LIMIT max_results;
|
|
234
|
+
END;
|
|
235
|
+
$$ LANGUAGE plpgsql;
|
|
236
|
+
|
|
237
|
+
-- Create hybrid search function (vector + text)
|
|
238
|
+
CREATE OR REPLACE FUNCTION rag_hybrid_search(
|
|
239
|
+
query_text text,
|
|
240
|
+
query_embedding vector(1536),
|
|
241
|
+
search_namespace text DEFAULT 'default',
|
|
242
|
+
search_category text DEFAULT NULL,
|
|
243
|
+
similarity_threshold float DEFAULT 0.5,
|
|
244
|
+
text_weight float DEFAULT 0.3,
|
|
245
|
+
vector_weight float DEFAULT 0.7,
|
|
246
|
+
max_results int DEFAULT 10
|
|
247
|
+
)
|
|
248
|
+
RETURNS TABLE (
|
|
249
|
+
id text,
|
|
250
|
+
content text,
|
|
251
|
+
category text,
|
|
252
|
+
fields jsonb,
|
|
253
|
+
metadata jsonb,
|
|
254
|
+
combined_score float
|
|
255
|
+
) AS $$
|
|
256
|
+
BEGIN
|
|
257
|
+
RETURN QUERY
|
|
258
|
+
SELECT
|
|
259
|
+
kb.id,
|
|
260
|
+
kb.content,
|
|
261
|
+
kb.category,
|
|
262
|
+
kb.fields,
|
|
263
|
+
kb.metadata,
|
|
264
|
+
(
|
|
265
|
+
text_weight * ts_rank(to_tsvector('english', kb.content), plainto_tsquery('english', query_text)) +
|
|
266
|
+
vector_weight * (1 - (kb.embedding <=> query_embedding))
|
|
267
|
+
) as combined_score
|
|
268
|
+
FROM rag_knowledge_base kb
|
|
269
|
+
WHERE
|
|
270
|
+
kb.namespace = search_namespace
|
|
271
|
+
AND (search_category IS NULL OR kb.category = search_category)
|
|
272
|
+
AND kb.embedding IS NOT NULL
|
|
273
|
+
AND (
|
|
274
|
+
to_tsvector('english', kb.content) @@ plainto_tsquery('english', query_text)
|
|
275
|
+
OR 1 - (kb.embedding <=> query_embedding) > similarity_threshold
|
|
276
|
+
)
|
|
277
|
+
ORDER BY combined_score DESC
|
|
278
|
+
LIMIT max_results;
|
|
279
|
+
END;
|
|
280
|
+
$$ LANGUAGE plpgsql;
|
|
281
|
+
|
|
282
|
+
-- Create analytics function
|
|
283
|
+
CREATE OR REPLACE FUNCTION rag_get_stats(search_namespace text DEFAULT 'default')
|
|
284
|
+
RETURNS TABLE (
|
|
285
|
+
total_documents bigint,
|
|
286
|
+
categories_count bigint,
|
|
287
|
+
avg_content_length float,
|
|
288
|
+
last_updated timestamptz
|
|
289
|
+
) AS $$
|
|
290
|
+
BEGIN
|
|
291
|
+
RETURN QUERY
|
|
292
|
+
SELECT
|
|
293
|
+
COUNT(*) as total_documents,
|
|
294
|
+
COUNT(DISTINCT category) as categories_count,
|
|
295
|
+
AVG(length(content))::float as avg_content_length,
|
|
296
|
+
MAX(updated_at) as last_updated
|
|
297
|
+
FROM rag_knowledge_base
|
|
298
|
+
WHERE namespace = search_namespace;
|
|
299
|
+
END;
|
|
300
|
+
$$ LANGUAGE plpgsql;
|
|
301
|
+
|
|
302
|
+
-- Enable RLS (Row Level Security)
|
|
303
|
+
ALTER TABLE rag_knowledge_base ENABLE ROW LEVEL SECURITY;
|
|
304
|
+
|
|
305
|
+
-- Create RLS policies
|
|
306
|
+
CREATE POLICY "Public read access" ON rag_knowledge_base
|
|
307
|
+
FOR SELECT USING (true);
|
|
308
|
+
|
|
309
|
+
CREATE POLICY "Authenticated users can insert" ON rag_knowledge_base
|
|
310
|
+
FOR INSERT WITH CHECK (auth.role() = 'authenticated');
|
|
311
|
+
|
|
312
|
+
CREATE POLICY "Authenticated users can update" ON rag_knowledge_base
|
|
313
|
+
FOR UPDATE USING (auth.role() = 'authenticated');
|
|
314
|
+
|
|
315
|
+
CREATE POLICY "Authenticated users can delete" ON rag_knowledge_base
|
|
316
|
+
FOR DELETE USING (auth.role() = 'authenticated');
|
|
317
|
+
|
|
318
|
+
-- Create updated_at trigger
|
|
319
|
+
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
|
320
|
+
RETURNS TRIGGER AS $$
|
|
321
|
+
BEGIN
|
|
322
|
+
NEW.updated_at = NOW();
|
|
323
|
+
RETURN NEW;
|
|
324
|
+
END;
|
|
325
|
+
$$ LANGUAGE plpgsql;
|
|
326
|
+
|
|
327
|
+
CREATE TRIGGER update_rag_knowledge_base_updated_at
|
|
328
|
+
BEFORE UPDATE ON rag_knowledge_base
|
|
329
|
+
FOR EACH ROW
|
|
330
|
+
EXECUTE FUNCTION update_updated_at_column();
|
|
331
|
+
|
|
332
|
+
-- Create app-specific views for common domains
|
|
333
|
+
CREATE VIEW plant_knowledge AS
|
|
334
|
+
SELECT * FROM rag_knowledge_base
|
|
335
|
+
WHERE namespace LIKE '%-plants' OR category IN ('plant-care', 'botanical', 'gardening');
|
|
336
|
+
|
|
337
|
+
CREATE VIEW product_knowledge AS
|
|
338
|
+
SELECT * FROM rag_knowledge_base
|
|
339
|
+
WHERE namespace LIKE '%-store' OR category IN ('products', 'ecommerce', 'catalog');
|
|
340
|
+
|
|
341
|
+
CREATE VIEW education_knowledge AS
|
|
342
|
+
SELECT * FROM rag_knowledge_base
|
|
343
|
+
WHERE namespace LIKE '%-learning' OR category IN ('courses', 'education', 'tutorials');
|
|
344
|
+
|
|
345
|
+
-- Insert sample data
|
|
346
|
+
INSERT INTO rag_knowledge_base (namespace, category, content, fields, metadata, source) VALUES
|
|
347
|
+
('{{packageName}}', 'faq', 'How do I get started with this platform? Getting started is easy! Simply sign up for an account, complete the onboarding process, and begin exploring the features. Our comprehensive documentation will guide you through each step.',
|
|
348
|
+
'{"title": "Getting Started Guide", "tags": ["beginner", "setup"]}',
|
|
349
|
+
'{"difficulty": "beginner", "popularity": 95}',
|
|
350
|
+
'{"type": "manual", "author": "system"}'),
|
|
351
|
+
|
|
352
|
+
('{{packageName}}', 'faq', 'What features are available in the platform? Our platform offers AI-powered chat, knowledge base management, real-time analytics, user authentication, payment processing, and much more. Check our features page for a complete list.',
|
|
353
|
+
'{"title": "Platform Features", "tags": ["features", "overview"]}',
|
|
354
|
+
'{"difficulty": "beginner", "popularity": 88}',
|
|
355
|
+
'{"type": "manual", "author": "system"}'),
|
|
356
|
+
|
|
357
|
+
('{{packageName}}', 'guide', 'To set up your knowledge base: 1. Navigate to the Knowledge section, 2. Click Add Document, 3. Enter your content and categorize it, 4. Save and your content will be automatically indexed for AI search.',
|
|
358
|
+
'{"title": "Knowledge Base Setup", "tags": ["knowledge", "setup", "guide"]}',
|
|
359
|
+
'{"difficulty": "intermediate", "popularity": 76}',
|
|
360
|
+
'{"type": "manual", "author": "system"}'),
|
|
361
|
+
|
|
362
|
+
('{{packageName}}', 'reference', 'API endpoints: GET /api/rag/search - Search knowledge base, POST /api/rag/chat - Chat with AI, POST /api/knowledge - Add document, PUT /api/knowledge/:id - Update document, DELETE /api/knowledge/:id - Delete document',
|
|
363
|
+
'{"title": "API Reference", "tags": ["api", "developer", "reference"]}',
|
|
364
|
+
'{"difficulty": "advanced", "popularity": 65}',
|
|
365
|
+
'{"type": "manual", "author": "system"}');
|
|
366
|
+
|
|
367
|
+
COMMENT ON TABLE rag_knowledge_base IS 'Stores knowledge base documents with vector embeddings for RAG system';
|
|
368
|
+
COMMENT ON COLUMN rag_knowledge_base.embedding IS 'Vector embedding for semantic search (1536 dimensions for OpenAI ada-002)';
|
|
369
|
+
COMMENT ON COLUMN rag_knowledge_base.fields IS 'Flexible schema for domain-specific structured data';
|
|
370
|
+
COMMENT ON COLUMN rag_knowledge_base.metadata IS 'Additional metadata like tags, difficulty, popularity scores';
|
|
371
|
+
COMMENT ON COLUMN rag_knowledge_base.source IS 'Information about where this document came from';
|
|
372
|
+
`
|
|
373
|
+
|
|
374
|
+
const timestamp = new Date().toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, '').replace('T', '_')
|
|
375
|
+
const migrationFile = path.join(migrationsDir, `${timestamp}_create_rag_tables.sql`)
|
|
376
|
+
|
|
377
|
+
fs.writeFileSync(migrationFile, migrationContent)
|
|
378
|
+
success(`Created migration file: ${migrationFile}`)
|
|
379
|
+
|
|
380
|
+
// Try to apply migration if Supabase is running
|
|
381
|
+
try {
|
|
382
|
+
log('Applying database migration...')
|
|
383
|
+
execSync('supabase db reset', { stdio: 'inherit' })
|
|
384
|
+
success('Database migration applied successfully')
|
|
385
|
+
} catch (err) {
|
|
386
|
+
warning('Could not apply migration automatically.')
|
|
387
|
+
warning('Please run: supabase db reset')
|
|
388
|
+
warning('Or apply the SQL migration manually to your database')
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
} catch (err) {
|
|
392
|
+
error(`Database setup failed: ${err.message}`)
|
|
393
|
+
warning('Please set up the database manually using the generated SQL files')
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function generateTypes() {
|
|
398
|
+
step(4, 'Generating TypeScript types')
|
|
399
|
+
|
|
400
|
+
try {
|
|
401
|
+
// Try to generate types
|
|
402
|
+
execSync('supabase gen types --local > types/supabase.ts', { stdio: 'pipe' })
|
|
403
|
+
success('TypeScript types generated')
|
|
404
|
+
} catch (err) {
|
|
405
|
+
warning('Could not generate types automatically')
|
|
406
|
+
warning('Please run: supabase gen types --local > types/supabase.ts')
|
|
407
|
+
|
|
408
|
+
// Create types directory and basic type file
|
|
409
|
+
if (!fs.existsSync('types')) {
|
|
410
|
+
fs.mkdirSync('types', { recursive: true })
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const basicTypes = `// Basic RAG types - replace with generated Supabase types
|
|
414
|
+
export interface Database {
|
|
415
|
+
public: {
|
|
416
|
+
Tables: {
|
|
417
|
+
rag_knowledge_base: {
|
|
418
|
+
Row: {
|
|
419
|
+
id: string
|
|
420
|
+
namespace: string
|
|
421
|
+
category: string
|
|
422
|
+
content: string
|
|
423
|
+
fields: any
|
|
424
|
+
metadata: any
|
|
425
|
+
source: any
|
|
426
|
+
embedding: number[] | null
|
|
427
|
+
created_at: string
|
|
428
|
+
updated_at: string
|
|
429
|
+
version: number
|
|
430
|
+
}
|
|
431
|
+
Insert: {
|
|
432
|
+
id?: string
|
|
433
|
+
namespace?: string
|
|
434
|
+
category?: string
|
|
435
|
+
content: string
|
|
436
|
+
fields?: any
|
|
437
|
+
metadata?: any
|
|
438
|
+
source?: any
|
|
439
|
+
embedding?: number[] | null
|
|
440
|
+
created_at?: string
|
|
441
|
+
updated_at?: string
|
|
442
|
+
version?: number
|
|
443
|
+
}
|
|
444
|
+
Update: {
|
|
445
|
+
id?: string
|
|
446
|
+
namespace?: string
|
|
447
|
+
category?: string
|
|
448
|
+
content?: string
|
|
449
|
+
fields?: any
|
|
450
|
+
metadata?: any
|
|
451
|
+
source?: any
|
|
452
|
+
embedding?: number[] | null
|
|
453
|
+
created_at?: string
|
|
454
|
+
updated_at?: string
|
|
455
|
+
version?: number
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
`
|
|
462
|
+
|
|
463
|
+
fs.writeFileSync('types/supabase.ts', basicTypes)
|
|
464
|
+
success('Created basic types file')
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function createConfigFiles() {
|
|
469
|
+
step(5, 'Creating configuration files')
|
|
470
|
+
|
|
471
|
+
// Create lib directory structure
|
|
472
|
+
const dirs = ['lib/rag', 'components/rag', 'hooks', 'scripts']
|
|
473
|
+
dirs.forEach(dir => {
|
|
474
|
+
if (!fs.existsSync(dir)) {
|
|
475
|
+
fs.mkdirSync(dir, { recursive: true })
|
|
476
|
+
success(`Created directory: ${dir}`)
|
|
477
|
+
}
|
|
478
|
+
})
|
|
479
|
+
|
|
480
|
+
// Create a seed data script
|
|
481
|
+
const seedScript = `#!/usr/bin/env node
|
|
482
|
+
|
|
483
|
+
const { createClient } = require('@supabase/supabase-js')
|
|
484
|
+
require('dotenv').config({ path: '.env.local' })
|
|
485
|
+
|
|
486
|
+
const supabase = createClient(
|
|
487
|
+
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
|
488
|
+
process.env.SUPABASE_SERVICE_ROLE_KEY
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
const sampleDocuments = [
|
|
492
|
+
{
|
|
493
|
+
namespace: '{{packageName}}',
|
|
494
|
+
category: 'getting-started',
|
|
495
|
+
content: 'Welcome to your AI-powered knowledge platform! This system uses RAG (Retrieval-Augmented Generation) to provide intelligent responses based on your knowledge base.',
|
|
496
|
+
fields: { title: 'Welcome Guide', difficulty: 'beginner' },
|
|
497
|
+
metadata: { featured: true, priority: 1 },
|
|
498
|
+
source: { type: 'seed', version: '1.0' }
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
namespace: '{{packageName}}',
|
|
502
|
+
category: 'features',
|
|
503
|
+
content: 'Key features include: AI chat with your documents, semantic search, knowledge management, real-time analytics, and seamless integration with your existing data.',
|
|
504
|
+
fields: { title: 'Platform Features', difficulty: 'beginner' },
|
|
505
|
+
metadata: { featured: true, priority: 2 },
|
|
506
|
+
source: { type: 'seed', version: '1.0' }
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
namespace: '{{packageName}}',
|
|
510
|
+
category: 'tutorials',
|
|
511
|
+
content: 'To add new knowledge: 1. Go to Knowledge Manager, 2. Click Add Document, 3. Fill in the content and metadata, 4. The system will automatically create embeddings for semantic search.',
|
|
512
|
+
fields: { title: 'Adding Knowledge Tutorial', difficulty: 'intermediate' },
|
|
513
|
+
metadata: { tutorial: true, priority: 3 },
|
|
514
|
+
source: { type: 'seed', version: '1.0' }
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
|
|
518
|
+
async function seedKnowledge() {
|
|
519
|
+
console.log('š± Seeding knowledge base...')
|
|
520
|
+
|
|
521
|
+
try {
|
|
522
|
+
for (const doc of sampleDocuments) {
|
|
523
|
+
const { data, error } = await supabase
|
|
524
|
+
.from('rag_knowledge_base')
|
|
525
|
+
.insert(doc)
|
|
526
|
+
|
|
527
|
+
if (error) {
|
|
528
|
+
console.error('Error inserting document:', error)
|
|
529
|
+
} else {
|
|
530
|
+
console.log('ā
Inserted:', doc.fields.title)
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
console.log('š Knowledge base seeded successfully!')
|
|
535
|
+
console.log('š Next steps:')
|
|
536
|
+
console.log(' 1. Run: npm run dev')
|
|
537
|
+
console.log(' 2. Visit: http://localhost:3000/ai')
|
|
538
|
+
console.log(' 3. Start chatting with your knowledge base!')
|
|
539
|
+
|
|
540
|
+
} catch (error) {
|
|
541
|
+
console.error('ā Seeding failed:', error)
|
|
542
|
+
process.exit(1)
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
seedKnowledge()
|
|
547
|
+
`
|
|
548
|
+
|
|
549
|
+
fs.writeFileSync('scripts/seed-knowledge.js', seedScript)
|
|
550
|
+
fs.chmodSync('scripts/seed-knowledge.js', 0o755)
|
|
551
|
+
success('Created seed script')
|
|
552
|
+
|
|
553
|
+
// Update package.json scripts
|
|
554
|
+
const packageJsonPath = 'package.json'
|
|
555
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
556
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
557
|
+
|
|
558
|
+
packageJson.scripts = {
|
|
559
|
+
...packageJson.scripts,
|
|
560
|
+
'setup:rag': 'node scripts/setup-rag.js',
|
|
561
|
+
'seed:knowledge': 'node scripts/seed-knowledge.js',
|
|
562
|
+
'db:types': 'supabase gen types --local > types/supabase.ts',
|
|
563
|
+
'db:reset': 'supabase db reset',
|
|
564
|
+
'db:push': 'supabase db push'
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
|
|
568
|
+
success('Updated package.json scripts')
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
function displayNextSteps() {
|
|
573
|
+
step(6, 'Setup complete! Next steps')
|
|
574
|
+
|
|
575
|
+
log('\nš RAG Knowledge System setup complete!\n', 'green')
|
|
576
|
+
|
|
577
|
+
log('š Next steps:', 'cyan')
|
|
578
|
+
log(' 1. Update your .env.local with actual API keys')
|
|
579
|
+
log(' 2. Ensure your Supabase database is running')
|
|
580
|
+
log(' 3. Run the seed script: npm run seed:knowledge')
|
|
581
|
+
log(' 4. Start your development server: npm run dev')
|
|
582
|
+
log(' 5. Visit /ai to test your RAG system')
|
|
583
|
+
|
|
584
|
+
log('\nš§ Available commands:', 'cyan')
|
|
585
|
+
log(' npm run setup:rag - Run this setup script')
|
|
586
|
+
log(' npm run seed:knowledge - Add sample knowledge documents')
|
|
587
|
+
log(' npm run db:types - Generate TypeScript types')
|
|
588
|
+
log(' npm run db:reset - Reset and migrate database')
|
|
589
|
+
log(' npm run db:push - Push migrations to remote')
|
|
590
|
+
|
|
591
|
+
log('\nš Documentation:', 'cyan')
|
|
592
|
+
log(' ⢠RAG Configuration: lib/rag/config.ts')
|
|
593
|
+
log(' ⢠React Hook: hooks/useRAGSystem.ts')
|
|
594
|
+
log(' ⢠Components: components/rag/')
|
|
595
|
+
log(' ⢠Database: supabase/migrations/')
|
|
596
|
+
|
|
597
|
+
log('\nš” Tips:', 'yellow')
|
|
598
|
+
log(' ⢠Customize domain in lib/rag/config.ts')
|
|
599
|
+
log(' ⢠Add your own knowledge via the web interface')
|
|
600
|
+
log(' ⢠Monitor usage in the Analytics dashboard')
|
|
601
|
+
log(' ⢠Check system health in the AI dashboard')
|
|
602
|
+
|
|
603
|
+
log('\nš Happy building with RAG!', 'green')
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// Main execution
|
|
607
|
+
async function main() {
|
|
608
|
+
try {
|
|
609
|
+
checkRequirements()
|
|
610
|
+
checkEnvironmentVariables()
|
|
611
|
+
setupDatabaseMigrations()
|
|
612
|
+
generateTypes()
|
|
613
|
+
createConfigFiles()
|
|
614
|
+
displayNextSteps()
|
|
615
|
+
} catch (err) {
|
|
616
|
+
error(`Setup failed: ${err.message}`)
|
|
617
|
+
process.exit(1)
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
main()
|
|
622
|
+
`
|