@imksh/create 1.0.25 → 1.0.26

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 (267) hide show
  1. package/package.json +1 -1
  2. package/src/commands/create.js +2 -1
  3. package/src/index.js +1 -1
  4. package/src/utils/askTemplate.js +1 -0
  5. package/templates/mern-react-native/mobile/_gitignore +43 -0
  6. package/templates/mern-react-native/mobile/package.json +2 -1
  7. package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +11 -15
  8. package/templates/mern-react-native/mobile/src/app/(tabs)/dashboard.tsx +2 -2
  9. package/templates/mern-react-native/mobile/src/app/(tabs)/search.tsx +2 -2
  10. package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +0 -60
  11. package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +6 -36
  12. package/templates/mern-react-native/mobile/src/services/notification.service.ts +22 -0
  13. package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +158 -33
  14. package/templates/next/next.config.mjs +1 -0
  15. package/templates/next/package.json +10 -9
  16. package/templates/next/postcss.config.js +5 -0
  17. package/templates/next/src/app/layout.js +1 -0
  18. package/templates/next/src/app/page.js +1 -1
  19. package/templates/next/src/components/layout/ProtectedRoute.jsx +3 -3
  20. package/templates/next/src/index.css +1 -0
  21. package/templates/next/src/store/useUiStore.js +13 -7
  22. package/templates/next-ts/.env.example +0 -0
  23. package/templates/next-ts/AGENTS.md +37 -0
  24. package/templates/next-ts/CLAUDE.md +1 -0
  25. package/templates/next-ts/_gitignore +0 -24
  26. package/templates/next-ts/next-env.d.ts +3 -1
  27. package/templates/next-ts/next.config.mjs +1 -0
  28. package/templates/next-ts/package.json +13 -12
  29. package/templates/next-ts/postcss.config.js +5 -0
  30. package/templates/next-ts/public/logo.png +0 -0
  31. package/templates/next-ts/src/app/error.tsx +41 -0
  32. package/templates/next-ts/src/app/layout.tsx +2 -1
  33. package/templates/next-ts/src/app/not-found.tsx +5 -0
  34. package/templates/next-ts/src/app/page.tsx +1 -1
  35. package/templates/next-ts/src/components/layout/ProtectedRoute.tsx +3 -3
  36. package/templates/next-ts/src/components/ui/Button.tsx +63 -0
  37. package/templates/next-ts/src/components/ui/Input.tsx +79 -0
  38. package/templates/next-ts/src/index.css +1 -0
  39. package/templates/next-ts/src/store/useUiStore.ts +13 -7
  40. package/templates/next-ts/tsconfig.json +19 -5
  41. package/templates/production-fullstack/client/index.html +14 -0
  42. package/templates/production-fullstack/client/package.json +47 -0
  43. package/templates/production-fullstack/client/public/_redirects +1 -0
  44. package/templates/production-fullstack/client/public/favicon.ico +0 -0
  45. package/templates/production-fullstack/client/public/favicon.svg +1 -0
  46. package/templates/production-fullstack/client/public/logo.png +0 -0
  47. package/templates/production-fullstack/client/public/manifest.json +24 -0
  48. package/templates/production-fullstack/client/public/sw.js +56 -0
  49. package/templates/production-fullstack/client/src/App.tsx +68 -0
  50. package/templates/production-fullstack/client/src/assets/animations/loading.json +1 -0
  51. package/templates/production-fullstack/client/src/assets/data/navigation.ts +29 -0
  52. package/templates/production-fullstack/client/src/assets/images/logo.png +0 -0
  53. package/templates/production-fullstack/client/src/components/layout/ProtectedRoute.tsx +23 -0
  54. package/templates/production-fullstack/client/src/components/layout/PublicLayout.tsx +13 -0
  55. package/templates/production-fullstack/client/src/components/layout/SidebarLayout.tsx +37 -0
  56. package/templates/production-fullstack/client/src/components/shared/Breadcrumbs.tsx +27 -0
  57. package/templates/production-fullstack/client/src/components/shared/LottieIcon.tsx +36 -0
  58. package/templates/production-fullstack/client/src/components/shared/NotFound.tsx +78 -0
  59. package/templates/production-fullstack/client/src/components/shared/PwaInstallPrompt.tsx +72 -0
  60. package/templates/production-fullstack/client/src/components/shared/SEO.tsx +67 -0
  61. package/templates/production-fullstack/client/src/components/shared/Scroll.tsx +25 -0
  62. package/templates/production-fullstack/client/src/components/shared/Unauthorized.tsx +76 -0
  63. package/templates/production-fullstack/client/src/components/shared/skeletons/common/CardSkeleton.tsx +23 -0
  64. package/templates/production-fullstack/client/src/components/shared/skeletons/common/DashboardSkeleton.tsx +19 -0
  65. package/templates/production-fullstack/client/src/components/shared/skeletons/common/ListSkeleton.tsx +24 -0
  66. package/templates/production-fullstack/client/src/components/shared/skeletons/common/PageSkeleton.tsx +26 -0
  67. package/templates/production-fullstack/client/src/components/shared/skeletons/common/ProfileSkeleton.tsx +23 -0
  68. package/templates/production-fullstack/client/src/components/shared/skeletons/common/Skeleton.tsx +18 -0
  69. package/templates/production-fullstack/client/src/components/shared/skeletons/common/TableSkeleton.tsx +33 -0
  70. package/templates/production-fullstack/client/src/components/ui/ConfirmModal.tsx +152 -0
  71. package/templates/production-fullstack/client/src/components/ui/Header.tsx +230 -0
  72. package/templates/production-fullstack/client/src/components/ui/Loading.tsx +19 -0
  73. package/templates/production-fullstack/client/src/components/ui/Modal.tsx +106 -0
  74. package/templates/production-fullstack/client/src/components/ui/SidebarHeader.tsx +34 -0
  75. package/templates/production-fullstack/client/src/components/ui/Table.tsx +118 -0
  76. package/templates/production-fullstack/client/src/components/ui/ToggleSwitch.tsx +38 -0
  77. package/templates/production-fullstack/client/src/components/ui/sidebar.tsx +152 -0
  78. package/templates/production-fullstack/client/src/config/index.ts +44 -0
  79. package/templates/production-fullstack/client/src/constants/navigation.ts +14 -0
  80. package/templates/production-fullstack/client/src/features/auth/api/authService.ts +19 -0
  81. package/templates/production-fullstack/client/src/features/auth/pages/Login.tsx +233 -0
  82. package/templates/production-fullstack/client/src/features/auth/store/useAuthStore.ts +143 -0
  83. package/templates/production-fullstack/client/src/features/core/pages/Home.tsx +150 -0
  84. package/templates/production-fullstack/client/src/features/core/pages/Profile.tsx +9 -0
  85. package/templates/production-fullstack/client/src/hooks/useLenis.ts +28 -0
  86. package/templates/production-fullstack/client/src/hooks/usePwaInstall.ts +45 -0
  87. package/templates/production-fullstack/client/src/hooks/useWindowSize.ts +25 -0
  88. package/templates/production-fullstack/client/src/index.css +158 -0
  89. package/templates/production-fullstack/client/src/lib/axios.ts +22 -0
  90. package/templates/production-fullstack/client/src/lib/dayjs.ts +12 -0
  91. package/templates/production-fullstack/client/src/lib/query-client.ts +11 -0
  92. package/templates/production-fullstack/client/src/lib/socket.ts +6 -0
  93. package/templates/production-fullstack/client/src/main.tsx +28 -0
  94. package/templates/production-fullstack/client/src/store/useUiStore.ts +74 -0
  95. package/templates/production-fullstack/client/src/utils/formatDate.ts +19 -0
  96. package/templates/production-fullstack/client/src/utils/getInitials.ts +10 -0
  97. package/templates/production-fullstack/client/src/vite-env.d.ts +1 -0
  98. package/templates/production-fullstack/client/tsconfig.json +25 -0
  99. package/templates/production-fullstack/client/tsconfig.node.json +10 -0
  100. package/templates/production-fullstack/client/vite.config.ts +8 -0
  101. package/templates/production-fullstack/mobile/LICENSE +21 -0
  102. package/templates/production-fullstack/mobile/app.json +84 -0
  103. package/templates/production-fullstack/mobile/assets/animations/celebrate.json +1 -0
  104. package/templates/production-fullstack/mobile/assets/animations/infinity.json +1 -0
  105. package/templates/production-fullstack/mobile/assets/animations/loading.json +1 -0
  106. package/templates/production-fullstack/mobile/assets/fonts/Inter_Bold.ttf +0 -0
  107. package/templates/production-fullstack/mobile/assets/fonts/Inter_ExtraBold.ttf +0 -0
  108. package/templates/production-fullstack/mobile/assets/fonts/Inter_Medium.ttf +0 -0
  109. package/templates/production-fullstack/mobile/assets/fonts/Inter_Regular.ttf +0 -0
  110. package/templates/production-fullstack/mobile/assets/fonts/Inter_SemiBold.ttf +0 -0
  111. package/templates/production-fullstack/mobile/assets/images/logo/logo.png +0 -0
  112. package/templates/production-fullstack/mobile/assets/images/logo/logo.svg +1 -0
  113. package/templates/production-fullstack/mobile/assets/images/logo/logoWithBg.png +0 -0
  114. package/templates/production-fullstack/mobile/babel.config.js +13 -0
  115. package/templates/production-fullstack/mobile/drizzle.config.ts +8 -0
  116. package/templates/production-fullstack/mobile/eas.json +24 -0
  117. package/templates/production-fullstack/mobile/eslint.config.js +10 -0
  118. package/templates/production-fullstack/mobile/metro.config.js +6 -0
  119. package/templates/production-fullstack/mobile/nativewind-env.d.ts +3 -0
  120. package/templates/production-fullstack/mobile/package.json +89 -0
  121. package/templates/production-fullstack/mobile/src/app/(auth)/_layout.tsx +12 -0
  122. package/templates/production-fullstack/mobile/src/app/(auth)/change-password.tsx +112 -0
  123. package/templates/production-fullstack/mobile/src/app/(auth)/edit-profile.tsx +160 -0
  124. package/templates/production-fullstack/mobile/src/app/(auth)/forgot-password.tsx +191 -0
  125. package/templates/production-fullstack/mobile/src/app/(auth)/login.tsx +253 -0
  126. package/templates/production-fullstack/mobile/src/app/_layout.tsx +102 -0
  127. package/templates/production-fullstack/mobile/src/app/global.css +82 -0
  128. package/templates/production-fullstack/mobile/src/components/common/AnimatedHeader.tsx +328 -0
  129. package/templates/production-fullstack/mobile/src/components/common/ConfirmationToast.tsx +67 -0
  130. package/templates/production-fullstack/mobile/src/components/common/Loading.tsx +26 -0
  131. package/templates/production-fullstack/mobile/src/components/common/LocationLoader.tsx +591 -0
  132. package/templates/production-fullstack/mobile/src/components/common/ScreenHeader.tsx +68 -0
  133. package/templates/production-fullstack/mobile/src/components/common/TabHeader.tsx +58 -0
  134. package/templates/production-fullstack/mobile/src/components/common/Typography.tsx +113 -0
  135. package/templates/production-fullstack/mobile/src/components/common/Welcome.tsx +55 -0
  136. package/templates/production-fullstack/mobile/src/components/ui/BottomModal.tsx +159 -0
  137. package/templates/production-fullstack/mobile/src/components/ui/ClassicTabBar.tsx +129 -0
  138. package/templates/production-fullstack/mobile/src/components/ui/CustomTabBar.tsx +238 -0
  139. package/templates/production-fullstack/mobile/src/components/ui/Sidebar.tsx +258 -0
  140. package/templates/production-fullstack/mobile/src/components/ui/buttons/Button.tsx +180 -0
  141. package/templates/production-fullstack/mobile/src/components/ui/buttons/ButtonGroup.tsx +32 -0
  142. package/templates/production-fullstack/mobile/src/components/ui/buttons/FloatingActionButton.tsx +72 -0
  143. package/templates/production-fullstack/mobile/src/components/ui/buttons/IconButton.tsx +84 -0
  144. package/templates/production-fullstack/mobile/src/components/ui/data-display/Accordion.tsx +82 -0
  145. package/templates/production-fullstack/mobile/src/components/ui/data-display/Avatar.tsx +47 -0
  146. package/templates/production-fullstack/mobile/src/components/ui/data-display/Badge.tsx +104 -0
  147. package/templates/production-fullstack/mobile/src/components/ui/data-display/Card.tsx +36 -0
  148. package/templates/production-fullstack/mobile/src/components/ui/data-display/Image.tsx +43 -0
  149. package/templates/production-fullstack/mobile/src/components/ui/data-display/ImageViewer.tsx +33 -0
  150. package/templates/production-fullstack/mobile/src/components/ui/data-display/SwipeableRow.tsx +94 -0
  151. package/templates/production-fullstack/mobile/src/components/ui/feedback/CircularProgress.tsx +38 -0
  152. package/templates/production-fullstack/mobile/src/components/ui/feedback/GestureWrapper.tsx +114 -0
  153. package/templates/production-fullstack/mobile/src/components/ui/feedback/ProgressBar.tsx +51 -0
  154. package/templates/production-fullstack/mobile/src/components/ui/feedback/Skeleton.tsx +84 -0
  155. package/templates/production-fullstack/mobile/src/components/ui/feedback/Spinner.tsx +50 -0
  156. package/templates/production-fullstack/mobile/src/components/ui/inputs/Checkbox.tsx +54 -0
  157. package/templates/production-fullstack/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
  158. package/templates/production-fullstack/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
  159. package/templates/production-fullstack/mobile/src/components/ui/inputs/Input.tsx +158 -0
  160. package/templates/production-fullstack/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
  161. package/templates/production-fullstack/mobile/src/components/ui/inputs/OTPInput.tsx +83 -0
  162. package/templates/production-fullstack/mobile/src/components/ui/inputs/PasswordInput.tsx +16 -0
  163. package/templates/production-fullstack/mobile/src/components/ui/inputs/Radio.tsx +54 -0
  164. package/templates/production-fullstack/mobile/src/components/ui/inputs/SearchBar.tsx +53 -0
  165. package/templates/production-fullstack/mobile/src/components/ui/inputs/Slider.tsx +49 -0
  166. package/templates/production-fullstack/mobile/src/components/ui/inputs/Switch.tsx +75 -0
  167. package/templates/production-fullstack/mobile/src/components/ui/inputs/TextArea.tsx +15 -0
  168. package/templates/production-fullstack/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
  169. package/templates/production-fullstack/mobile/src/components/ui/layout/Container.tsx +23 -0
  170. package/templates/production-fullstack/mobile/src/components/ui/layout/Divider.tsx +20 -0
  171. package/templates/production-fullstack/mobile/src/components/ui/layout/Grid.tsx +62 -0
  172. package/templates/production-fullstack/mobile/src/components/ui/layout/KeyboardAvoidingViewWrapper.tsx +16 -0
  173. package/templates/production-fullstack/mobile/src/components/ui/layout/ScrollContainer.tsx +21 -0
  174. package/templates/production-fullstack/mobile/src/components/ui/layout/Section.tsx +51 -0
  175. package/templates/production-fullstack/mobile/src/components/ui/layout/Spacer.tsx +6 -0
  176. package/templates/production-fullstack/mobile/src/components/ui/layout/Stack.tsx +34 -0
  177. package/templates/production-fullstack/mobile/src/components/ui/navigation/Pagination.tsx +61 -0
  178. package/templates/production-fullstack/mobile/src/components/ui/navigation/ProgressStepper.tsx +66 -0
  179. package/templates/production-fullstack/mobile/src/components/ui/navigation/Tabs.tsx +173 -0
  180. package/templates/production-fullstack/mobile/src/config/sidebar.config.ts +72 -0
  181. package/templates/production-fullstack/mobile/src/config/tabNavigation.ts +64 -0
  182. package/templates/production-fullstack/mobile/src/constants/Colors.ts +71 -0
  183. package/templates/production-fullstack/mobile/src/db/index.ts +9 -0
  184. package/templates/production-fullstack/mobile/src/db/schema.ts +14 -0
  185. package/templates/production-fullstack/mobile/src/features/auth/api/auth.service.ts +35 -0
  186. package/templates/production-fullstack/mobile/src/features/auth/store/useAuthStore.ts +273 -0
  187. package/templates/production-fullstack/mobile/src/features/auth/types/auth.type.ts +14 -0
  188. package/templates/production-fullstack/mobile/src/hooks/useDebounce.ts +17 -0
  189. package/templates/production-fullstack/mobile/src/lib/axios.ts +27 -0
  190. package/templates/production-fullstack/mobile/src/lib/query-client.ts +11 -0
  191. package/templates/production-fullstack/mobile/src/lib/socket.ts +36 -0
  192. package/templates/production-fullstack/mobile/src/lib/storage.ts +55 -0
  193. package/templates/production-fullstack/mobile/src/services/permission.service.ts +214 -0
  194. package/templates/production-fullstack/mobile/src/store/localStore.ts +7 -0
  195. package/templates/production-fullstack/mobile/src/store/useNotificationStore.ts +53 -0
  196. package/templates/production-fullstack/mobile/src/types/common.type.ts +6 -0
  197. package/templates/production-fullstack/mobile/src/types/images.d.ts +24 -0
  198. package/templates/production-fullstack/mobile/src/utils/toast.ts +26 -0
  199. package/templates/production-fullstack/mobile/tailwind.config.js +71 -0
  200. package/templates/production-fullstack/mobile/tsconfig.json +23 -0
  201. package/templates/production-fullstack/server/.env.example +63 -0
  202. package/templates/production-fullstack/server/README.md +75 -0
  203. package/templates/production-fullstack/server/eslint.config.js +13 -0
  204. package/templates/production-fullstack/server/package.json +58 -0
  205. package/templates/production-fullstack/server/prisma/schema/core/attachment.prisma +14 -0
  206. package/templates/production-fullstack/server/prisma/schema/core/notification.prisma +18 -0
  207. package/templates/production-fullstack/server/prisma/schema/core/permission.prisma +26 -0
  208. package/templates/production-fullstack/server/prisma/schema/core/role.prisma +25 -0
  209. package/templates/production-fullstack/server/prisma/schema/core/user.prisma +56 -0
  210. package/templates/production-fullstack/server/prisma/schema/enums/common.prisma +13 -0
  211. package/templates/production-fullstack/server/prisma/schema/enums/notification.prisma +6 -0
  212. package/templates/production-fullstack/server/prisma/schema/enums/user.prisma +11 -0
  213. package/templates/production-fullstack/server/prisma/schema/schema.prisma +7 -0
  214. package/templates/production-fullstack/server/prisma.config.ts +14 -0
  215. package/templates/production-fullstack/server/src/app.ts +36 -0
  216. package/templates/production-fullstack/server/src/common/middlewares/auth.middleware.ts +45 -0
  217. package/templates/production-fullstack/server/src/common/middlewares/errorHandler.ts +16 -0
  218. package/templates/production-fullstack/server/src/common/middlewares/multer.ts +20 -0
  219. package/templates/production-fullstack/server/src/common/middlewares/rateLimiter.ts +53 -0
  220. package/templates/production-fullstack/server/src/common/services/email.service.ts +28 -0
  221. package/templates/production-fullstack/server/src/common/services/push.service.ts +65 -0
  222. package/templates/production-fullstack/server/src/common/services/storage.service.ts +9 -0
  223. package/templates/production-fullstack/server/src/common/types/express.d.ts +10 -0
  224. package/templates/production-fullstack/server/src/common/utils/cloudinaryUpload.ts +44 -0
  225. package/templates/production-fullstack/server/src/common/utils/emailOtp.ts +30 -0
  226. package/templates/production-fullstack/server/src/common/utils/genOtpToken.ts +22 -0
  227. package/templates/production-fullstack/server/src/common/utils/generateVapidKeys.ts +12 -0
  228. package/templates/production-fullstack/server/src/common/utils/jwt.ts +27 -0
  229. package/templates/production-fullstack/server/src/common/utils/pushHelper.ts +22 -0
  230. package/templates/production-fullstack/server/src/config/env.ts +2 -0
  231. package/templates/production-fullstack/server/src/config/logger.ts +58 -0
  232. package/templates/production-fullstack/server/src/config/prisma.ts +26 -0
  233. package/templates/production-fullstack/server/src/features/attachments/upload.controller.ts +22 -0
  234. package/templates/production-fullstack/server/src/features/attachments/upload.routes.ts +11 -0
  235. package/templates/production-fullstack/server/src/features/auth/auth.controller.ts +124 -0
  236. package/templates/production-fullstack/server/src/features/auth/auth.routes.ts +22 -0
  237. package/templates/production-fullstack/server/src/features/auth/auth.service.ts +155 -0
  238. package/templates/production-fullstack/server/src/features/notifications/push.controller.ts +55 -0
  239. package/templates/production-fullstack/server/src/features/notifications/push.routes.ts +11 -0
  240. package/templates/production-fullstack/server/src/index.ts +17 -0
  241. package/templates/production-fullstack/server/src/routes/index.ts +12 -0
  242. package/templates/production-fullstack/server/src/sockets/auth.ts +0 -0
  243. package/templates/production-fullstack/server/src/sockets/connection.ts +31 -0
  244. package/templates/production-fullstack/server/src/sockets/emitters/assignment.emitter.ts +0 -0
  245. package/templates/production-fullstack/server/src/sockets/emitters/attendance.emitter.ts +0 -0
  246. package/templates/production-fullstack/server/src/sockets/emitters/exam.emitter.ts +0 -0
  247. package/templates/production-fullstack/server/src/sockets/emitters/notification.emitter.ts +17 -0
  248. package/templates/production-fullstack/server/src/sockets/events.ts +27 -0
  249. package/templates/production-fullstack/server/src/sockets/handlers/attendance.handler.ts +0 -0
  250. package/templates/production-fullstack/server/src/sockets/handlers/chat.handler.ts +0 -0
  251. package/templates/production-fullstack/server/src/sockets/handlers/index.ts +15 -0
  252. package/templates/production-fullstack/server/src/sockets/handlers/lms.handler.ts +0 -0
  253. package/templates/production-fullstack/server/src/sockets/handlers/notification.handler.ts +39 -0
  254. package/templates/production-fullstack/server/src/sockets/index.ts +39 -0
  255. package/templates/production-fullstack/server/src/sockets/middleware.ts +54 -0
  256. package/templates/production-fullstack/server/src/sockets/rooms.ts +11 -0
  257. package/templates/production-fullstack/server/src/sockets/types.ts +32 -0
  258. package/templates/production-fullstack/server/tsconfig.json +14 -0
  259. package/templates/react-native/package.json +2 -1
  260. package/templates/react-native/src/app/(auth)/edit-profile.tsx +11 -15
  261. package/templates/react-native/src/app/(tabs)/dashboard.tsx +2 -2
  262. package/templates/react-native/src/app/(tabs)/search.tsx +2 -2
  263. package/templates/react-native/src/config/sidebar.config.ts +0 -60
  264. package/templates/react-native/src/config/tabNavigation.ts +6 -36
  265. package/templates/react-native/src/services/notification.service.ts +22 -0
  266. package/templates/react-native/src/store/useNotificationStore.ts +158 -33
  267. /package/templates/{react-native → production-fullstack/mobile}/expo-env.d.ts +0 -0
