@digilogiclabs/create-saas-app 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +153 -113
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/create.d.ts.map +1 -1
- package/dist/cli/commands/create.js +2 -6
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +15 -8
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/dist/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/dist/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/dist/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/dist/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/dist/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/dist/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/dist/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/dist/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/dist/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/dist/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/dist/templates/shared/mock/web/.env.local +55 -0
- package/dist/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/dist/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/dist/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/dist/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/dist/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/dist/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
- package/dist/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
- package/dist/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
- package/dist/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/base/template/eslint.config.mjs +14 -0
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/dist/templates/web/base/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/dist/templates/web/base/template/src/app/page.tsx +97 -193
- package/dist/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/dist/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/base/template/src/components/shared/header.tsx +229 -63
- package/dist/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
- package/dist/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
- package/dist/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
- package/dist/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
- package/dist/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
- package/dist/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
- package/dist/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
- package/dist/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
- package/dist/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
- package/dist/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
- package/dist/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
- package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +14 -3
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
- package/dist/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/dist/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/dist/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/dist/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/dist/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/dist/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/dist/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/dist/templates/web/ui-package-test/template/package.json +19 -23
- package/dist/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/dist/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/package.json +1 -1
- package/src/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/src/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/src/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/src/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/src/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/src/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/src/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/src/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/src/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/src/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/src/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/src/templates/shared/mock/web/.env.local +55 -0
- package/src/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/src/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/src/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/src/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/src/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/src/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
- package/src/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
- package/src/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
- package/src/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/base/template/eslint.config.mjs +14 -0
- package/src/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/src/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/src/templates/web/base/template/src/app/layout.tsx +40 -38
- package/src/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/src/templates/web/base/template/src/app/page.tsx +97 -193
- package/src/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/src/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/base/template/src/components/shared/header.tsx +229 -63
- package/src/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
- package/src/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
- package/src/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
- package/src/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
- package/src/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
- package/src/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
- package/src/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
- package/src/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
- package/src/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
- package/src/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
- package/src/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
- package/src/templates/web/micro-saas/template/src/app/login/page.tsx +14 -3
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
- package/src/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
- package/src/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/src/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/src/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/src/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/src/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/src/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/src/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/src/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/src/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/src/templates/web/ui-package-test/template/package.json +19 -23
- package/src/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/src/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/src/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/dist/templates/web/base/template/.eslintrc.js +0 -8
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/base/template/src/test/setup.ts +0 -74
- package/dist/templates/web/base/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/src/templates/web/base/template/.eslintrc.js +0 -8
- package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/base/template/src/test/setup.ts +0 -74
- package/src/templates/web/base/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-only/template/vitest.config.ts +0 -17
|
@@ -1,655 +0,0 @@
|
|
|
1
|
-
# Mobile AI Knowledge App with RAG v4.0.0
|
|
2
|
-
|
|
3
|
-
A powerful React Native/Expo application with AI-powered knowledge base using Retrieval-Augmented Generation (RAG), featuring offline support, voice input, and native mobile optimizations.
|
|
4
|
-
|
|
5
|
-
## 📱 Mobile-First Features
|
|
6
|
-
|
|
7
|
-
### AI & Knowledge Base
|
|
8
|
-
- **RAG-Powered Chat**: Intelligent conversations with your knowledge base
|
|
9
|
-
- **Voice Input**: Speak your queries with native speech recognition
|
|
10
|
-
- **Offline Mode**: Cached responses and queued queries for offline use
|
|
11
|
-
- **Touch-Optimized UI**: Native mobile interactions and gestures
|
|
12
|
-
- **Push Notifications**: Real-time updates for new knowledge
|
|
13
|
-
- **Haptic Feedback**: Enhanced tactile user experience
|
|
14
|
-
|
|
15
|
-
### Native Integrations
|
|
16
|
-
- **Camera Integration**: Scan documents to add to knowledge base
|
|
17
|
-
- **File System Access**: Import documents from device storage
|
|
18
|
-
- **Background Sync**: Knowledge updates while app is backgrounded
|
|
19
|
-
- **Biometric Auth**: Face ID/Touch ID for secure access
|
|
20
|
-
- **Deep Linking**: Share knowledge items with native URLs
|
|
21
|
-
|
|
22
|
-
### Performance Optimizations
|
|
23
|
-
- **Lazy Loading**: Efficient memory usage with virtualized lists
|
|
24
|
-
- **Image Caching**: Optimized asset loading and caching
|
|
25
|
-
- **Bundle Splitting**: Reduced initial app size
|
|
26
|
-
- **Native Performance**: 60fps animations and smooth scrolling
|
|
27
|
-
|
|
28
|
-
## 🏗️ Architecture
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
app/
|
|
32
|
-
├── (tabs)/ # Tab-based navigation
|
|
33
|
-
│ ├── ai.tsx # Main AI interface
|
|
34
|
-
│ ├── knowledge.tsx # Knowledge management
|
|
35
|
-
│ └── analytics.tsx # Usage analytics
|
|
36
|
-
├── auth/ # Authentication screens
|
|
37
|
-
│ ├── login.tsx
|
|
38
|
-
│ └── signup.tsx
|
|
39
|
-
├── onboarding/ # First-time user experience
|
|
40
|
-
hooks/
|
|
41
|
-
├── useRAGSystem.ts # Core RAG functionality
|
|
42
|
-
├── useOfflineSync.ts # Offline synchronization
|
|
43
|
-
└── useVoiceInput.ts # Voice recognition
|
|
44
|
-
lib/
|
|
45
|
-
├── rag/
|
|
46
|
-
│ ├── config.ts # Mobile-optimized RAG config
|
|
47
|
-
│ └── cache.ts # Offline caching strategy
|
|
48
|
-
├── supabase.ts # Mobile Supabase client
|
|
49
|
-
└── storage.ts # AsyncStorage utilities
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## 🛠️ Quick Start
|
|
53
|
-
|
|
54
|
-
### 1. Installation
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
# Create new mobile project
|
|
58
|
-
npm create saas-app my-mobile-ai-app --template=mobile-ai-rag
|
|
59
|
-
|
|
60
|
-
# Navigate to project
|
|
61
|
-
cd my-mobile-ai-app
|
|
62
|
-
|
|
63
|
-
# Install dependencies
|
|
64
|
-
npx expo install
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 2. Environment Setup
|
|
68
|
-
|
|
69
|
-
Create `.env.local`:
|
|
70
|
-
|
|
71
|
-
```env
|
|
72
|
-
# Supabase Configuration
|
|
73
|
-
EXPO_PUBLIC_SUPABASE_URL=your_supabase_url
|
|
74
|
-
EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
|
|
75
|
-
|
|
76
|
-
# OpenAI Configuration (client-side - use cautiously)
|
|
77
|
-
EXPO_PUBLIC_OPENAI_API_KEY=your_openai_api_key
|
|
78
|
-
|
|
79
|
-
# App Configuration
|
|
80
|
-
APP_VARIANT=development
|
|
81
|
-
EAS_PROJECT_ID=your_eas_project_id
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**⚠️ Important**: Environment variables in React Native are embedded in the build. Use server-side API routes for sensitive operations in production.
|
|
85
|
-
|
|
86
|
-
### 3. Database Setup
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Setup RAG system
|
|
90
|
-
npm run setup:rag
|
|
91
|
-
|
|
92
|
-
# Seed with mobile-optimized knowledge
|
|
93
|
-
npm run seed:knowledge
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 4. Development
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
# Start Expo development server
|
|
100
|
-
npx expo start
|
|
101
|
-
|
|
102
|
-
# Run on iOS simulator
|
|
103
|
-
npx expo start --ios
|
|
104
|
-
|
|
105
|
-
# Run on Android emulator
|
|
106
|
-
npx expo start --android
|
|
107
|
-
|
|
108
|
-
# Open in Expo Go app
|
|
109
|
-
# Scan the QR code with your phone
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## 📱 Mobile-Specific Usage
|
|
113
|
-
|
|
114
|
-
### Voice-Enabled Chat
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
import { useRAGSystem } from '@/hooks/useRAGSystem'
|
|
118
|
-
import { RAGChatPanel } from '@digilogiclabs/saas-factory-ui/native'
|
|
119
|
-
|
|
120
|
-
export default function ChatScreen() {
|
|
121
|
-
const ragSystem = useRAGSystem({
|
|
122
|
-
domain: 'generic',
|
|
123
|
-
enableOffline: true,
|
|
124
|
-
enableVoice: true
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<RAGChatPanel
|
|
129
|
-
ragSystem={ragSystem.ragSystem}
|
|
130
|
-
enableVoiceInput={true}
|
|
131
|
-
enableOfflineMode={true}
|
|
132
|
-
mobileOptimized={true}
|
|
133
|
-
showSources={true}
|
|
134
|
-
showConfidenceScore={false} // Simplified for mobile
|
|
135
|
-
/>
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Offline-First Knowledge Management
|
|
141
|
-
|
|
142
|
-
```typescript
|
|
143
|
-
import { useOfflineSync } from '@/hooks/useOfflineSync'
|
|
144
|
-
|
|
145
|
-
export default function KnowledgeScreen() {
|
|
146
|
-
const ragSystem = useRAGSystem()
|
|
147
|
-
const offlineSync = useOfflineSync({
|
|
148
|
-
syncInterval: 300000, // 5 minutes
|
|
149
|
-
autoSync: true
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
return (
|
|
153
|
-
<KnowledgeManagementPanel
|
|
154
|
-
ragSystem={ragSystem.ragSystem}
|
|
155
|
-
offlineMode={!ragSystem.isOnline}
|
|
156
|
-
syncStatus={offlineSync.status}
|
|
157
|
-
onSync={offlineSync.syncNow}
|
|
158
|
-
/>
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Native UI Components
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
import {
|
|
167
|
-
TabbedInterface,
|
|
168
|
-
SwipeableCard,
|
|
169
|
-
VirtualScrollList,
|
|
170
|
-
NativeFeatureHighlight
|
|
171
|
-
} from '@digilogiclabs/saas-factory-ui/native'
|
|
172
|
-
|
|
173
|
-
// Swipeable knowledge cards
|
|
174
|
-
<SwipeableCard
|
|
175
|
-
rightActions={[
|
|
176
|
-
{ label: 'Edit', color: '#3b82f6', onPress: handleEdit },
|
|
177
|
-
{ label: 'Delete', color: '#ef4444', onPress: handleDelete }
|
|
178
|
-
]}
|
|
179
|
-
>
|
|
180
|
-
<KnowledgeCard item={knowledge} />
|
|
181
|
-
</SwipeableCard>
|
|
182
|
-
|
|
183
|
-
// High-performance lists
|
|
184
|
-
<VirtualScrollList
|
|
185
|
-
data={knowledgeItems}
|
|
186
|
-
renderItem={renderKnowledgeItem}
|
|
187
|
-
estimatedItemSize={120}
|
|
188
|
-
onEndReached={loadMore}
|
|
189
|
-
/>
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## 🔄 Offline Capabilities
|
|
193
|
-
|
|
194
|
-
### Caching Strategy
|
|
195
|
-
```typescript
|
|
196
|
-
// lib/rag/cache.ts
|
|
197
|
-
export class MobileRAGCache {
|
|
198
|
-
private cache = new Map<string, CachedResponse>()
|
|
199
|
-
private maxSize = 100 // Configurable cache size
|
|
200
|
-
|
|
201
|
-
async getCached(query: string): Promise<RAGResponse | null> {
|
|
202
|
-
const cached = this.cache.get(query)
|
|
203
|
-
if (cached && !this.isExpired(cached)) {
|
|
204
|
-
return cached.response
|
|
205
|
-
}
|
|
206
|
-
return null
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
async setCached(query: string, response: RAGResponse) {
|
|
210
|
-
if (this.cache.size >= this.maxSize) {
|
|
211
|
-
this.evictOldest()
|
|
212
|
-
}
|
|
213
|
-
this.cache.set(query, {
|
|
214
|
-
response,
|
|
215
|
-
timestamp: Date.now(),
|
|
216
|
-
expiresAt: Date.now() + (24 * 60 * 60 * 1000) // 24 hours
|
|
217
|
-
})
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Offline Queue Management
|
|
223
|
-
```typescript
|
|
224
|
-
// hooks/useOfflineSync.ts
|
|
225
|
-
export function useOfflineSync() {
|
|
226
|
-
const [offlineQueue, setOfflineQueue] = useState<OfflineQuery[]>([])
|
|
227
|
-
|
|
228
|
-
const queueQuery = async (query: string) => {
|
|
229
|
-
const offlineQuery: OfflineQuery = {
|
|
230
|
-
id: uuid(),
|
|
231
|
-
query,
|
|
232
|
-
timestamp: new Date(),
|
|
233
|
-
synced: false
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
setOfflineQueue(prev => [...prev, offlineQuery])
|
|
237
|
-
await AsyncStorage.setItem('offline_queue', JSON.stringify(offlineQueue))
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const syncQueue = async () => {
|
|
241
|
-
// Process queued queries when online
|
|
242
|
-
for (const query of offlineQueue) {
|
|
243
|
-
try {
|
|
244
|
-
await ragSystem.query(query.query)
|
|
245
|
-
query.synced = true
|
|
246
|
-
} catch (error) {
|
|
247
|
-
console.error('Sync failed:', error)
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## 🎤 Voice Integration
|
|
255
|
-
|
|
256
|
-
### Speech-to-Text
|
|
257
|
-
```typescript
|
|
258
|
-
import { useVoiceRecognition } from '@/hooks/useVoiceRecognition'
|
|
259
|
-
|
|
260
|
-
export function VoiceInput() {
|
|
261
|
-
const {
|
|
262
|
-
isListening,
|
|
263
|
-
transcript,
|
|
264
|
-
startListening,
|
|
265
|
-
stopListening,
|
|
266
|
-
clearTranscript
|
|
267
|
-
} = useVoiceRecognition({
|
|
268
|
-
language: 'en-US',
|
|
269
|
-
continuous: false,
|
|
270
|
-
interimResults: true
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<TouchableOpacity
|
|
275
|
-
onPress={isListening ? stopListening : startListening}
|
|
276
|
-
style={styles.voiceButton}
|
|
277
|
-
>
|
|
278
|
-
<Mic color={isListening ? '#ef4444' : '#3b82f6'} size={24} />
|
|
279
|
-
</TouchableOpacity>
|
|
280
|
-
)
|
|
281
|
-
}
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Text-to-Speech
|
|
285
|
-
```typescript
|
|
286
|
-
import * as Speech from 'expo-speech'
|
|
287
|
-
|
|
288
|
-
const speakResponse = (text: string) => {
|
|
289
|
-
Speech.speak(text, {
|
|
290
|
-
language: 'en-US',
|
|
291
|
-
pitch: 1.0,
|
|
292
|
-
rate: 0.8,
|
|
293
|
-
voice: 'com.apple.ttsbundle.Samantha-compact'
|
|
294
|
-
})
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
## 📊 Native Analytics
|
|
299
|
-
|
|
300
|
-
### Performance Monitoring
|
|
301
|
-
```typescript
|
|
302
|
-
import { useRAGAnalytics } from '@/hooks/useRAGAnalytics'
|
|
303
|
-
|
|
304
|
-
export function AnalyticsScreen() {
|
|
305
|
-
const analytics = useRAGAnalytics({
|
|
306
|
-
trackAppState: true,
|
|
307
|
-
trackMemoryUsage: true,
|
|
308
|
-
trackNetworkStatus: true
|
|
309
|
-
})
|
|
310
|
-
|
|
311
|
-
return (
|
|
312
|
-
<ScrollView>
|
|
313
|
-
<PerformanceMetrics
|
|
314
|
-
responseTime={analytics.averageResponseTime}
|
|
315
|
-
cacheHitRate={analytics.cacheHitRate}
|
|
316
|
-
offlineQueryRate={analytics.offlineQueryRate}
|
|
317
|
-
/>
|
|
318
|
-
|
|
319
|
-
<UsageCharts
|
|
320
|
-
queryVolume={analytics.queryVolume}
|
|
321
|
-
userSessions={analytics.sessionData}
|
|
322
|
-
knowledgeGrowth={analytics.knowledgeGrowth}
|
|
323
|
-
/>
|
|
324
|
-
</ScrollView>
|
|
325
|
-
)
|
|
326
|
-
}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
## 🔐 Security & Privacy
|
|
330
|
-
|
|
331
|
-
### Secure Storage
|
|
332
|
-
```typescript
|
|
333
|
-
import * as SecureStore from 'expo-secure-store'
|
|
334
|
-
|
|
335
|
-
// Store sensitive data securely
|
|
336
|
-
await SecureStore.setItemAsync('user_token', authToken)
|
|
337
|
-
|
|
338
|
-
// Retrieve secure data
|
|
339
|
-
const token = await SecureStore.getItemAsync('user_token')
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### Biometric Authentication
|
|
343
|
-
```typescript
|
|
344
|
-
import * as LocalAuthentication from 'expo-local-authentication'
|
|
345
|
-
|
|
346
|
-
const authenticateWithBiometrics = async () => {
|
|
347
|
-
const hasHardware = await LocalAuthentication.hasHardwareAsync()
|
|
348
|
-
const supportedTypes = await LocalAuthentication.supportedAuthenticationTypesAsync()
|
|
349
|
-
|
|
350
|
-
if (hasHardware && supportedTypes.length > 0) {
|
|
351
|
-
const result = await LocalAuthentication.authenticateAsync({
|
|
352
|
-
promptMessage: 'Authenticate to access your AI assistant',
|
|
353
|
-
fallbackLabel: 'Use passcode'
|
|
354
|
-
})
|
|
355
|
-
|
|
356
|
-
return result.success
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
return false
|
|
360
|
-
}
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
## 🚀 Build & Distribution
|
|
364
|
-
|
|
365
|
-
### EAS Build Configuration
|
|
366
|
-
```json
|
|
367
|
-
{
|
|
368
|
-
"expo": {
|
|
369
|
-
"name": "AI Knowledge Assistant",
|
|
370
|
-
"slug": "ai-knowledge-assistant",
|
|
371
|
-
"version": "1.0.0",
|
|
372
|
-
"orientation": "portrait",
|
|
373
|
-
"platforms": ["ios", "android"],
|
|
374
|
-
"assetBundlePatterns": ["**/*"]
|
|
375
|
-
},
|
|
376
|
-
"build": {
|
|
377
|
-
"preview": {
|
|
378
|
-
"android": {
|
|
379
|
-
"buildType": "apk"
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
"preview2": {
|
|
383
|
-
"android": {
|
|
384
|
-
"gradleCommand": ":app:assembleRelease"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
"preview3": {
|
|
388
|
-
"developmentClient": true
|
|
389
|
-
},
|
|
390
|
-
"production": {}
|
|
391
|
-
},
|
|
392
|
-
"submit": {
|
|
393
|
-
"production": {}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
### Building for Production
|
|
399
|
-
```bash
|
|
400
|
-
# Build for iOS
|
|
401
|
-
eas build --platform ios --profile production
|
|
402
|
-
|
|
403
|
-
# Build for Android
|
|
404
|
-
eas build --platform android --profile production
|
|
405
|
-
|
|
406
|
-
# Submit to app stores
|
|
407
|
-
eas submit --platform ios
|
|
408
|
-
eas submit --platform android
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
## 📱 Platform-Specific Features
|
|
412
|
-
|
|
413
|
-
### iOS Features
|
|
414
|
-
```typescript
|
|
415
|
-
// Push notifications
|
|
416
|
-
import * as Notifications from 'expo-notifications'
|
|
417
|
-
|
|
418
|
-
Notifications.setNotificationHandler({
|
|
419
|
-
handleNotification: async () => ({
|
|
420
|
-
shouldShowAlert: true,
|
|
421
|
-
shouldPlaySound: true,
|
|
422
|
-
shouldSetBadge: true,
|
|
423
|
-
}),
|
|
424
|
-
})
|
|
425
|
-
|
|
426
|
-
// Background app refresh
|
|
427
|
-
import * as BackgroundFetch from 'expo-background-fetch'
|
|
428
|
-
import * as TaskManager from 'expo-task-manager'
|
|
429
|
-
|
|
430
|
-
const BACKGROUND_SYNC_TASK = 'background-sync'
|
|
431
|
-
|
|
432
|
-
TaskManager.defineTask(BACKGROUND_SYNC_TASK, () => {
|
|
433
|
-
// Background sync logic
|
|
434
|
-
return BackgroundFetch.BackgroundFetchResult.NewData
|
|
435
|
-
})
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### Android Features
|
|
439
|
-
```typescript
|
|
440
|
-
// File system access
|
|
441
|
-
import * as DocumentPicker from 'expo-document-picker'
|
|
442
|
-
|
|
443
|
-
const pickDocument = async () => {
|
|
444
|
-
const result = await DocumentPicker.getDocumentAsync({
|
|
445
|
-
type: ['text/plain', 'text/markdown', 'application/pdf'],
|
|
446
|
-
copyToCacheDirectory: true,
|
|
447
|
-
multiple: true
|
|
448
|
-
})
|
|
449
|
-
|
|
450
|
-
if (result.type === 'success') {
|
|
451
|
-
// Process selected documents
|
|
452
|
-
await addDocumentToKnowledge(result)
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// Deep linking
|
|
457
|
-
import * as Linking from 'expo-linking'
|
|
458
|
-
|
|
459
|
-
const url = Linking.createURL('knowledge', {
|
|
460
|
-
queryParams: { id: 'doc123' }
|
|
461
|
-
})
|
|
462
|
-
// myapp://knowledge?id=doc123
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
## 🧪 Testing
|
|
466
|
-
|
|
467
|
-
### Unit Tests
|
|
468
|
-
```bash
|
|
469
|
-
npm run test
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
### Component Testing
|
|
473
|
-
```typescript
|
|
474
|
-
import { render, fireEvent } from '@testing-library/react-native'
|
|
475
|
-
import { RAGChatPanel } from '@/components/RAGChatPanel'
|
|
476
|
-
|
|
477
|
-
test('sends query on button press', () => {
|
|
478
|
-
const mockQuery = jest.fn()
|
|
479
|
-
const { getByTestId } = render(
|
|
480
|
-
<RAGChatPanel onQuery={mockQuery} />
|
|
481
|
-
)
|
|
482
|
-
|
|
483
|
-
fireEvent.press(getByTestId('send-button'))
|
|
484
|
-
expect(mockQuery).toHaveBeenCalled()
|
|
485
|
-
})
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
### E2E Testing with Detox
|
|
489
|
-
```javascript
|
|
490
|
-
describe('AI Chat Flow', () => {
|
|
491
|
-
beforeEach(async () => {
|
|
492
|
-
await device.reloadReactNative()
|
|
493
|
-
})
|
|
494
|
-
|
|
495
|
-
it('should navigate to chat and send message', async () => {
|
|
496
|
-
await element(by.id('ai-tab')).tap()
|
|
497
|
-
await element(by.id('chat-input')).typeText('Hello AI')
|
|
498
|
-
await element(by.id('send-button')).tap()
|
|
499
|
-
await expect(element(by.id('chat-message'))).toBeVisible()
|
|
500
|
-
})
|
|
501
|
-
})
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
## 🔧 Configuration
|
|
505
|
-
|
|
506
|
-
### Domain-Specific Mobile Configs
|
|
507
|
-
```typescript
|
|
508
|
-
// lib/rag/mobileConfig.ts
|
|
509
|
-
export const mobileRAGConfigs = {
|
|
510
|
-
plants: {
|
|
511
|
-
voice: {
|
|
512
|
-
plantNamesRecognition: true,
|
|
513
|
-
scientificNamesSupport: true
|
|
514
|
-
},
|
|
515
|
-
camera: {
|
|
516
|
-
plantIdentification: true,
|
|
517
|
-
diseaseDetection: true
|
|
518
|
-
},
|
|
519
|
-
notifications: {
|
|
520
|
-
wateringReminders: true,
|
|
521
|
-
seasonalTips: true
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
ecommerce: {
|
|
526
|
-
voice: {
|
|
527
|
-
productSearch: true,
|
|
528
|
-
priceQueries: true
|
|
529
|
-
},
|
|
530
|
-
camera: {
|
|
531
|
-
barcodeScanning: true,
|
|
532
|
-
visualSearch: true
|
|
533
|
-
},
|
|
534
|
-
notifications: {
|
|
535
|
-
priceAlerts: true,
|
|
536
|
-
stockUpdates: true
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
## 📈 Performance Best Practices
|
|
543
|
-
|
|
544
|
-
### Memory Management
|
|
545
|
-
```typescript
|
|
546
|
-
// Efficient list rendering
|
|
547
|
-
import { FlashList } from '@shopify/flash-list'
|
|
548
|
-
|
|
549
|
-
<FlashList
|
|
550
|
-
data={knowledge}
|
|
551
|
-
renderItem={renderKnowledgeItem}
|
|
552
|
-
estimatedItemSize={120}
|
|
553
|
-
getItemType={(item) => item.category}
|
|
554
|
-
removeClippedSubviews={true}
|
|
555
|
-
/>
|
|
556
|
-
|
|
557
|
-
// Image optimization
|
|
558
|
-
import { Image } from 'expo-image'
|
|
559
|
-
|
|
560
|
-
<Image
|
|
561
|
-
source={{ uri: imageUrl }}
|
|
562
|
-
placeholder={blurhash}
|
|
563
|
-
contentFit="cover"
|
|
564
|
-
transition={200}
|
|
565
|
-
/>
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
### Battery Optimization
|
|
569
|
-
```typescript
|
|
570
|
-
// Debounced search to reduce API calls
|
|
571
|
-
import { useDebouncedCallback } from 'use-debounce'
|
|
572
|
-
|
|
573
|
-
const debouncedSearch = useDebouncedCallback(
|
|
574
|
-
(query: string) => ragSystem.query(query),
|
|
575
|
-
500 // 500ms delay
|
|
576
|
-
)
|
|
577
|
-
|
|
578
|
-
// Background task limiting
|
|
579
|
-
import * as BackgroundFetch from 'expo-background-fetch'
|
|
580
|
-
|
|
581
|
-
await BackgroundFetch.setMinimumIntervalAsync(
|
|
582
|
-
BackgroundFetch.BackgroundFetchInterval.Never
|
|
583
|
-
)
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
## 🎯 Advanced Mobile Features
|
|
587
|
-
|
|
588
|
-
### Augmented Reality Integration
|
|
589
|
-
```typescript
|
|
590
|
-
// ARCore/ARKit for visual knowledge search
|
|
591
|
-
import { Camera } from 'expo-camera'
|
|
592
|
-
import { BarCodeScanner } from 'expo-barcode-scanner'
|
|
593
|
-
|
|
594
|
-
const ARKnowledgeScanner = () => {
|
|
595
|
-
const handleBarCodeScanned = ({ data }) => {
|
|
596
|
-
// Search knowledge base for scanned item
|
|
597
|
-
ragSystem.query(`Information about ${data}`)
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
return (
|
|
601
|
-
<Camera
|
|
602
|
-
style={styles.camera}
|
|
603
|
-
onBarCodeScanned={handleBarCodeScanned}
|
|
604
|
-
barCodeScannerSettings={{
|
|
605
|
-
barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
|
|
606
|
-
}}
|
|
607
|
-
/>
|
|
608
|
-
)
|
|
609
|
-
}
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
### Machine Learning Integration
|
|
613
|
-
```typescript
|
|
614
|
-
// On-device ML for enhanced privacy
|
|
615
|
-
import * as tf from '@tensorflow/tfjs-react-native'
|
|
616
|
-
|
|
617
|
-
const processImageLocally = async (imageUri: string) => {
|
|
618
|
-
// Load pre-trained model for image classification
|
|
619
|
-
const modelUrl = bundleResourceIO(modelJson, modelWeights)
|
|
620
|
-
const model = await tf.loadLayersModel(modelUrl)
|
|
621
|
-
|
|
622
|
-
// Process image and search knowledge
|
|
623
|
-
const predictions = await model.predict(processedImage)
|
|
624
|
-
const searchQuery = interpretPredictions(predictions)
|
|
625
|
-
|
|
626
|
-
return ragSystem.query(searchQuery)
|
|
627
|
-
}
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
## 🤝 Contributing
|
|
631
|
-
|
|
632
|
-
1. Fork the repository
|
|
633
|
-
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
634
|
-
3. Make your changes and test on both iOS and Android
|
|
635
|
-
4. Run tests: `npm run test`
|
|
636
|
-
5. Submit a pull request
|
|
637
|
-
|
|
638
|
-
## 📄 License
|
|
639
|
-
|
|
640
|
-
MIT License - see LICENSE file for details
|
|
641
|
-
|
|
642
|
-
## 🆘 Support
|
|
643
|
-
|
|
644
|
-
- 📖 [Mobile Documentation](https://docs.example.com/mobile-rag)
|
|
645
|
-
- 💬 [Discord Community](https://discord.gg/example)
|
|
646
|
-
- 🐛 [Issue Tracker](https://github.com/example/mobile-issues)
|
|
647
|
-
- 📱 [Mobile-Specific FAQ](https://docs.example.com/mobile-faq)
|
|
648
|
-
|
|
649
|
-
---
|
|
650
|
-
|
|
651
|
-
Built with ❤️ using Expo, React Native, Supabase, OpenAI, and RAG v4.0.0
|
|
652
|
-
|
|
653
|
-
**Download from:**
|
|
654
|
-
- 🍎 [App Store](https://apps.apple.com/app/example)
|
|
655
|
-
- 🤖 [Google Play](https://play.google.com/store/apps/example)
|