From a8867a18893c17cb5973737833bf68b2a454f28d Mon Sep 17 00:00:00 2001 From: Ivan Dalmet Date: Fri, 4 Jul 2025 11:54:51 +0200 Subject: [PATCH] feat: add !STARTERCONF for demo elements --- .github/workflows/e2e-tests.yml | 2 +- src/env/client.ts | 1 + src/features/auth/config.ts | 2 +- src/features/dashboard/manager/page-dashboard.tsx | 7 ++++--- src/features/demo/demo-app-switch.tsx | 1 + src/features/demo/demo-marketing-bento.tsx | 1 + src/features/demo/demo-mode-drawer.tsx | 1 + src/features/demo/demo-welcome.tsx | 1 + src/features/devtools/login-hint.tsx | 10 ++++------ src/features/home/app/page-home.tsx | 7 ++++--- src/lib/orpc/client.ts | 3 ++- src/locales/ar/index.ts | 4 ++-- src/locales/en/index.ts | 4 ++-- src/locales/fr/index.ts | 4 ++-- src/locales/sw/index.ts | 4 ++-- src/providers.tsx | 9 ++++++--- src/server/auth.tsx | 4 ++-- src/server/email.tsx | 1 + src/server/orpc.ts | 1 + 19 files changed, 39 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7dcfc9a0d..2808e2c5d 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -21,7 +21,7 @@ jobs: VITE_IS_DEMO: false BETTER_AUTH_SECRET: fyXjLxjXJowjicI2BAjxOaUsQd1QafdegZDciJE/xM8= EMAIL_SERVER: smtp://username:password@localhost:1025 - EMAIL_FROM: Start UI + EMAIL_FROM: Example services: postgres: image: postgres diff --git a/src/env/client.ts b/src/env/client.ts index 2b32ffe79..5eafb4a01 100644 --- a/src/env/client.ts +++ b/src/env/client.ts @@ -25,6 +25,7 @@ export const envClient = createEnv({ clientPrefix: 'VITE_', client: { VITE_BASE_URL: z.string().url(), + // !STARTERCONF [demoMode] Remove this VITE_IS_DEMO env var VITE_IS_DEMO: z .enum(['true', 'false']) .optional() diff --git a/src/features/auth/config.ts b/src/features/auth/config.ts index a88bb310f..5510067d2 100644 --- a/src/features/auth/config.ts +++ b/src/features/auth/config.ts @@ -1,5 +1,5 @@ import { envClient } from '@/env/client'; -export const AUTH_SIGNUP_ENABLED = envClient.VITE_IS_DEMO ? false : true; +export const AUTH_SIGNUP_ENABLED = envClient.VITE_IS_DEMO ? false : true; // !STARTERCONF [demoMode] Remove the envClient.VITE_IS_DEMO condition. You can export const AUTH_EMAIL_OTP_MOCKED = '000000'; export const AUTH_EMAIL_OTP_EXPIRATION_IN_MINUTES = 5; diff --git a/src/features/dashboard/manager/page-dashboard.tsx b/src/features/dashboard/manager/page-dashboard.tsx index cd0a05cef..2dc992178 100644 --- a/src/features/dashboard/manager/page-dashboard.tsx +++ b/src/features/dashboard/manager/page-dashboard.tsx @@ -1,6 +1,6 @@ -import { DemoAppSwitch } from '@/features/demo/demo-app-switch'; -import { DemoMarketingBento } from '@/features/demo/demo-marketing-bento'; -import { DemoWelcome } from '@/features/demo/demo-welcome'; +import { DemoAppSwitch } from '@/features/demo/demo-app-switch'; // !STARTERCONF [demoMode] Remove this import +import { DemoMarketingBento } from '@/features/demo/demo-marketing-bento'; // !STARTERCONF [demoMode] Remove this import +import { DemoWelcome } from '@/features/demo/demo-welcome'; // !STARTERCONF [demoMode] Remove this import import { PageLayout, PageLayoutContent, @@ -16,6 +16,7 @@ export const PageDashboard = () => {
+ {/* !STARTERCONF [demoMode] Update with your content */} diff --git a/src/features/demo/demo-app-switch.tsx b/src/features/demo/demo-app-switch.tsx index d24e11535..6f0b28eb8 100644 --- a/src/features/demo/demo-app-switch.tsx +++ b/src/features/demo/demo-app-switch.tsx @@ -1,3 +1,4 @@ +// !STARTERCONF [demoMode] Remove the demo folder import { Link, useMatchRoute } from '@tanstack/react-router'; import { ArrowRightIcon } from 'lucide-react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/demo/demo-marketing-bento.tsx b/src/features/demo/demo-marketing-bento.tsx index a3ba14433..e4174ac3d 100644 --- a/src/features/demo/demo-marketing-bento.tsx +++ b/src/features/demo/demo-marketing-bento.tsx @@ -1,3 +1,4 @@ +// !STARTERCONF [demoMode] Remove the demo folder export const DemoMarketingBento = () => { return (
diff --git a/src/features/demo/demo-mode-drawer.tsx b/src/features/demo/demo-mode-drawer.tsx index aa858cdf1..881e502c4 100644 --- a/src/features/demo/demo-mode-drawer.tsx +++ b/src/features/demo/demo-mode-drawer.tsx @@ -1,3 +1,4 @@ +// !STARTERCONF [demoMode] Remove the demo folder import { create } from 'zustand'; import { diff --git a/src/features/demo/demo-welcome.tsx b/src/features/demo/demo-welcome.tsx index 5cd372199..459ce9f9d 100644 --- a/src/features/demo/demo-welcome.tsx +++ b/src/features/demo/demo-welcome.tsx @@ -1,3 +1,4 @@ +// !STARTERCONF [demoMode] Remove the demo folder import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; diff --git a/src/features/devtools/login-hint.tsx b/src/features/devtools/login-hint.tsx index ddd5a7a11..2ac3e137c 100644 --- a/src/features/devtools/login-hint.tsx +++ b/src/features/devtools/login-hint.tsx @@ -10,6 +10,7 @@ export const LoginEmailHint = () => { const form = useFormContext(); const mockedEmail = 'admin@admin.com'; + // !STARTERCONF [demoMode] Remove the `&& !envClient.VITE_IS_DEMO` condition if (import.meta.env.PROD && !envClient.VITE_IS_DEMO) { return null; } @@ -17,9 +18,7 @@ export const LoginEmailHint = () => { return ( - - {envClient.VITE_IS_DEMO ? 'Demo mode' : 'Dev mode'} - + Dev mode You can login with{' '}