@@ -0,0 +1,13 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: [
5
+ ["babel-preset-expo", { jsxImportSource: "nativewind" }],
6
+ "nativewind/babel",
7
+ ],
8
+ plugins: [
9
+ ["inline-import", { "extensions": [".sql"] }],
10
+ "react-native-reanimated/plugin"
11
+ ],
12
+ };
13
+ };
@@ -0,0 +1,8 @@
1
+ import type { Config } from 'drizzle-kit';
2
+
3
+ export default {
4
+ schema: './src/db/schema.ts',
5
+ out: './drizzle',
6
+ dialect: 'sqlite',
7
+ driver: 'expo',
8
+ } satisfies Config;
@@ -0,0 +1,24 @@
1
+ {
2
+ "cli": {
3
+ "version": ">= 21.0.2",
4
+ "appVersionSource": "remote"
5
+ },
6
+ "build": {
7
+ "development": {
8
+ "developmentClient": true,
9
+ "distribution": "internal"
10
+ },
11
+ "preview": {
12
+ "distribution": "internal",
13
+ "android": {
14
+ "buildType": "apk"
15
+ }
16
+ },
17
+ "production": {
18
+ "autoIncrement": true
19
+ }
20
+ },
21
+ "submit": {
22
+ "production": {}
23
+ }
24
+ }
@@ -0,0 +1,10 @@
1
+ // https://docs.expo.dev/guides/using-eslint/
2
+ const { defineConfig } = require('eslint/config');
3
+ const expoConfig = require("eslint-config-expo/flat");
4
+
5
+ module.exports = defineConfig([
6
+ expoConfig,
7
+ {
8
+ ignores: ["dist/*"],
9
+ }
10
+ ]);
@@ -0,0 +1,6 @@
1
+ const { getDefaultConfig } = require("expo/metro-config");
2
+ const { withNativeWind } = require('nativewind/metro');
3
+
4
+ const config = getDefaultConfig(__dirname)
5
+
6
+ module.exports = withNativeWind(config, { input: './src/app/global.css' })
@@ -0,0 +1,3 @@
1
+ /// <reference types="nativewind/types" />
2
+
3
+ // NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "mobile",
3
+ "main": "expo-router/entry",
4
+ "version": "1.0.0",
5
+ "dependencies": {
6
+ "@expo/ui": "~57.0.7",
7
+ "@expo/vector-icons": "^15.1.1",
8
+ "@react-native-async-storage/async-storage": "2.2.0",
9
+ "@react-native-community/slider": "^5.2.0",
10
+ "@react-native-picker/picker": "^2.11.4",
11
+ "@react-navigation/bottom-tabs": "^7.18.10",
12
+ "@tanstack/react-query": "^5.101.4",
13
+ "axios": "^1.18.1",
14
+ "babel-preset-expo": "^57.0.3",
15
+ "dayjs": "^1.11.21",
16
+ "drizzle-orm": "^0.45.2",
17
+ "expo": "~57.0.7",
18
+ "expo-blur": "~57.0.2",
19
+ "expo-constants": "~57.0.6",
20
+ "expo-device": "~57.0.1",
21
+ "expo-font": "~57.0.1",
22
+ "expo-glass-effect": "~57.0.1",
23
+ "expo-image": "~57.0.1",
24
+ "expo-image-picker": "~57.0.7",
25
+ "expo-linear-gradient": "^57.0.1",
26
+ "expo-linking": "~57.0.3",
27
+ "expo-location": "~57.0.7",
28
+ "expo-notifications": "~57.0.6",
29
+ "expo-router": "~57.0.7",
30
+ "expo-splash-screen": "~57.0.4",
31
+ "expo-sqlite": "^57.0.1",
32
+ "expo-status-bar": "~57.0.1",
33
+ "expo-symbols": "~57.0.1",
34
+ "expo-system-ui": "~57.0.1",
35
+ "expo-web-browser": "~57.0.1",
36
+ "lottie-react": "^2.4.1",
37
+ "lottie-react-native": "^7.3.8",
38
+ "nativewind": "^4.2.6",
39
+ "prettier-plugin-tailwindcss": "^0.5.14",
40
+ "react": "19.2.3",
41
+ "react-dom": "19.2.3",
42
+ "react-native": "0.86.0",
43
+ "react-native-gesture-handler": "~2.32.0",
44
+ "react-native-image-viewing": "^0.2.2",
45
+ "react-native-keyboard-aware-scroll-view": "^0.9.5",
46
+ "react-native-maps": "1.27.2",
47
+ "react-native-otp-entry": "^1.8.6",
48
+ "react-native-paper": "^5.15.3",
49
+ "react-native-permissions": "^5.6.0",
50
+ "react-native-reanimated": "^4.5.2",
51
+ "react-native-safe-area-context": "^5.8.0",
52
+ "react-native-screens": "4.25.2",
53
+ "react-native-toast-message": "^2.4.0",
54
+ "react-native-web": "~0.21.0",
55
+ "react-native-webview": "13.16.1",
56
+ "react-native-worklets": "0.10.0",
57
+ "socket.io-client": "^4.8.3",
58
+ "tailwindcss": "^3.4.19",
59
+ "zustand": "^5.0.14"
60
+ },
61
+ "devDependencies": {
62
+ "@types/react": "~19.2.2",
63
+ "babel-plugin-inline-import": "^3.0.0",
64
+ "drizzle-kit": "^0.31.10",
65
+ "eslint": "^9.0.0",
66
+ "eslint-config-expo": "~57.0.0",
67
+ "typescript": "~6.0.3"
68
+ },
69
+ "scripts": {
70
+ "dev": "expo start -c",
71
+ "start": "expo start",
72
+ "reset-project": "node ./scripts/reset-project.js",
73
+ "android": "expo run:android",
74
+ "ios": "expo run:ios",
75
+ "web": "expo start --web",
76
+ "lint": "expo lint",
77
+ "format": "expo lint --fix",
78
+ "ts:check": "tsc --noEmit",
79
+ "build": "eas build",
80
+ "build:android": "eas build -p android",
81
+ "build:ios": "eas build -p ios",
82
+ "export": "expo export",
83
+ "build:eas:apk": "eas build -p android --profile preview",
84
+ "build:eas:aab": "eas build -p android --profile production",
85
+ "build:apk": "npx expo prebuild && cd android && ./gradlew assembleRelease",
86
+ "build:aab": "npx expo prebuild && cd android && ./gradlew bundleRelease"
87
+ },
88
+ "private": true
89
+ }
@@ -0,0 +1,12 @@
1
+ import { Stack } from 'expo-router';
2
+
3
+ export default function AuthLayout() {
4
+ return (
5
+ <Stack screenOptions={{ headerShown: false }}>
6
+ <Stack.Screen name="login" />
7
+ <Stack.Screen name="forgot-password" />
8
+ <Stack.Screen name="edit-profile" options={{ presentation: 'modal' }} />
9
+ <Stack.Screen name="change-password" options={{ presentation: 'modal' }} />
10
+ </Stack>
11
+ );
12
+ }
@@ -0,0 +1,112 @@
1
+ import React, { useState , useCallback } from "react";
2
+ import { View } from "react-native";
3
+ import { useAuthStore } from "../../features/auth/store/useAuthStore";
4
+ import { Txt } from "../../components/common/Typography";
5
+ import { router, useFocusEffect } from "expo-router";
6
+ import ScrollContainer from "../../components/ui/layout/ScrollContainer";
7
+ import Input from "../../components/ui/inputs/Input";
8
+ import Button from "../../components/ui/buttons/Button";
9
+ import ScreenHeader from "@/components/common/ScreenHeader";
10
+
11
+ export default function ChangePasswordScreen() {
12
+ const { changePassword, loading, error, clearError } = useAuthStore();
13
+
14
+ useFocusEffect(
15
+ useCallback(() => {
16
+ return () => clearError();
17
+ }, [clearError])
18
+ );
19
+
20
+ const [oldPassword, setOldPassword] = useState("");
21
+ const [newPassword, setNewPassword] = useState("");
22
+ const [confirmPassword, setConfirmPassword] = useState("");
23
+
24
+ const [showOldPassword, setShowOldPassword] = useState(false);
25
+ const [showNewPassword, setShowNewPassword] = useState(false);
26
+ const [showConfirmPassword, setShowConfirmPassword] = useState(false);
27
+
28
+ const [validationError, setValidationError] = useState("");
29
+
30
+ const handleSave = async () => {
31
+ setValidationError("");
32
+ if (!oldPassword || !newPassword || !confirmPassword) {
33
+ setValidationError("Please fill all fields");
34
+ return;
35
+ }
36
+
37
+ if (newPassword !== confirmPassword) {
38
+ setValidationError("New passwords do not match");
39
+ return;
40
+ }
41
+
42
+ const success = await changePassword(oldPassword, newPassword);
43
+ if (success) {
44
+ router.back();
45
+ }
46
+ };
47
+
48
+ return (
49
+ <>
50
+ <ScreenHeader title="Change Password" />
51
+ <ScrollContainer
52
+ contentContainerStyle={{
53
+ flexGrow: 1,
54
+ padding: 16,
55
+ }}
56
+ className="bg-base-100"
57
+ >
58
+ {error || validationError ? (
59
+ <View className="bg-error/10 border border-error/20 rounded-2xl p-3 mb-4">
60
+ <Txt variant="md" className="text-error text-xs text-center">
61
+ ⚠️ {validationError || error}
62
+ </Txt>
63
+ </View>
64
+ ) : null}
65
+
66
+ <View className="gap-4">
67
+ <Input
68
+ leftIcon="lock-closed"
69
+ rightIcon={showOldPassword ? "eye-off" : "eye"}
70
+ onRightIconPress={() => setShowOldPassword(!showOldPassword)}
71
+ placeholder="Current Password"
72
+ value={oldPassword}
73
+ onChangeText={setOldPassword}
74
+ secureTextEntry={!showOldPassword}
75
+ />
76
+
77
+ <Input
78
+ leftIcon="key"
79
+ rightIcon={showNewPassword ? "eye-off" : "eye"}
80
+ onRightIconPress={() => setShowNewPassword(!showNewPassword)}
81
+ placeholder="New Password"
82
+ value={newPassword}
83
+ onChangeText={setNewPassword}
84
+ secureTextEntry={!showNewPassword}
85
+ />
86
+
87
+ <Input
88
+ leftIcon="checkmark-circle"
89
+ rightIcon={showConfirmPassword ? "eye-off" : "eye"}
90
+ onRightIconPress={() =>
91
+ setShowConfirmPassword(!showConfirmPassword)
92
+ }
93
+ placeholder="Confirm New Password"
94
+ value={confirmPassword}
95
+ onChangeText={setConfirmPassword}
96
+ secureTextEntry={!showConfirmPassword}
97
+ />
98
+
99
+ <View className="mt-4">
100
+ <Button
101
+ label="Update Password"
102
+ onPress={handleSave}
103
+ isLoading={loading}
104
+ variant="primary"
105
+ isFullWidth
106
+ />
107
+ </View>
108
+ </View>
109
+ </ScrollContainer>
110
+ </>
111
+ );
112
+ }
@@ -0,0 +1,160 @@
1
+ import React, { useState , useCallback } from "react";
2
+ import { View, TouchableOpacity } from "react-native";
3
+ import { useAuthStore } from "../../features/auth/store/useAuthStore";
4
+ import { Txt } from "../../components/common/Typography";
5
+ import { router, useFocusEffect } from "expo-router";
6
+ import * as ImagePicker from "expo-image-picker";
7
+ import { Ionicons } from "@expo/vector-icons";
8
+ import Avatar from "../../components/ui/data-display/Avatar";
9
+
10
+ import ScrollContainer from "../../components/ui/layout/ScrollContainer";
11
+ import Input from "../../components/ui/inputs/Input";
12
+ import Button from "../../components/ui/buttons/Button";
13
+ import ScreenHeader from "@/components/common/ScreenHeader";
14
+ import { toast } from "@/utils/toast";
15
+ import { authService } from "@/features/auth/api/auth.service";
16
+
17
+ export default function EditProfileScreen() {
18
+ const { user, error, setUser, clearError } = useAuthStore();
19
+ const [loading, setLoading] = useState(false);
20
+
21
+ useFocusEffect(
22
+ useCallback(() => {
23
+ return () => clearError();
24
+ }, [clearError])
25
+ );
26
+
27
+ const [name, setName] = useState(user?.name || "");
28
+ const [phone, setPhone] = useState(user?.phone || "");
29
+ const [avatarUri, setAvatarUri] = useState<string | null>(null);
30
+
31
+ const pickImage = async () => {
32
+ const result = await ImagePicker.launchImageLibraryAsync({
33
+ mediaTypes: ImagePicker.MediaTypeOptions.Images,
34
+ allowsEditing: true,
35
+ aspect: [1, 1],
36
+ quality: 0.8,
37
+ });
38
+
39
+ if (!result.canceled && result.assets[0]) {
40
+ setAvatarUri(result.assets[0].uri);
41
+ }
42
+ };
43
+
44
+ const handleSave = async () => {
45
+ const formData = new FormData();
46
+ try {
47
+ setLoading(true);
48
+ if (name !== user?.name) formData.append("name", name);
49
+ if (phone !== user?.phone) formData.append("phone", phone);
50
+
51
+ if (avatarUri) {
52
+ const filename = avatarUri.split("/").pop() || "avatar.jpg";
53
+ const match = /\.(\w+)$/.exec(filename);
54
+ const type = match ? `image/${match[1]}` : `image`;
55
+
56
+ formData.append("file", {
57
+ uri: avatarUri,
58
+ name: filename,
59
+ type,
60
+ } as any);
61
+ }
62
+
63
+ // Only update if something changed
64
+ if (
65
+ (formData as any).getParts &&
66
+ (formData as any).getParts().length === 0
67
+ ) {
68
+ router.back();
69
+ return;
70
+ }
71
+
72
+ const res = await authService.updateMe(formData);
73
+ if (res.data.success) {
74
+ setUser(res.data.data);
75
+ toast.success("Profile updated successfully");
76
+ router.back();
77
+ } else {
78
+ toast.error(res.data.message || "An error occurred");
79
+ }
80
+
81
+ console.log(res.data.data);
82
+ } catch (error: any) {
83
+ toast.error(error.response?.data?.message || error.message);
84
+ } finally {
85
+ setLoading(false);
86
+ }
87
+ };
88
+
89
+ return (
90
+ <>
91
+ <ScreenHeader title="Edit Profile" />
92
+ <ScrollContainer
93
+ contentContainerStyle={{
94
+ flexGrow: 1,
95
+ padding: 16,
96
+ }}
97
+ className="bg-base-100"
98
+ >
99
+ <View className="items-center mb-8">
100
+ <View className="relative">
101
+ <View className="w-28 h-28 rounded-full items-center justify-center border-4 border-base-100 shadow-sm shadow-base-content/20 overflow-hidden">
102
+ {avatarUri ? (
103
+ <Avatar url={avatarUri} size={104} />
104
+ ) : (
105
+ <Avatar
106
+ url={
107
+ user?.avatar?.url ||
108
+ `https://placehold.co/600x400?text=${user?.name?.charAt(0).toUpperCase() || "U"}`
109
+ }
110
+ size={104}
111
+ />
112
+ )}
113
+ </View>
114
+ <TouchableOpacity
115
+ onPress={pickImage}
116
+ className="absolute bottom-0 right-0 bg-primary p-2 rounded-full border-2 border-base-100"
117
+ >
118
+ <Ionicons name="camera" size={18} color="#fff" />
119
+ </TouchableOpacity>
120
+ </View>
121
+ </View>
122
+
123
+ {error ? (
124
+ <View className="bg-error/10 border border-error/20 rounded-2xl p-3 mb-4">
125
+ <Txt variant="md" className="text-error text-xs text-center">
126
+ ⚠️ {error}
127
+ </Txt>
128
+ </View>
129
+ ) : null}
130
+
131
+ <View className="gap-4">
132
+ <Input
133
+ leftIcon="person"
134
+ placeholder="Full name"
135
+ value={name}
136
+ onChangeText={setName}
137
+ />
138
+
139
+ <Input
140
+ leftIcon="call"
141
+ placeholder="Phone number"
142
+ value={phone}
143
+ onChangeText={setPhone}
144
+ keyboardType="phone-pad"
145
+ />
146
+
147
+ <View className="mt-4">
148
+ <Button
149
+ label="Save Changes"
150
+ onPress={handleSave}
151
+ isLoading={loading}
152
+ variant="primary"
153
+ isFullWidth
154
+ />
155
+ </View>
156
+ </View>
157
+ </ScrollContainer>
158
+ </>
159
+ );
160
+ }
@@ -0,0 +1,191 @@
1
+ import React, { useState, useEffect , useCallback } from "react";
2
+ import { View } from "react-native";
3
+ import { useAuthStore } from "../../features/auth/store/useAuthStore";
4
+ import { Txt } from "../../components/common/Typography";
5
+ import { router, useFocusEffect } from "expo-router";
6
+ import ScrollContainer from "../../components/ui/layout/ScrollContainer";
7
+ import Input from "../../components/ui/inputs/Input";
8
+ import Button from "../../components/ui/buttons/Button";
9
+
10
+ export default function ForgotPasswordScreen() {
11
+ const { genOtp, verifyOtp, resetPassword, loading, error, clearError } = useAuthStore();
12
+ const [step, setStep] = useState<"email" | "otp" | "password">("email");
13
+
14
+ useFocusEffect(
15
+ useCallback(() => {
16
+ return () => clearError();
17
+ }, [clearError])
18
+ );
19
+
20
+ const [email, setEmail] = useState("");
21
+ const [otp, setOtp] = useState("");
22
+ const [newPassword, setNewPassword] = useState("");
23
+ const [showPassword, setShowPassword] = useState(false);
24
+
25
+ const [timer, setTimer] = useState(0);
26
+
27
+ useEffect(() => {
28
+ let interval: ReturnType<typeof setInterval>;
29
+ if (timer > 0) {
30
+ interval = setInterval(() => {
31
+ setTimer((prev) => prev - 1);
32
+ }, 1000);
33
+ }
34
+ return () => clearInterval(interval);
35
+ }, [timer]);
36
+
37
+ const handleSendOtp = async () => {
38
+ if (!email) return;
39
+ const success = await genOtp(email);
40
+ if (success) {
41
+ setStep("otp");
42
+ setTimer(60);
43
+ }
44
+ };
45
+
46
+ const handleVerifyOtp = async () => {
47
+ if (!otp) return;
48
+ const success = await verifyOtp(email, otp);
49
+ if (success) {
50
+ setStep("password");
51
+ }
52
+ };
53
+
54
+ const handleResetPassword = async () => {
55
+ if (!newPassword) return;
56
+ const success = await resetPassword(newPassword);
57
+ if (success) {
58
+ router.replace("/(auth)/login");
59
+ }
60
+ };
61
+
62
+ return (
63
+ <ScrollContainer
64
+ contentContainerStyle={{
65
+ flexGrow: 1,
66
+ justifyContent: "center",
67
+ padding: 16,
68
+ }}
69
+ className="bg-base-100"
70
+ >
71
+ <View className="w-full p-6">
72
+ <View className="items-center mb-8 w-full">
73
+ <Txt variant="xl" className="text-2xl mb-1 text-center">
74
+ {step === "email" && "Forgot Password"}
75
+ {step === "otp" && "Verify Email"}
76
+ {step === "password" && "Reset Password"}
77
+ </Txt>
78
+ <Txt
79
+ variant="sm"
80
+ className="text-xs text-base-content/50 text-center px-2"
81
+ >
82
+ {step === "email" && "Enter your email to receive an OTP"}
83
+ {step === "otp" && `Enter the OTP sent to ${email}`}
84
+ {step === "password" && "Enter your new password"}
85
+ </Txt>
86
+ </View>
87
+
88
+ {error ? (
89
+ <View className="bg-error/10 border border-error/20 rounded-2xl p-3 mb-4">
90
+ <Txt variant="md" className="text-error text-xs text-center">
91
+ ⚠️ {error}
92
+ </Txt>
93
+ </View>
94
+ ) : null}
95
+
96
+ <View className="gap-2">
97
+ {step === "email" && (
98
+ <>
99
+ <Input
100
+ leftIcon="mail"
101
+ placeholder="Email address"
102
+ value={email}
103
+ onChangeText={setEmail}
104
+ autoCapitalize="none"
105
+ keyboardType="email-address"
106
+ />
107
+ <View className="mt-2">
108
+ <Button
109
+ label="Send OTP →"
110
+ onPress={handleSendOtp}
111
+ isLoading={loading}
112
+ variant="primary"
113
+ isFullWidth
114
+ />
115
+ </View>
116
+ </>
117
+ )}
118
+
119
+ {step === "otp" && (
120
+ <>
121
+ <Input
122
+ leftIcon="key"
123
+ placeholder="Enter OTP"
124
+ value={otp}
125
+ onChangeText={setOtp}
126
+ keyboardType="numeric"
127
+ />
128
+ <View className="mt-2">
129
+ <Button
130
+ label="Verify OTP →"
131
+ onPress={handleVerifyOtp}
132
+ isLoading={loading}
133
+ variant="primary"
134
+ isFullWidth
135
+ />
136
+ </View>
137
+ <View className="mt-4">
138
+ <Button
139
+ label={timer > 0 ? `Resend OTP in ${timer}s` : "Resend OTP"}
140
+ onPress={handleSendOtp}
141
+ disabled={timer > 0 || loading}
142
+ variant="outline"
143
+ isFullWidth
144
+ />
145
+ </View>
146
+ </>
147
+ )}
148
+
149
+ {step === "password" && (
150
+ <>
151
+ <Input
152
+ leftIcon="lock-closed"
153
+ rightIcon={showPassword ? "eye-off" : "eye"}
154
+ onRightIconPress={() => setShowPassword(!showPassword)}
155
+ placeholder="New Password"
156
+ value={newPassword}
157
+ onChangeText={setNewPassword}
158
+ secureTextEntry={!showPassword}
159
+ />
160
+ <View className="mt-2">
161
+ <Button
162
+ label="Reset Password →"
163
+ onPress={handleResetPassword}
164
+ isLoading={loading}
165
+ variant="primary"
166
+ isFullWidth
167
+ />
168
+ </View>
169
+ </>
170
+ )}
171
+ </View>
172
+
173
+ <View className="mt-8">
174
+ <Txt
175
+ variant="sm"
176
+ className="text-sm text-base-content/50 text-center"
177
+ >
178
+ Remember your password?{" "}
179
+ <Txt
180
+ variant="md"
181
+ className="text-primary text-sm"
182
+ onPress={() => router.push("/(auth)/login")}
183
+ >
184
+ Sign in
185
+ </Txt>
186
+ </Txt>
187
+ </View>
188
+ </View>
189
+ </ScrollContainer>
190
+ );
191
+ }