@imksh/create 1.0.24 → 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.
- package/package.json +1 -1
- package/src/commands/create.js +2 -1
- package/src/index.js +1 -1
- package/src/utils/askTemplate.js +1 -0
- package/templates/mern-react-native/client/src/vite-env.d.ts +1 -0
- package/templates/mern-react-native/mobile/_gitignore +43 -0
- package/templates/mern-react-native/mobile/babel.config.js +1 -0
- package/templates/mern-react-native/mobile/drizzle.config.ts +8 -0
- package/templates/mern-react-native/mobile/expo-env.d.ts +3 -0
- package/templates/mern-react-native/mobile/package.json +8 -1
- package/templates/mern-react-native/mobile/src/app/(auth)/_layout.tsx +12 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/change-password.tsx +112 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +156 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/mern-react-native/mobile/src/app/{login.tsx → (auth)/login.tsx} +69 -21
- package/templates/mern-react-native/mobile/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/mern-react-native/mobile/src/app/(tabs)/index.tsx +18 -17
- package/templates/mern-react-native/mobile/src/app/(tabs)/profile.tsx +23 -60
- package/templates/mern-react-native/mobile/src/app/(tabs)/search.tsx +2 -2
- package/templates/mern-react-native/mobile/src/app/_layout.tsx +22 -4
- package/templates/mern-react-native/mobile/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/mern-react-native/mobile/src/components/common/LocationLoader.tsx +591 -0
- package/templates/mern-react-native/mobile/src/components/common/ScreenHeader.tsx +41 -17
- package/templates/mern-react-native/mobile/src/components/common/TabHeader.tsx +58 -0
- package/templates/mern-react-native/mobile/src/components/common/Typography.tsx +49 -30
- package/templates/mern-react-native/mobile/src/components/common/Welcome.tsx +2 -2
- package/templates/mern-react-native/mobile/src/components/ui/BottomModal.tsx +31 -20
- package/templates/mern-react-native/mobile/src/components/ui/ClassicTabBar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/CustomTabBar.tsx +108 -71
- package/templates/mern-react-native/mobile/src/components/ui/Sidebar.tsx +81 -56
- package/templates/mern-react-native/mobile/src/components/ui/buttons/Button.tsx +106 -37
- package/templates/mern-react-native/mobile/src/components/ui/buttons/IconButton.tsx +4 -2
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Accordion.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Avatar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Badge.tsx +45 -17
- package/templates/mern-react-native/mobile/src/components/ui/data-display/ImageViewer.tsx +19 -9
- package/templates/mern-react-native/mobile/src/components/ui/feedback/CircularProgress.tsx +5 -4
- package/templates/mern-react-native/mobile/src/components/ui/feedback/ProgressBar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/feedback/Skeleton.tsx +3 -0
- package/templates/mern-react-native/mobile/src/components/ui/feedback/Spinner.tsx +11 -3
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Checkbox.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Input.tsx +54 -14
- package/templates/mern-react-native/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/OTPInput.tsx +32 -9
- package/templates/mern-react-native/mobile/src/components/ui/inputs/PasswordInput.tsx +2 -1
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Radio.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/SearchBar.tsx +41 -4
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Slider.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Switch.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/TextArea.tsx +2 -1
- package/templates/mern-react-native/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/mern-react-native/mobile/src/components/ui/layout/Grid.tsx +52 -10
- package/templates/mern-react-native/mobile/src/components/ui/layout/Section.tsx +7 -8
- package/templates/mern-react-native/mobile/src/components/ui/navigation/Pagination.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/navigation/ProgressStepper.tsx +6 -5
- package/templates/mern-react-native/mobile/src/components/ui/navigation/Tabs.tsx +30 -4
- package/templates/mern-react-native/mobile/src/config/api.ts +12 -1
- package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +12 -0
- package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +1 -1
- package/templates/mern-react-native/mobile/src/db/index.ts +9 -0
- package/templates/mern-react-native/mobile/src/db/schema.ts +14 -0
- package/templates/mern-react-native/mobile/src/hooks/useDebounce.ts +17 -0
- package/templates/mern-react-native/mobile/src/services/notification.service.ts +22 -0
- package/templates/mern-react-native/mobile/src/services/socket.service.ts +36 -0
- package/templates/mern-react-native/mobile/src/store/useAuthStore.ts +122 -27
- package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +178 -0
- package/templates/mern-react-native/mobile/src/types/auth.type.ts +14 -0
- package/templates/mern-react-native/mobile/tsconfig.json +1 -0
- package/templates/mern-ts/client/src/vite-env.d.ts +1 -0
- package/templates/next/next.config.mjs +1 -0
- package/templates/next/package.json +10 -9
- package/templates/next/postcss.config.js +5 -0
- package/templates/next/src/app/layout.js +1 -0
- package/templates/next/src/app/page.js +1 -1
- package/templates/next/src/components/layout/ProtectedRoute.jsx +3 -3
- package/templates/next/src/index.css +1 -0
- package/templates/next/src/store/useUiStore.js +13 -7
- package/templates/next-ts/.env.example +0 -0
- package/templates/next-ts/AGENTS.md +37 -0
- package/templates/next-ts/CLAUDE.md +1 -0
- package/templates/next-ts/_gitignore +0 -24
- package/templates/next-ts/next-env.d.ts +3 -1
- package/templates/next-ts/next.config.mjs +1 -0
- package/templates/next-ts/package.json +13 -12
- package/templates/next-ts/postcss.config.js +5 -0
- package/templates/next-ts/public/logo.png +0 -0
- package/templates/next-ts/src/app/error.tsx +41 -0
- package/templates/next-ts/src/app/layout.tsx +2 -1
- package/templates/next-ts/src/app/not-found.tsx +5 -0
- package/templates/next-ts/src/app/page.tsx +1 -1
- package/templates/next-ts/src/components/layout/ProtectedRoute.tsx +3 -3
- package/templates/next-ts/src/components/ui/Button.tsx +63 -0
- package/templates/next-ts/src/components/ui/Input.tsx +79 -0
- package/templates/next-ts/src/index.css +1 -0
- package/templates/next-ts/src/store/useUiStore.ts +13 -7
- package/templates/next-ts/tsconfig.json +19 -5
- package/templates/production-fullstack/client/index.html +14 -0
- package/templates/production-fullstack/client/package.json +47 -0
- package/templates/production-fullstack/client/public/_redirects +1 -0
- package/templates/production-fullstack/client/public/favicon.ico +0 -0
- package/templates/production-fullstack/client/public/favicon.svg +1 -0
- package/templates/production-fullstack/client/public/logo.png +0 -0
- package/templates/production-fullstack/client/public/manifest.json +24 -0
- package/templates/production-fullstack/client/public/sw.js +56 -0
- package/templates/production-fullstack/client/src/App.tsx +68 -0
- package/templates/production-fullstack/client/src/assets/animations/loading.json +1 -0
- package/templates/production-fullstack/client/src/assets/data/navigation.ts +29 -0
- package/templates/production-fullstack/client/src/assets/images/logo.png +0 -0
- package/templates/production-fullstack/client/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/production-fullstack/client/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/production-fullstack/client/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/production-fullstack/client/src/components/shared/Breadcrumbs.tsx +27 -0
- package/templates/production-fullstack/client/src/components/shared/LottieIcon.tsx +36 -0
- package/templates/production-fullstack/client/src/components/shared/NotFound.tsx +78 -0
- package/templates/production-fullstack/client/src/components/shared/PwaInstallPrompt.tsx +72 -0
- package/templates/production-fullstack/client/src/components/shared/SEO.tsx +67 -0
- package/templates/production-fullstack/client/src/components/shared/Scroll.tsx +25 -0
- package/templates/production-fullstack/client/src/components/shared/Unauthorized.tsx +76 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/Skeleton.tsx +18 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/production-fullstack/client/src/components/ui/ConfirmModal.tsx +152 -0
- package/templates/production-fullstack/client/src/components/ui/Header.tsx +230 -0
- package/templates/production-fullstack/client/src/components/ui/Loading.tsx +19 -0
- package/templates/production-fullstack/client/src/components/ui/Modal.tsx +106 -0
- package/templates/production-fullstack/client/src/components/ui/SidebarHeader.tsx +34 -0
- package/templates/production-fullstack/client/src/components/ui/Table.tsx +118 -0
- package/templates/production-fullstack/client/src/components/ui/ToggleSwitch.tsx +38 -0
- package/templates/production-fullstack/client/src/components/ui/sidebar.tsx +152 -0
- package/templates/production-fullstack/client/src/config/index.ts +44 -0
- package/templates/production-fullstack/client/src/constants/navigation.ts +14 -0
- package/templates/production-fullstack/client/src/features/auth/api/authService.ts +19 -0
- package/templates/production-fullstack/client/src/features/auth/pages/Login.tsx +233 -0
- package/templates/production-fullstack/client/src/features/auth/store/useAuthStore.ts +143 -0
- package/templates/production-fullstack/client/src/features/core/pages/Home.tsx +150 -0
- package/templates/production-fullstack/client/src/features/core/pages/Profile.tsx +9 -0
- package/templates/production-fullstack/client/src/hooks/useLenis.ts +28 -0
- package/templates/production-fullstack/client/src/hooks/usePwaInstall.ts +45 -0
- package/templates/production-fullstack/client/src/hooks/useWindowSize.ts +25 -0
- package/templates/production-fullstack/client/src/index.css +158 -0
- package/templates/production-fullstack/client/src/lib/axios.ts +22 -0
- package/templates/production-fullstack/client/src/lib/dayjs.ts +12 -0
- package/templates/production-fullstack/client/src/lib/query-client.ts +11 -0
- package/templates/production-fullstack/client/src/lib/socket.ts +6 -0
- package/templates/production-fullstack/client/src/main.tsx +28 -0
- package/templates/production-fullstack/client/src/store/useUiStore.ts +74 -0
- package/templates/production-fullstack/client/src/utils/formatDate.ts +19 -0
- package/templates/production-fullstack/client/src/utils/getInitials.ts +10 -0
- package/templates/production-fullstack/client/src/vite-env.d.ts +1 -0
- package/templates/production-fullstack/client/tsconfig.json +25 -0
- package/templates/production-fullstack/client/tsconfig.node.json +10 -0
- package/templates/production-fullstack/client/vite.config.ts +8 -0
- package/templates/production-fullstack/mobile/LICENSE +21 -0
- package/templates/production-fullstack/mobile/app.json +84 -0
- package/templates/production-fullstack/mobile/assets/animations/celebrate.json +1 -0
- package/templates/production-fullstack/mobile/assets/animations/infinity.json +1 -0
- package/templates/production-fullstack/mobile/assets/animations/loading.json +1 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Bold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_ExtraBold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Medium.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Regular.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_SemiBold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logo.png +0 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logo.svg +1 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logoWithBg.png +0 -0
- package/templates/production-fullstack/mobile/babel.config.js +13 -0
- package/templates/production-fullstack/mobile/drizzle.config.ts +8 -0
- package/templates/production-fullstack/mobile/eas.json +24 -0
- package/templates/production-fullstack/mobile/eslint.config.js +10 -0
- package/templates/production-fullstack/mobile/expo-env.d.ts +3 -0
- package/templates/production-fullstack/mobile/metro.config.js +6 -0
- package/templates/production-fullstack/mobile/nativewind-env.d.ts +3 -0
- package/templates/production-fullstack/mobile/package.json +89 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/_layout.tsx +12 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/change-password.tsx +112 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/edit-profile.tsx +160 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/login.tsx +253 -0
- package/templates/production-fullstack/mobile/src/app/_layout.tsx +102 -0
- package/templates/production-fullstack/mobile/src/app/global.css +82 -0
- package/templates/production-fullstack/mobile/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/production-fullstack/mobile/src/components/common/ConfirmationToast.tsx +67 -0
- package/templates/production-fullstack/mobile/src/components/common/Loading.tsx +26 -0
- package/templates/production-fullstack/mobile/src/components/common/LocationLoader.tsx +591 -0
- package/templates/production-fullstack/mobile/src/components/common/ScreenHeader.tsx +68 -0
- package/templates/production-fullstack/mobile/src/components/common/TabHeader.tsx +58 -0
- package/templates/production-fullstack/mobile/src/components/common/Typography.tsx +113 -0
- package/templates/production-fullstack/mobile/src/components/common/Welcome.tsx +55 -0
- package/templates/production-fullstack/mobile/src/components/ui/BottomModal.tsx +159 -0
- package/templates/production-fullstack/mobile/src/components/ui/ClassicTabBar.tsx +129 -0
- package/templates/production-fullstack/mobile/src/components/ui/CustomTabBar.tsx +238 -0
- package/templates/production-fullstack/mobile/src/components/ui/Sidebar.tsx +258 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/Button.tsx +180 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/ButtonGroup.tsx +32 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/FloatingActionButton.tsx +72 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/IconButton.tsx +84 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Accordion.tsx +82 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Avatar.tsx +47 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Badge.tsx +104 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Card.tsx +36 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Image.tsx +43 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/ImageViewer.tsx +33 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/SwipeableRow.tsx +94 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/CircularProgress.tsx +38 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/GestureWrapper.tsx +114 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/ProgressBar.tsx +51 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/Skeleton.tsx +84 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/Spinner.tsx +50 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Checkbox.tsx +54 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Input.tsx +158 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/OTPInput.tsx +83 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/PasswordInput.tsx +16 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Radio.tsx +54 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/SearchBar.tsx +53 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Slider.tsx +49 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Switch.tsx +75 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/TextArea.tsx +15 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Container.tsx +23 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Divider.tsx +20 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Grid.tsx +62 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/KeyboardAvoidingViewWrapper.tsx +16 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/ScrollContainer.tsx +21 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Section.tsx +51 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Spacer.tsx +6 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Stack.tsx +34 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/Pagination.tsx +61 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/ProgressStepper.tsx +66 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/Tabs.tsx +173 -0
- package/templates/production-fullstack/mobile/src/config/sidebar.config.ts +72 -0
- package/templates/production-fullstack/mobile/src/config/tabNavigation.ts +64 -0
- package/templates/production-fullstack/mobile/src/constants/Colors.ts +71 -0
- package/templates/production-fullstack/mobile/src/db/index.ts +9 -0
- package/templates/production-fullstack/mobile/src/db/schema.ts +14 -0
- package/templates/production-fullstack/mobile/src/features/auth/api/auth.service.ts +35 -0
- package/templates/production-fullstack/mobile/src/features/auth/store/useAuthStore.ts +273 -0
- package/templates/production-fullstack/mobile/src/features/auth/types/auth.type.ts +14 -0
- package/templates/production-fullstack/mobile/src/hooks/useDebounce.ts +17 -0
- package/templates/production-fullstack/mobile/src/lib/axios.ts +27 -0
- package/templates/production-fullstack/mobile/src/lib/query-client.ts +11 -0
- package/templates/production-fullstack/mobile/src/lib/socket.ts +36 -0
- package/templates/production-fullstack/mobile/src/lib/storage.ts +55 -0
- package/templates/production-fullstack/mobile/src/services/permission.service.ts +214 -0
- package/templates/production-fullstack/mobile/src/store/localStore.ts +7 -0
- package/templates/production-fullstack/mobile/src/store/useNotificationStore.ts +53 -0
- package/templates/production-fullstack/mobile/src/types/common.type.ts +6 -0
- package/templates/production-fullstack/mobile/src/types/images.d.ts +24 -0
- package/templates/production-fullstack/mobile/src/utils/toast.ts +26 -0
- package/templates/production-fullstack/mobile/tailwind.config.js +71 -0
- package/templates/production-fullstack/mobile/tsconfig.json +23 -0
- package/templates/production-fullstack/server/.env.example +63 -0
- package/templates/production-fullstack/server/README.md +75 -0
- package/templates/production-fullstack/server/eslint.config.js +13 -0
- package/templates/production-fullstack/server/package.json +58 -0
- package/templates/production-fullstack/server/prisma/schema/core/attachment.prisma +14 -0
- package/templates/production-fullstack/server/prisma/schema/core/notification.prisma +18 -0
- package/templates/production-fullstack/server/prisma/schema/core/permission.prisma +26 -0
- package/templates/production-fullstack/server/prisma/schema/core/role.prisma +25 -0
- package/templates/production-fullstack/server/prisma/schema/core/user.prisma +56 -0
- package/templates/production-fullstack/server/prisma/schema/enums/common.prisma +13 -0
- package/templates/production-fullstack/server/prisma/schema/enums/notification.prisma +6 -0
- package/templates/production-fullstack/server/prisma/schema/enums/user.prisma +11 -0
- package/templates/production-fullstack/server/prisma/schema/schema.prisma +7 -0
- package/templates/production-fullstack/server/prisma.config.ts +14 -0
- package/templates/production-fullstack/server/src/app.ts +36 -0
- package/templates/production-fullstack/server/src/common/middlewares/auth.middleware.ts +45 -0
- package/templates/production-fullstack/server/src/common/middlewares/errorHandler.ts +16 -0
- package/templates/production-fullstack/server/src/common/middlewares/multer.ts +20 -0
- package/templates/production-fullstack/server/src/common/middlewares/rateLimiter.ts +53 -0
- package/templates/production-fullstack/server/src/common/services/email.service.ts +28 -0
- package/templates/production-fullstack/server/src/common/services/push.service.ts +65 -0
- package/templates/production-fullstack/server/src/common/services/storage.service.ts +9 -0
- package/templates/production-fullstack/server/src/common/types/express.d.ts +10 -0
- package/templates/production-fullstack/server/src/common/utils/cloudinaryUpload.ts +44 -0
- package/templates/production-fullstack/server/src/common/utils/emailOtp.ts +30 -0
- package/templates/production-fullstack/server/src/common/utils/genOtpToken.ts +22 -0
- package/templates/production-fullstack/server/src/common/utils/generateVapidKeys.ts +12 -0
- package/templates/production-fullstack/server/src/common/utils/jwt.ts +27 -0
- package/templates/production-fullstack/server/src/common/utils/pushHelper.ts +22 -0
- package/templates/production-fullstack/server/src/config/env.ts +2 -0
- package/templates/production-fullstack/server/src/config/logger.ts +58 -0
- package/templates/production-fullstack/server/src/config/prisma.ts +26 -0
- package/templates/production-fullstack/server/src/features/attachments/upload.controller.ts +22 -0
- package/templates/production-fullstack/server/src/features/attachments/upload.routes.ts +11 -0
- package/templates/production-fullstack/server/src/features/auth/auth.controller.ts +124 -0
- package/templates/production-fullstack/server/src/features/auth/auth.routes.ts +22 -0
- package/templates/production-fullstack/server/src/features/auth/auth.service.ts +155 -0
- package/templates/production-fullstack/server/src/features/notifications/push.controller.ts +55 -0
- package/templates/production-fullstack/server/src/features/notifications/push.routes.ts +11 -0
- package/templates/production-fullstack/server/src/index.ts +17 -0
- package/templates/production-fullstack/server/src/routes/index.ts +12 -0
- package/templates/production-fullstack/server/src/sockets/auth.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/connection.ts +31 -0
- package/templates/production-fullstack/server/src/sockets/emitters/assignment.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/attendance.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/exam.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/notification.emitter.ts +17 -0
- package/templates/production-fullstack/server/src/sockets/events.ts +27 -0
- package/templates/production-fullstack/server/src/sockets/handlers/attendance.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/chat.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/index.ts +15 -0
- package/templates/production-fullstack/server/src/sockets/handlers/lms.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/notification.handler.ts +39 -0
- package/templates/production-fullstack/server/src/sockets/index.ts +39 -0
- package/templates/production-fullstack/server/src/sockets/middleware.ts +54 -0
- package/templates/production-fullstack/server/src/sockets/rooms.ts +11 -0
- package/templates/production-fullstack/server/src/sockets/types.ts +32 -0
- package/templates/production-fullstack/server/tsconfig.json +14 -0
- package/templates/react-native/babel.config.js +1 -0
- package/templates/react-native/drizzle.config.ts +8 -0
- package/templates/react-native/package.json +8 -1
- package/templates/react-native/src/app/(auth)/_layout.tsx +12 -0
- package/templates/react-native/src/app/(auth)/change-password.tsx +112 -0
- package/templates/react-native/src/app/(auth)/edit-profile.tsx +156 -0
- package/templates/react-native/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/react-native/src/app/{login.tsx → (auth)/login.tsx} +69 -21
- package/templates/react-native/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/react-native/src/app/(tabs)/index.tsx +18 -17
- package/templates/react-native/src/app/(tabs)/profile.tsx +23 -60
- package/templates/react-native/src/app/(tabs)/search.tsx +2 -2
- package/templates/react-native/src/app/_layout.tsx +22 -4
- package/templates/react-native/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/react-native/src/components/common/LocationLoader.tsx +591 -0
- package/templates/react-native/src/components/common/ScreenHeader.tsx +41 -17
- package/templates/react-native/src/components/common/TabHeader.tsx +58 -0
- package/templates/react-native/src/components/common/Typography.tsx +49 -30
- package/templates/react-native/src/components/common/Welcome.tsx +2 -2
- package/templates/react-native/src/components/ui/BottomModal.tsx +31 -20
- package/templates/react-native/src/components/ui/ClassicTabBar.tsx +4 -3
- package/templates/react-native/src/components/ui/CustomTabBar.tsx +108 -71
- package/templates/react-native/src/components/ui/Sidebar.tsx +81 -56
- package/templates/react-native/src/components/ui/buttons/Button.tsx +106 -37
- package/templates/react-native/src/components/ui/buttons/IconButton.tsx +4 -2
- package/templates/react-native/src/components/ui/data-display/Accordion.tsx +3 -2
- package/templates/react-native/src/components/ui/data-display/Avatar.tsx +4 -3
- package/templates/react-native/src/components/ui/data-display/Badge.tsx +45 -17
- package/templates/react-native/src/components/ui/data-display/ImageViewer.tsx +19 -9
- package/templates/react-native/src/components/ui/feedback/CircularProgress.tsx +5 -4
- package/templates/react-native/src/components/ui/feedback/ProgressBar.tsx +4 -3
- package/templates/react-native/src/components/ui/feedback/Skeleton.tsx +3 -0
- package/templates/react-native/src/components/ui/feedback/Spinner.tsx +11 -3
- package/templates/react-native/src/components/ui/inputs/Checkbox.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/react-native/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/react-native/src/components/ui/inputs/Input.tsx +54 -14
- package/templates/react-native/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/react-native/src/components/ui/inputs/OTPInput.tsx +32 -9
- package/templates/react-native/src/components/ui/inputs/PasswordInput.tsx +2 -1
- package/templates/react-native/src/components/ui/inputs/Radio.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/SearchBar.tsx +41 -4
- package/templates/react-native/src/components/ui/inputs/Slider.tsx +4 -3
- package/templates/react-native/src/components/ui/inputs/Switch.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/TextArea.tsx +2 -1
- package/templates/react-native/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/react-native/src/components/ui/layout/Grid.tsx +52 -10
- package/templates/react-native/src/components/ui/layout/Section.tsx +7 -8
- package/templates/react-native/src/components/ui/navigation/Pagination.tsx +4 -3
- package/templates/react-native/src/components/ui/navigation/ProgressStepper.tsx +6 -5
- package/templates/react-native/src/components/ui/navigation/Tabs.tsx +30 -4
- package/templates/react-native/src/config/api.ts +12 -1
- package/templates/react-native/src/config/sidebar.config.ts +12 -0
- package/templates/react-native/src/config/tabNavigation.ts +1 -1
- package/templates/react-native/src/db/index.ts +9 -0
- package/templates/react-native/src/db/schema.ts +14 -0
- package/templates/react-native/src/hooks/useDebounce.ts +17 -0
- package/templates/react-native/src/services/notification.service.ts +22 -0
- package/templates/react-native/src/services/socket.service.ts +36 -0
- package/templates/react-native/src/store/useAuthStore.ts +122 -27
- package/templates/react-native/src/store/useNotificationStore.ts +178 -0
- package/templates/react-native/src/types/auth.type.ts +14 -0
- package/templates/react-native/tsconfig.json +1 -0
- package/templates/react-ts/src/vite-env.d.ts +1 -0
- package/templates/mern-react-native/mobile/.env.example +0 -2
- package/templates/mern-react-native/mobile/.vscode/extensions.json +0 -1
- package/templates/mern-react-native/mobile/.vscode/settings.json +0 -7
- package/templates/mern-react-native/mobile/README.md +0 -159
- package/templates/mern-react-native/mobile/docs/README.md +0 -17
- package/templates/mern-react-native/mobile/docs/components/buttons.md +0 -40
- package/templates/mern-react-native/mobile/docs/components/data-display.md +0 -44
- package/templates/mern-react-native/mobile/docs/components/feedback.md +0 -36
- package/templates/mern-react-native/mobile/docs/components/gestures.md +0 -60
- package/templates/mern-react-native/mobile/docs/components/inputs.md +0 -41
- package/templates/mern-react-native/mobile/docs/components/layout.md +0 -34
- package/templates/mern-react-native/mobile/docs/components/navigation.md +0 -31
- package/templates/mern-react-native/mobile/docs/features.md +0 -85
- package/templates/mern-react-native/mobile/docs/getting-started.md +0 -47
- package/templates/mern-react-native/mobile/src/components/common/HomeHeader.tsx +0 -43
- package/templates/mern-react-native/mobile/src/components/settings/SettingToggle.tsx +0 -26
- package/templates/mern-react-native/mobile/src/components/settings/SettingsOptions.tsx +0 -47
- package/templates/react-native/.env.example +0 -2
- package/templates/react-native/.vscode/extensions.json +0 -1
- package/templates/react-native/.vscode/settings.json +0 -7
- package/templates/react-native/README.md +0 -159
- package/templates/react-native/docs/README.md +0 -17
- package/templates/react-native/docs/components/buttons.md +0 -40
- package/templates/react-native/docs/components/data-display.md +0 -44
- package/templates/react-native/docs/components/feedback.md +0 -36
- package/templates/react-native/docs/components/gestures.md +0 -60
- package/templates/react-native/docs/components/inputs.md +0 -41
- package/templates/react-native/docs/components/layout.md +0 -34
- package/templates/react-native/docs/components/navigation.md +0 -31
- package/templates/react-native/docs/features.md +0 -85
- package/templates/react-native/docs/getting-started.md +0 -47
- package/templates/react-native/src/components/common/HomeHeader.tsx +0 -43
- package/templates/react-native/src/components/settings/SettingToggle.tsx +0 -26
- package/templates/react-native/src/components/settings/SettingsOptions.tsx +0 -47
|
@@ -0,0 +1,253 @@
|
|
|
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 { Redirect, 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 Tabs from "../../components/ui/navigation/Tabs";
|
|
10
|
+
import Image from "@/components/ui/data-display/Image";
|
|
11
|
+
import logo from "../../../assets/images/logo/logo.png";
|
|
12
|
+
|
|
13
|
+
export default function LoginScreen() {
|
|
14
|
+
const {
|
|
15
|
+
login,
|
|
16
|
+
signup,
|
|
17
|
+
sendOtp,
|
|
18
|
+
loading,
|
|
19
|
+
error,
|
|
20
|
+
user,
|
|
21
|
+
isCheckingAuth,
|
|
22
|
+
clearError,
|
|
23
|
+
demoLogin,
|
|
24
|
+
} = useAuthStore();
|
|
25
|
+
|
|
26
|
+
useFocusEffect(
|
|
27
|
+
useCallback(() => {
|
|
28
|
+
return () => clearError();
|
|
29
|
+
}, [clearError]),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const [mode, setMode] = useState("login");
|
|
33
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
34
|
+
const [form, setForm] = useState({
|
|
35
|
+
name: "",
|
|
36
|
+
email: "",
|
|
37
|
+
password: "",
|
|
38
|
+
otp: "",
|
|
39
|
+
});
|
|
40
|
+
const [otpSent, setOtpSent] = useState(false);
|
|
41
|
+
const [timer, setTimer] = useState(0);
|
|
42
|
+
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
let interval: ReturnType<typeof setInterval>;
|
|
45
|
+
if (timer > 0) {
|
|
46
|
+
interval = setInterval(() => {
|
|
47
|
+
setTimer((prev) => prev - 1);
|
|
48
|
+
}, 1000);
|
|
49
|
+
}
|
|
50
|
+
return () => clearInterval(interval);
|
|
51
|
+
}, [timer]);
|
|
52
|
+
|
|
53
|
+
const handleChange = (name: string, value: string) => {
|
|
54
|
+
setForm((prev) => ({ ...prev, [name]: value }));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleSubmit = async () => {
|
|
58
|
+
let ok;
|
|
59
|
+
if (mode === "login") {
|
|
60
|
+
ok = await login(form.email, form.password);
|
|
61
|
+
} else {
|
|
62
|
+
if (!otpSent) {
|
|
63
|
+
ok = await sendOtp(form.email);
|
|
64
|
+
if (ok) {
|
|
65
|
+
setOtpSent(true);
|
|
66
|
+
setTimer(60);
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
ok = await signup(form.name, form.email, form.password, form.otp);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (!isCheckingAuth && user) {
|
|
75
|
+
return <Redirect href="/(tabs)" />;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<ScrollContainer
|
|
80
|
+
contentContainerStyle={{
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
justifyContent: "center",
|
|
83
|
+
padding: 16,
|
|
84
|
+
}}
|
|
85
|
+
className="bg-base-100"
|
|
86
|
+
>
|
|
87
|
+
<View className="w-full p-6 ">
|
|
88
|
+
{/* Header */}
|
|
89
|
+
<View className="items-center mb-8 w-full">
|
|
90
|
+
<View className="w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 items-center justify-center mb-4">
|
|
91
|
+
<Image src={logo} height={40} width={40} />
|
|
92
|
+
</View>
|
|
93
|
+
<Txt
|
|
94
|
+
variant="xl"
|
|
95
|
+
className="text-2xl mb-1 text-center"
|
|
96
|
+
numberOfLines={1}
|
|
97
|
+
>
|
|
98
|
+
{mode === "login" ? "Welcome back" : "Create account"}
|
|
99
|
+
</Txt>
|
|
100
|
+
<Txt
|
|
101
|
+
variant="sm"
|
|
102
|
+
className="text-xs text-base-content/50 text-center px-2"
|
|
103
|
+
>
|
|
104
|
+
{mode === "login"
|
|
105
|
+
? "Sign in to continue your journey"
|
|
106
|
+
: "Enter your information to create a new account"}
|
|
107
|
+
</Txt>
|
|
108
|
+
</View>
|
|
109
|
+
|
|
110
|
+
{/* Tab Switcher */}
|
|
111
|
+
<View className="mb-6">
|
|
112
|
+
<Tabs
|
|
113
|
+
variant="button"
|
|
114
|
+
activeTab={mode}
|
|
115
|
+
onChange={(id) => {
|
|
116
|
+
setMode(id);
|
|
117
|
+
setOtpSent(false);
|
|
118
|
+
}}
|
|
119
|
+
tabs={[
|
|
120
|
+
{ id: "login", label: "Sign in" },
|
|
121
|
+
{ id: "signup", label: "Sign Up" },
|
|
122
|
+
]}
|
|
123
|
+
/>
|
|
124
|
+
</View>
|
|
125
|
+
|
|
126
|
+
{/* Error */}
|
|
127
|
+
{error ? (
|
|
128
|
+
<View className="bg-error/10 border border-error/20 rounded-2xl p-3 mb-4">
|
|
129
|
+
<Txt variant="md" className="text-error text-xs text-center">
|
|
130
|
+
⚠️ {error}
|
|
131
|
+
</Txt>
|
|
132
|
+
</View>
|
|
133
|
+
) : null}
|
|
134
|
+
|
|
135
|
+
{/* Form */}
|
|
136
|
+
<View className="gap-2">
|
|
137
|
+
{mode === "signup" && (
|
|
138
|
+
<Input
|
|
139
|
+
leftIcon="person"
|
|
140
|
+
placeholder="Full name"
|
|
141
|
+
value={form.name}
|
|
142
|
+
onChangeText={(val) => handleChange("name", val)}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
<Input
|
|
147
|
+
leftIcon="mail"
|
|
148
|
+
placeholder="Email address"
|
|
149
|
+
value={form.email}
|
|
150
|
+
onChangeText={(val) => handleChange("email", val)}
|
|
151
|
+
autoCapitalize="none"
|
|
152
|
+
keyboardType="email-address"
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
<Input
|
|
156
|
+
leftIcon="lock-closed"
|
|
157
|
+
rightIcon={showPassword ? "eye-off" : "eye"}
|
|
158
|
+
onRightIconPress={() => setShowPassword(!showPassword)}
|
|
159
|
+
placeholder="Password"
|
|
160
|
+
value={form.password}
|
|
161
|
+
onChangeText={(val) => handleChange("password", val)}
|
|
162
|
+
secureTextEntry={!showPassword}
|
|
163
|
+
/>
|
|
164
|
+
|
|
165
|
+
{mode === "login" && (
|
|
166
|
+
<View className="items-end mt-1 mb-2">
|
|
167
|
+
<Txt
|
|
168
|
+
variant="md"
|
|
169
|
+
className="text-primary text-xs"
|
|
170
|
+
onPress={() => router.push("/(auth)/forgot-password")}
|
|
171
|
+
>
|
|
172
|
+
Forgot Password?
|
|
173
|
+
</Txt>
|
|
174
|
+
</View>
|
|
175
|
+
)}
|
|
176
|
+
|
|
177
|
+
{mode === "signup" && otpSent && (
|
|
178
|
+
<Input
|
|
179
|
+
leftIcon="key"
|
|
180
|
+
placeholder="Enter OTP"
|
|
181
|
+
value={form.otp}
|
|
182
|
+
onChangeText={(val) => handleChange("otp", val)}
|
|
183
|
+
keyboardType="numeric"
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
<View className="mt-2">
|
|
188
|
+
<Button
|
|
189
|
+
label={
|
|
190
|
+
mode === "login"
|
|
191
|
+
? "Sign In →"
|
|
192
|
+
: otpSent
|
|
193
|
+
? "Verify & Create Account →"
|
|
194
|
+
: "Send OTP →"
|
|
195
|
+
}
|
|
196
|
+
onPress={handleSubmit}
|
|
197
|
+
isLoading={loading}
|
|
198
|
+
variant="primary"
|
|
199
|
+
isFullWidth
|
|
200
|
+
/>
|
|
201
|
+
</View>
|
|
202
|
+
|
|
203
|
+
{mode === "login" && (
|
|
204
|
+
<View className="mt-2">
|
|
205
|
+
<Button
|
|
206
|
+
label="Demo Login"
|
|
207
|
+
onPress={() => demoLogin()}
|
|
208
|
+
isLoading={loading}
|
|
209
|
+
variant="outline"
|
|
210
|
+
isFullWidth
|
|
211
|
+
/>
|
|
212
|
+
</View>
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
{mode === "signup" && otpSent && (
|
|
216
|
+
<View className="mt-2">
|
|
217
|
+
<Button
|
|
218
|
+
label={timer > 0 ? `Resend OTP in ${timer}s` : "Resend OTP"}
|
|
219
|
+
onPress={async () => {
|
|
220
|
+
const ok = await sendOtp(form.email);
|
|
221
|
+
if (ok) setTimer(60);
|
|
222
|
+
}}
|
|
223
|
+
disabled={timer > 0 || loading}
|
|
224
|
+
variant="outline"
|
|
225
|
+
isFullWidth
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
)}
|
|
229
|
+
</View>
|
|
230
|
+
|
|
231
|
+
{/* Footer */}
|
|
232
|
+
<View className="mt-8">
|
|
233
|
+
<Txt
|
|
234
|
+
variant="sm"
|
|
235
|
+
className="text-sm text-base-content/50 text-center"
|
|
236
|
+
>
|
|
237
|
+
{mode === "login" ? "New here? " : "Already have an account? "}
|
|
238
|
+
<Txt
|
|
239
|
+
variant="md"
|
|
240
|
+
className="text-primary text-sm"
|
|
241
|
+
onPress={() => {
|
|
242
|
+
setMode(mode === "login" ? "signup" : "login");
|
|
243
|
+
setOtpSent(false);
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
{mode === "login" ? "Create an account" : "Sign in"}
|
|
247
|
+
</Txt>
|
|
248
|
+
</Txt>
|
|
249
|
+
</View>
|
|
250
|
+
</View>
|
|
251
|
+
</ScrollContainer>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { Stack, useRouter, useSegments } from "expo-router";
|
|
3
|
+
import Toast from "react-native-toast-message";
|
|
4
|
+
import { useAuthStore } from "../features/auth/store/useAuthStore";
|
|
5
|
+
import { useColorScheme } from "nativewind";
|
|
6
|
+
import { Colors } from "../constants/Colors";
|
|
7
|
+
import "./global.css";
|
|
8
|
+
import Loading from "@/components/common/Loading";
|
|
9
|
+
|
|
10
|
+
import { PaperProvider } from "react-native-paper";
|
|
11
|
+
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
12
|
+
import { useFonts } from "expo-font";
|
|
13
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
14
|
+
import * as SplashScreen from "expo-splash-screen";
|
|
15
|
+
import { StatusBar } from "expo-status-bar";
|
|
16
|
+
import { QueryClientProvider } from "@tanstack/react-query";
|
|
17
|
+
import { queryClient } from "../lib/query-client";
|
|
18
|
+
|
|
19
|
+
SplashScreen.preventAutoHideAsync();
|
|
20
|
+
|
|
21
|
+
export default function RootLayout() {
|
|
22
|
+
const [fontsLoaded, fontError] = useFonts({
|
|
23
|
+
InterRegular: require("../../assets/fonts/Inter_Regular.ttf"),
|
|
24
|
+
InterMedium: require("../../assets/fonts/Inter_Medium.ttf"),
|
|
25
|
+
InterSemiBold: require("../../assets/fonts/Inter_SemiBold.ttf"),
|
|
26
|
+
InterBold: require("../../assets/fonts/Inter_Bold.ttf"),
|
|
27
|
+
InterExtraBold: require("../../assets/fonts/Inter_ExtraBold.ttf"),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { getMe, isCheckingAuth, loadCachedUser, user } = useAuthStore();
|
|
31
|
+
const { colorScheme, setColorScheme } = useColorScheme();
|
|
32
|
+
const colors = Colors[colorScheme ?? "light"];
|
|
33
|
+
|
|
34
|
+
const segments = useSegments();
|
|
35
|
+
const router = useRouter();
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (fontsLoaded || fontError) {
|
|
39
|
+
SplashScreen.hideAsync();
|
|
40
|
+
}
|
|
41
|
+
}, [fontsLoaded, fontError]);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
// Load cached user quickly, then fetch fresh in background
|
|
45
|
+
loadCachedUser().then(() => {
|
|
46
|
+
getMe();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Load saved theme
|
|
50
|
+
AsyncStorage.getItem("theme").then((savedTheme) => {
|
|
51
|
+
if (savedTheme === "light" || savedTheme === "dark") {
|
|
52
|
+
setColorScheme(savedTheme);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (isCheckingAuth) return;
|
|
60
|
+
|
|
61
|
+
const inAuthGroup = segments[0] === "(auth)";
|
|
62
|
+
|
|
63
|
+
if (!user && !inAuthGroup) {
|
|
64
|
+
// Redirect to the auth group
|
|
65
|
+
router.replace("/(auth)/login");
|
|
66
|
+
} else if (user && inAuthGroup) {
|
|
67
|
+
// Redirect away from auth
|
|
68
|
+
router.replace("/(tabs)");
|
|
69
|
+
}
|
|
70
|
+
}, [user, isCheckingAuth, segments]);
|
|
71
|
+
|
|
72
|
+
if (!fontsLoaded && !fontError) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (isCheckingAuth) {
|
|
77
|
+
return <Loading />;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<QueryClientProvider client={queryClient}>
|
|
82
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
83
|
+
<PaperProvider>
|
|
84
|
+
<StatusBar style={colorScheme === "dark" ? "light" : "dark"} />
|
|
85
|
+
<Stack
|
|
86
|
+
screenOptions={{
|
|
87
|
+
headerShown: false,
|
|
88
|
+
contentStyle: { backgroundColor: colors.base100 },
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
92
|
+
<Stack.Screen
|
|
93
|
+
name="(auth)"
|
|
94
|
+
options={{ headerShown: false, animation: "fade" }}
|
|
95
|
+
/>
|
|
96
|
+
</Stack>
|
|
97
|
+
<Toast />
|
|
98
|
+
</PaperProvider>
|
|
99
|
+
</GestureHandlerRootView>
|
|
100
|
+
</QueryClientProvider>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
/* Surface */
|
|
8
|
+
--color-base-100: 255 255 255; /* #FFFFFF */
|
|
9
|
+
--color-base-200: 248 250 252; /* #F8FAFC */
|
|
10
|
+
--color-base-300: 226 232 240; /* #E2E8F0 */
|
|
11
|
+
--color-base-content: 15 23 42; /* #0F172A */
|
|
12
|
+
|
|
13
|
+
/* Brand */
|
|
14
|
+
--color-primary: 59 130 246; /* #3B82F6 */
|
|
15
|
+
--color-primary-content: 255 255 255;
|
|
16
|
+
|
|
17
|
+
--color-secondary: 100 116 139; /* #64748B */
|
|
18
|
+
--color-secondary-content: 255 255 255;
|
|
19
|
+
|
|
20
|
+
--color-accent: 20 184 166; /* #14B8A6 */
|
|
21
|
+
--color-accent-content: 255 255 255;
|
|
22
|
+
|
|
23
|
+
/* Neutral */
|
|
24
|
+
--color-neutral: 30 41 59; /* #1E293B */
|
|
25
|
+
--color-neutral-content: 255 255 255;
|
|
26
|
+
|
|
27
|
+
/* Semantic */
|
|
28
|
+
--color-info: 14 165 233; /* #0EA5E9 */
|
|
29
|
+
--color-info-content: 255 255 255;
|
|
30
|
+
|
|
31
|
+
--color-success: 34 197 94; /* #22C55E */
|
|
32
|
+
--color-success-content: 255 255 255;
|
|
33
|
+
|
|
34
|
+
--color-warning: 245 158 11; /* #F59E0B */
|
|
35
|
+
--color-warning-content: 255 255 255;
|
|
36
|
+
|
|
37
|
+
--color-error: 239 68 68; /* #EF4444 */
|
|
38
|
+
--color-error-content: 255 255 255;
|
|
39
|
+
|
|
40
|
+
/* Radius */
|
|
41
|
+
--rounded-box: 12px;
|
|
42
|
+
--rounded-btn: 10px;
|
|
43
|
+
--rounded-badge: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (prefers-color-scheme: dark) {
|
|
47
|
+
:root {
|
|
48
|
+
/* Surface */
|
|
49
|
+
--color-base-100: 17 24 39; /* #111827 */
|
|
50
|
+
--color-base-200: 27 36 51; /* #1B2433 */
|
|
51
|
+
--color-base-300: 42 52 69; /* #2A3445 */
|
|
52
|
+
--color-base-content: 248 250 252;/* #F8FAFC */
|
|
53
|
+
|
|
54
|
+
/* Brand */
|
|
55
|
+
--color-primary: 96 165 250; /* #60A5FA */
|
|
56
|
+
--color-primary-content: 255 255 255;
|
|
57
|
+
|
|
58
|
+
--color-secondary: 148 163 184; /* #94A3B8 */
|
|
59
|
+
--color-secondary-content: 17 24 39;
|
|
60
|
+
|
|
61
|
+
--color-accent: 45 212 191; /* #2DD4BF */
|
|
62
|
+
--color-accent-content: 17 24 39;
|
|
63
|
+
|
|
64
|
+
/* Neutral */
|
|
65
|
+
--color-neutral: 248 250 252; /* #F8FAFC */
|
|
66
|
+
--color-neutral-content: 17 24 39;
|
|
67
|
+
|
|
68
|
+
/* Semantic */
|
|
69
|
+
--color-info: 56 189 248; /* #38BDF8 */
|
|
70
|
+
--color-info-content: 17 24 39;
|
|
71
|
+
|
|
72
|
+
--color-success: 74 222 128; /* #4ADE80 */
|
|
73
|
+
--color-success-content: 17 24 39;
|
|
74
|
+
|
|
75
|
+
--color-warning: 251 191 36; /* #FBBF24 */
|
|
76
|
+
--color-warning-content: 17 24 39;
|
|
77
|
+
|
|
78
|
+
--color-error: 248 113 113; /* #F87171 */
|
|
79
|
+
--color-error-content: 255 255 255;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|