@digilogiclabs/create-saas-app 2.11.0 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli/index.js +1 -1
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/generators/template-generator.d.ts +0 -2
  6. package/dist/generators/template-generator.d.ts.map +1 -1
  7. package/dist/generators/template-generator.js +18 -17
  8. package/dist/generators/template-generator.js.map +1 -1
  9. package/dist/templates/mobile/base/template/App.tsx +7 -4
  10. package/dist/templates/mobile/base/template/app/checkout.tsx +5 -2
  11. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +6 -2
  12. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +7 -3
  13. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +5 -2
  14. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +7 -2
  15. package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +2 -4
  16. package/dist/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +6 -3
  17. package/dist/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +6 -3
  18. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +6 -2
  19. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +7 -3
  20. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +5 -2
  21. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +7 -2
  22. package/dist/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +2 -4
  23. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +6 -3
  24. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +6 -3
  25. package/dist/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
  26. package/dist/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
  27. package/dist/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
  28. package/dist/templates/shared/config/web/next.config.mjs +0 -1
  29. package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
  30. package/dist/templates/shared/design/web/src/components/ui/button.tsx +56 -0
  31. package/dist/templates/shared/email/web/src/lib/email/client.ts +1 -1
  32. package/dist/templates/shared/error-pages/web/src/app/error.tsx +13 -11
  33. package/dist/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
  34. package/dist/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
  35. package/dist/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
  36. package/dist/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
  37. package/dist/templates/shared/loading/web/components/skeleton.tsx +4 -4
  38. package/dist/templates/shared/mock/web/.env.local +55 -0
  39. package/dist/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
  40. package/dist/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
  41. package/dist/templates/shared/mock/web/src/lib/mock.ts +147 -0
  42. package/dist/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
  43. package/dist/templates/shared/redis/web/src/lib/redis.ts +1 -1
  44. package/dist/templates/web/ai-platform/template/package.json +0 -1
  45. package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +5 -2
  46. package/dist/templates/web/ai-platform/template/src/app/playground/page.tsx +5 -2
  47. package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +2 -5
  48. package/dist/templates/web/base/template/eslint.config.mjs +14 -0
  49. package/dist/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
  50. package/dist/templates/web/base/template/src/app/checkout/page.tsx +76 -103
  51. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
  52. package/dist/templates/web/base/template/src/app/layout.tsx +40 -38
  53. package/dist/templates/web/base/template/src/app/login/page.tsx +116 -66
  54. package/dist/templates/web/base/template/src/app/page.tsx +97 -193
  55. package/dist/templates/web/base/template/src/app/settings/page.tsx +154 -0
  56. package/dist/templates/web/base/template/src/app/signup/page.tsx +117 -66
  57. package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
  58. package/dist/templates/web/base/template/src/components/shared/header.tsx +229 -63
  59. package/dist/templates/web/iot-dashboard/template/package.json +0 -1
  60. package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +2 -5
  61. package/dist/templates/web/marketplace/template/package.json +0 -1
  62. package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +2 -5
  63. package/dist/templates/web/micro-saas/template/package.json +0 -1
  64. package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +2 -5
  65. package/dist/templates/web/ui-auth/template/eslint.config.mjs +14 -0
  66. package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
  67. package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
  68. package/dist/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
  69. package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
  70. package/dist/templates/web/ui-auth/template/src/app/page.tsx +106 -306
  71. package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
  72. package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
  73. package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
  74. package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
  75. package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
  76. package/dist/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
  77. package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
  78. package/dist/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
  79. package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
  80. package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
  81. package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
  82. package/dist/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
  83. package/dist/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
  84. package/dist/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
  85. package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
  86. package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
  87. package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
  88. package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
  89. package/dist/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
  90. package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
  91. package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
  92. package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
  93. package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
  94. package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
  95. package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
  96. package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
  97. package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
  98. package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
  99. package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
  100. package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
  101. package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
  102. package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
  103. package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
  104. package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
  105. package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
  106. package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
  107. package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
  108. package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
  109. package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
  110. package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
  111. package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
  112. package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
  113. package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
  114. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
  115. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
  116. package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
  117. package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
  118. package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
  119. package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
  120. package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
  121. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
  122. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
  123. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
  124. package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
  125. package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
  126. package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
  127. package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
  128. package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
  129. package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
  130. package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
  131. package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
  132. package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
  133. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
  134. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
  135. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
  136. package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
  137. package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
  138. package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
  139. package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
  140. package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
  141. package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
  142. package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
  143. package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
  144. package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
  145. package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
  146. package/dist/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
  147. package/dist/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
  148. package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
  149. package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
  150. package/dist/templates/web/ui-only/template/eslint.config.mjs +14 -0
  151. package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
  152. package/dist/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
  153. package/dist/templates/web/ui-only/template/src/app/page.tsx +69 -91
  154. package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
  155. package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
  156. package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
  157. package/dist/templates/web/ui-package-test/template/package.json +19 -23
  158. package/dist/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
  159. package/dist/templates/web/ui-package-test/template/src/app/globals.css +88 -0
  160. package/dist/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
  161. package/dist/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
  162. package/package.json +1 -1
  163. package/src/templates/mobile/base/template/App.tsx +7 -4
  164. package/src/templates/mobile/base/template/app/checkout.tsx +5 -2
  165. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +6 -2
  166. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +7 -3
  167. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +5 -2
  168. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +7 -2
  169. package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +2 -4
  170. package/src/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +6 -3
  171. package/src/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +6 -3
  172. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +6 -2
  173. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +7 -3
  174. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +5 -2
  175. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +7 -2
  176. package/src/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +2 -4
  177. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +6 -3
  178. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +6 -3
  179. package/src/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
  180. package/src/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
  181. package/src/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
  182. package/src/templates/shared/config/web/next.config.mjs +0 -1
  183. package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
  184. package/src/templates/shared/design/web/src/components/ui/button.tsx +56 -0
  185. package/src/templates/shared/email/web/src/lib/email/client.ts +1 -1
  186. package/src/templates/shared/error-pages/web/src/app/error.tsx +13 -11
  187. package/src/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
  188. package/src/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
  189. package/src/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
  190. package/src/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
  191. package/src/templates/shared/loading/web/components/skeleton.tsx +4 -4
  192. package/src/templates/shared/mock/web/.env.local +55 -0
  193. package/src/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
  194. package/src/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
  195. package/src/templates/shared/mock/web/src/lib/mock.ts +147 -0
  196. package/src/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
  197. package/src/templates/shared/redis/web/src/lib/redis.ts +1 -1
  198. package/src/templates/web/ai-platform/template/package.json +0 -1
  199. package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +5 -2
  200. package/src/templates/web/ai-platform/template/src/app/playground/page.tsx +5 -2
  201. package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +2 -5
  202. package/src/templates/web/base/template/eslint.config.mjs +14 -0
  203. package/src/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
  204. package/src/templates/web/base/template/src/app/checkout/page.tsx +76 -103
  205. package/src/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
  206. package/src/templates/web/base/template/src/app/layout.tsx +40 -38
  207. package/src/templates/web/base/template/src/app/login/page.tsx +116 -66
  208. package/src/templates/web/base/template/src/app/page.tsx +97 -193
  209. package/src/templates/web/base/template/src/app/settings/page.tsx +154 -0
  210. package/src/templates/web/base/template/src/app/signup/page.tsx +117 -66
  211. package/src/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
  212. package/src/templates/web/base/template/src/components/shared/header.tsx +229 -63
  213. package/src/templates/web/iot-dashboard/template/package.json +0 -1
  214. package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +2 -5
  215. package/src/templates/web/marketplace/template/package.json +0 -1
  216. package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +2 -5
  217. package/src/templates/web/micro-saas/template/package.json +0 -1
  218. package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +2 -5
  219. package/src/templates/web/ui-auth/template/eslint.config.mjs +14 -0
  220. package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
  221. package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
  222. package/src/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
  223. package/src/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
  224. package/src/templates/web/ui-auth/template/src/app/page.tsx +106 -306
  225. package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
  226. package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
  227. package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
  228. package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
  229. package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
  230. package/src/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
  231. package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
  232. package/src/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
  233. package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
  234. package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
  235. package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
  236. package/src/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
  237. package/src/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
  238. package/src/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
  239. package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
  240. package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
  241. package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
  242. package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
  243. package/src/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
  244. package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
  245. package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
  246. package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
  247. package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
  248. package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
  249. package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
  250. package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
  251. package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
  252. package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
  253. package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
  254. package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
  255. package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
  256. package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
  257. package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
  258. package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
  259. package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
  260. package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
  261. package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
  262. package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
  263. package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
  264. package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
  265. package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
  266. package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
  267. package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
  268. package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
  269. package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
  270. package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
  271. package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
  272. package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
  273. package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
  274. package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
  275. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
  276. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
  277. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
  278. package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
  279. package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
  280. package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
  281. package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
  282. package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
  283. package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
  284. package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
  285. package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
  286. package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
  287. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
  288. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
  289. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
  290. package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
  291. package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
  292. package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
  293. package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
  294. package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
  295. package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
  296. package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
  297. package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
  298. package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
  299. package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
  300. package/src/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
  301. package/src/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
  302. package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
  303. package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
  304. package/src/templates/web/ui-only/template/eslint.config.mjs +14 -0
  305. package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
  306. package/src/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
  307. package/src/templates/web/ui-only/template/src/app/page.tsx +69 -91
  308. package/src/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
  309. package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
  310. package/src/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
  311. package/src/templates/web/ui-package-test/template/package.json +19 -23
  312. package/src/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
  313. package/src/templates/web/ui-package-test/template/src/app/globals.css +88 -0
  314. package/src/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
  315. package/src/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
  316. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
  317. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
  318. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
  319. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
  320. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
  321. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
  322. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
  323. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
  324. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
  325. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
  326. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
  327. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
  328. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
  329. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
  330. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
  331. package/dist/templates/web/base/template/.eslintrc.js +0 -8
  332. package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
  333. package/dist/templates/web/base/template/src/test/setup.ts +0 -74
  334. package/dist/templates/web/base/template/vitest.config.ts +0 -17
  335. package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
  336. package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
  337. package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -74
  338. package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
  339. package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
  340. package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
  341. package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
  342. package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
  343. package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
  344. package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
  345. package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
  346. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
  347. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
  348. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
  349. package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
  350. package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
  351. package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
  352. package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
  353. package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
  354. package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
  355. package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
  356. package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
  357. package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
  358. package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
  359. package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
  360. package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
  361. package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
  362. package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
  363. package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -74
  364. package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
  365. package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
  366. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
  367. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
  368. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
  369. package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
  370. package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
  371. package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
  372. package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
  373. package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
  374. package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
  375. package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
  376. package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
  377. package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
  378. package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
  379. package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
  380. package/src/templates/web/base/template/.eslintrc.js +0 -8
  381. package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
  382. package/src/templates/web/base/template/src/test/setup.ts +0 -74
  383. package/src/templates/web/base/template/vitest.config.ts +0 -17
  384. package/src/templates/web/ui-auth/template/.eslintrc.js +0 -8
  385. package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
  386. package/src/templates/web/ui-auth/template/src/test/setup.ts +0 -74
  387. package/src/templates/web/ui-auth/template/vitest.config.ts +0 -17
  388. package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
  389. package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
  390. package/src/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
  391. package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
  392. package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
  393. package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
  394. package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
  395. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
  396. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
  397. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
  398. package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
  399. package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
  400. package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
  401. package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
  402. package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
  403. package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
  404. package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
  405. package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
  406. package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
  407. package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
  408. package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
  409. package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
  410. package/src/templates/web/ui-only/template/.eslintrc.js +0 -8
  411. package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
  412. package/src/templates/web/ui-only/template/src/test/setup.ts +0 -74
  413. package/src/templates/web/ui-only/template/vitest.config.ts +0 -17
