@imksh/create 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/bin/index.js +3 -0
- package/package.json +43 -0
- package/src/commands/create.js +90 -0
- package/src/index.js +41 -0
- package/src/utils/askTemplate.js +25 -0
- package/src/utils/copyTemplate.js +36 -0
- package/src/utils/installPackages.js +25 -0
- package/src/utils/logger.js +17 -0
- package/src/utils/runGit.js +11 -0
- package/templates/mern/_gitignore +2 -0
- package/templates/mern/client/_gitignore +24 -0
- package/templates/mern/client/index.html +14 -0
- package/templates/mern/client/package.json +39 -0
- package/templates/mern/client/public/_redirects +1 -0
- package/templates/mern/client/public/favicon.ico +0 -0
- package/templates/mern/client/public/favicon.svg +1 -0
- package/templates/mern/client/public/logo.png +0 -0
- package/templates/mern/client/public/manifest.json +24 -0
- package/templates/mern/client/public/sw.js +56 -0
- package/templates/mern/client/src/App.jsx +68 -0
- package/templates/mern/client/src/assets/animations/loading.json +1 -0
- package/templates/mern/client/src/assets/data/navigation.js +29 -0
- package/templates/mern/client/src/assets/images/logo.png +0 -0
- package/templates/mern/client/src/components/common/Breadcrumbs.jsx +27 -0
- package/templates/mern/client/src/components/common/Loading.jsx +19 -0
- package/templates/mern/client/src/components/common/LottieIcon.jsx +36 -0
- package/templates/mern/client/src/components/common/NotFound.jsx +78 -0
- package/templates/mern/client/src/components/common/PwaInstallPrompt.jsx +72 -0
- package/templates/mern/client/src/components/common/SEO.jsx +67 -0
- package/templates/mern/client/src/components/common/Scroll.jsx +25 -0
- package/templates/mern/client/src/components/common/Table.jsx +110 -0
- package/templates/mern/client/src/components/common/ToggleSwitch.jsx +38 -0
- package/templates/mern/client/src/components/common/Unauthorized.jsx +76 -0
- package/templates/mern/client/src/components/layout/ProtectedRoute.jsx +17 -0
- package/templates/mern/client/src/components/layout/PublicLayout.jsx +13 -0
- package/templates/mern/client/src/components/layout/SidebarLayout.jsx +37 -0
- package/templates/mern/client/src/components/modals/ConfirmModal.jsx +135 -0
- package/templates/mern/client/src/components/modals/Modal.jsx +94 -0
- package/templates/mern/client/src/components/skeletons/common/CardSkeleton.jsx +23 -0
- package/templates/mern/client/src/components/skeletons/common/DashboardSkeleton.jsx +19 -0
- package/templates/mern/client/src/components/skeletons/common/ListSkeleton.jsx +24 -0
- package/templates/mern/client/src/components/skeletons/common/PageSkeleton.jsx +26 -0
- package/templates/mern/client/src/components/skeletons/common/ProfileSkeleton.jsx +23 -0
- package/templates/mern/client/src/components/skeletons/common/Skeleton.jsx +18 -0
- package/templates/mern/client/src/components/skeletons/common/TableSkeleton.jsx +33 -0
- package/templates/mern/client/src/components/ui/Header.jsx +230 -0
- package/templates/mern/client/src/components/ui/SidebarHeader.jsx +27 -0
- package/templates/mern/client/src/components/ui/sidebar.jsx +152 -0
- package/templates/mern/client/src/config/api.js +22 -0
- package/templates/mern/client/src/config/appConfig.js +44 -0
- package/templates/mern/client/src/config/navigation.js +14 -0
- package/templates/mern/client/src/hooks/useLenis.js +28 -0
- package/templates/mern/client/src/hooks/usePwaInstall.js +45 -0
- package/templates/mern/client/src/hooks/useWindowSize.js +25 -0
- package/templates/mern/client/src/index.css +158 -0
- package/templates/mern/client/src/main.jsx +24 -0
- package/templates/mern/client/src/pages/Home.jsx +154 -0
- package/templates/mern/client/src/pages/Login.jsx +196 -0
- package/templates/mern/client/src/pages/Profile.jsx +9 -0
- package/templates/mern/client/src/services/authService.js +16 -0
- package/templates/mern/client/src/store/useAuthStore.js +98 -0
- package/templates/mern/client/src/store/useUiStore.js +54 -0
- package/templates/mern/client/src/utils/getInitials.js +10 -0
- package/templates/mern/client/vite.config.js +8 -0
- package/templates/mern/package.json +18 -0
- package/templates/mern/server/.env.example +62 -0
- package/templates/mern/server/README.md +65 -0
- package/templates/mern/server/_gitignore +24 -0
- package/templates/mern/server/package.json +32 -0
- package/templates/mern/server/src/app.js +42 -0
- package/templates/mern/server/src/config/cloudinary.js +9 -0
- package/templates/mern/server/src/config/db.js +14 -0
- package/templates/mern/server/src/config/dotenv.js +2 -0
- package/templates/mern/server/src/config/email.js +30 -0
- package/templates/mern/server/src/config/socket.js +54 -0
- package/templates/mern/server/src/config/webPush.js +9 -0
- package/templates/mern/server/src/controllers/auth.controller.js +153 -0
- package/templates/mern/server/src/controllers/upload.controller.js +26 -0
- package/templates/mern/server/src/index.js +24 -0
- package/templates/mern/server/src/middleware/auth.middleware.js +43 -0
- package/templates/mern/server/src/middleware/errorHandler.js +22 -0
- package/templates/mern/server/src/middleware/multer.js +21 -0
- package/templates/mern/server/src/middleware/rateLimiter.js +57 -0
- package/templates/mern/server/src/models/otp.model.js +21 -0
- package/templates/mern/server/src/models/pushSubscription.model.js +32 -0
- package/templates/mern/server/src/models/user.model.js +43 -0
- package/templates/mern/server/src/routes/auth.route.js +22 -0
- package/templates/mern/server/src/routes/index.js +10 -0
- package/templates/mern/server/src/routes/upload.route.js +12 -0
- package/templates/mern/server/src/services/auth.service.js +162 -0
- package/templates/mern/server/src/services/auth.service.ts +0 -0
- package/templates/mern/server/src/utils/authToken.js +26 -0
- package/templates/mern/server/src/utils/cloudinary.js +27 -0
- package/templates/mern/server/src/utils/cloudinaryUpload.js +87 -0
- package/templates/mern/server/src/utils/emailOtp.js +190 -0
- package/templates/mern/server/src/utils/genOtpToken.js +20 -0
- package/templates/mern/server/src/utils/generateVapidKeys.js +12 -0
- package/templates/mern/server/src/utils/jwt.js +25 -0
- package/templates/mern/server/src/utils/logger.js +25 -0
- package/templates/mern-ts/_gitignore +2 -0
- package/templates/mern-ts/client/_gitignore +24 -0
- package/templates/mern-ts/client/index.html +14 -0
- package/templates/mern-ts/client/package.json +45 -0
- package/templates/mern-ts/client/public/_redirects +1 -0
- package/templates/mern-ts/client/public/favicon.ico +0 -0
- package/templates/mern-ts/client/public/favicon.svg +1 -0
- package/templates/mern-ts/client/public/logo.png +0 -0
- package/templates/mern-ts/client/public/manifest.json +24 -0
- package/templates/mern-ts/client/public/sw.js +56 -0
- package/templates/mern-ts/client/src/App.tsx +68 -0
- package/templates/mern-ts/client/src/assets/animations/loading.json +1 -0
- package/templates/mern-ts/client/src/assets/data/navigation.ts +29 -0
- package/templates/mern-ts/client/src/assets/images/logo.png +0 -0
- package/templates/mern-ts/client/src/components/common/Breadcrumbs.tsx +27 -0
- package/templates/mern-ts/client/src/components/common/Loading.tsx +19 -0
- package/templates/mern-ts/client/src/components/common/LottieIcon.tsx +36 -0
- package/templates/mern-ts/client/src/components/common/NotFound.tsx +78 -0
- package/templates/mern-ts/client/src/components/common/PwaInstallPrompt.tsx +72 -0
- package/templates/mern-ts/client/src/components/common/SEO.tsx +67 -0
- package/templates/mern-ts/client/src/components/common/Scroll.tsx +25 -0
- package/templates/mern-ts/client/src/components/common/Table.tsx +118 -0
- package/templates/mern-ts/client/src/components/common/ToggleSwitch.tsx +38 -0
- package/templates/mern-ts/client/src/components/common/Unauthorized.tsx +76 -0
- package/templates/mern-ts/client/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/mern-ts/client/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/mern-ts/client/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/mern-ts/client/src/components/modals/ConfirmModal.tsx +135 -0
- package/templates/mern-ts/client/src/components/modals/Modal.tsx +94 -0
- package/templates/mern-ts/client/src/components/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/mern-ts/client/src/components/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/mern-ts/client/src/components/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/mern-ts/client/src/components/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/mern-ts/client/src/components/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/mern-ts/client/src/components/skeletons/common/Skeleton.tsx +18 -0
- package/templates/mern-ts/client/src/components/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/mern-ts/client/src/components/ui/Header.tsx +230 -0
- package/templates/mern-ts/client/src/components/ui/SidebarHeader.tsx +27 -0
- package/templates/mern-ts/client/src/components/ui/sidebar.tsx +152 -0
- package/templates/mern-ts/client/src/config/api.ts +22 -0
- package/templates/mern-ts/client/src/config/appConfig.ts +44 -0
- package/templates/mern-ts/client/src/config/navigation.ts +14 -0
- package/templates/mern-ts/client/src/hooks/useLenis.ts +28 -0
- package/templates/mern-ts/client/src/hooks/usePwaInstall.ts +45 -0
- package/templates/mern-ts/client/src/hooks/useWindowSize.ts +25 -0
- package/templates/mern-ts/client/src/index.css +158 -0
- package/templates/mern-ts/client/src/main.tsx +24 -0
- package/templates/mern-ts/client/src/pages/Home.tsx +154 -0
- package/templates/mern-ts/client/src/pages/Login.tsx +196 -0
- package/templates/mern-ts/client/src/pages/Profile.tsx +9 -0
- package/templates/mern-ts/client/src/services/authService.ts +16 -0
- package/templates/mern-ts/client/src/store/useAuthStore.ts +98 -0
- package/templates/mern-ts/client/src/store/useUiStore.ts +54 -0
- package/templates/mern-ts/client/src/utils/getInitials.ts +10 -0
- package/templates/mern-ts/client/tsconfig.json +25 -0
- package/templates/mern-ts/client/tsconfig.node.json +10 -0
- package/templates/mern-ts/client/vite.config.ts +8 -0
- package/templates/mern-ts/package.json +19 -0
- package/templates/mern-ts/server/.env.example +62 -0
- package/templates/mern-ts/server/README.md +69 -0
- package/templates/mern-ts/server/_gitignore +24 -0
- package/templates/mern-ts/server/package.json +47 -0
- package/templates/mern-ts/server/src/app.ts +36 -0
- package/templates/mern-ts/server/src/config/cloudinary.ts +9 -0
- package/templates/mern-ts/server/src/config/db.ts +15 -0
- package/templates/mern-ts/server/src/config/dotenv.ts +2 -0
- package/templates/mern-ts/server/src/config/email.ts +28 -0
- package/templates/mern-ts/server/src/config/socket.ts +54 -0
- package/templates/mern-ts/server/src/config/webPush.ts +9 -0
- package/templates/mern-ts/server/src/controllers/auth.controller.ts +126 -0
- package/templates/mern-ts/server/src/controllers/upload.controller.ts +22 -0
- package/templates/mern-ts/server/src/index.ts +17 -0
- package/templates/mern-ts/server/src/middleware/auth.middleware.ts +38 -0
- package/templates/mern-ts/server/src/middleware/errorHandler.ts +16 -0
- package/templates/mern-ts/server/src/middleware/multer.ts +20 -0
- package/templates/mern-ts/server/src/middleware/rateLimiter.ts +53 -0
- package/templates/mern-ts/server/src/models/otp.model.ts +21 -0
- package/templates/mern-ts/server/src/models/pushSubscription.model.ts +32 -0
- package/templates/mern-ts/server/src/models/user.model.ts +43 -0
- package/templates/mern-ts/server/src/routes/auth.route.ts +22 -0
- package/templates/mern-ts/server/src/routes/index.ts +10 -0
- package/templates/mern-ts/server/src/routes/upload.route.ts +11 -0
- package/templates/mern-ts/server/src/services/auth.service.ts +115 -0
- package/templates/mern-ts/server/src/types/express.d.ts +10 -0
- package/templates/mern-ts/server/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/mern-ts/server/src/utils/emailOtp.ts +30 -0
- package/templates/mern-ts/server/src/utils/genOtpToken.ts +22 -0
- package/templates/mern-ts/server/src/utils/generateVapidKeys.ts +12 -0
- package/templates/mern-ts/server/src/utils/jwt.ts +27 -0
- package/templates/mern-ts/server/src/utils/logger.ts +27 -0
- package/templates/mern-ts/server/tsconfig.json +14 -0
- package/templates/next/_gitignore +24 -0
- package/templates/next/package.json +20 -0
- package/templates/next/src/app/layout.js +7 -0
- package/templates/next/src/app/page.js +218 -0
- package/templates/next-ts/_gitignore +24 -0
- package/templates/next-ts/package.json +24 -0
- package/templates/next-ts/src/app/layout.tsx +9 -0
- package/templates/next-ts/src/app/page.tsx +218 -0
- package/templates/next-ts/tsconfig.json +27 -0
- package/templates/node/.env.example +62 -0
- package/templates/node/README.md +65 -0
- package/templates/node/_gitignore +24 -0
- package/templates/node/package.json +32 -0
- package/templates/node/src/app.js +42 -0
- package/templates/node/src/config/cloudinary.js +9 -0
- package/templates/node/src/config/db.js +14 -0
- package/templates/node/src/config/dotenv.js +2 -0
- package/templates/node/src/config/email.js +30 -0
- package/templates/node/src/config/socket.js +54 -0
- package/templates/node/src/config/webPush.js +9 -0
- package/templates/node/src/controllers/auth.controller.js +153 -0
- package/templates/node/src/controllers/upload.controller.js +26 -0
- package/templates/node/src/index.js +24 -0
- package/templates/node/src/middleware/auth.middleware.js +43 -0
- package/templates/node/src/middleware/errorHandler.js +22 -0
- package/templates/node/src/middleware/multer.js +21 -0
- package/templates/node/src/middleware/rateLimiter.js +57 -0
- package/templates/node/src/models/otp.model.js +21 -0
- package/templates/node/src/models/pushSubscription.model.js +32 -0
- package/templates/node/src/models/user.model.js +43 -0
- package/templates/node/src/routes/auth.route.js +22 -0
- package/templates/node/src/routes/index.js +10 -0
- package/templates/node/src/routes/upload.route.js +12 -0
- package/templates/node/src/services/auth.service.js +162 -0
- package/templates/node/src/services/auth.service.ts +0 -0
- package/templates/node/src/utils/authToken.js +26 -0
- package/templates/node/src/utils/cloudinary.js +27 -0
- package/templates/node/src/utils/cloudinaryUpload.js +87 -0
- package/templates/node/src/utils/emailOtp.js +190 -0
- package/templates/node/src/utils/genOtpToken.js +20 -0
- package/templates/node/src/utils/generateVapidKeys.js +12 -0
- package/templates/node/src/utils/jwt.js +25 -0
- package/templates/node/src/utils/logger.js +25 -0
- package/templates/node-prisma/.env.example +63 -0
- package/templates/node-prisma/README.md +69 -0
- package/templates/node-prisma/_gitignore +24 -0
- package/templates/node-prisma/package.json +35 -0
- package/templates/node-prisma/prisma/schema.prisma +41 -0
- package/templates/node-prisma/src/app.js +42 -0
- package/templates/node-prisma/src/config/cloudinary.js +9 -0
- package/templates/node-prisma/src/config/db.js +16 -0
- package/templates/node-prisma/src/config/dotenv.js +2 -0
- package/templates/node-prisma/src/config/email.js +30 -0
- package/templates/node-prisma/src/config/socket.js +54 -0
- package/templates/node-prisma/src/config/webPush.js +9 -0
- package/templates/node-prisma/src/controllers/auth.controller.js +146 -0
- package/templates/node-prisma/src/controllers/upload.controller.js +26 -0
- package/templates/node-prisma/src/index.js +24 -0
- package/templates/node-prisma/src/middleware/auth.middleware.js +44 -0
- package/templates/node-prisma/src/middleware/errorHandler.js +22 -0
- package/templates/node-prisma/src/middleware/multer.js +21 -0
- package/templates/node-prisma/src/middleware/rateLimiter.js +57 -0
- package/templates/node-prisma/src/routes/auth.route.js +22 -0
- package/templates/node-prisma/src/routes/index.js +10 -0
- package/templates/node-prisma/src/routes/upload.route.js +12 -0
- package/templates/node-prisma/src/services/auth.service.js +163 -0
- package/templates/node-prisma/src/services/auth.service.ts +0 -0
- package/templates/node-prisma/src/utils/authToken.js +26 -0
- package/templates/node-prisma/src/utils/cloudinary.js +27 -0
- package/templates/node-prisma/src/utils/cloudinaryUpload.js +87 -0
- package/templates/node-prisma/src/utils/emailOtp.js +190 -0
- package/templates/node-prisma/src/utils/genOtpToken.js +20 -0
- package/templates/node-prisma/src/utils/generateVapidKeys.js +12 -0
- package/templates/node-prisma/src/utils/jwt.js +25 -0
- package/templates/node-prisma/src/utils/logger.js +25 -0
- package/templates/node-prisma-ts/.env.example +63 -0
- package/templates/node-prisma-ts/README.md +73 -0
- package/templates/node-prisma-ts/_gitignore +24 -0
- package/templates/node-prisma-ts/package.json +48 -0
- package/templates/node-prisma-ts/prisma/schema.prisma +41 -0
- package/templates/node-prisma-ts/src/app.ts +36 -0
- package/templates/node-prisma-ts/src/config/cloudinary.ts +9 -0
- package/templates/node-prisma-ts/src/config/db.ts +16 -0
- package/templates/node-prisma-ts/src/config/dotenv.ts +2 -0
- package/templates/node-prisma-ts/src/config/email.ts +28 -0
- package/templates/node-prisma-ts/src/config/socket.ts +54 -0
- package/templates/node-prisma-ts/src/config/webPush.ts +9 -0
- package/templates/node-prisma-ts/src/controllers/auth.controller.ts +124 -0
- package/templates/node-prisma-ts/src/controllers/upload.controller.ts +22 -0
- package/templates/node-prisma-ts/src/index.ts +17 -0
- package/templates/node-prisma-ts/src/middleware/auth.middleware.ts +45 -0
- package/templates/node-prisma-ts/src/middleware/errorHandler.ts +16 -0
- package/templates/node-prisma-ts/src/middleware/multer.ts +20 -0
- package/templates/node-prisma-ts/src/middleware/rateLimiter.ts +53 -0
- package/templates/node-prisma-ts/src/routes/auth.route.ts +22 -0
- package/templates/node-prisma-ts/src/routes/index.ts +10 -0
- package/templates/node-prisma-ts/src/routes/upload.route.ts +11 -0
- package/templates/node-prisma-ts/src/services/auth.service.ts +163 -0
- package/templates/node-prisma-ts/src/types/express.d.ts +10 -0
- package/templates/node-prisma-ts/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/node-prisma-ts/src/utils/emailOtp.ts +30 -0
- package/templates/node-prisma-ts/src/utils/genOtpToken.ts +22 -0
- package/templates/node-prisma-ts/src/utils/generateVapidKeys.ts +12 -0
- package/templates/node-prisma-ts/src/utils/jwt.ts +27 -0
- package/templates/node-prisma-ts/src/utils/logger.ts +27 -0
- package/templates/node-prisma-ts/tsconfig.json +14 -0
- package/templates/node-ts/.env.example +62 -0
- package/templates/node-ts/README.md +69 -0
- package/templates/node-ts/_gitignore +24 -0
- package/templates/node-ts/package.json +47 -0
- package/templates/node-ts/src/app.ts +36 -0
- package/templates/node-ts/src/config/cloudinary.ts +9 -0
- package/templates/node-ts/src/config/db.ts +15 -0
- package/templates/node-ts/src/config/dotenv.ts +2 -0
- package/templates/node-ts/src/config/email.ts +28 -0
- package/templates/node-ts/src/config/socket.ts +54 -0
- package/templates/node-ts/src/config/webPush.ts +9 -0
- package/templates/node-ts/src/controllers/auth.controller.ts +126 -0
- package/templates/node-ts/src/controllers/upload.controller.ts +22 -0
- package/templates/node-ts/src/index.ts +17 -0
- package/templates/node-ts/src/middleware/auth.middleware.ts +38 -0
- package/templates/node-ts/src/middleware/errorHandler.ts +16 -0
- package/templates/node-ts/src/middleware/multer.ts +20 -0
- package/templates/node-ts/src/middleware/rateLimiter.ts +53 -0
- package/templates/node-ts/src/models/otp.model.ts +21 -0
- package/templates/node-ts/src/models/pushSubscription.model.ts +32 -0
- package/templates/node-ts/src/models/user.model.ts +43 -0
- package/templates/node-ts/src/routes/auth.route.ts +22 -0
- package/templates/node-ts/src/routes/index.ts +10 -0
- package/templates/node-ts/src/routes/upload.route.ts +11 -0
- package/templates/node-ts/src/services/auth.service.ts +115 -0
- package/templates/node-ts/src/types/express.d.ts +10 -0
- package/templates/node-ts/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/node-ts/src/utils/emailOtp.ts +30 -0
- package/templates/node-ts/src/utils/genOtpToken.ts +22 -0
- package/templates/node-ts/src/utils/generateVapidKeys.ts +12 -0
- package/templates/node-ts/src/utils/jwt.ts +27 -0
- package/templates/node-ts/src/utils/logger.ts +27 -0
- package/templates/node-ts/tsconfig.json +18 -0
- package/templates/react/.env.example +1 -0
- package/templates/react/_gitignore +24 -0
- package/templates/react/index.html +14 -0
- package/templates/react/package.json +39 -0
- package/templates/react/public/_redirects +1 -0
- package/templates/react/public/favicon.ico +0 -0
- package/templates/react/public/favicon.svg +1 -0
- package/templates/react/public/logo.png +0 -0
- package/templates/react/public/manifest.json +24 -0
- package/templates/react/public/sw.js +56 -0
- package/templates/react/src/App.jsx +68 -0
- package/templates/react/src/assets/animations/loading.json +1 -0
- package/templates/react/src/assets/data/navigation.js +29 -0
- package/templates/react/src/assets/images/logo.png +0 -0
- package/templates/react/src/components/common/Breadcrumbs.jsx +27 -0
- package/templates/react/src/components/common/Loading.jsx +19 -0
- package/templates/react/src/components/common/LottieIcon.jsx +36 -0
- package/templates/react/src/components/common/NotFound.jsx +78 -0
- package/templates/react/src/components/common/PwaInstallPrompt.jsx +72 -0
- package/templates/react/src/components/common/SEO.jsx +67 -0
- package/templates/react/src/components/common/Scroll.jsx +25 -0
- package/templates/react/src/components/common/Table.jsx +110 -0
- package/templates/react/src/components/common/ToggleSwitch.jsx +38 -0
- package/templates/react/src/components/common/Unauthorized.jsx +76 -0
- package/templates/react/src/components/layout/ProtectedRoute.jsx +17 -0
- package/templates/react/src/components/layout/PublicLayout.jsx +13 -0
- package/templates/react/src/components/layout/SidebarLayout.jsx +37 -0
- package/templates/react/src/components/modals/ConfirmModal.jsx +135 -0
- package/templates/react/src/components/modals/Modal.jsx +94 -0
- package/templates/react/src/components/skeletons/common/CardSkeleton.jsx +23 -0
- package/templates/react/src/components/skeletons/common/DashboardSkeleton.jsx +19 -0
- package/templates/react/src/components/skeletons/common/ListSkeleton.jsx +24 -0
- package/templates/react/src/components/skeletons/common/PageSkeleton.jsx +26 -0
- package/templates/react/src/components/skeletons/common/ProfileSkeleton.jsx +23 -0
- package/templates/react/src/components/skeletons/common/Skeleton.jsx +18 -0
- package/templates/react/src/components/skeletons/common/TableSkeleton.jsx +33 -0
- package/templates/react/src/components/ui/Header.jsx +230 -0
- package/templates/react/src/components/ui/SidebarHeader.jsx +27 -0
- package/templates/react/src/components/ui/sidebar.jsx +152 -0
- package/templates/react/src/config/api.js +22 -0
- package/templates/react/src/config/appConfig.js +44 -0
- package/templates/react/src/config/navigation.js +14 -0
- package/templates/react/src/hooks/useLenis.js +28 -0
- package/templates/react/src/hooks/usePwaInstall.js +45 -0
- package/templates/react/src/hooks/useWindowSize.js +25 -0
- package/templates/react/src/index.css +158 -0
- package/templates/react/src/main.jsx +24 -0
- package/templates/react/src/pages/Home.jsx +154 -0
- package/templates/react/src/pages/Login.jsx +196 -0
- package/templates/react/src/pages/Profile.jsx +9 -0
- package/templates/react/src/services/authService.js +16 -0
- package/templates/react/src/store/useAuthStore.js +98 -0
- package/templates/react/src/store/useUiStore.js +54 -0
- package/templates/react/src/utils/getInitials.js +10 -0
- package/templates/react/vite.config.js +8 -0
- package/templates/react-ts/_gitignore +24 -0
- package/templates/react-ts/index.html +14 -0
- package/templates/react-ts/package.json +45 -0
- package/templates/react-ts/public/_redirects +1 -0
- package/templates/react-ts/public/favicon.ico +0 -0
- package/templates/react-ts/public/favicon.svg +1 -0
- package/templates/react-ts/public/logo.png +0 -0
- package/templates/react-ts/public/manifest.json +24 -0
- package/templates/react-ts/public/sw.js +56 -0
- package/templates/react-ts/src/App.tsx +68 -0
- package/templates/react-ts/src/assets/animations/loading.json +1 -0
- package/templates/react-ts/src/assets/data/navigation.ts +29 -0
- package/templates/react-ts/src/assets/images/logo.png +0 -0
- package/templates/react-ts/src/components/common/Breadcrumbs.tsx +27 -0
- package/templates/react-ts/src/components/common/Loading.tsx +19 -0
- package/templates/react-ts/src/components/common/LottieIcon.tsx +36 -0
- package/templates/react-ts/src/components/common/NotFound.tsx +78 -0
- package/templates/react-ts/src/components/common/PwaInstallPrompt.tsx +72 -0
- package/templates/react-ts/src/components/common/SEO.tsx +67 -0
- package/templates/react-ts/src/components/common/Scroll.tsx +25 -0
- package/templates/react-ts/src/components/common/Table.tsx +118 -0
- package/templates/react-ts/src/components/common/ToggleSwitch.tsx +38 -0
- package/templates/react-ts/src/components/common/Unauthorized.tsx +76 -0
- package/templates/react-ts/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/react-ts/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/react-ts/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/react-ts/src/components/modals/ConfirmModal.tsx +135 -0
- package/templates/react-ts/src/components/modals/Modal.tsx +94 -0
- package/templates/react-ts/src/components/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/react-ts/src/components/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/react-ts/src/components/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/react-ts/src/components/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/react-ts/src/components/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/react-ts/src/components/skeletons/common/Skeleton.tsx +18 -0
- package/templates/react-ts/src/components/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/react-ts/src/components/ui/Header.tsx +230 -0
- package/templates/react-ts/src/components/ui/SidebarHeader.tsx +27 -0
- package/templates/react-ts/src/components/ui/sidebar.tsx +152 -0
- package/templates/react-ts/src/config/api.ts +22 -0
- package/templates/react-ts/src/config/appConfig.ts +44 -0
- package/templates/react-ts/src/config/navigation.ts +14 -0
- package/templates/react-ts/src/hooks/useLenis.ts +28 -0
- package/templates/react-ts/src/hooks/usePwaInstall.ts +45 -0
- package/templates/react-ts/src/hooks/useWindowSize.ts +25 -0
- package/templates/react-ts/src/index.css +158 -0
- package/templates/react-ts/src/main.tsx +24 -0
- package/templates/react-ts/src/pages/Home.tsx +154 -0
- package/templates/react-ts/src/pages/Login.tsx +196 -0
- package/templates/react-ts/src/pages/Profile.tsx +9 -0
- package/templates/react-ts/src/services/authService.ts +16 -0
- package/templates/react-ts/src/store/useAuthStore.ts +98 -0
- package/templates/react-ts/src/store/useUiStore.ts +54 -0
- package/templates/react-ts/src/utils/getInitials.ts +10 -0
- package/templates/react-ts/tsconfig.json +25 -0
- package/templates/react-ts/tsconfig.node.json +10 -0
- package/templates/react-ts/vite.config.ts +8 -0
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "React App",
|
|
3
|
+
"short_name": "React",
|
|
4
|
+
"description": "A React application built with @imksh/create",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"background_color": "#1d232a",
|
|
8
|
+
"theme_color": "#2563eb",
|
|
9
|
+
"orientation": "any",
|
|
10
|
+
"icons": [
|
|
11
|
+
{
|
|
12
|
+
"src": "/favicon.ico",
|
|
13
|
+
"sizes": "192x192",
|
|
14
|
+
"type": "image/x-icon",
|
|
15
|
+
"purpose": "any maskable"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"src": "/favicon.svg",
|
|
19
|
+
"sizes": "512x512",
|
|
20
|
+
"type": "image/svg+xml",
|
|
21
|
+
"purpose": "any maskable"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const CACHE_NAME = "React App";
|
|
2
|
+
const ASSETS = ["/", "/index.html", "/logo.png", "/manifest.json"];
|
|
3
|
+
|
|
4
|
+
// Install Event
|
|
5
|
+
self.addEventListener("install", (e) => {
|
|
6
|
+
e.waitUntil(
|
|
7
|
+
caches
|
|
8
|
+
.open(CACHE_NAME)
|
|
9
|
+
.then((cache) => {
|
|
10
|
+
return cache.addAll(ASSETS);
|
|
11
|
+
})
|
|
12
|
+
.then(() => self.skipWaiting()),
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Activate Event
|
|
17
|
+
self.addEventListener("activate", (e) => {
|
|
18
|
+
e.waitUntil(
|
|
19
|
+
caches
|
|
20
|
+
.keys()
|
|
21
|
+
.then((keys) => {
|
|
22
|
+
return Promise.all(
|
|
23
|
+
keys.map((key) => {
|
|
24
|
+
if (key !== CACHE_NAME) {
|
|
25
|
+
return caches.delete(key);
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
})
|
|
30
|
+
.then(() => self.clients.claim()),
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Fetch Event (Network First, fallback to cache)
|
|
35
|
+
self.addEventListener("fetch", (e) => {
|
|
36
|
+
// Only handle GET requests and skip chrome-extension/dev-tools queries
|
|
37
|
+
if (
|
|
38
|
+
e.request.method !== "GET" ||
|
|
39
|
+
!e.request.url.startsWith(self.location.origin)
|
|
40
|
+
) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
e.respondWith(
|
|
45
|
+
fetch(e.request)
|
|
46
|
+
.then((res) => {
|
|
47
|
+
// Cache clone of successful network response
|
|
48
|
+
const resClone = res.clone();
|
|
49
|
+
caches.open(CACHE_NAME).then((cache) => {
|
|
50
|
+
cache.put(e.request, resClone);
|
|
51
|
+
});
|
|
52
|
+
return res;
|
|
53
|
+
})
|
|
54
|
+
.catch(() => caches.match(e.request)),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { Routes, Route } from "react-router-dom";
|
|
3
|
+
import { Toaster } from "react-hot-toast";
|
|
4
|
+
import Home from "./pages/Home";
|
|
5
|
+
import Login from "./pages/Login";
|
|
6
|
+
import Profile from "./pages/Profile";
|
|
7
|
+
import Scroll from "./components/common/Scroll";
|
|
8
|
+
import Loading from "./components/common/Loading";
|
|
9
|
+
import useLenis from "./hooks/useLenis";
|
|
10
|
+
import { useAuthStore } from "./store/useAuthStore";
|
|
11
|
+
import NotFound from "./components/common/NotFound";
|
|
12
|
+
import Unauthorized from "./components/common/Unauthorized";
|
|
13
|
+
import ProtectedRoute from "./components/layout/ProtectedRoute";
|
|
14
|
+
import PublicLayout from "./components/layout/PublicLayout";
|
|
15
|
+
import SidebarLayout from "./components/layout/SidebarLayout";
|
|
16
|
+
|
|
17
|
+
const App = () => {
|
|
18
|
+
const { getMe, loading } = useAuthStore();
|
|
19
|
+
|
|
20
|
+
// Initialize Lenis smooth scroll
|
|
21
|
+
// useLenis();
|
|
22
|
+
|
|
23
|
+
// useEffect(() => {
|
|
24
|
+
// getMe();
|
|
25
|
+
// }, []);
|
|
26
|
+
|
|
27
|
+
// if (loading) {
|
|
28
|
+
// return (
|
|
29
|
+
// <div className="flex h-screen items-center justify-center bg-base-100">
|
|
30
|
+
// <Loading />
|
|
31
|
+
// </div>
|
|
32
|
+
// );
|
|
33
|
+
// }
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div className="min-h-screen bg-base-100 text-base-content">
|
|
37
|
+
<Toaster position="top-right" />
|
|
38
|
+
<Scroll />
|
|
39
|
+
<Routes>
|
|
40
|
+
<Route path="/" element={<Home />} />
|
|
41
|
+
|
|
42
|
+
{/* <Route element={<PublicLayout />}>
|
|
43
|
+
<Route path="/" element={<Home />} />
|
|
44
|
+
</Route> */}
|
|
45
|
+
|
|
46
|
+
{/* Auth Page Routes */}
|
|
47
|
+
<Route path="/login" element={<Login />} />
|
|
48
|
+
<Route path="/unauthorized" element={<Unauthorized />} />
|
|
49
|
+
|
|
50
|
+
{/* Protected Routes wrapped in ProtectedRoute and SidebarLayout */}
|
|
51
|
+
<Route
|
|
52
|
+
element={
|
|
53
|
+
<ProtectedRoute>
|
|
54
|
+
<SidebarLayout />
|
|
55
|
+
</ProtectedRoute>
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
<Route path="/profile" element={<Profile />} />
|
|
59
|
+
</Route>
|
|
60
|
+
|
|
61
|
+
{/* Fallback Route */}
|
|
62
|
+
<Route path="/*" element={<NotFound />} />
|
|
63
|
+
</Routes>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default App;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"4.6.8","fr":29.9700012207031,"ip":0,"op":40.0000016292334,"w":256,"h":256,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 3","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[208.6,127.969,0],"e":[208.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":30,"s":[208.6,88,0],"e":[208.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":40.0000016292334}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9843137,0.5490196,0,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[168.6,128,0],"e":[168.6,88,0],"to":[0,-6.66666650772095,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":25,"s":[168.6,88,0],"e":[168.6,128,0],"to":[0,0,0],"ti":[0,-6.66666650772095,0]},{"t":35.0000014255792}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9921569,0.8470588,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[128.594,127.969,0],"e":[128.594,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[128.594,88,0],"e":[128.594,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":30.0000012219251}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.2627451,0.627451,0.2784314,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 4","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":5,"s":[88.6,127.969,0],"e":[88.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[88.6,88,0],"e":[88.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":25.0000010182709}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.1176471,0.5333334,0.8980392,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 5","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[48.6,127.969,0],"e":[48.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[48.6,88,0],"e":[48.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":20.0000008146167}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.8980392,0.2235294,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1}]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FaHome,
|
|
3
|
+
FaUser,
|
|
4
|
+
FaCog,
|
|
5
|
+
FaBook
|
|
6
|
+
} from "react-icons/fa";
|
|
7
|
+
|
|
8
|
+
export const navigation = [
|
|
9
|
+
{
|
|
10
|
+
title: "Home",
|
|
11
|
+
path: "/",
|
|
12
|
+
icon: FaHome,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
title: "Courses",
|
|
16
|
+
path: "/courses",
|
|
17
|
+
icon: FaBook,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: "Profile",
|
|
21
|
+
path: "/profile",
|
|
22
|
+
icon: FaUser,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "Settings",
|
|
26
|
+
path: "/settings",
|
|
27
|
+
icon: FaCog,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { ChevronRight } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
export const Breadcrumbs = ({ items }) => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex items-center gap-1.5 text-sm font-bold text-base-content/50 flex-wrap">
|
|
8
|
+
{items.map((item, idx) => {
|
|
9
|
+
const isLast = idx === items.length - 1;
|
|
10
|
+
return (
|
|
11
|
+
<React.Fragment key={idx}>
|
|
12
|
+
{item.path && !isLast ? (
|
|
13
|
+
<Link to={item.path} className="hover:text-primary transition-colors">
|
|
14
|
+
{item.label}
|
|
15
|
+
</Link>
|
|
16
|
+
) : (
|
|
17
|
+
<span className={isLast ? "text-base font-black text-base-content tracking-tight" : ""}>
|
|
18
|
+
{item.label}
|
|
19
|
+
</span>
|
|
20
|
+
)}
|
|
21
|
+
{!isLast && <ChevronRight size={14} className="text-base-content/30 shrink-0" />}
|
|
22
|
+
</React.Fragment>
|
|
23
|
+
);
|
|
24
|
+
})}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import LottieAnimation from "./LottieIcon";
|
|
3
|
+
import loader from "../../assets/animations/loading.json";
|
|
4
|
+
|
|
5
|
+
const Loading = ({
|
|
6
|
+
className = "w-60 h-60",
|
|
7
|
+
bgClass = "bg-base-100",
|
|
8
|
+
animationData = loader,
|
|
9
|
+
}) => {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className={`absolute inset-0 flex items-center justify-center z-50 ${bgClass} max-h-dvh`}
|
|
13
|
+
>
|
|
14
|
+
<LottieAnimation animation={animationData} className={className} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default Loading;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { memo, useEffect, useRef } from "react";
|
|
2
|
+
import { useInView } from "framer-motion";
|
|
3
|
+
import lottie from "lottie-web";
|
|
4
|
+
|
|
5
|
+
const LottieIcon = memo(
|
|
6
|
+
({ animation, className = "", loop = true, autoplay = true }) => {
|
|
7
|
+
const containerRef = useRef(null);
|
|
8
|
+
|
|
9
|
+
const isInView = useInView(containerRef, {
|
|
10
|
+
once: true,
|
|
11
|
+
margin: "100px",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!isInView || !containerRef.current) return;
|
|
16
|
+
|
|
17
|
+
const instance = lottie.loadAnimation({
|
|
18
|
+
container: containerRef.current,
|
|
19
|
+
renderer: "svg",
|
|
20
|
+
loop,
|
|
21
|
+
autoplay,
|
|
22
|
+
animationData: animation,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return () => {
|
|
26
|
+
instance.destroy();
|
|
27
|
+
};
|
|
28
|
+
}, [animation, autoplay, loop, isInView]);
|
|
29
|
+
|
|
30
|
+
return <div ref={containerRef} className={className} />;
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
LottieIcon.displayName = "LottieIcon";
|
|
35
|
+
|
|
36
|
+
export default LottieIcon;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { motion } from "framer-motion";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { FaArrowLeft, FaHouse } from "react-icons/fa6";
|
|
4
|
+
|
|
5
|
+
const NotFound = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="min-h-screen flex items-center justify-center bg-base-100 px-6">
|
|
8
|
+
<div className="max-w-lg text-center">
|
|
9
|
+
<motion.h1
|
|
10
|
+
initial={{ opacity: 0, scale: 0.6 }}
|
|
11
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
12
|
+
transition={{
|
|
13
|
+
duration: 0.5,
|
|
14
|
+
type: "spring",
|
|
15
|
+
stiffness: 120,
|
|
16
|
+
}}
|
|
17
|
+
className="text-8xl md:text-9xl font-black text-primary"
|
|
18
|
+
>
|
|
19
|
+
404
|
|
20
|
+
</motion.h1>
|
|
21
|
+
|
|
22
|
+
<motion.h2
|
|
23
|
+
initial={{ opacity: 0, y: 20 }}
|
|
24
|
+
animate={{ opacity: 1, y: 0 }}
|
|
25
|
+
transition={{ delay: 0.15 }}
|
|
26
|
+
className="mt-6 text-3xl font-bold"
|
|
27
|
+
>
|
|
28
|
+
Page Not Found
|
|
29
|
+
</motion.h2>
|
|
30
|
+
|
|
31
|
+
<motion.p
|
|
32
|
+
initial={{ opacity: 0 }}
|
|
33
|
+
animate={{ opacity: 0.7 }}
|
|
34
|
+
transition={{ delay: 0.3 }}
|
|
35
|
+
className="mt-3 text-base-content/70"
|
|
36
|
+
>
|
|
37
|
+
Sorry, the page you're looking for doesn't exist or has been moved.
|
|
38
|
+
</motion.p>
|
|
39
|
+
|
|
40
|
+
<motion.div
|
|
41
|
+
initial={{ opacity: 0, y: 25 }}
|
|
42
|
+
animate={{ opacity: 1, y: 0 }}
|
|
43
|
+
transition={{ delay: 0.45 }}
|
|
44
|
+
className="mt-8 flex flex-wrap justify-center gap-3"
|
|
45
|
+
>
|
|
46
|
+
<Link to="/" className="btn btn-primary gap-2">
|
|
47
|
+
<FaHouse />
|
|
48
|
+
Home
|
|
49
|
+
</Link>
|
|
50
|
+
|
|
51
|
+
<button
|
|
52
|
+
onClick={() => window.history.back()}
|
|
53
|
+
className="btn btn-ghost gap-2"
|
|
54
|
+
>
|
|
55
|
+
<FaArrowLeft />
|
|
56
|
+
Go Back
|
|
57
|
+
</button>
|
|
58
|
+
</motion.div>
|
|
59
|
+
|
|
60
|
+
<motion.div
|
|
61
|
+
initial={{ opacity: 0 }}
|
|
62
|
+
animate={{
|
|
63
|
+
opacity: [0.2, 0.6, 0.2],
|
|
64
|
+
}}
|
|
65
|
+
transition={{
|
|
66
|
+
repeat: Infinity,
|
|
67
|
+
duration: 2,
|
|
68
|
+
}}
|
|
69
|
+
className="mt-16 text-8xl font-black text-base-300 select-none"
|
|
70
|
+
>
|
|
71
|
+
?
|
|
72
|
+
</motion.div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default NotFound;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import usePwaInstall from "../hooks/usePwaInstall";
|
|
3
|
+
|
|
4
|
+
const DISMISS_KEY = "gradify_pwa_dismissed_at";
|
|
5
|
+
const DISMISS_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
6
|
+
|
|
7
|
+
const wasDismissedRecently = () => {
|
|
8
|
+
const raw = localStorage.getItem(DISMISS_KEY);
|
|
9
|
+
if (!raw) return false;
|
|
10
|
+
const dismissedAt = Number(raw);
|
|
11
|
+
if (!Number.isFinite(dismissedAt)) return false;
|
|
12
|
+
return Date.now() - dismissedAt < DISMISS_TTL_MS;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const PwaInstallPrompt = () => {
|
|
16
|
+
const { canInstall, isInstalled, promptInstall } = usePwaInstall();
|
|
17
|
+
const [visible, setVisible] = useState(false);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (typeof window === "undefined") return undefined;
|
|
21
|
+
if (!canInstall || wasDismissedRecently() || isInstalled) {
|
|
22
|
+
setVisible(false);
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setVisible(true);
|
|
27
|
+
return undefined;
|
|
28
|
+
}, [canInstall, isInstalled]);
|
|
29
|
+
|
|
30
|
+
const handleInstall = async () => {
|
|
31
|
+
const result = await promptInstall();
|
|
32
|
+
if (result?.outcome === "accepted") {
|
|
33
|
+
setVisible(false);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
localStorage.setItem(DISMISS_KEY, String(Date.now()));
|
|
37
|
+
setVisible(false);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const handleDismiss = () => {
|
|
41
|
+
localStorage.setItem(DISMISS_KEY, String(Date.now()));
|
|
42
|
+
setVisible(false);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
if (!visible) return null;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="fixed bottom-5 right-5 z-50 w-[min(92vw,360px)] rounded-2xl border border-(--border-color) bg-(--card-bg) p-4 shadow-lg">
|
|
49
|
+
<p className="text-sm text-(--text-secondary)">
|
|
50
|
+
Install Gradify for faster access and offline-ready learning.
|
|
51
|
+
</p>
|
|
52
|
+
<div className="mt-3 flex items-center gap-2">
|
|
53
|
+
<button
|
|
54
|
+
type="button"
|
|
55
|
+
onClick={handleInstall}
|
|
56
|
+
className="rounded-xl bg-(--color-primary) px-4 py-2 text-sm font-semibold text-white hover:opacity-90"
|
|
57
|
+
>
|
|
58
|
+
Install App
|
|
59
|
+
</button>
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
onClick={handleDismiss}
|
|
63
|
+
className="rounded-xl border border-(--border-color) px-3 py-2 text-sm text-(--text-secondary) hover:bg-(--bg-muted)"
|
|
64
|
+
>
|
|
65
|
+
Not now
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default PwaInstallPrompt;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
const SEO = ({
|
|
5
|
+
title,
|
|
6
|
+
description,
|
|
7
|
+
keywords,
|
|
8
|
+
canonical,
|
|
9
|
+
noIndex = false,
|
|
10
|
+
}) => {
|
|
11
|
+
const location = useLocation();
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// TITLE
|
|
15
|
+
if (title) {
|
|
16
|
+
document.title = title;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// DESCRIPTION
|
|
20
|
+
if (description) {
|
|
21
|
+
let meta = document.querySelector("meta[name='description']");
|
|
22
|
+
if (!meta) {
|
|
23
|
+
meta = document.createElement("meta");
|
|
24
|
+
meta.name = "description";
|
|
25
|
+
document.head.appendChild(meta);
|
|
26
|
+
}
|
|
27
|
+
meta.content = description;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// KEYWORDS (optional)
|
|
31
|
+
if (keywords) {
|
|
32
|
+
let meta = document.querySelector("meta[name='keywords']");
|
|
33
|
+
if (!meta) {
|
|
34
|
+
meta = document.createElement("meta");
|
|
35
|
+
meta.name = "keywords";
|
|
36
|
+
document.head.appendChild(meta);
|
|
37
|
+
}
|
|
38
|
+
meta.content = keywords;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// CANONICAL
|
|
42
|
+
let link = document.querySelector("link[rel='canonical']");
|
|
43
|
+
if (!link) {
|
|
44
|
+
link = document.createElement("link");
|
|
45
|
+
link.rel = "canonical";
|
|
46
|
+
document.head.appendChild(link);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
link.href =
|
|
50
|
+
canonical ||
|
|
51
|
+
`https://shreebaglamukhi.com${location.pathname}`;
|
|
52
|
+
|
|
53
|
+
// ROBOTS
|
|
54
|
+
let robots = document.querySelector("meta[name='robots']");
|
|
55
|
+
if (!robots) {
|
|
56
|
+
robots = document.createElement("meta");
|
|
57
|
+
robots.name = "robots";
|
|
58
|
+
document.head.appendChild(robots);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
robots.content = noIndex ? "noindex,nofollow" : "index,follow";
|
|
62
|
+
}, [title, description, keywords, canonical, noIndex, location.pathname]);
|
|
63
|
+
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default SEO;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useLocation, useNavigationType } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
export default function ScrollRestoration() {
|
|
5
|
+
const { pathname, key } = useLocation();
|
|
6
|
+
const navigationType = useNavigationType();
|
|
7
|
+
const positions = useRef(new Map());
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const main = document.querySelector("main");
|
|
11
|
+
if (!main) return;
|
|
12
|
+
|
|
13
|
+
if (navigationType === "POP") {
|
|
14
|
+
main.scrollTop = positions.current.get(key) ?? 0;
|
|
15
|
+
} else {
|
|
16
|
+
main.scrollTop = 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return () => {
|
|
20
|
+
positions.current.set(key, main.scrollTop);
|
|
21
|
+
};
|
|
22
|
+
}, [key, pathname, navigationType]);
|
|
23
|
+
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import TableSkeleton from "../skeletons/common/TableSkeleton";
|
|
3
|
+
|
|
4
|
+
const Table = ({
|
|
5
|
+
columns = [],
|
|
6
|
+
data = [],
|
|
7
|
+
loading = false,
|
|
8
|
+
onRowClick = null,
|
|
9
|
+
emptyMessage = "No data available",
|
|
10
|
+
currentPage = 1,
|
|
11
|
+
totalPages = 1,
|
|
12
|
+
onPageChange = null,
|
|
13
|
+
}) => {
|
|
14
|
+
if (loading) {
|
|
15
|
+
return <TableSkeleton rows={5} columns={columns.length || 4} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex flex-col w-full border border-base-300 rounded-xl overflow-hidden bg-base-100 shadow-sm">
|
|
20
|
+
{/* Table Container */}
|
|
21
|
+
<div className="overflow-x-auto w-full">
|
|
22
|
+
<table className="table table-hover w-full min-w-full">
|
|
23
|
+
{/* Header */}
|
|
24
|
+
<thead className="bg-base-200/60 border-b border-base-300">
|
|
25
|
+
<tr>
|
|
26
|
+
{columns.map((col, index) => (
|
|
27
|
+
<th
|
|
28
|
+
key={col.accessor || index}
|
|
29
|
+
className="px-6 py-4 text-left text-xs font-bold text-base-content/80 uppercase tracking-wider"
|
|
30
|
+
>
|
|
31
|
+
{col.header}
|
|
32
|
+
</th>
|
|
33
|
+
))}
|
|
34
|
+
</tr>
|
|
35
|
+
</thead>
|
|
36
|
+
|
|
37
|
+
{/* Body */}
|
|
38
|
+
<tbody className="divide-y divide-base-300 bg-base-100">
|
|
39
|
+
{data.length > 0 ? (
|
|
40
|
+
data.map((row, rowIndex) => (
|
|
41
|
+
<tr
|
|
42
|
+
key={row.id || rowIndex}
|
|
43
|
+
onClick={() => onRowClick && onRowClick(row)}
|
|
44
|
+
className={`transition-colors duration-150 ${
|
|
45
|
+
onRowClick ? "cursor-pointer hover:bg-base-200" : ""
|
|
46
|
+
}`}
|
|
47
|
+
>
|
|
48
|
+
{columns.map((col, colIndex) => {
|
|
49
|
+
const value = col.accessor ? row[col.accessor] : undefined;
|
|
50
|
+
return (
|
|
51
|
+
<td
|
|
52
|
+
key={col.accessor || colIndex}
|
|
53
|
+
className="px-6 py-4 text-sm text-base-content/90 whitespace-nowrap align-middle"
|
|
54
|
+
>
|
|
55
|
+
{col.render ? col.render(value, row, rowIndex) : value}
|
|
56
|
+
</td>
|
|
57
|
+
);
|
|
58
|
+
})}
|
|
59
|
+
</tr>
|
|
60
|
+
))
|
|
61
|
+
) : (
|
|
62
|
+
<tr>
|
|
63
|
+
<td
|
|
64
|
+
colSpan={columns.length}
|
|
65
|
+
className="px-6 py-12 text-center text-sm text-base-content/60"
|
|
66
|
+
>
|
|
67
|
+
<div className="flex flex-col items-center justify-center gap-2">
|
|
68
|
+
<span className="text-2xl">📁</span>
|
|
69
|
+
<span>{emptyMessage}</span>
|
|
70
|
+
</div>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
)}
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
{/* Pagination Footer */}
|
|
79
|
+
{totalPages > 1 && onPageChange && (
|
|
80
|
+
<div className="border-t border-base-300 px-6 py-4 bg-base-200/30 flex items-center justify-between shrink-0">
|
|
81
|
+
{/* Info text */}
|
|
82
|
+
<div className="text-xs text-base-content/75 font-medium">
|
|
83
|
+
Page <span className="font-bold">{currentPage}</span> of{" "}
|
|
84
|
+
<span className="font-bold">{totalPages}</span>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{/* Page controls */}
|
|
88
|
+
<div className="flex gap-2">
|
|
89
|
+
<button
|
|
90
|
+
onClick={() => onPageChange(currentPage - 1)}
|
|
91
|
+
disabled={currentPage <= 1}
|
|
92
|
+
className="btn btn-sm btn-outline rounded-lg text-xs"
|
|
93
|
+
>
|
|
94
|
+
Previous
|
|
95
|
+
</button>
|
|
96
|
+
<button
|
|
97
|
+
onClick={() => onPageChange(currentPage + 1)}
|
|
98
|
+
disabled={currentPage >= totalPages}
|
|
99
|
+
className="btn btn-sm btn-outline rounded-lg text-xs"
|
|
100
|
+
>
|
|
101
|
+
Next
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export default Table;
|