@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.
Files changed (416) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +153 -113
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cli/commands/create.d.ts.map +1 -1
  5. package/dist/cli/commands/create.js +2 -6
  6. package/dist/cli/commands/create.js.map +1 -1
  7. package/dist/cli/index.js +1 -1
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/generators/template-generator.d.ts.map +1 -1
  10. package/dist/generators/template-generator.js +15 -8
  11. package/dist/generators/template-generator.js.map +1 -1
  12. package/dist/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
  13. package/dist/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
  14. package/dist/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
  15. package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
  16. package/dist/templates/shared/design/web/src/components/ui/button.tsx +56 -0
  17. package/dist/templates/shared/email/web/src/lib/email/client.ts +1 -1
  18. package/dist/templates/shared/error-pages/web/src/app/error.tsx +13 -11
  19. package/dist/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
  20. package/dist/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
  21. package/dist/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
  22. package/dist/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
  23. package/dist/templates/shared/loading/web/components/skeleton.tsx +4 -4
  24. package/dist/templates/shared/mock/web/.env.local +55 -0
  25. package/dist/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
  26. package/dist/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
  27. package/dist/templates/shared/mock/web/src/lib/mock.ts +147 -0
  28. package/dist/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
  29. package/dist/templates/shared/redis/web/src/lib/redis.ts +1 -1
  30. package/dist/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
  31. package/dist/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
  32. package/dist/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
  33. package/dist/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
  34. package/dist/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
  35. package/dist/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
  36. package/dist/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
  37. package/dist/templates/web/base/template/eslint.config.mjs +14 -0
  38. package/dist/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
  39. package/dist/templates/web/base/template/src/app/checkout/page.tsx +76 -103
  40. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
  41. package/dist/templates/web/base/template/src/app/layout.tsx +40 -38
  42. package/dist/templates/web/base/template/src/app/login/page.tsx +116 -66
  43. package/dist/templates/web/base/template/src/app/page.tsx +97 -193
  44. package/dist/templates/web/base/template/src/app/settings/page.tsx +154 -0
  45. package/dist/templates/web/base/template/src/app/signup/page.tsx +117 -66
  46. package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
  47. package/dist/templates/web/base/template/src/components/shared/header.tsx +229 -63
  48. package/dist/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
  49. package/dist/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
  50. package/dist/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
  51. package/dist/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
  52. package/dist/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
  53. package/dist/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
  54. package/dist/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
  55. package/dist/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
  56. package/dist/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
  57. package/dist/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
  58. package/dist/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
  59. package/dist/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
  60. package/dist/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
  61. package/dist/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
  62. package/dist/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
  63. package/dist/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
  64. package/dist/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
  65. package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +14 -3
  66. package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
  67. package/dist/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
  68. package/dist/templates/web/ui-auth/template/eslint.config.mjs +14 -0
  69. package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
  70. package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
  71. package/dist/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
  72. package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
  73. package/dist/templates/web/ui-auth/template/src/app/page.tsx +106 -306
  74. package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
  75. package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
  76. package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
  77. package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
  78. package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
  79. package/dist/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
  80. package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
  81. package/dist/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
  82. package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
  83. package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
  84. package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
  85. package/dist/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
  86. package/dist/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
  87. package/dist/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
  88. package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
  89. package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
  90. package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
  91. package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
  92. package/dist/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
  93. package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
  94. package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
  95. package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
  96. package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
  97. package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
  98. package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
  99. package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
  100. package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
  101. package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
  102. package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
  103. package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
  104. package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
  105. package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
  106. package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
  107. package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
  108. package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
  109. package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
  110. package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
  111. package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
  112. package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
  113. package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
  114. package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
  115. package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
  116. package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
  117. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
  118. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
  119. package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
  120. package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
  121. package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
  122. package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
  123. package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
  124. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
  125. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
  126. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
  127. package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
  128. package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
  129. package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
  130. package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
  131. package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
  132. package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
  133. package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
  134. package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
  135. package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
  136. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
  137. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
  138. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
  139. package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
  140. package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
  141. package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
  142. package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
  143. package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
  144. package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
  145. package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
  146. package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
  147. package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
  148. package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
  149. package/dist/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
  150. package/dist/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
  151. package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
  152. package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
  153. package/dist/templates/web/ui-only/template/eslint.config.mjs +14 -0
  154. package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
  155. package/dist/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
  156. package/dist/templates/web/ui-only/template/src/app/page.tsx +69 -91
  157. package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
  158. package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
  159. package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
  160. package/dist/templates/web/ui-package-test/template/package.json +19 -23
  161. package/dist/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
  162. package/dist/templates/web/ui-package-test/template/src/app/globals.css +88 -0
  163. package/dist/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
  164. package/dist/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
  165. package/package.json +1 -1
  166. package/src/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
  167. package/src/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
  168. package/src/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
  169. package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
  170. package/src/templates/shared/design/web/src/components/ui/button.tsx +56 -0
  171. package/src/templates/shared/email/web/src/lib/email/client.ts +1 -1
  172. package/src/templates/shared/error-pages/web/src/app/error.tsx +13 -11
  173. package/src/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
  174. package/src/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
  175. package/src/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
  176. package/src/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
  177. package/src/templates/shared/loading/web/components/skeleton.tsx +4 -4
  178. package/src/templates/shared/mock/web/.env.local +55 -0
  179. package/src/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
  180. package/src/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
  181. package/src/templates/shared/mock/web/src/lib/mock.ts +147 -0
  182. package/src/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
  183. package/src/templates/shared/redis/web/src/lib/redis.ts +1 -1
  184. package/src/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
  185. package/src/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
  186. package/src/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
  187. package/src/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
  188. package/src/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
  189. package/src/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
  190. package/src/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
  191. package/src/templates/web/base/template/eslint.config.mjs +14 -0
  192. package/src/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
  193. package/src/templates/web/base/template/src/app/checkout/page.tsx +76 -103
  194. package/src/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
  195. package/src/templates/web/base/template/src/app/layout.tsx +40 -38
  196. package/src/templates/web/base/template/src/app/login/page.tsx +116 -66
  197. package/src/templates/web/base/template/src/app/page.tsx +97 -193
  198. package/src/templates/web/base/template/src/app/settings/page.tsx +154 -0
  199. package/src/templates/web/base/template/src/app/signup/page.tsx +117 -66
  200. package/src/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
  201. package/src/templates/web/base/template/src/components/shared/header.tsx +229 -63
  202. package/src/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
  203. package/src/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
  204. package/src/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
  205. package/src/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
  206. package/src/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
  207. package/src/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
  208. package/src/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
  209. package/src/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
  210. package/src/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
  211. package/src/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
  212. package/src/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
  213. package/src/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
  214. package/src/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
  215. package/src/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
  216. package/src/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
  217. package/src/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
  218. package/src/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
  219. package/src/templates/web/micro-saas/template/src/app/login/page.tsx +14 -3
  220. package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +15 -4
  221. package/src/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
  222. package/src/templates/web/ui-auth/template/eslint.config.mjs +14 -0
  223. package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
  224. package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
  225. package/src/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
  226. package/src/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
  227. package/src/templates/web/ui-auth/template/src/app/page.tsx +106 -306
  228. package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
  229. package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
  230. package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
  231. package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
  232. package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
  233. package/src/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
  234. package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
  235. package/src/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
  236. package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
  237. package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
  238. package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
  239. package/src/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
  240. package/src/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
  241. package/src/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
  242. package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
  243. package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
  244. package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
  245. package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
  246. package/src/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
  247. package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
  248. package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
  249. package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
  250. package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
  251. package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
  252. package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
  253. package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
  254. package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
  255. package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
  256. package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
  257. package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
  258. package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
  259. package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
  260. package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
  261. package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
  262. package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
  263. package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
  264. package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
  265. package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
  266. package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
  267. package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
  268. package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
  269. package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
  270. package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
  271. package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
  272. package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
  273. package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
  274. package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
  275. package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
  276. package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
  277. package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
  278. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
  279. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
  280. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
  281. package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
  282. package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
  283. package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
  284. package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
  285. package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
  286. package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
  287. package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
  288. package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
  289. package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
  290. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
  291. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
  292. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
  293. package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
  294. package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
  295. package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
  296. package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
  297. package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
  298. package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
  299. package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
  300. package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
  301. package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
  302. package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
  303. package/src/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
  304. package/src/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
  305. package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
  306. package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
  307. package/src/templates/web/ui-only/template/eslint.config.mjs +14 -0
  308. package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
  309. package/src/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
  310. package/src/templates/web/ui-only/template/src/app/page.tsx +69 -91
  311. package/src/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
  312. package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
  313. package/src/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
  314. package/src/templates/web/ui-package-test/template/package.json +19 -23
  315. package/src/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
  316. package/src/templates/web/ui-package-test/template/src/app/globals.css +88 -0
  317. package/src/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
  318. package/src/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
  319. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
  320. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
  321. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
  322. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
  323. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
  324. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
  325. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
  326. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
  327. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
  328. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
  329. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
  330. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
  331. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
  332. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
  333. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
  334. package/dist/templates/web/base/template/.eslintrc.js +0 -8
  335. package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
  336. package/dist/templates/web/base/template/src/test/setup.ts +0 -74
  337. package/dist/templates/web/base/template/vitest.config.ts +0 -17
  338. package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
  339. package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
  340. package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -74
  341. package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
  342. package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
  343. package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
  344. package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
  345. package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
  346. package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
  347. package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
  348. package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
  349. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
  350. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
  351. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
  352. package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
  353. package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
  354. package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
  355. package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
  356. package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
  357. package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
  358. package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
  359. package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
  360. package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
  361. package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
  362. package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
  363. package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
  364. package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
  365. package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
  366. package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -74
  367. package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
  368. package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
  369. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
  370. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
  371. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
  372. package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
  373. package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
  374. package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
  375. package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
  376. package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
  377. package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
  378. package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
  379. package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
  380. package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
  381. package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
  382. package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
  383. package/src/templates/web/base/template/.eslintrc.js +0 -8
  384. package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
  385. package/src/templates/web/base/template/src/test/setup.ts +0 -74
  386. package/src/templates/web/base/template/vitest.config.ts +0 -17
  387. package/src/templates/web/ui-auth/template/.eslintrc.js +0 -8
  388. package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
  389. package/src/templates/web/ui-auth/template/src/test/setup.ts +0 -74
  390. package/src/templates/web/ui-auth/template/vitest.config.ts +0 -17
  391. package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
  392. package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
  393. package/src/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
  394. package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
  395. package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
  396. package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
  397. package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
  398. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
  399. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
  400. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
  401. package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
  402. package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
  403. package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
  404. package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
  405. package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
  406. package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
  407. package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
  408. package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
  409. package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
  410. package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
  411. package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
  412. package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
  413. package/src/templates/web/ui-only/template/.eslintrc.js +0 -8
  414. package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
  415. package/src/templates/web/ui-only/template/src/test/setup.ts +0 -74
  416. 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)