@idevconn/create-icore 0.1.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/LICENSE +201 -0
- package/README.md +56 -0
- package/dist/cli.js +300 -0
- package/dist/index.cjs +303 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +265 -0
- package/package.json +72 -0
- package/templates/.husky/pre-commit +56 -0
- package/templates/.nvmrc +1 -0
- package/templates/.prettierignore +7 -0
- package/templates/.prettierrc +7 -0
- package/templates/.yarnrc.yml +7 -0
- package/templates/apps/api/.env.example +19 -0
- package/templates/apps/api/eslint.config.mjs +23 -0
- package/templates/apps/api/package.json +20 -0
- package/templates/apps/api/project.json +76 -0
- package/templates/apps/api/src/app/abilities/__tests__/ability.guard.unit.test.ts +49 -0
- package/templates/apps/api/src/app/abilities/abilities.module.ts +10 -0
- package/templates/apps/api/src/app/abilities/ability.factory.ts +13 -0
- package/templates/apps/api/src/app/abilities/ability.guard.ts +29 -0
- package/templates/apps/api/src/app/abilities/check-ability.decorator.ts +12 -0
- package/templates/apps/api/src/app/app.module.ts +19 -0
- package/templates/apps/api/src/app/auth/__tests__/auth.guard.unit.test.ts +66 -0
- package/templates/apps/api/src/app/auth/auth.controller.ts +62 -0
- package/templates/apps/api/src/app/auth/auth.guard.ts +42 -0
- package/templates/apps/api/src/app/auth/auth.module.ts +17 -0
- package/templates/apps/api/src/app/auth/public.decorator.ts +4 -0
- package/templates/apps/api/src/app/profile/profile.controller.ts +15 -0
- package/templates/apps/api/src/app/profile/profile.module.ts +5 -0
- package/templates/apps/api/src/app/storage/__tests__/assert-ownership.unit.test.ts +28 -0
- package/templates/apps/api/src/app/storage/assert-ownership.ts +8 -0
- package/templates/apps/api/src/app/storage/storage.controller.ts +108 -0
- package/templates/apps/api/src/app/storage/storage.module.ts +10 -0
- package/templates/apps/api/src/assets/.gitkeep +0 -0
- package/templates/apps/api/src/main.ts +43 -0
- package/templates/apps/api/tsconfig.app.json +13 -0
- package/templates/apps/api/tsconfig.json +16 -0
- package/templates/apps/api/tsconfig.spec.json +16 -0
- package/templates/apps/api/vitest.config.mts +21 -0
- package/templates/apps/api/webpack.config.js +25 -0
- package/templates/apps/microservices/auth/.env.example +38 -0
- package/templates/apps/microservices/auth/package.json +19 -0
- package/templates/apps/microservices/auth/project.json +65 -0
- package/templates/apps/microservices/auth/src/app/__tests__/auth.controller.firebase.integration.unit.test.ts +53 -0
- package/templates/apps/microservices/auth/src/app/__tests__/auth.controller.supabase.integration.unit.test.ts +47 -0
- package/templates/apps/microservices/auth/src/app/__tests__/auth.controller.unit.test.ts +87 -0
- package/templates/apps/microservices/auth/src/app/app.module.ts +66 -0
- package/templates/apps/microservices/auth/src/app/auth.controller.ts +60 -0
- package/templates/apps/microservices/auth/src/assets/.gitkeep +0 -0
- package/templates/apps/microservices/auth/src/main.ts +28 -0
- package/templates/apps/microservices/auth/tsconfig.app.json +13 -0
- package/templates/apps/microservices/auth/tsconfig.json +16 -0
- package/templates/apps/microservices/auth/tsconfig.spec.json +16 -0
- package/templates/apps/microservices/auth/vitest.config.mts +21 -0
- package/templates/apps/microservices/auth/webpack.config.js +25 -0
- package/templates/apps/microservices/upload/.env.example +30 -0
- package/templates/apps/microservices/upload/package.json +21 -0
- package/templates/apps/microservices/upload/project.json +65 -0
- package/templates/apps/microservices/upload/src/app/__tests__/storage.controller.unit.test.ts +49 -0
- package/templates/apps/microservices/upload/src/app/app.module.ts +117 -0
- package/templates/apps/microservices/upload/src/app/storage.controller.ts +51 -0
- package/templates/apps/microservices/upload/src/assets/.gitkeep +0 -0
- package/templates/apps/microservices/upload/src/main.ts +28 -0
- package/templates/apps/microservices/upload/tsconfig.app.json +13 -0
- package/templates/apps/microservices/upload/tsconfig.json +16 -0
- package/templates/apps/microservices/upload/tsconfig.spec.json +16 -0
- package/templates/apps/microservices/upload/vitest.config.mts +22 -0
- package/templates/apps/microservices/upload/webpack.config.js +25 -0
- package/templates/apps/templates/client-shadcn/.env.example +2 -0
- package/templates/apps/templates/client-shadcn/eslint.config.mjs +10 -0
- package/templates/apps/templates/client-shadcn/index.html +17 -0
- package/templates/apps/templates/client-shadcn/project.json +9 -0
- package/templates/apps/templates/client-shadcn/public/favicon.ico +0 -0
- package/templates/apps/templates/client-shadcn/src/app/app.module.css +1 -0
- package/templates/apps/templates/client-shadcn/src/app/app.spec.tsx +9 -0
- package/templates/apps/templates/client-shadcn/src/app/app.tsx +7 -0
- package/templates/apps/templates/client-shadcn/src/assets/.gitkeep +0 -0
- package/templates/apps/templates/client-shadcn/src/components/AccessDeniedPage.tsx +15 -0
- package/templates/apps/templates/client-shadcn/src/components/PageLayout.tsx +55 -0
- package/templates/apps/templates/client-shadcn/src/components/layout/LayoutFooter.tsx +8 -0
- package/templates/apps/templates/client-shadcn/src/components/layout/LayoutHeader.tsx +57 -0
- package/templates/apps/templates/client-shadcn/src/components/layout/LayoutSider.tsx +44 -0
- package/templates/apps/templates/client-shadcn/src/components/ui/button.tsx +50 -0
- package/templates/apps/templates/client-shadcn/src/components/ui/card.tsx +63 -0
- package/templates/apps/templates/client-shadcn/src/components/ui/input.tsx +23 -0
- package/templates/apps/templates/client-shadcn/src/components/ui/label.tsx +18 -0
- package/templates/apps/templates/client-shadcn/src/globals.css +27 -0
- package/templates/apps/templates/client-shadcn/src/layouts/MainLayout.tsx +17 -0
- package/templates/apps/templates/client-shadcn/src/lib/notify.ts +15 -0
- package/templates/apps/templates/client-shadcn/src/lib/utils.ts +6 -0
- package/templates/apps/templates/client-shadcn/src/main.tsx +50 -0
- package/templates/apps/templates/client-shadcn/src/routeTree.gen.ts +136 -0
- package/templates/apps/templates/client-shadcn/src/routes/__root.tsx +5 -0
- package/templates/apps/templates/client-shadcn/src/routes/_dashboard/dashboard.tsx +33 -0
- package/templates/apps/templates/client-shadcn/src/routes/_dashboard/profile.tsx +88 -0
- package/templates/apps/templates/client-shadcn/src/routes/_dashboard.tsx +16 -0
- package/templates/apps/templates/client-shadcn/src/routes/index.tsx +33 -0
- package/templates/apps/templates/client-shadcn/src/routes/login.tsx +93 -0
- package/templates/apps/templates/client-shadcn/src/styles.css +1 -0
- package/templates/apps/templates/client-shadcn/tsconfig.app.json +27 -0
- package/templates/apps/templates/client-shadcn/tsconfig.json +21 -0
- package/templates/apps/templates/client-shadcn/tsconfig.spec.json +30 -0
- package/templates/apps/templates/client-shadcn/vite.config.mts +92 -0
- package/templates/apps/templates/client-shadcn-e2e/eslint.config.mjs +12 -0
- package/templates/apps/templates/client-shadcn-e2e/playwright.config.ts +69 -0
- package/templates/apps/templates/client-shadcn-e2e/project.json +10 -0
- package/templates/apps/templates/client-shadcn-e2e/src/icore.spec.ts +27 -0
- package/templates/apps/templates/client-shadcn-e2e/tsconfig.json +19 -0
- package/templates/eslint.config.mjs +20 -0
- package/templates/libs/auth-client/README.md +11 -0
- package/templates/libs/auth-client/eslint.config.mjs +22 -0
- package/templates/libs/auth-client/package.json +15 -0
- package/templates/libs/auth-client/project.json +19 -0
- package/templates/libs/auth-client/src/index.ts +2 -0
- package/templates/libs/auth-client/src/lib/auth-client.module.ts +25 -0
- package/templates/libs/auth-client/src/lib/auth-client.service.ts +30 -0
- package/templates/libs/auth-client/tsconfig.json +24 -0
- package/templates/libs/auth-client/tsconfig.lib.json +26 -0
- package/templates/libs/auth-client/tsconfig.spec.json +22 -0
- package/templates/libs/auth-client/vitest.config.mts +22 -0
- package/templates/libs/auth-strategies/firebase/README.md +11 -0
- package/templates/libs/auth-strategies/firebase/eslint.config.mjs +22 -0
- package/templates/libs/auth-strategies/firebase/package.json +15 -0
- package/templates/libs/auth-strategies/firebase/project.json +19 -0
- package/templates/libs/auth-strategies/firebase/src/index.ts +4 -0
- package/templates/libs/auth-strategies/firebase/src/lib/__tests__/firebase-auth.contract.unit.test.ts +13 -0
- package/templates/libs/auth-strategies/firebase/src/lib/firebase-auth.strategy.ts +77 -0
- package/templates/libs/auth-strategies/firebase/src/lib/identity-toolkit.client.ts +72 -0
- package/templates/libs/auth-strategies/firebase/src/lib/testing/mock-admin-auth.ts +41 -0
- package/templates/libs/auth-strategies/firebase/src/lib/testing/mock-identity-toolkit.ts +76 -0
- package/templates/libs/auth-strategies/firebase/tsconfig.json +24 -0
- package/templates/libs/auth-strategies/firebase/tsconfig.lib.json +23 -0
- package/templates/libs/auth-strategies/firebase/tsconfig.spec.json +22 -0
- package/templates/libs/auth-strategies/firebase/vitest.config.mts +22 -0
- package/templates/libs/auth-strategies/supabase/README.md +11 -0
- package/templates/libs/auth-strategies/supabase/eslint.config.mjs +22 -0
- package/templates/libs/auth-strategies/supabase/package.json +16 -0
- package/templates/libs/auth-strategies/supabase/project.json +19 -0
- package/templates/libs/auth-strategies/supabase/src/index.ts +2 -0
- package/templates/libs/auth-strategies/supabase/src/lib/__tests__/supabase-auth.contract.unit.test.ts +8 -0
- package/templates/libs/auth-strategies/supabase/src/lib/supabase-auth.strategy.ts +79 -0
- package/templates/libs/auth-strategies/supabase/src/lib/testing/mock-supabase.ts +107 -0
- package/templates/libs/auth-strategies/supabase/tsconfig.json +24 -0
- package/templates/libs/auth-strategies/supabase/tsconfig.lib.json +23 -0
- package/templates/libs/auth-strategies/supabase/tsconfig.spec.json +22 -0
- package/templates/libs/auth-strategies/supabase/vitest.config.mts +22 -0
- package/templates/libs/shared/README.md +11 -0
- package/templates/libs/shared/eslint.config.mjs +24 -0
- package/templates/libs/shared/package.json +14 -0
- package/templates/libs/shared/project.json +19 -0
- package/templates/libs/shared/src/__tests__/transport.unit.test.ts +58 -0
- package/templates/libs/shared/src/abilities/__tests__/ability.unit.test.ts +28 -0
- package/templates/libs/shared/src/abilities/ability.ts +21 -0
- package/templates/libs/shared/src/abilities/index.ts +2 -0
- package/templates/libs/shared/src/abilities/subjects.ts +2 -0
- package/templates/libs/shared/src/index.ts +3 -0
- package/templates/libs/shared/src/strategies/__tests__/fake-auth.contract.unit.test.ts +4 -0
- package/templates/libs/shared/src/strategies/__tests__/fake-storage.contract.unit.test.ts +4 -0
- package/templates/libs/shared/src/strategies/auth.ts +21 -0
- package/templates/libs/shared/src/strategies/contract/auth-contract.ts +66 -0
- package/templates/libs/shared/src/strategies/contract/storage-contract.ts +58 -0
- package/templates/libs/shared/src/strategies/fakes/fake-auth.ts +73 -0
- package/templates/libs/shared/src/strategies/fakes/fake-storage.ts +51 -0
- package/templates/libs/shared/src/strategies/fakes/index.ts +2 -0
- package/templates/libs/shared/src/strategies/index.ts +5 -0
- package/templates/libs/shared/src/strategies/storage.ts +17 -0
- package/templates/libs/shared/src/transport.ts +55 -0
- package/templates/libs/shared/tsconfig.json +24 -0
- package/templates/libs/shared/tsconfig.lib.json +23 -0
- package/templates/libs/shared/tsconfig.spec.json +22 -0
- package/templates/libs/shared/vitest.config.mts +21 -0
- package/templates/libs/storage-strategies/cloudinary/README.md +11 -0
- package/templates/libs/storage-strategies/cloudinary/eslint.config.mjs +23 -0
- package/templates/libs/storage-strategies/cloudinary/package.json +15 -0
- package/templates/libs/storage-strategies/cloudinary/project.json +19 -0
- package/templates/libs/storage-strategies/cloudinary/src/index.ts +2 -0
- package/templates/libs/storage-strategies/cloudinary/src/lib/__tests__/cloudinary-storage.contract.unit.test.ts +8 -0
- package/templates/libs/storage-strategies/cloudinary/src/lib/cloudinary-storage.strategy.ts +75 -0
- package/templates/libs/storage-strategies/cloudinary/src/lib/testing/mock-cloudinary.ts +36 -0
- package/templates/libs/storage-strategies/cloudinary/tsconfig.json +24 -0
- package/templates/libs/storage-strategies/cloudinary/tsconfig.lib.json +23 -0
- package/templates/libs/storage-strategies/cloudinary/tsconfig.spec.json +22 -0
- package/templates/libs/storage-strategies/cloudinary/vitest.config.mts +22 -0
- package/templates/libs/storage-strategies/firebase/README.md +11 -0
- package/templates/libs/storage-strategies/firebase/eslint.config.mjs +23 -0
- package/templates/libs/storage-strategies/firebase/package.json +15 -0
- package/templates/libs/storage-strategies/firebase/project.json +19 -0
- package/templates/libs/storage-strategies/firebase/src/index.ts +2 -0
- package/templates/libs/storage-strategies/firebase/src/lib/__tests__/firebase-storage.contract.unit.test.ts +8 -0
- package/templates/libs/storage-strategies/firebase/src/lib/firebase-storage.strategy.ts +63 -0
- package/templates/libs/storage-strategies/firebase/src/lib/testing/mock-firebase-storage.ts +43 -0
- package/templates/libs/storage-strategies/firebase/tsconfig.json +24 -0
- package/templates/libs/storage-strategies/firebase/tsconfig.lib.json +23 -0
- package/templates/libs/storage-strategies/firebase/tsconfig.spec.json +22 -0
- package/templates/libs/storage-strategies/firebase/vitest.config.mts +22 -0
- package/templates/libs/storage-strategies/supabase/README.md +11 -0
- package/templates/libs/storage-strategies/supabase/eslint.config.mjs +22 -0
- package/templates/libs/storage-strategies/supabase/package.json +16 -0
- package/templates/libs/storage-strategies/supabase/project.json +19 -0
- package/templates/libs/storage-strategies/supabase/src/index.ts +2 -0
- package/templates/libs/storage-strategies/supabase/src/lib/__tests__/supabase-storage.contract.unit.test.ts +8 -0
- package/templates/libs/storage-strategies/supabase/src/lib/supabase-storage.strategy.ts +53 -0
- package/templates/libs/storage-strategies/supabase/src/lib/testing/mock-supabase-storage.ts +78 -0
- package/templates/libs/storage-strategies/supabase/tsconfig.json +24 -0
- package/templates/libs/storage-strategies/supabase/tsconfig.lib.json +23 -0
- package/templates/libs/storage-strategies/supabase/tsconfig.spec.json +22 -0
- package/templates/libs/storage-strategies/supabase/vitest.config.mts +22 -0
- package/templates/libs/template-shared/README.md +11 -0
- package/templates/libs/template-shared/eslint.config.mjs +23 -0
- package/templates/libs/template-shared/package.json +22 -0
- package/templates/libs/template-shared/project.json +19 -0
- package/templates/libs/template-shared/src/index.ts +9 -0
- package/templates/libs/template-shared/src/lib/abilities/ability-provider.tsx +19 -0
- package/templates/libs/template-shared/src/lib/api/create-api.ts +20 -0
- package/templates/libs/template-shared/src/lib/draft/index.ts +1 -0
- package/templates/libs/template-shared/src/lib/i18n/create-i18n.ts +42 -0
- package/templates/libs/template-shared/src/lib/i18n/keys.ts +30 -0
- package/templates/libs/template-shared/src/lib/landing/LandingPage.tsx +68 -0
- package/templates/libs/template-shared/src/lib/notify/use-notify.ts +26 -0
- package/templates/libs/template-shared/src/lib/stores/auth.store.ts +29 -0
- package/templates/libs/template-shared/src/lib/stores/loading.store.ts +13 -0
- package/templates/libs/template-shared/tsconfig.json +24 -0
- package/templates/libs/template-shared/tsconfig.lib.json +25 -0
- package/templates/libs/template-shared/tsconfig.spec.json +22 -0
- package/templates/libs/template-shared/vitest.config.mts +22 -0
- package/templates/libs/upload-client/README.md +11 -0
- package/templates/libs/upload-client/eslint.config.mjs +22 -0
- package/templates/libs/upload-client/package.json +15 -0
- package/templates/libs/upload-client/project.json +19 -0
- package/templates/libs/upload-client/src/index.ts +2 -0
- package/templates/libs/upload-client/src/lib/upload-client.module.ts +25 -0
- package/templates/libs/upload-client/src/lib/upload-client.service.ts +38 -0
- package/templates/libs/upload-client/tsconfig.json +24 -0
- package/templates/libs/upload-client/tsconfig.lib.json +26 -0
- package/templates/libs/upload-client/tsconfig.spec.json +22 -0
- package/templates/libs/upload-client/vitest.config.mts +22 -0
- package/templates/nx.json +113 -0
- package/templates/package.json +24 -0
- package/templates/tools/create-icore/_template-shell/package.json +24 -0
- package/templates/tsconfig.base.json +29 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>ClientShadcn</title>
|
|
6
|
+
<base href="/" />
|
|
7
|
+
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
10
|
+
<meta name="x-app-version" content="%APP_VERSION%" />
|
|
11
|
+
<link rel="stylesheet" href="/src/styles.css" />
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "client-shadcn",
|
|
3
|
+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "apps/templates/client-shadcn/src",
|
|
5
|
+
"projectType": "application",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"// targets": "to see all targets run: nx show project client-shadcn --web",
|
|
8
|
+
"targets": {}
|
|
9
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Your styles goes here. */
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useTranslation } from 'react-i18next';
|
|
2
|
+
import { Link } from '@tanstack/react-router';
|
|
3
|
+
|
|
4
|
+
export function AccessDeniedPage() {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
return (
|
|
7
|
+
<div className="min-h-[60vh] flex flex-col items-center justify-center gap-2 text-center px-6">
|
|
8
|
+
<h1 className="text-2xl font-semibold">{t('error.accessDenied')}</h1>
|
|
9
|
+
<p className="text-muted-foreground">{t('error.unknown')}</p>
|
|
10
|
+
<Link to="/_dashboard/dashboard" className="mt-4 underline">
|
|
11
|
+
← Dashboard
|
|
12
|
+
</Link>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Can, useDraft, useLoading } from '@icore/template-shared';
|
|
4
|
+
import type { AbilityAction, AbilitySubject } from '@icore/shared';
|
|
5
|
+
import { AccessDeniedPage } from './AccessDeniedPage';
|
|
6
|
+
|
|
7
|
+
interface PageLayoutProps {
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
/** CASL action gate. When provided together with `subject`, renders AccessDeniedPage if the ability check fails. */
|
|
11
|
+
action?: AbilityAction;
|
|
12
|
+
/** CASL subject gate. When provided together with `action`, renders AccessDeniedPage if the ability check fails. */
|
|
13
|
+
subject?: AbilitySubject;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function PageLayout({ title, description, action, subject, children }: PageLayoutProps) {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const isLoading = useLoading();
|
|
20
|
+
|
|
21
|
+
// Reset global draft state on mount/unmount so navigation is never blocked on a fresh page.
|
|
22
|
+
useDraft(false);
|
|
23
|
+
|
|
24
|
+
const content = (
|
|
25
|
+
<div className="p-4 md:p-6 space-y-4">
|
|
26
|
+
<div>
|
|
27
|
+
<h1 className="text-xl font-semibold text-foreground">{title}</h1>
|
|
28
|
+
{description && <p className="text-sm text-muted-foreground mt-1">{description}</p>}
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
{isLoading && (
|
|
32
|
+
<div
|
|
33
|
+
role="status"
|
|
34
|
+
aria-label={t('common.loading')}
|
|
35
|
+
className="fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm"
|
|
36
|
+
>
|
|
37
|
+
<div className="h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// When both action and subject are provided, gate the content with a CASL ability check.
|
|
46
|
+
if (action && subject) {
|
|
47
|
+
return (
|
|
48
|
+
<Can I={action} a={subject as Exclude<AbilitySubject, 'all'>} passThrough>
|
|
49
|
+
{({ isAllowed }: { isAllowed: boolean }) => (isAllowed ? content : <AccessDeniedPage />)}
|
|
50
|
+
</Can>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return content;
|
|
55
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useTranslation } from 'react-i18next';
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router';
|
|
3
|
+
import { useAuthStore, setStoredLocale, type IcoreLocale } from '@icore/template-shared';
|
|
4
|
+
import { Button } from '../ui/button';
|
|
5
|
+
|
|
6
|
+
const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
7
|
+
{ code: 'en', label: 'EN' },
|
|
8
|
+
{ code: 'ru', label: 'RU' },
|
|
9
|
+
{ code: 'he', label: 'HE' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export function LayoutHeader() {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
const user = useAuthStore((s) => s.user);
|
|
16
|
+
const logout = useAuthStore((s) => s.logout);
|
|
17
|
+
|
|
18
|
+
function handleLocale(code: IcoreLocale) {
|
|
19
|
+
setStoredLocale(code);
|
|
20
|
+
window.location.reload();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function handleLogout() {
|
|
24
|
+
logout();
|
|
25
|
+
void navigate({ to: '/login' });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<header className="border-b border-border px-6 py-3 flex items-center justify-between bg-background">
|
|
30
|
+
<span className="font-semibold text-foreground tracking-tight">icore</span>
|
|
31
|
+
|
|
32
|
+
<div className="flex items-center gap-4">
|
|
33
|
+
<div className="flex items-center gap-1">
|
|
34
|
+
{LOCALES.map(({ code, label }) => (
|
|
35
|
+
<button
|
|
36
|
+
key={code}
|
|
37
|
+
onClick={() => handleLocale(code)}
|
|
38
|
+
className="text-xs px-2 py-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors"
|
|
39
|
+
type="button"
|
|
40
|
+
>
|
|
41
|
+
{label}
|
|
42
|
+
</button>
|
|
43
|
+
))}
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div className="flex items-center gap-2">
|
|
47
|
+
<span className="text-sm text-muted-foreground hidden sm:inline">
|
|
48
|
+
{user?.email ?? ''}
|
|
49
|
+
</span>
|
|
50
|
+
<Button variant="outline" size="sm" onClick={handleLogout}>
|
|
51
|
+
{t('common.logout')}
|
|
52
|
+
</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</header>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Link } from '@tanstack/react-router';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ChevronLeft, ChevronRight, LayoutDashboard, User } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
export function LayoutSider() {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<aside
|
|
12
|
+
className={`relative flex flex-col border-r border-border bg-background transition-all duration-200 ${
|
|
13
|
+
collapsed ? 'w-12' : 'w-48'
|
|
14
|
+
}`}
|
|
15
|
+
>
|
|
16
|
+
<nav className="flex flex-col gap-1 p-2 flex-1">
|
|
17
|
+
<Link
|
|
18
|
+
to="/_dashboard/dashboard"
|
|
19
|
+
activeOptions={{ exact: true }}
|
|
20
|
+
className="flex items-center gap-2 px-2 py-2 rounded hover:bg-muted text-sm text-foreground transition-colors [&.active]:bg-muted [&.active]:font-medium"
|
|
21
|
+
>
|
|
22
|
+
<LayoutDashboard size={16} className="shrink-0" />
|
|
23
|
+
{!collapsed && <span>{t('nav.dashboard')}</span>}
|
|
24
|
+
</Link>
|
|
25
|
+
<Link
|
|
26
|
+
to="/_dashboard/profile"
|
|
27
|
+
className="flex items-center gap-2 px-2 py-2 rounded hover:bg-muted text-sm text-foreground transition-colors [&.active]:bg-muted [&.active]:font-medium"
|
|
28
|
+
>
|
|
29
|
+
<User size={16} className="shrink-0" />
|
|
30
|
+
{!collapsed && <span>{t('nav.profile')}</span>}
|
|
31
|
+
</Link>
|
|
32
|
+
</nav>
|
|
33
|
+
|
|
34
|
+
<button
|
|
35
|
+
onClick={() => setCollapsed((c) => !c)}
|
|
36
|
+
className="absolute -right-3 top-4 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground hover:text-foreground shadow-sm"
|
|
37
|
+
type="button"
|
|
38
|
+
aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
|
|
39
|
+
>
|
|
40
|
+
{collapsed ? <ChevronRight size={12} /> : <ChevronLeft size={12} />}
|
|
41
|
+
</button>
|
|
42
|
+
</aside>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
'bg-[--color-primary] text-[--color-primary-foreground] hover:bg-[--color-primary]/90',
|
|
13
|
+
destructive: 'bg-[--color-destructive] text-white hover:bg-[--color-destructive]/90',
|
|
14
|
+
outline:
|
|
15
|
+
'border border-[--color-border] bg-transparent hover:bg-[--color-muted] hover:text-[--color-foreground]',
|
|
16
|
+
secondary: 'bg-[--color-muted] text-[--color-foreground] hover:bg-[--color-muted]/80',
|
|
17
|
+
ghost: 'hover:bg-[--color-muted] hover:text-[--color-foreground]',
|
|
18
|
+
link: 'text-[--color-primary] underline-offset-4 hover:underline',
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
default: 'h-10 px-4 py-2',
|
|
22
|
+
sm: 'h-9 rounded-md px-3',
|
|
23
|
+
lg: 'h-11 rounded-md px-8',
|
|
24
|
+
icon: 'h-10 w-10',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: 'default',
|
|
29
|
+
size: 'default',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export interface ButtonProps
|
|
35
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
36
|
+
VariantProps<typeof buttonVariants> {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
41
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : 'button';
|
|
43
|
+
return (
|
|
44
|
+
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
Button.displayName = 'Button';
|
|
49
|
+
|
|
50
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// NOTE: shadcn ships Card + its sub-components (CardHeader, CardTitle, etc.)
|
|
2
|
+
// as a single export module. This is an exception to the project's
|
|
3
|
+
// "one component per file" rule, which applies to APPLICATION components —
|
|
4
|
+
// vendored design-system primitives that always travel together are kept
|
|
5
|
+
// in a single file matching the upstream shadcn source structure.
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { cn } from '../../lib/utils';
|
|
8
|
+
|
|
9
|
+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
10
|
+
({ className, ...props }, ref) => (
|
|
11
|
+
<div
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
'rounded-lg border border-[--color-border] bg-[--color-background] text-[--color-foreground] shadow-sm',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
Card.displayName = 'Card';
|
|
22
|
+
|
|
23
|
+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
24
|
+
({ className, ...props }, ref) => (
|
|
25
|
+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
CardHeader.displayName = 'CardHeader';
|
|
29
|
+
|
|
30
|
+
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
31
|
+
({ className, ...props }, ref) => (
|
|
32
|
+
<h3
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn('text-2xl font-semibold leading-none tracking-tight', className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
CardTitle.displayName = 'CardTitle';
|
|
40
|
+
|
|
41
|
+
const CardDescription = React.forwardRef<
|
|
42
|
+
HTMLParagraphElement,
|
|
43
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
44
|
+
>(({ className, ...props }, ref) => (
|
|
45
|
+
<p ref={ref} className={cn('text-sm text-[--color-muted-foreground]', className)} {...props} />
|
|
46
|
+
));
|
|
47
|
+
CardDescription.displayName = 'CardDescription';
|
|
48
|
+
|
|
49
|
+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
50
|
+
({ className, ...props }, ref) => (
|
|
51
|
+
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
CardContent.displayName = 'CardContent';
|
|
55
|
+
|
|
56
|
+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
57
|
+
({ className, ...props }, ref) => (
|
|
58
|
+
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
CardFooter.displayName = 'CardFooter';
|
|
62
|
+
|
|
63
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
|
|
4
|
+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
|
+
|
|
6
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
7
|
+
({ className, type, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<input
|
|
10
|
+
type={type}
|
|
11
|
+
className={cn(
|
|
12
|
+
'flex h-10 w-full rounded-md border border-[--color-border] bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[--color-muted-foreground] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[--color-primary] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
ref={ref}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
Input.displayName = 'Input';
|
|
22
|
+
|
|
23
|
+
export { Input };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const labelVariants = cva(
|
|
7
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const Label = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
|
|
15
|
+
));
|
|
16
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
17
|
+
|
|
18
|
+
export { Label };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--color-background: oklch(0.99 0 0);
|
|
5
|
+
--color-foreground: oklch(0.15 0 0);
|
|
6
|
+
--color-primary: oklch(0.45 0.18 250);
|
|
7
|
+
--color-primary-foreground: oklch(0.98 0 0);
|
|
8
|
+
--color-muted: oklch(0.96 0 0);
|
|
9
|
+
--color-muted-foreground: oklch(0.45 0 0);
|
|
10
|
+
--color-border: oklch(0.92 0 0);
|
|
11
|
+
--color-destructive: oklch(0.55 0.25 25);
|
|
12
|
+
--radius-default: 0.5rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@layer base {
|
|
16
|
+
body {
|
|
17
|
+
background-color: var(--color-background);
|
|
18
|
+
color: var(--color-foreground);
|
|
19
|
+
}
|
|
20
|
+
html.dark {
|
|
21
|
+
--color-background: oklch(0.15 0 0);
|
|
22
|
+
--color-foreground: oklch(0.98 0 0);
|
|
23
|
+
--color-muted: oklch(0.25 0 0);
|
|
24
|
+
--color-muted-foreground: oklch(0.7 0 0);
|
|
25
|
+
--color-border: oklch(0.3 0 0);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { LayoutHeader } from '../components/layout/LayoutHeader';
|
|
3
|
+
import { LayoutSider } from '../components/layout/LayoutSider';
|
|
4
|
+
import { LayoutFooter } from '../components/layout/LayoutFooter';
|
|
5
|
+
|
|
6
|
+
export function MainLayout({ children }: { children: ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<div className="min-h-screen flex flex-col bg-background text-foreground">
|
|
9
|
+
<LayoutHeader />
|
|
10
|
+
<div className="flex-1 flex">
|
|
11
|
+
<LayoutSider />
|
|
12
|
+
<main className="flex-1 min-w-0">{children}</main>
|
|
13
|
+
</div>
|
|
14
|
+
<LayoutFooter />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { toast } from 'sonner';
|
|
2
|
+
import { setNotifier } from '@icore/template-shared';
|
|
3
|
+
|
|
4
|
+
export function wireShadcnNotifier() {
|
|
5
|
+
setNotifier({
|
|
6
|
+
success: (title, opts) =>
|
|
7
|
+
toast.success(title, { description: opts?.description, duration: opts?.duration }),
|
|
8
|
+
error: (title, opts) =>
|
|
9
|
+
toast.error(title, { description: opts?.description, duration: opts?.duration }),
|
|
10
|
+
info: (title, opts) =>
|
|
11
|
+
toast(title, { description: opts?.description, duration: opts?.duration }),
|
|
12
|
+
warning: (title, opts) =>
|
|
13
|
+
toast.warning(title, { description: opts?.description, duration: opts?.duration }),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import './globals.css';
|
|
2
|
+
import { StrictMode } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
5
|
+
import { RouterProvider, createRouter } from '@tanstack/react-router';
|
|
6
|
+
import {
|
|
7
|
+
AbilityProvider,
|
|
8
|
+
createIcoreApi,
|
|
9
|
+
createIcoreI18n,
|
|
10
|
+
ICORE_LOCALES,
|
|
11
|
+
} from '@icore/template-shared';
|
|
12
|
+
import { I18nextProvider } from 'react-i18next';
|
|
13
|
+
import { Toaster } from 'sonner';
|
|
14
|
+
import { routeTree } from './routeTree.gen';
|
|
15
|
+
import { wireShadcnNotifier } from './lib/notify';
|
|
16
|
+
|
|
17
|
+
const queryClient = new QueryClient({
|
|
18
|
+
defaultOptions: { queries: { retry: false, refetchOnWindowFocus: false } },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const router = createRouter({ routeTree, context: { queryClient } });
|
|
22
|
+
|
|
23
|
+
declare module '@tanstack/react-router' {
|
|
24
|
+
interface Register {
|
|
25
|
+
router: typeof router;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const i18n = createIcoreI18n({ resources: ICORE_LOCALES });
|
|
30
|
+
|
|
31
|
+
// Single shared API instance — used by every query in src/queries/
|
|
32
|
+
export const api = createIcoreApi({
|
|
33
|
+
baseUrl: import.meta.env.VITE_API_URL ?? '/api',
|
|
34
|
+
onUnauthorized: () => router.navigate({ to: '/login' }),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
wireShadcnNotifier();
|
|
38
|
+
|
|
39
|
+
createRoot(document.getElementById('root')!).render(
|
|
40
|
+
<StrictMode>
|
|
41
|
+
<I18nextProvider i18n={i18n}>
|
|
42
|
+
<QueryClientProvider client={queryClient}>
|
|
43
|
+
<AbilityProvider>
|
|
44
|
+
<RouterProvider router={router} />
|
|
45
|
+
<Toaster richColors />
|
|
46
|
+
</AbilityProvider>
|
|
47
|
+
</QueryClientProvider>
|
|
48
|
+
</I18nextProvider>
|
|
49
|
+
</StrictMode>,
|
|
50
|
+
);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
|
+
|
|
7
|
+
// This file was automatically generated by TanStack Router.
|
|
8
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
+
|
|
11
|
+
import { Route as rootRouteImport } from './routes/__root';
|
|
12
|
+
import { Route as LoginRouteImport } from './routes/login';
|
|
13
|
+
import { Route as DashboardRouteImport } from './routes/_dashboard';
|
|
14
|
+
import { Route as IndexRouteImport } from './routes/index';
|
|
15
|
+
import { Route as DashboardProfileRouteImport } from './routes/_dashboard/profile';
|
|
16
|
+
import { Route as DashboardDashboardRouteImport } from './routes/_dashboard/dashboard';
|
|
17
|
+
|
|
18
|
+
const LoginRoute = LoginRouteImport.update({
|
|
19
|
+
id: '/login',
|
|
20
|
+
path: '/login',
|
|
21
|
+
getParentRoute: () => rootRouteImport,
|
|
22
|
+
} as any);
|
|
23
|
+
const DashboardRoute = DashboardRouteImport.update({
|
|
24
|
+
id: '/_dashboard',
|
|
25
|
+
getParentRoute: () => rootRouteImport,
|
|
26
|
+
} as any);
|
|
27
|
+
const IndexRoute = IndexRouteImport.update({
|
|
28
|
+
id: '/',
|
|
29
|
+
path: '/',
|
|
30
|
+
getParentRoute: () => rootRouteImport,
|
|
31
|
+
} as any);
|
|
32
|
+
const DashboardProfileRoute = DashboardProfileRouteImport.update({
|
|
33
|
+
id: '/profile',
|
|
34
|
+
path: '/profile',
|
|
35
|
+
getParentRoute: () => DashboardRoute,
|
|
36
|
+
} as any);
|
|
37
|
+
const DashboardDashboardRoute = DashboardDashboardRouteImport.update({
|
|
38
|
+
id: '/dashboard',
|
|
39
|
+
path: '/dashboard',
|
|
40
|
+
getParentRoute: () => DashboardRoute,
|
|
41
|
+
} as any);
|
|
42
|
+
|
|
43
|
+
export interface FileRoutesByFullPath {
|
|
44
|
+
'/': typeof IndexRoute;
|
|
45
|
+
'/login': typeof LoginRoute;
|
|
46
|
+
'/dashboard': typeof DashboardDashboardRoute;
|
|
47
|
+
'/profile': typeof DashboardProfileRoute;
|
|
48
|
+
}
|
|
49
|
+
export interface FileRoutesByTo {
|
|
50
|
+
'/': typeof IndexRoute;
|
|
51
|
+
'/login': typeof LoginRoute;
|
|
52
|
+
'/dashboard': typeof DashboardDashboardRoute;
|
|
53
|
+
'/profile': typeof DashboardProfileRoute;
|
|
54
|
+
}
|
|
55
|
+
export interface FileRoutesById {
|
|
56
|
+
__root__: typeof rootRouteImport;
|
|
57
|
+
'/': typeof IndexRoute;
|
|
58
|
+
'/_dashboard': typeof DashboardRouteWithChildren;
|
|
59
|
+
'/login': typeof LoginRoute;
|
|
60
|
+
'/_dashboard/dashboard': typeof DashboardDashboardRoute;
|
|
61
|
+
'/_dashboard/profile': typeof DashboardProfileRoute;
|
|
62
|
+
}
|
|
63
|
+
export interface FileRouteTypes {
|
|
64
|
+
fileRoutesByFullPath: FileRoutesByFullPath;
|
|
65
|
+
fullPaths: '/' | '/login' | '/dashboard' | '/profile';
|
|
66
|
+
fileRoutesByTo: FileRoutesByTo;
|
|
67
|
+
to: '/' | '/login' | '/dashboard' | '/profile';
|
|
68
|
+
id: '__root__' | '/' | '/_dashboard' | '/login' | '/_dashboard/dashboard' | '/_dashboard/profile';
|
|
69
|
+
fileRoutesById: FileRoutesById;
|
|
70
|
+
}
|
|
71
|
+
export interface RootRouteChildren {
|
|
72
|
+
IndexRoute: typeof IndexRoute;
|
|
73
|
+
DashboardRoute: typeof DashboardRouteWithChildren;
|
|
74
|
+
LoginRoute: typeof LoginRoute;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare module '@tanstack/react-router' {
|
|
78
|
+
interface FileRoutesByPath {
|
|
79
|
+
'/login': {
|
|
80
|
+
id: '/login';
|
|
81
|
+
path: '/login';
|
|
82
|
+
fullPath: '/login';
|
|
83
|
+
preLoaderRoute: typeof LoginRouteImport;
|
|
84
|
+
parentRoute: typeof rootRouteImport;
|
|
85
|
+
};
|
|
86
|
+
'/_dashboard': {
|
|
87
|
+
id: '/_dashboard';
|
|
88
|
+
path: '';
|
|
89
|
+
fullPath: '/';
|
|
90
|
+
preLoaderRoute: typeof DashboardRouteImport;
|
|
91
|
+
parentRoute: typeof rootRouteImport;
|
|
92
|
+
};
|
|
93
|
+
'/': {
|
|
94
|
+
id: '/';
|
|
95
|
+
path: '/';
|
|
96
|
+
fullPath: '/';
|
|
97
|
+
preLoaderRoute: typeof IndexRouteImport;
|
|
98
|
+
parentRoute: typeof rootRouteImport;
|
|
99
|
+
};
|
|
100
|
+
'/_dashboard/profile': {
|
|
101
|
+
id: '/_dashboard/profile';
|
|
102
|
+
path: '/profile';
|
|
103
|
+
fullPath: '/profile';
|
|
104
|
+
preLoaderRoute: typeof DashboardProfileRouteImport;
|
|
105
|
+
parentRoute: typeof DashboardRoute;
|
|
106
|
+
};
|
|
107
|
+
'/_dashboard/dashboard': {
|
|
108
|
+
id: '/_dashboard/dashboard';
|
|
109
|
+
path: '/dashboard';
|
|
110
|
+
fullPath: '/dashboard';
|
|
111
|
+
preLoaderRoute: typeof DashboardDashboardRouteImport;
|
|
112
|
+
parentRoute: typeof DashboardRoute;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface DashboardRouteChildren {
|
|
118
|
+
DashboardDashboardRoute: typeof DashboardDashboardRoute;
|
|
119
|
+
DashboardProfileRoute: typeof DashboardProfileRoute;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const DashboardRouteChildren: DashboardRouteChildren = {
|
|
123
|
+
DashboardDashboardRoute: DashboardDashboardRoute,
|
|
124
|
+
DashboardProfileRoute: DashboardProfileRoute,
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const DashboardRouteWithChildren = DashboardRoute._addFileChildren(DashboardRouteChildren);
|
|
128
|
+
|
|
129
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
130
|
+
IndexRoute: IndexRoute,
|
|
131
|
+
DashboardRoute: DashboardRouteWithChildren,
|
|
132
|
+
LoginRoute: LoginRoute,
|
|
133
|
+
};
|
|
134
|
+
export const routeTree = rootRouteImport
|
|
135
|
+
._addFileChildren(rootRouteChildren)
|
|
136
|
+
._addFileTypes<FileRouteTypes>();
|