@imksh/create 1.0.25 → 1.0.27
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/mobile/_gitignore +43 -0
- package/templates/mern-react-native/mobile/package.json +2 -1
- package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +11 -15
- package/templates/mern-react-native/mobile/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/mern-react-native/mobile/src/app/(tabs)/search.tsx +2 -2
- package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +0 -60
- package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +6 -36
- package/templates/mern-react-native/mobile/src/services/notification.service.ts +22 -0
- package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +158 -33
- 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/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/_gitignore +24 -0
- 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/_gitignore +43 -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/_gitignore +24 -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/src/assets/animations/loading.json +1 -0
- package/templates/react-native/_gitignore +43 -0
- package/templates/react-native/package.json +2 -1
- package/templates/react-native/src/app/(auth)/edit-profile.tsx +11 -15
- package/templates/react-native/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/react-native/src/app/(tabs)/search.tsx +2 -2
- package/templates/react-native/src/config/sidebar.config.ts +0 -60
- package/templates/react-native/src/config/tabNavigation.ts +6 -36
- package/templates/react-native/src/services/notification.service.ts +22 -0
- package/templates/react-native/src/store/useNotificationStore.ts +158 -33
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
import { authService } from "../api/authService";
|
|
3
|
+
|
|
4
|
+
export interface User {
|
|
5
|
+
_id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
role: string;
|
|
10
|
+
avatar?: {
|
|
11
|
+
url?: string;
|
|
12
|
+
publicId?: string;
|
|
13
|
+
};
|
|
14
|
+
createdAt?: string;
|
|
15
|
+
updatedAt?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AuthState {
|
|
19
|
+
user: User | null;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
isCheckingAuth: boolean;
|
|
22
|
+
error: string | null;
|
|
23
|
+
sendOtp: (email: string) => Promise<boolean>;
|
|
24
|
+
signup: (name: string, email: string, password: string, otp: string, role?: string) => Promise<boolean>;
|
|
25
|
+
login: (email: string, password: string) => Promise<boolean>;
|
|
26
|
+
getMe: () => Promise<void>;
|
|
27
|
+
updateProfile: (updates: Partial<User> | FormData) => Promise<boolean>;
|
|
28
|
+
logout: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const useAuthStore = create<AuthState>((set) => ({
|
|
32
|
+
user: null,
|
|
33
|
+
loading: false,
|
|
34
|
+
isCheckingAuth: true,
|
|
35
|
+
error: null,
|
|
36
|
+
|
|
37
|
+
sendOtp: async (email: string) => {
|
|
38
|
+
set({ loading: true, error: null });
|
|
39
|
+
try {
|
|
40
|
+
await authService.sendOtp(email);
|
|
41
|
+
return true;
|
|
42
|
+
} catch (err: any) {
|
|
43
|
+
set({
|
|
44
|
+
error: err.response?.data?.message || err.message,
|
|
45
|
+
loading: false,
|
|
46
|
+
});
|
|
47
|
+
return false;
|
|
48
|
+
} finally {
|
|
49
|
+
set({ loading: false });
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
signup: async (name: string, email: string, password: string, otp: string, role = "user") => {
|
|
54
|
+
set({ loading: true, error: null });
|
|
55
|
+
try {
|
|
56
|
+
const { data } = await authService.signup(name, email, password, otp, role);
|
|
57
|
+
if (data.token) {
|
|
58
|
+
localStorage.setItem("token", data.token);
|
|
59
|
+
}
|
|
60
|
+
set({
|
|
61
|
+
user: data.data,
|
|
62
|
+
loading: false,
|
|
63
|
+
});
|
|
64
|
+
return true;
|
|
65
|
+
} catch (err: any) {
|
|
66
|
+
set({
|
|
67
|
+
error: err.response?.data?.message || err.message,
|
|
68
|
+
loading: false,
|
|
69
|
+
});
|
|
70
|
+
return false;
|
|
71
|
+
} finally {
|
|
72
|
+
set({ loading: false });
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
login: async (email: string, password: string) => {
|
|
77
|
+
set({ loading: true, error: null });
|
|
78
|
+
try {
|
|
79
|
+
const { data } = await authService.login(email, password);
|
|
80
|
+
if (data.token) {
|
|
81
|
+
localStorage.setItem("token", data.token);
|
|
82
|
+
}
|
|
83
|
+
set({
|
|
84
|
+
user: data.data,
|
|
85
|
+
loading: false,
|
|
86
|
+
});
|
|
87
|
+
return true;
|
|
88
|
+
} catch (err: any) {
|
|
89
|
+
set({
|
|
90
|
+
error: err.response?.data?.message || err.message,
|
|
91
|
+
loading: false,
|
|
92
|
+
});
|
|
93
|
+
return false;
|
|
94
|
+
} finally {
|
|
95
|
+
set({ loading: false });
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
getMe: async () => {
|
|
100
|
+
set({ isCheckingAuth: true });
|
|
101
|
+
try {
|
|
102
|
+
const { data } = await authService.getMe();
|
|
103
|
+
set({ user: data.data, isCheckingAuth: false });
|
|
104
|
+
} catch (err: any) {
|
|
105
|
+
set({ isCheckingAuth: false });
|
|
106
|
+
} finally {
|
|
107
|
+
set({ isCheckingAuth: false });
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
updateProfile: async (updates: Partial<User> | FormData) => {
|
|
112
|
+
set({ loading: true, error: null });
|
|
113
|
+
try {
|
|
114
|
+
const { data } = await authService.updateMe(updates);
|
|
115
|
+
set({ user: data.data, loading: false });
|
|
116
|
+
return true;
|
|
117
|
+
} catch (err: any) {
|
|
118
|
+
set({
|
|
119
|
+
error: err.response?.data?.message || err.message,
|
|
120
|
+
loading: false,
|
|
121
|
+
});
|
|
122
|
+
return false;
|
|
123
|
+
} finally {
|
|
124
|
+
set({ loading: false });
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
logout: async () => {
|
|
129
|
+
try {
|
|
130
|
+
await authService.logout();
|
|
131
|
+
} catch (_) {
|
|
132
|
+
// ignore errors — cookie may already be expired
|
|
133
|
+
} finally {
|
|
134
|
+
localStorage.removeItem("token");
|
|
135
|
+
set({ loading: false });
|
|
136
|
+
}
|
|
137
|
+
set({
|
|
138
|
+
user: null,
|
|
139
|
+
error: null,
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
}));
|
|
143
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import { FiZap, FiLayers, FiCpu, FiShield, FiArrowRight } from "react-icons/fi";
|
|
5
|
+
import appConfig from "../../../config/index";
|
|
6
|
+
import toast from "react-hot-toast";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
|
|
9
|
+
const Home = () => {
|
|
10
|
+
const [count, setCount] = useState(0);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className="h-full w-full relative overflow-hidden flex flex-col items-center justify-center p-6 text-base-content">
|
|
14
|
+
{/* Hero Welcome Section */}
|
|
15
|
+
<div className="max-w-3xl w-full text-center space-y-6">
|
|
16
|
+
<motion.div
|
|
17
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
18
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
19
|
+
transition={{ duration: 0.5 }}
|
|
20
|
+
className="flex items-center justify-center gap-3 mb-2"
|
|
21
|
+
>
|
|
22
|
+
<div className="bg-primary/10 text-primary p-2.5 rounded-2xl">
|
|
23
|
+
<img
|
|
24
|
+
src={appConfig.app.logo}
|
|
25
|
+
alt={appConfig.app.name}
|
|
26
|
+
className="w-8 h-8 rounded-full"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
<span className="text-sm font-semibold tracking-widest uppercase text-primary-content/65">
|
|
30
|
+
React Starter Kit
|
|
31
|
+
</span>
|
|
32
|
+
</motion.div>
|
|
33
|
+
|
|
34
|
+
<motion.h1
|
|
35
|
+
initial={{ opacity: 0, y: 15 }}
|
|
36
|
+
animate={{ opacity: 1, y: 0 }}
|
|
37
|
+
transition={{ duration: 0.5, delay: 0.1 }}
|
|
38
|
+
className="text-4xl sm:text-5xl font-black tracking-tight text-base-content"
|
|
39
|
+
>
|
|
40
|
+
Welcome to {appConfig.app.name}
|
|
41
|
+
</motion.h1>
|
|
42
|
+
|
|
43
|
+
<motion.p
|
|
44
|
+
initial={{ opacity: 0, y: 15 }}
|
|
45
|
+
animate={{ opacity: 1, y: 0 }}
|
|
46
|
+
transition={{ duration: 0.5, delay: 0.2 }}
|
|
47
|
+
className="text-sm sm:text-base text-base-content/70 max-w-xl mx-auto leading-relaxed"
|
|
48
|
+
>
|
|
49
|
+
A production-ready React setup built using <strong>@imksh/cli</strong>
|
|
50
|
+
. Everything is pre-configured and ready to publish.
|
|
51
|
+
</motion.p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
{/* Features Grid */}
|
|
55
|
+
<motion.div
|
|
56
|
+
initial={{ opacity: 0, y: 20 }}
|
|
57
|
+
animate={{ opacity: 1, y: 0 }}
|
|
58
|
+
transition={{ duration: 0.6, delay: 0.3 }}
|
|
59
|
+
className="grid grid-cols-2 md:grid-cols-4 gap-4 max-w-4xl w-full my-10 shrink-0"
|
|
60
|
+
>
|
|
61
|
+
{/* Card 1 */}
|
|
62
|
+
<div className="bg-base-200/50 backdrop-blur border border-base-content/10 p-5 rounded-2xl flex flex-col gap-3 hover:bg-base-200 transition-colors">
|
|
63
|
+
<div className="text-primary text-xl">
|
|
64
|
+
<FiLayers />
|
|
65
|
+
</div>
|
|
66
|
+
<div>
|
|
67
|
+
<h3 className="text-sm font-bold text-base-content">Zustand & UI</h3>
|
|
68
|
+
<p className="text-xs text-base-content/70 mt-1">
|
|
69
|
+
Light/Dark theme, sidebar collapse & responsive menu states.
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{/* Card 2 */}
|
|
75
|
+
<div className="bg-base-200/50 backdrop-blur border border-base-content/10 p-5 rounded-2xl flex flex-col gap-3 hover:bg-base-200 transition-colors">
|
|
76
|
+
<div className="text-success text-xl">
|
|
77
|
+
<FiZap />
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<h3 className="text-sm font-bold text-base-content">Tailwind & UI</h3>
|
|
81
|
+
<p className="text-xs text-base-content/70 mt-1">
|
|
82
|
+
Tailwind CSS v4 + FlyonUI components pre-configured.
|
|
83
|
+
</p>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{/* Card 3 */}
|
|
88
|
+
<div className="bg-base-200/50 backdrop-blur border border-base-content/10 p-5 rounded-2xl flex flex-col gap-3 hover:bg-base-200 transition-colors">
|
|
89
|
+
<div className="text-warning text-xl">
|
|
90
|
+
<FiCpu />
|
|
91
|
+
</div>
|
|
92
|
+
<div>
|
|
93
|
+
<h3 className="text-sm font-bold text-base-content">Layouts & Router</h3>
|
|
94
|
+
<p className="text-xs text-base-content/70 mt-1">
|
|
95
|
+
Public & Dashboard layouts with dynamic headers.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
{/* Card 4 */}
|
|
101
|
+
<div className="bg-base-200/50 backdrop-blur border border-base-content/10 p-5 rounded-2xl flex flex-col gap-3 hover:bg-base-200 transition-colors">
|
|
102
|
+
<div className="text-error text-xl">
|
|
103
|
+
<FiShield />
|
|
104
|
+
</div>
|
|
105
|
+
<div>
|
|
106
|
+
<h3 className="text-sm font-bold text-base-content">Helpers</h3>
|
|
107
|
+
<p className="text-xs text-base-content/70 mt-1">
|
|
108
|
+
Modal system, Tables, Loading Skeletons, and Auth Services.
|
|
109
|
+
</p>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</motion.div>
|
|
113
|
+
|
|
114
|
+
{/* Call to Actions */}
|
|
115
|
+
<motion.div
|
|
116
|
+
initial={{ opacity: 0, y: 15 }}
|
|
117
|
+
animate={{ opacity: 1, y: 0 }}
|
|
118
|
+
transition={{ duration: 0.5, delay: 0.4 }}
|
|
119
|
+
className="flex gap-4"
|
|
120
|
+
>
|
|
121
|
+
<motion.button
|
|
122
|
+
whileTap={{ scale: 0.95 }}
|
|
123
|
+
onClick={() => setCount((prev) => prev + 1)}
|
|
124
|
+
className="btn btn-primary rounded-xl px-6 py-2.5 font-semibold text-sm gap-2 shadow-lg shadow-primary/20 flex items-center transition-all"
|
|
125
|
+
>
|
|
126
|
+
count {count}
|
|
127
|
+
</motion.button>
|
|
128
|
+
<motion.button
|
|
129
|
+
whileTap={{ scale: 0.95 }}
|
|
130
|
+
onClick={() => toast.success("Hello World")}
|
|
131
|
+
className="btn btn-outline rounded-xl px-6 py-2.5 font-semibold text-sm gap-2 flex items-center transition-all border-base-content/20 text-base-content hover:bg-base-content/5"
|
|
132
|
+
>
|
|
133
|
+
Show Toast
|
|
134
|
+
</motion.button>
|
|
135
|
+
</motion.div>
|
|
136
|
+
|
|
137
|
+
{/* Footer Branding */}
|
|
138
|
+
<motion.div
|
|
139
|
+
initial={{ opacity: 0 }}
|
|
140
|
+
animate={{ opacity: 0.5 }}
|
|
141
|
+
transition={{ duration: 0.5, delay: 0.5 }}
|
|
142
|
+
className="absolute bottom-6 text-xs text-base-content/50 font-medium"
|
|
143
|
+
>
|
|
144
|
+
Generated with @imksh/cli • Version {appConfig.app.version}
|
|
145
|
+
</motion.div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default Home;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import Lenis from "lenis";
|
|
3
|
+
|
|
4
|
+
const useLenis = () => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const lenis = new Lenis({
|
|
7
|
+
duration: 1.1, // reduce
|
|
8
|
+
easing: (t) => 1 - Math.pow(1 - t, 3),
|
|
9
|
+
smooth: true,
|
|
10
|
+
smoothTouch: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
let rafId;
|
|
14
|
+
const raf = (time) => {
|
|
15
|
+
lenis.raf(time);
|
|
16
|
+
rafId = requestAnimationFrame(raf);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
rafId = requestAnimationFrame(raf);
|
|
20
|
+
|
|
21
|
+
return () => {
|
|
22
|
+
cancelAnimationFrame(rafId);
|
|
23
|
+
lenis.destroy();
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default useLenis;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
const usePwaInstall = () => {
|
|
4
|
+
const [canInstall, setCanInstall] = useState(false);
|
|
5
|
+
const [isInstalled, setIsInstalled] = useState(false);
|
|
6
|
+
const [deferredPrompt, setDeferredPrompt] = useState(null);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const handleBeforeInstallPrompt = (e) => {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
setDeferredPrompt(e);
|
|
12
|
+
setCanInstall(true);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const handleAppInstalled = () => {
|
|
16
|
+
setIsInstalled(true);
|
|
17
|
+
setCanInstall(false);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
window.addEventListener("beforeinstallprompt", handleBeforeInstallPrompt);
|
|
21
|
+
window.addEventListener("appinstalled", handleAppInstalled);
|
|
22
|
+
|
|
23
|
+
if (window.matchMedia("(display-mode: standalone)").matches) {
|
|
24
|
+
setIsInstalled(true);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return () => {
|
|
28
|
+
window.removeEventListener("beforeinstallprompt", handleBeforeInstallPrompt);
|
|
29
|
+
window.removeEventListener("appinstalled", handleAppInstalled);
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
const promptInstall = async () => {
|
|
34
|
+
if (!deferredPrompt) return null;
|
|
35
|
+
deferredPrompt.prompt();
|
|
36
|
+
const choiceResult = await deferredPrompt.userChoice;
|
|
37
|
+
setDeferredPrompt(null);
|
|
38
|
+
setCanInstall(false);
|
|
39
|
+
return choiceResult;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return { canInstall, isInstalled, promptInstall };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default usePwaInstall;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
const useWindowSize = () => {
|
|
4
|
+
const [size, setSize] = useState({
|
|
5
|
+
width: window.innerWidth,
|
|
6
|
+
height: window.innerHeight,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const handleResize = () => {
|
|
12
|
+
setSize({
|
|
13
|
+
width: window.innerWidth,
|
|
14
|
+
height: window.innerHeight,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
window.addEventListener("resize", handleResize);
|
|
19
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return size;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default useWindowSize;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');
|
|
2
|
+
@import "tailwindcss";
|
|
3
|
+
@plugin "flyonui";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/* ========================================
|
|
7
|
+
LIGHT THEME
|
|
8
|
+
======================================== */
|
|
9
|
+
:root, [data-theme="light"] {
|
|
10
|
+
/* --font-sans: "Outfit", sans-serif; */
|
|
11
|
+
--color-base-100: #ffffff;
|
|
12
|
+
--color-base-200: #f8fafc;
|
|
13
|
+
--color-base-300: #e2e8f0;
|
|
14
|
+
--color-base-content: #0f172a;
|
|
15
|
+
|
|
16
|
+
--color-primary: #2563eb;
|
|
17
|
+
--color-primary-content: #ffffff;
|
|
18
|
+
--color-secondary: #64748b;
|
|
19
|
+
--color-secondary-content: #ffffff;
|
|
20
|
+
--color-accent: #00b8a3;
|
|
21
|
+
--color-accent-content: #ffffff;
|
|
22
|
+
--color-neutral: #1e293b;
|
|
23
|
+
--color-neutral-content: #ffffff;
|
|
24
|
+
|
|
25
|
+
--color-info: #0ea5e9;
|
|
26
|
+
--color-success: #22c55e;
|
|
27
|
+
--color-warning: #f59e0b;
|
|
28
|
+
--color-error: #ef4444;
|
|
29
|
+
|
|
30
|
+
--rounded-box: 12px;
|
|
31
|
+
--rounded-btn: 10px;
|
|
32
|
+
--rounded-badge: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ========================================
|
|
36
|
+
DARK THEME
|
|
37
|
+
======================================== */
|
|
38
|
+
[data-theme="dark"] {
|
|
39
|
+
--color-base-100: #282828;
|
|
40
|
+
--color-base-200: #242424;
|
|
41
|
+
--color-base-300: #2d2d2d;
|
|
42
|
+
--color-base-content: #f5f5f5;
|
|
43
|
+
|
|
44
|
+
--color-primary: #2563eb;
|
|
45
|
+
--color-primary-content: #ffffff;
|
|
46
|
+
--color-secondary: #3a3a3a;
|
|
47
|
+
--color-secondary-content: #d4d4d4;
|
|
48
|
+
--color-accent: #00b8a3;
|
|
49
|
+
--color-accent-content: #ffffff;
|
|
50
|
+
--color-neutral: #2d2d2d;
|
|
51
|
+
--color-neutral-content: #f5f5f5;
|
|
52
|
+
|
|
53
|
+
--color-info: #38bdf8;
|
|
54
|
+
--color-success: #22c55e;
|
|
55
|
+
--color-warning: #f59e0b;
|
|
56
|
+
--color-error: #ef4444;
|
|
57
|
+
|
|
58
|
+
--rounded-box: 12px;
|
|
59
|
+
--rounded-btn: 10px;
|
|
60
|
+
--rounded-badge: 8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ========================================
|
|
64
|
+
MODERN UI UTILITIES & ANIMATIONS
|
|
65
|
+
======================================== */
|
|
66
|
+
html {
|
|
67
|
+
scroll-behavior: smooth;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
body {
|
|
71
|
+
font-family: var(--font-sans);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.glass-panel {
|
|
75
|
+
background: rgba(255, 255, 255, 0.03);
|
|
76
|
+
backdrop-filter: blur(16px);
|
|
77
|
+
-webkit-backdrop-filter: blur(16px);
|
|
78
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-theme="light"] .glass-panel {
|
|
82
|
+
background: rgba(255, 255, 255, 0.6);
|
|
83
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes float {
|
|
87
|
+
0%, 100% { transform: translateY(0); }
|
|
88
|
+
50% { transform: translateY(-10px); }
|
|
89
|
+
}
|
|
90
|
+
.animate-float {
|
|
91
|
+
animation: float 6s ease-in-out infinite;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@keyframes float-slow {
|
|
95
|
+
0%, 100% { transform: translateY(0); }
|
|
96
|
+
50% { transform: translateY(-20px); }
|
|
97
|
+
}
|
|
98
|
+
.animate-float-slow {
|
|
99
|
+
animation: float-slow 8s ease-in-out infinite;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@keyframes pulse-glow {
|
|
103
|
+
0%, 100% { opacity: 0.4; transform: scale(1); }
|
|
104
|
+
50% { opacity: 0.8; transform: scale(1.05); }
|
|
105
|
+
}
|
|
106
|
+
.animate-pulse-glow {
|
|
107
|
+
animation: pulse-glow 4s ease-in-out infinite;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* ========================================
|
|
111
|
+
ANIMATIONS
|
|
112
|
+
======================================== */
|
|
113
|
+
@keyframes slideInRight {
|
|
114
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
115
|
+
to { transform: translateX(0); opacity: 1; }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.animate-slideInRight {
|
|
119
|
+
animation: slideInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes fadeIn {
|
|
123
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
124
|
+
to { opacity: 1; transform: translateY(0); }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.animate-fadeIn {
|
|
128
|
+
animation: fadeIn 0.3s ease forwards;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes zoomIn {
|
|
132
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
133
|
+
to { opacity: 1; transform: scale(1); }
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.animate-zoomIn {
|
|
137
|
+
animation: zoomIn 0.18s ease forwards;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Hide Scrollbar */
|
|
141
|
+
|
|
142
|
+
::-webkit-scrollbar {
|
|
143
|
+
width: 0px;
|
|
144
|
+
height: 0px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
* {
|
|
148
|
+
scrollbar-width: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.hide-scrollbar {
|
|
152
|
+
-ms-overflow-style: none; /* IE & Edge */
|
|
153
|
+
scrollbar-width: none; /* Firefox */
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.hide-scrollbar::-webkit-scrollbar {
|
|
157
|
+
display: none; /* Chrome, Safari */
|
|
158
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
export const api = axios.create({
|
|
4
|
+
baseURL: import.meta.env.VITE_API_URL || "http://localhost:5001/api",
|
|
5
|
+
withCredentials: true, // send httpOnly cookies on every request
|
|
6
|
+
headers: {
|
|
7
|
+
"Content-Type": "application/json",
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
api.interceptors.request.use(
|
|
12
|
+
(config) => {
|
|
13
|
+
const token = localStorage.getItem("token");
|
|
14
|
+
if (token) {
|
|
15
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
16
|
+
}
|
|
17
|
+
return config;
|
|
18
|
+
},
|
|
19
|
+
(error) => {
|
|
20
|
+
return Promise.reject(error);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import relativeTime from "dayjs/plugin/relativeTime";
|
|
3
|
+
import timezone from "dayjs/plugin/timezone";
|
|
4
|
+
import utc from "dayjs/plugin/utc";
|
|
5
|
+
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
6
|
+
|
|
7
|
+
dayjs.extend(relativeTime);
|
|
8
|
+
dayjs.extend(timezone);
|
|
9
|
+
dayjs.extend(utc);
|
|
10
|
+
dayjs.extend(localizedFormat);
|
|
11
|
+
|
|
12
|
+
export default dayjs;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
import { BrowserRouter } from "react-router-dom";
|
|
4
|
+
import { QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { queryClient } from "./lib/query-client.js";
|
|
6
|
+
import App from "./App.js";
|
|
7
|
+
import "./index.css";
|
|
8
|
+
|
|
9
|
+
if ("serviceWorker" in navigator) {
|
|
10
|
+
window.addEventListener("load", () => {
|
|
11
|
+
navigator.serviceWorker
|
|
12
|
+
.register("/sw.js")
|
|
13
|
+
.then((reg) =>
|
|
14
|
+
console.log("Service Worker registered successfully:", reg.scope),
|
|
15
|
+
)
|
|
16
|
+
.catch((err) => console.log("Service Worker registration failed:", err));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
|
21
|
+
<React.StrictMode>
|
|
22
|
+
<QueryClientProvider client={queryClient}>
|
|
23
|
+
<BrowserRouter>
|
|
24
|
+
<App />
|
|
25
|
+
</BrowserRouter>
|
|
26
|
+
</QueryClientProvider>
|
|
27
|
+
</React.StrictMode>,
|
|
28
|
+
);
|