@@ -1,787 +0,0 @@
1
- # Mobile AI Setup Guide
2
-
3
- Complete setup guide for your React Native AI Knowledge App with RAG v4.0.0.
4
-
5
- ## 📱 Quick Mobile Setup
6
-
7
- ```bash
8
- # Create mobile AI app
9
- npm create saas-app my-mobile-ai --template=mobile-ai-rag
10
- cd my-mobile-ai
11
-
12
- # Setup for React Native/Expo
13
- npm run setup:rag
14
-
15
- # Seed mobile knowledge
16
- npm run seed:knowledge
17
-
18
- # Start development
19
- npx expo start
20
- ```
21
-
22
- **Scan QR code with Expo Go app** or press `i` for iOS simulator, `a` for Android emulator.
23
-
24
- ## 🔧 Prerequisites
25
-
26
- ### Development Environment
27
-
28
- **macOS (iOS + Android):**
29
- ```bash
30
- # Install Xcode (for iOS)
31
- # Download from Mac App Store
32
-
33
- # Install Android Studio (for Android)
34
- # Download from developer.android.com
35
-
36
- # Install Expo CLI
37
- npm install -g @expo/cli
38
-
39
- # Install iOS Simulator (optional)
40
- xcrun simctl list devices
41
- ```
42
-
43
- **Windows/Linux (Android only):**
44
- ```bash
45
- # Install Android Studio
46
- # Download from developer.android.com
47
-
48
- # Install Expo CLI
49
- npm install -g @expo/cli
50
-
51
- # Setup Android emulator
52
- # Follow Android Studio setup guide
53
- ```
54
-
55
- ### Required Accounts
56
-
57
- 1. **Expo Account**: [Sign up at expo.dev](https://expo.dev/)
58
- 2. **Supabase Account**: [Database backend](https://supabase.com/)
59
- 3. **OpenAI Account**: [AI/ML services](https://platform.openai.com/)
60
- 4. **EAS Account**: For app building (optional for development)
61
-
62
- ## 📁 Mobile Project Structure
63
-
64
- ```
65
- my-mobile-ai/
66
- ├── app/ # Expo Router pages
67
- │ ├── (tabs)/ # Tab navigation
68
- │ │ ├── ai.tsx # Main AI interface
69
- │ │ ├── knowledge.tsx # Knowledge management
70
- │ │ └── analytics.tsx # Usage analytics
71
- │ ├── auth/ # Authentication screens
72
- │ │ ├── login.tsx
73
- │ │ └── signup.tsx
74
- │ └── onboarding/ # First-time user flow
75
- ├── components/
76
- │ └── rag/ # RAG-specific components
77
- ├── hooks/
78
- │ ├── useRAGSystem.ts # Core RAG functionality
79
- │ ├── useOfflineSync.ts # Offline capabilities
80
- │ └── useVoiceInput.ts # Speech recognition
81
- ├── lib/
82
- │ ├── rag/ # RAG configuration
83
- │ ├── supabase.ts # Mobile Supabase client
84
- │ └── storage.ts # AsyncStorage utilities
85
- ├── types/ # TypeScript definitions
86
- └── scripts/ # Setup and utility scripts
87
- ```
88
-
89
- ## ⚙️ Environment Configuration
90
-
91
- ### Mobile Environment Variables
92
-
93
- Create `.env.local`:
94
-
95
- ```env
96
- # Supabase Configuration
97
- EXPO_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
98
- EXPO_PUBLIC_SUPABASE_ANON_KEY=eyJ0eXAi...your-anon-key
99
-
100
- # OpenAI Configuration (client-side)
101
- EXPO_PUBLIC_OPENAI_API_KEY=sk-...your-openai-key
102
-
103
- # App Configuration
104
- APP_VARIANT=development
105
- EAS_PROJECT_ID=your-eas-project-id
106
- ```
107
-
108
- ⚠️ **Security Note**: React Native embeds environment variables in the build. For production apps, use server-side API routes for sensitive operations.
109
-
110
- ### App Configuration
111
-
112
- Update `app.config.js`:
113
-
114
- ```javascript
115
- const IS_DEV = process.env.APP_VARIANT === 'development'
116
-
117
- export default {
118
- expo: {
119
- name: IS_DEV ? 'AI Assistant (Dev)' : 'AI Assistant',
120
- slug: 'ai-knowledge-assistant',
121
- version: '1.0.0',
122
-
123
- // App icons and splash screen
124
- icon: './assets/icon.png',
125
- splash: {
126
- image: './assets/splash.png',
127
- resizeMode: 'contain',
128
- backgroundColor: '#ffffff'
129
- },
130
-
131
- // Platform-specific config
132
- ios: {
133
- bundleIdentifier: 'com.yourcompany.ai-assistant',
134
- supportsTablet: true,
135
- infoPlist: {
136
- NSMicrophoneUsageDescription: 'This app uses microphone for voice queries',
137
- NSCameraUsageDescription: 'This app uses camera to scan documents'
138
- }
139
- },
140
-
141
- android: {
142
- package: 'com.yourcompany.aiassistant',
143
- permissions: [
144
- 'RECORD_AUDIO',
145
- 'CAMERA',
146
- 'READ_EXTERNAL_STORAGE'
147
- ]
148
- },
149
-
150
- // Configuration passed to app
151
- extra: {
152
- supabaseUrl: process.env.EXPO_PUBLIC_SUPABASE_URL,
153
- supabaseAnonKey: process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY,
154
- openaiApiKey: process.env.EXPO_PUBLIC_OPENAI_API_KEY
155
- }
156
- }
157
- }
158
- ```
159
-
160
- ## 🎯 Domain-Specific Mobile Configs
161
-
162
- ### Plant Care App
163
- ```typescript
164
- // lib/rag/config.ts
165
- export const plantCareConfig = {
166
- domain: 'plants',
167
- voice: {
168
- plantNamesRecognition: true,
169
- scientificNamesSupport: true,
170
- gardeningTerms: true
171
- },
172
- camera: {
173
- plantIdentification: true,
174
- diseaseDetection: true,
175
- leafAnalysis: true
176
- },
177
- notifications: {
178
- wateringReminders: true,
179
- seasonalTips: true,
180
- pestAlerts: true
181
- },
182
- offline: {
183
- essentialPlantInfo: true,
184
- emergencyGuides: true
185
- }
186
- }
187
- ```
188
-
189
- ### E-commerce App
190
- ```typescript
191
- export const ecommerceConfig = {
192
- domain: 'ecommerce',
193
- voice: {
194
- productSearch: true,
195
- priceQueries: true,
196
- brandRecognition: true
197
- },
198
- camera: {
199
- barcodeScanning: true,
200
- visualProductSearch: true,
201
- receiptScanning: true
202
- },
203
- notifications: {
204
- priceDropAlerts: true,
205
- stockAlerts: true,
206
- dealNotifications: true
207
- },
208
- offline: {
209
- productCatalog: true,
210
- wishlistAccess: true
211
- }
212
- }
213
- ```
214
-
215
- ### Education App
216
- ```typescript
217
- export const educationConfig = {
218
- domain: 'education',
219
- voice: {
220
- questionAnswering: true,
221
- pronunciationHelp: true,
222
- languageSupport: ['en', 'es', 'fr']
223
- },
224
- camera: {
225
- documentScanning: true,
226
- handwritingRecognition: true,
227
- diagramAnalysis: true
228
- },
229
- notifications: {
230
- studyReminders: true,
231
- assignmentDeadlines: true,
232
- progressUpdates: true
233
- },
234
- offline: {
235
- courseContent: true,
236
- practiceExercises: true,
237
- offlineQuizzes: true
238
- }
239
- }
240
- ```
241
-
242
- ## 📱 Mobile-Specific Features Setup
243
-
244
- ### Voice Input Configuration
245
-
246
- ```typescript
247
- // hooks/useVoiceInput.ts
248
- import { useState, useEffect } from 'react'
249
- import Voice from '@react-native-voice/voice'
250
-
251
- export function useVoiceInput() {
252
- const [isListening, setIsListening] = useState(false)
253
- const [transcript, setTranscript] = useState('')
254
-
255
- useEffect(() => {
256
- Voice.onSpeechStart = () => setIsListening(true)
257
- Voice.onSpeechEnd = () => setIsListening(false)
258
- Voice.onSpeechResults = (e) => setTranscript(e.value[0])
259
-
260
- return () => Voice.destroy().then(Voice.removeAllListeners)
261
- }, [])
262
-
263
- const startListening = async () => {
264
- try {
265
- await Voice.start('en-US')
266
- } catch (error) {
267
- console.error('Voice start error:', error)
268
- }
269
- }
270
-
271
- const stopListening = async () => {
272
- try {
273
- await Voice.stop()
274
- } catch (error) {
275
- console.error('Voice stop error:', error)
276
- }
277
- }
278
-
279
- return { isListening, transcript, startListening, stopListening }
280
- }
281
- ```
282
-
283
- ### Offline Sync Setup
284
-
285
- ```typescript
286
- // hooks/useOfflineSync.ts
287
- import { useState, useEffect } from 'react'
288
- import AsyncStorage from '@react-native-async-storage/async-storage'
289
- import NetInfo from '@react-native-community/netinfo'
290
-
291
- export function useOfflineSync() {
292
- const [isOnline, setIsOnline] = useState(true)
293
- const [pendingQueries, setPendingQueries] = useState<string[]>([])
294
-
295
- useEffect(() => {
296
- const unsubscribe = NetInfo.addEventListener(state => {
297
- setIsOnline(state.isConnected ?? false)
298
-
299
- if (state.isConnected) {
300
- processPendingQueries()
301
- }
302
- })
303
-
304
- loadPendingQueries()
305
- return unsubscribe
306
- }, [])
307
-
308
- const queueQuery = async (query: string) => {
309
- const updated = [...pendingQueries, query]
310
- setPendingQueries(updated)
311
- await AsyncStorage.setItem('pending_queries', JSON.stringify(updated))
312
- }
313
-
314
- const loadPendingQueries = async () => {
315
- const stored = await AsyncStorage.getItem('pending_queries')
316
- if (stored) {
317
- setPendingQueries(JSON.parse(stored))
318
- }
319
- }
320
-
321
- const processPendingQueries = async () => {
322
- // Process queued queries when back online
323
- for (const query of pendingQueries) {
324
- try {
325
- // Process with RAG system
326
- await processQuery(query)
327
- } catch (error) {
328
- console.error('Failed to process queued query:', error)
329
- }
330
- }
331
-
332
- setPendingQueries([])
333
- await AsyncStorage.removeItem('pending_queries')
334
- }
335
-
336
- return { isOnline, queueQuery, pendingCount: pendingQueries.length }
337
- }
338
- ```
339
-
340
- ### Camera Integration
341
-
342
- ```typescript
343
- // components/DocumentScanner.tsx
344
- import { Camera, CameraType } from 'expo-camera'
345
- import { useState } from 'react'
346
- import { Text, View, TouchableOpacity } from 'react-native'
347
-
348
- export function DocumentScanner({ onDocumentScanned }) {
349
- const [type, setType] = useState(CameraType.back)
350
- const [permission, requestPermission] = Camera.useCameraPermissions()
351
-
352
- if (!permission) {
353
- return <View />
354
- }
355
-
356
- if (!permission.granted) {
357
- return (
358
- <View>
359
- <Text>We need camera permission to scan documents</Text>
360
- <TouchableOpacity onPress={requestPermission}>
361
- <Text>Grant Permission</Text>
362
- </TouchableOpacity>
363
- </View>
364
- )
365
- }
366
-
367
- const takePicture = async () => {
368
- if (camera) {
369
- const photo = await camera.takePictureAsync()
370
- // Process photo with OCR or send to RAG system
371
- onDocumentScanned(photo.uri)
372
- }
373
- }
374
-
375
- return (
376
- <View style={{ flex: 1 }}>
377
- <Camera style={{ flex: 1 }} type={type} ref={ref => setCamera(ref)}>
378
- <View style={{ flex: 1, justifyContent: 'flex-end', alignItems: 'center' }}>
379
- <TouchableOpacity onPress={takePicture}>
380
- <Text>Scan Document</Text>
381
- </TouchableOpacity>
382
- </View>
383
- </Camera>
384
- </View>
385
- )
386
- }
387
- ```
388
-
389
- ## 📊 Mobile Analytics Setup
390
-
391
- ### Usage Tracking
392
-
393
- ```typescript
394
- // lib/analytics.ts
395
- import { Analytics } from 'expo-analytics'
396
-
397
- export class MobileRAGAnalytics {
398
- private analytics: Analytics
399
-
400
- constructor() {
401
- this.analytics = new Analytics('UA-XXXXXXXXX-X') // Your Google Analytics ID
402
- }
403
-
404
- trackQuery(query: string, responseTime: number, confidence: number) {
405
- this.analytics.event('rag_query', {
406
- query_length: query.length,
407
- response_time: responseTime,
408
- confidence_score: confidence,
409
- platform: 'mobile'
410
- })
411
- }
412
-
413
- trackOfflineUsage(queriesQueued: number) {
414
- this.analytics.event('offline_usage', {
415
- queries_queued: queriesQueued,
416
- platform: 'mobile'
417
- })
418
- }
419
-
420
- trackVoiceUsage(duration: number, success: boolean) {
421
- this.analytics.event('voice_input', {
422
- duration,
423
- success,
424
- platform: 'mobile'
425
- })
426
- }
427
- }
428
- ```
429
-
430
- ### Performance Monitoring
431
-
432
- ```typescript
433
- // hooks/usePerformanceMonitoring.ts
434
- import { useState, useEffect } from 'react'
435
- import { AppState, Dimensions } from 'react-native'
436
-
437
- export function usePerformanceMonitoring() {
438
- const [metrics, setMetrics] = useState({
439
- memoryUsage: 0,
440
- responseTime: 0,
441
- cacheHitRate: 0,
442
- batteryLevel: 0
443
- })
444
-
445
- useEffect(() => {
446
- const subscription = AppState.addEventListener('change', (nextAppState) => {
447
- if (nextAppState === 'active') {
448
- collectMetrics()
449
- }
450
- })
451
-
452
- return () => subscription?.remove()
453
- }, [])
454
-
455
- const collectMetrics = () => {
456
- // Collect performance metrics
457
- setMetrics({
458
- memoryUsage: getMemoryUsage(),
459
- responseTime: getAverageResponseTime(),
460
- cacheHitRate: getCacheHitRate(),
461
- batteryLevel: getBatteryLevel()
462
- })
463
- }
464
-
465
- return metrics
466
- }
467
- ```
468
-
469
- ## 🚀 Building and Distribution
470
-
471
- ### Development Build
472
-
473
- ```bash
474
- # Install EAS CLI
475
- npm install -g @expo/cli
476
-
477
- # Login to Expo
478
- npx expo login
479
-
480
- # Create development build
481
- npx expo run:ios
482
- npx expo run:android
483
- ```
484
-
485
- ### Production Build with EAS
486
-
487
- Create `eas.json`:
488
-
489
- ```json
490
- {
491
- "cli": {
492
- "version": ">= 3.0.0"
493
- },
494
- "build": {
495
- "development": {
496
- "developmentClient": true,
497
- "distribution": "internal",
498
- "ios": {
499
- "resourceClass": "m1-medium"
500
- }
501
- },
502
- "preview": {
503
- "distribution": "internal",
504
- "ios": {
505
- "resourceClass": "m1-medium"
506
- }
507
- },
508
- "production": {
509
- "ios": {
510
- "resourceClass": "m1-medium"
511
- }
512
- }
513
- },
514
- "submit": {
515
- "production": {}
516
- }
517
- }
518
- ```
519
-
520
- Build commands:
521
-
522
- ```bash
523
- # Build for iOS
524
- eas build --platform ios --profile production
525
-
526
- # Build for Android
527
- eas build --platform android --profile production
528
-
529
- # Submit to app stores
530
- eas submit --platform ios
531
- eas submit --platform android
532
- ```
533
-
534
- ### App Store Configuration
535
-
536
- **iOS (App Store Connect):**
537
- 1. Create app in App Store Connect
538
- 2. Configure app metadata and screenshots
539
- 3. Upload build with EAS Submit
540
- 4. Submit for review
541
-
542
- **Android (Google Play Console):**
543
- 1. Create app in Google Play Console
544
- 2. Configure store listing and content rating
545
- 3. Upload AAB file with EAS Submit
546
- 4. Submit for review
547
-
548
- ## 🔒 Mobile Security
549
-
550
- ### Secure Storage
551
-
552
- ```typescript
553
- import * as SecureStore from 'expo-secure-store'
554
-
555
- export class SecureStorage {
556
- static async setItem(key: string, value: string) {
557
- await SecureStore.setItemAsync(key, value)
558
- }
559
-
560
- static async getItem(key: string): Promise<string | null> {
561
- return await SecureStore.getItemAsync(key)
562
- }
563
-
564
- static async removeItem(key: string) {
565
- await SecureStore.deleteItemAsync(key)
566
- }
567
- }
568
-
569
- // Usage
570
- await SecureStorage.setItem('user_token', authToken)
571
- const token = await SecureStorage.getItem('user_token')
572
- ```
573
-
574
- ### Biometric Authentication
575
-
576
- ```typescript
577
- import * as LocalAuthentication from 'expo-local-authentication'
578
-
579
- export async function authenticateWithBiometrics() {
580
- const hasHardware = await LocalAuthentication.hasHardwareAsync()
581
- const supportedTypes = await LocalAuthentication.supportedAuthenticationTypesAsync()
582
-
583
- if (hasHardware && supportedTypes.length > 0) {
584
- const result = await LocalAuthentication.authenticateAsync({
585
- promptMessage: 'Authenticate to access your AI assistant',
586
- fallbackLabel: 'Use passcode',
587
- disableDeviceFallback: false
588
- })
589
-
590
- return result.success
591
- }
592
-
593
- return false
594
- }
595
- ```
596
-
597
- ### Certificate Pinning
598
-
599
- ```typescript
600
- // app.config.js
601
- export default {
602
- expo: {
603
- plugins: [
604
- [
605
- 'expo-ssl-public-key-pinning',
606
- {
607
- 'your-api-domain.com': {
608
- 'includeSubdomains': true,
609
- 'pinset': [
610
- {
611
- 'type': 'sha256',
612
- 'value': 'YOUR_SSL_CERTIFICATE_SHA256_HASH'
613
- }
614
- ]
615
- }
616
- }
617
- ]
618
- ]
619
- }
620
- }
621
- ```
622
-
623
- ## 🧪 Testing Mobile Apps
624
-
625
- ### Unit Testing with Jest
626
-
627
- ```bash
628
- npm install --save-dev jest @testing-library/react-native @testing-library/jest-native
629
- ```
630
-
631
- ```typescript
632
- // __tests__/RAGSystem.test.ts
633
- import { useRAGSystem } from '../hooks/useRAGSystem'
634
- import { renderHook, act } from '@testing-library/react-native'
635
-
636
- describe('RAG System', () => {
637
- test('should initialize RAG system', async () => {
638
- const { result } = renderHook(() => useRAGSystem())
639
-
640
- await act(async () => {
641
- await result.current.initialize()
642
- })
643
-
644
- expect(result.current.isReady).toBe(true)
645
- })
646
-
647
- test('should handle offline queries', async () => {
648
- const { result } = renderHook(() => useRAGSystem({ enableOffline: true }))
649
-
650
- await act(async () => {
651
- await result.current.query('test question')
652
- })
653
-
654
- expect(result.current.offlineQueueSize).toBeGreaterThan(0)
655
- })
656
- })
657
- ```
658
-
659
- ### E2E Testing with Detox
660
-
661
- ```bash
662
- npm install --save-dev detox jest-circus
663
- ```
664
-
665
- ```javascript
666
- // e2e/ai-chat.e2e.js
667
- describe('AI Chat Flow', () => {
668
- beforeEach(async () => {
669
- await device.reloadReactNative()
670
- })
671
-
672
- it('should send message and receive response', async () => {
673
- // Navigate to AI tab
674
- await element(by.id('ai-tab')).tap()
675
-
676
- // Type a message
677
- await element(by.id('chat-input')).typeText('Hello AI')
678
- await element(by.id('send-button')).tap()
679
-
680
- // Wait for response
681
- await waitFor(element(by.id('ai-response')))
682
- .toBeVisible()
683
- .withTimeout(5000)
684
-
685
- // Verify response received
686
- await expect(element(by.id('ai-response'))).toHaveText(
687
- expect.stringContaining('Hello')
688
- )
689
- })
690
-
691
- it('should work in offline mode', async () => {
692
- // Simulate offline mode
693
- await device.setNetworkConnection(false, 'airplane')
694
-
695
- // Navigate to AI tab
696
- await element(by.id('ai-tab')).tap()
697
-
698
- // Send message while offline
699
- await element(by.id('chat-input')).typeText('Offline question')
700
- await element(by.id('send-button')).tap()
701
-
702
- // Verify offline message appears
703
- await expect(element(by.id('offline-indicator'))).toBeVisible()
704
-
705
- // Restore connection
706
- await device.setNetworkConnection(true, 'wifi')
707
-
708
- // Verify message was processed
709
- await waitFor(element(by.id('ai-response')))
710
- .toBeVisible()
711
- .withTimeout(10000)
712
- })
713
- })
714
- ```
715
-
716
- ## 📱 Platform-Specific Features
717
-
718
- ### iOS-Specific Features
719
-
720
- ```typescript
721
- // iOS Shortcuts integration
722
- import { Shortcuts } from 'expo-shortcuts'
723
-
724
- Shortcuts.addShortcut({
725
- id: 'ask-ai',
726
- title: 'Ask AI Assistant',
727
- shortTitle: 'Ask AI',
728
- systemImageName: 'brain.head.profile',
729
- params: {
730
- action: 'open_chat'
731
- }
732
- })
733
-
734
- // iOS Widgets
735
- import { WidgetKit } from 'expo-widget-kit'
736
-
737
- WidgetKit.reloadAllTimelines()
738
- ```
739
-
740
- ### Android-Specific Features
741
-
742
- ```typescript
743
- // Android App Shortcuts
744
- import { ShortcutManager } from 'expo-shortcuts'
745
-
746
- ShortcutManager.addDynamicShortcuts([
747
- {
748
- id: 'ask-question',
749
- shortLabel: 'Ask Question',
750
- longLabel: 'Ask AI Assistant a Question',
751
- icon: 'ic_chat',
752
- intent: {
753
- action: 'android.intent.action.VIEW',
754
- data: 'myapp://chat'
755
- }
756
- }
757
- ])
758
-
759
- // Android Widgets with React Native
760
- import { AppWidgetProvider } from 'expo-widget'
761
-
762
- export class AIWidgetProvider extends AppWidgetProvider {
763
- onUpdate(context, appWidgetManager, appWidgetIds) {
764
- // Update widget with recent AI responses
765
- }
766
- }
767
- ```
768
-
769
- ## 🎯 Next Steps
770
-
771
- Your mobile AI app is now ready! Here's what to do next:
772
-
773
- 1. **Customize for Your Domain**: Configure the RAG system for your specific use case
774
- 2. **Add Content**: Import your knowledge base via the mobile interface
775
- 3. **Test on Devices**: Use Expo Go for quick testing, development builds for advanced features
776
- 4. **Optimize Performance**: Monitor analytics and adjust caching/offline strategies
777
- 5. **Deploy**: Build production versions and submit to app stores
778
-
779
- ### Advanced Mobile Features to Explore
780
-
781
- - **AR Integration**: Visual knowledge search with camera
782
- - **Wearable Support**: Apple Watch/WearOS integration
783
- - **Background Processing**: Smart notifications and proactive assistance
784
- - **Multi-language**: Localization for global audiences
785
- - **Accessibility**: Screen reader and voice navigation support
786
-
787
- Happy mobile development! 📱🚀