From 0e042456d58dbceae2ba0df76e0e29d0a8a7aae1 Mon Sep 17 00:00:00 2001 From: Atharva Deosthale Date: Thu, 16 Oct 2025 17:33:23 +0530 Subject: [PATCH 1/4] copy prompt --- .../overview/platforms/createAndroid.svelte | 40 +++++++++++++- .../overview/platforms/createApple.svelte | 39 ++++++++++++- .../overview/platforms/createFlutter.svelte | 39 ++++++++++++- .../platforms/createReactNative.svelte | 40 +++++++++++++- .../overview/platforms/createWeb.svelte | 55 ++++++++++++++++++- 5 files changed, 208 insertions(+), 5 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte index e5aba6c42..f6e3d4209 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte @@ -10,7 +10,8 @@ Typography, Fieldset, InlineCode, - Tooltip + Tooltip, + Alert } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconAndroid, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; @@ -39,6 +40,31 @@ const val APPWRITE_PROJECT_NAME = "${$project.name}" const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}"`; + const prompt = ` + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal, VSCode or Android Studio. + + \`\`\`bash + ${gitCloneCode} + \`\`\` + + 2. Open the file \`constants/AppwriteConfig.kt\` and update the configuration settings. + + + \`\`\`kotlin + ${configCode} + \`\`\` + + 3. Run the app on a connected device or emulator, then click the \`Send a ping\` button to verify the setup. + `; + + async function copyPrompt() { + await navigator.clipboard.writeText(prompt); + addNotification({ + type: 'success', + message: 'Prompt copied to clipboard' + }); + } + async function createAndroidPlatform() { try { isCreatingPlatform = true; @@ -162,6 +188,18 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page. {#if isPlatformCreated}
+ + + Paste it into your LLM to generate a working setup. + + + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal, VSCode or Android Studio. diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte index d83013497..4b9237df1 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte @@ -11,7 +11,8 @@ Typography, Fieldset, InlineCode, - Tooltip + Tooltip, + Alert } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconApple, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; @@ -41,6 +42,22 @@ APPWRITE_PROJECT_NAME: "${$project.name}" APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}"`; + const prompt = ` + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal or XCode. + + \`\`\`bash + ${gitCloneCode} + \`\`\` + + 2. Update the configuration settings in the file \`Sources/Config.plist\` to reflect the values below: + + \`\`\`plaintext + ${configCode} + \`\`\` + + 3. Run the app on a connected device or simulator, then click the \`Send a ping\` button to verify the setup. + `; + export let platform: PlatformType = PlatformType.Appleios; let platforms: { [key: string]: PlatformType } = { @@ -50,6 +67,14 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject(page.params.region, page.params.proj tvOS: PlatformType.Appletvos }; + async function copyPrompt() { + await navigator.clipboard.writeText(prompt); + addNotification({ + type: 'success', + message: 'Prompt copied to clipboard' + }); + } + async function createApplePlatform() { try { isCreatingPlatform = true; @@ -192,6 +217,18 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject(page.params.region, page.params.proj {#if isPlatformCreated}
+ + + Paste it into your LLM to generate a working setup. + + + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal or XCode. diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte index ac39899ae..00f67852d 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte @@ -11,7 +11,8 @@ Typography, Fieldset, InlineCode, - Tooltip + Tooltip, + Alert } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconFlutter, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; @@ -42,6 +43,22 @@ static const String appwritePublicEndpoint = '${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}'; }`; + const prompt = ` + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal, VSCode or Android Studio. + + \`\`\`bash + ${gitCloneCode} + \`\`\` + + 2. Replace lib/config/environment.dart to reflect the values below: + + \`\`\`dart + ${configCode} + \`\`\` + + 3. Run the app on a connected device or simulator using \`flutter run -d [device_name]\`, then click the \`Send a ping\` button to verify the setup. + `; + export let platform: PlatformType = PlatformType.Flutterandroid; let platforms: { [key: string]: PlatformType } = { @@ -108,6 +125,14 @@ [PlatformType.Flutterwindows]: 'Package name' }; + async function copyPrompt() { + await navigator.clipboard.writeText(prompt); + addNotification({ + type: 'success', + message: 'Prompt copied to clipboard' + }); + } + async function createFlutterPlatform() { try { isCreatingPlatform = true; @@ -273,6 +298,18 @@ {#if isPlatformCreated}
+ + + Paste it into your LLM to generate a working setup. + + + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal, VSCode or Android Studio. diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte index 2853694a1..23792884b 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte @@ -11,7 +11,8 @@ Typography, Fieldset, InlineCode, - Tooltip + Tooltip, + Alert } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconReact, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; @@ -40,6 +41,22 @@ EXPO_PUBLIC_APPWRITE_PROJECT_NAME="${$project.name}" EXPO_PUBLIC_APPWRITE_ENDPOINT=${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}`; + const prompt = ` + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal or VSCode. + + \`\`\`bash + ${gitCloneCode} + \`\`\` + + 2. Add your Appwrite credentials to \`.env.example\` then rename it to \`.env\` if needed. + + \`\`\`dotenv + ${updateConfigCode} + \`\`\` + + 3. Run the app on a connected device or simulator using \`npm install\` followed by \`npm run ios\` or \`npm run android\`, then click the \`Send a ping\` button to verify the setup. + `; + export let platform: PlatformType = PlatformType.Reactnativeandroid; let platforms: { [key: string]: PlatformType } = { @@ -76,6 +93,14 @@ EXPO_PUBLIC_APPWRITE_ENDPOINT=${sdk.forProject(page.params.region, page.params.p [PlatformType.Reactnativeios]: 'Bundle ID' }; + async function copyPrompt() { + await navigator.clipboard.writeText(prompt); + addNotification({ + type: 'success', + message: 'Prompt copied to clipboard' + }); + } + async function createReactNativePlatform() { try { isCreatingPlatform = true; @@ -217,6 +242,19 @@ EXPO_PUBLIC_APPWRITE_ENDPOINT=${sdk.forProject(page.params.region, page.params.p {#if isPlatformCreated}
+ + + Paste it into your LLM to generate a working setup. + + + + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal or VSCode. diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte index 3a16c105f..0288a657b 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte @@ -11,7 +11,8 @@ Fieldset, InlineCode, Card, - Tooltip + Tooltip, + Alert } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { @@ -151,6 +152,45 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p $: selectedFramework = frameworks.find((framework) => framework.key === selectedFrameworkKey); $: selectedFrameworkIcon = selectedFramework ? selectedFramework.icon : NoFrameworkIcon; + $: prompt = `1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal or VSCode. + + \`\`\`bash + git clone https://github.com/appwrite/starter-for-${selectedFramework.key} + cd starter-for-${selectedFramework.key} + \`\`\` + + 2. Copy the file \`.env.example\` to \`.env\` and update the configuration settings. + + \`\`\`dotenv + APPWRITE_PROJECT_ID=${projectId} + APPWRITE_PROJECT_NAME=${$project.name} + APPWRITE_ENDPOINT=${sdk.forProject(page.params.region, page.params.project).client.config.endpoint} + \`\`\` + + 3. Install project dependencies + + \`\`\`bash + npm install + \`\`\` + + 4. Run the app, then click the \`Send a ping\` button + to verify the setup. + + \`\`\`bash + ${selectedFramework.runCommand} + \`\`\` + + Demo app runs on http://localhost:${selectedFramework.portNumber} + `; + + async function copyPrompt() { + await navigator.clipboard.writeText(prompt); + addNotification({ + type: 'success', + message: 'Prompt copied to clipboard' + }); + } async function createWebPlatform() { hostnameError = hostname !== '' ? !new RegExp(extendedHostnameRegex).test(hostname) : null; @@ -287,6 +327,19 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p {#if isPlatformCreated && !isChangingFramework}
+ + + Paste it into your LLM to generate a working setup. + + + + 1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal or VSCode. From f4647217bdb3443cfb66f540f339d568cad6d72f Mon Sep 17 00:00:00 2001 From: Atharva Deosthale Date: Tue, 21 Oct 2025 11:17:03 +0530 Subject: [PATCH 2/4] add using --- .../overview/platforms/createFlutter.svelte | 3 +-- .../overview/platforms/createWeb.svelte | 3 ++- .../overview/platforms/store.ts | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte index 8cfd79cab..a86f087a3 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte @@ -11,8 +11,7 @@ Typography, Fieldset, InlineCode, - Tooltip, - Alert + Tooltip } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconFlutter, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte index e05af4c81..3e7f656ad 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte @@ -164,7 +164,8 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p ? `APPWRITE_PROJECT_ID=${projectId}\nAPPWRITE_PROJECT_NAME=${$project.name}\nAPPWRITE_ENDPOINT=${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}` : selectedFramework?.updateConfigCode || '', configLanguage: selectedFramework?.key === 'angular' ? 'ts' : 'dotenv', - runInstructions: `${selectedFramework?.key === 'angular' ? 'Replace the file with the configuration above' : 'Copy the file `.env.example` to `.env` and update the configuration settings'}. Install project dependencies using \`npm install\`, then run the app using \`${selectedFramework?.runCommand}\`. Demo app runs on http://localhost:${selectedFramework?.portNumber}. Click the \`Send a ping\` button to verify the setup.` + runInstructions: `${selectedFramework?.key === 'angular' ? 'Replace the file with the configuration above' : 'Copy the file `.env.example` to `.env` and update the configuration settings'}. Install project dependencies using \`npm install\`, then run the app using \`${selectedFramework?.runCommand}\`. Demo app runs on http://localhost:${selectedFramework?.portNumber}. Click the \`Send a ping\` button to verify the setup.`, + using: 'the terminal or VSCode' }); async function createWebPlatform() { diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/store.ts b/src/routes/(console)/project-[region]-[project]/overview/platforms/store.ts index 233a97da4..11a2fa5c7 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/store.ts +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/store.ts @@ -24,6 +24,7 @@ export type LLMPromptConfig = { configCode: string; configLanguage: string; runInstructions: string; + using: string; }; export function getCorrectTitle(isConnectPlatform: boolean, platform: string) { @@ -31,7 +32,7 @@ export function getCorrectTitle(isConnectPlatform: boolean, platform: string) { } export function generatePromptFromConfig(config: LLMPromptConfig): string { - return `1. If you're starting a new project, you can clone our starter kit from GitHub using the terminal, VSCode or Android Studio. + return `1. If you're starting a new project, you can clone our starter kit from GitHub using ${config.using || 'the terminal'}. \`\`\`bash ${config.cloneCommand} @@ -53,6 +54,7 @@ type PlatformConfig = { configFile: string; configLanguage: string; runInstructions: string; + using: string; }; const platformConfigs: Record = { @@ -63,7 +65,8 @@ const platformConfigs: Record = { configFile: 'constants/AppwriteConfig.kt', configLanguage: 'kotlin', runInstructions: - 'Run the app on a connected device or emulator, then click the `Send a ping` button to verify the setup.' + 'Run the app on a connected device or emulator, then click the `Send a ping` button to verify the setup.', + using: 'the terminal, VSCode or Android Studio' }, apple: { name: 'Apple platforms', @@ -72,7 +75,8 @@ const platformConfigs: Record = { configFile: 'Sources/Config.plist', configLanguage: 'plaintext', runInstructions: - 'Run the app on a connected device or simulator, then click the `Send a ping` button to verify the setup.' + 'Run the app on a connected device or simulator, then click the `Send a ping` button to verify the setup.', + using: 'the terminal or XCode' }, flutter: { name: 'Flutter', @@ -81,7 +85,8 @@ const platformConfigs: Record = { configFile: 'lib/config/environment.dart', configLanguage: 'dart', runInstructions: - 'Run the app on a connected device or simulator using `flutter run -d [device_name]`, then click the `Send a ping` button to verify the setup.' + 'Run the app on a connected device or simulator using `flutter run -d [device_name]`, then click the `Send a ping` button to verify the setup.', + using: 'the terminal' }, reactnative: { name: 'React Native', @@ -90,7 +95,8 @@ const platformConfigs: Record = { configFile: '.env.example', configLanguage: 'dotenv', runInstructions: - 'Add your Appwrite credentials to `.env.example` then rename it to `.env` if needed. Run the app on a connected device or simulator using `npm install` followed by `npm run ios` or `npm run android`, then click the `Send a ping` button to verify the setup.' + 'Add your Appwrite credentials to `.env.example` then rename it to `.env` if needed. Run the app on a connected device or simulator using `npm install` followed by `npm run ios` or `npm run android`, then click the `Send a ping` button to verify the setup.', + using: 'the terminal or VSCode' } }; @@ -106,6 +112,7 @@ export function buildPlatformConfig(platformKey: string, configCode: string): LL configFile: config.configFile, configCode: configCode, configLanguage: config.configLanguage, - runInstructions: config.runInstructions + runInstructions: config.runInstructions, + using: config.using }; } From 6700f994ce792d20cb1b74b4106e3e94a77f2f69 Mon Sep 17 00:00:00 2001 From: Atharva Deosthale Date: Tue, 21 Oct 2025 11:20:25 +0530 Subject: [PATCH 3/4] lint --- .../overview/platforms/createApple.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte index 319c70fc0..7eb9f346a 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte @@ -11,8 +11,7 @@ Typography, Fieldset, InlineCode, - Tooltip, - Alert + Tooltip } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconApple, IconAppwrite, IconInfo } from '@appwrite.io/pink-icons-svelte'; From 26d1bf31658f7d7e8180f978558d99519fb7f731 Mon Sep 17 00:00:00 2001 From: Atharva Deosthale Date: Tue, 21 Oct 2025 11:27:41 +0530 Subject: [PATCH 4/4] add analytics for copy prompt --- src/lib/actions/analytics.ts | 3 ++- .../overview/platforms/llmBanner.svelte | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index b511e59c8..44cd6ec68 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -195,7 +195,8 @@ export enum Click { VariablesCreateClick = 'click_variable_create', VariablesUpdateClick = 'click_variable_update', VariablesImportClick = 'click_variable_import', - WebsiteOpenClick = 'click_open_website' + WebsiteOpenClick = 'click_open_website', + CopyPromptStarterKitClick = 'click_copy_prompt_starter_kit' } export enum Submit { diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte index caf7156ac..dc207f4bc 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte @@ -4,6 +4,7 @@ import { Alert, Typography } from '@appwrite.io/pink-svelte'; import { addNotification } from '$lib/stores/notifications'; import { buildPlatformConfig, generatePromptFromConfig, type LLMPromptConfig } from './store'; + import { Click, trackEvent } from '$lib/actions/analytics'; let { platform, @@ -26,6 +27,10 @@ async function copyPrompt() { await copy(prompt); + trackEvent(Click.CopyPromptStarterKitClick, { + platform: config.title + }); + addNotification({ type: 'success', message: 'Prompt copied to clipboard'