From cdc3cb23ec9b53403d6e8770c985e7e777332775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 21 Feb 2025 09:58:24 +0100 Subject: [PATCH 1/4] React starter template --- app/config/frameworks.php | 18 +++++++++++ app/config/site-templates.php | 60 +++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/app/config/frameworks.php b/app/config/frameworks.php index d19262ff57..c6871663a6 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -44,6 +44,24 @@ return [ ] ] ], + 'react' => [ + 'key' => 'react', + 'name' => 'React', + 'buildRuntime' => 'ssr-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + 'envCommand' => '', + 'fallbackFile' => 'index.html' + ] + ] + ], 'nuxt' => [ 'key' => 'nuxt', 'name' => 'Nuxt', diff --git a/app/config/site-templates.php b/app/config/site-templates.php index 64d8cf3729..f37be17cfe 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -79,6 +79,25 @@ const TEMPLATE_FRAMEWORKS = [ 'adapter' => 'static', 'fallbackFile' => null, ], + 'OTHER' => [ + 'key' => 'other', + 'name' => 'Other', + 'installCommand' => 'npm install', + 'buildCommand' => 'npm run build', + 'buildRuntime' => 'ssr-22', + 'adapter' => 'static', + 'fallbackFile' => 'index.html', + ], + 'REACT' => [ + 'key' => 'react', + 'name' => 'React', + 'installCommand' => 'npm install', + 'buildCommand' => 'npm run build', + 'buildRuntime' => 'ssr-22', + 'adapter' => 'static', + 'outputDirectory' => './dist', + 'fallbackFile' => 'index.html', + ], ]; function getFramework(string $frameworkEnum, array $overrides) @@ -129,6 +148,47 @@ return [ ], ] ], + [ + 'key' => 'starter-for-react', + 'name' => 'React starter', + 'useCases' => ['starter'], + 'demoImage' => $url . '/console/images/sites/templates/starter-for-react.png', + 'frameworks' => [ + getFramework('REACT', [ + 'providerRootDirectory' => './', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'starter-for-react', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.1.*', + 'variables' => [ + [ + 'name' => 'VITE_APPWRITE_ENDPOINT', + 'description' => 'Endpoint of Appwrite server', + 'value' => '{apiEndpoint}', + 'placeholder' => '{apiEndpoint}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_ID', + 'description' => 'Your Appwrite project ID', + 'value' => '{projectId}', + 'placeholder' => '{projectId}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_NAME', + 'description' => 'Your Appwrite project name', + 'value' => '{projectName}', + 'placeholder' => '{projectName}', + 'required' => true, + 'type' => 'text' + ], + ] + ], [ 'key' => 'starter-for-nextjs', 'name' => 'Next.js starter', diff --git a/docker-compose.yml b/docker-compose.yml index 6dec6e3918..6ad6182bc6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -205,7 +205,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.3.0-sites-rc.9 + image: appwrite/console:5.3.0-sites-rc.10 restart: unless-stopped networks: - appwrite From ede068d5f42d5eeb95d7721c0a755e6caa107632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 21 Feb 2025 10:51:53 +0100 Subject: [PATCH 2/4] Add react native, vue template --- app/config/frameworks.php | 18 +++++++ app/config/site-templates.php | 52 +++++++++++++++++++ .../specs/open-api3-latest-console.json | 4 ++ app/config/specs/open-api3-latest-server.json | 4 ++ app/config/specs/swagger2-latest-console.json | 4 ++ app/config/specs/swagger2-latest-server.json | 4 ++ 6 files changed, 86 insertions(+) diff --git a/app/config/frameworks.php b/app/config/frameworks.php index c6871663a6..bd872001b0 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -88,6 +88,24 @@ return [ ] ] ], + 'vue' => [ + 'key' => 'vue', + 'name' => 'Vue.js', + 'buildRuntime' => 'ssr-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + 'envCommand' => '', + 'fallbackFile' => 'index.html' + ] + ] + ], 'sveltekit' => [ 'key' => 'sveltekit', 'name' => 'SvelteKit', diff --git a/app/config/site-templates.php b/app/config/site-templates.php index f37be17cfe..ff62bb1727 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -98,6 +98,16 @@ const TEMPLATE_FRAMEWORKS = [ 'outputDirectory' => './dist', 'fallbackFile' => 'index.html', ], + 'VUE' => [ + 'key' => 'vue', + 'name' => 'Vue.js', + 'installCommand' => 'npm install', + 'buildCommand' => 'npm run build', + 'buildRuntime' => 'ssr-22', + 'adapter' => 'static', + 'outputDirectory' => './dist', + 'fallbackFile' => 'index.html', + ], ]; function getFramework(string $frameworkEnum, array $overrides) @@ -189,6 +199,48 @@ return [ ], ] ], + [ + 'key' => 'starter-for-react-native', + 'name' => 'React Native starter', + 'useCases' => ['starter'], + 'demoImage' => $url . '/console/images/sites/templates/starter-for-react-native.png', + 'frameworks' => [ + getFramework('REACT', [ + 'providerRootDirectory' => './', + 'fallbackFile' => '+not-found.html', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'starter-for-react-native', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.1.*', + 'variables' => [ + [ + 'name' => 'VITE_APPWRITE_ENDPOINT', + 'description' => 'Endpoint of Appwrite server', + 'value' => '{apiEndpoint}', + 'placeholder' => '{apiEndpoint}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_ID', + 'description' => 'Your Appwrite project ID', + 'value' => '{projectId}', + 'placeholder' => '{projectId}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_NAME', + 'description' => 'Your Appwrite project name', + 'value' => '{projectName}', + 'placeholder' => '{projectName}', + 'required' => true, + 'type' => 'text' + ], + ] + ], [ 'key' => 'starter-for-nextjs', 'name' => 'Next.js starter', diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index d51a36910c..95702eb336 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -24095,7 +24095,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", @@ -24660,7 +24662,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 5a3cf63fa1..d26cbf0d6d 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -16416,7 +16416,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", @@ -16759,7 +16761,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index bc5850aa78..4fa0961506 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -24592,7 +24592,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", @@ -25169,7 +25171,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index c5ea60e44a..baafe5ecdd 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -16892,7 +16892,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", @@ -17251,7 +17253,9 @@ "x-example": "nextjs", "enum": [ "nextjs", + "react", "nuxt", + "vue", "sveltekit", "astro", "remix", From 67d6404c70a48583ab5136dbc8acc766a4f67fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 21 Feb 2025 12:46:44 +0100 Subject: [PATCH 3/4] Add further templates --- .env | 2 +- app/config/site-templates.php | 142 +++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 55 deletions(-) diff --git a/.env b/.env index 66bc54aac9..73283cb4ff 100644 --- a/.env +++ b/.env @@ -82,7 +82,7 @@ _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_SITES_RUNTIMES=static-1,ssr-22,flutter-3.24 -_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,remix,flutter,other # TODO: Angular +_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,remix,flutter,other,react,vue # TODO: Angular _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_DELAY= _APP_MAINTENANCE_RETENTION_CACHE=2592000 diff --git a/app/config/site-templates.php b/app/config/site-templates.php index ff62bb1727..79d230bcb5 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -200,18 +200,17 @@ return [ ] ], [ - 'key' => 'starter-for-react-native', - 'name' => 'React Native starter', + 'key' => 'starter-for-vue', + 'name' => 'Vue starter', 'useCases' => ['starter'], - 'demoImage' => $url . '/console/images/sites/templates/starter-for-react-native.png', + 'demoImage' => $url . '/console/images/sites/templates/starter-for-vue.png', 'frameworks' => [ - getFramework('REACT', [ + getFramework('VUE', [ 'providerRootDirectory' => './', - 'fallbackFile' => '+not-found.html', ]), ], 'vcsProvider' => 'github', - 'providerRepositoryId' => 'starter-for-react-native', + 'providerRepositoryId' => 'starter-for-vue', 'providerOwner' => 'appwrite', 'providerVersion' => '0.1.*', 'variables' => [ @@ -241,6 +240,48 @@ return [ ], ] ], + [ + 'key' => 'starter-for-react-native', + 'name' => 'React Native starter', + 'useCases' => ['starter'], + 'demoImage' => $url . '/console/images/sites/templates/starter-for-react-native.png', + 'frameworks' => [ + getFramework('REACT', [ + 'providerRootDirectory' => './', + 'fallbackFile' => '+not-found.html', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'starter-for-react-native', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.1.*', + 'variables' => [ + [ + 'name' => 'EXPO_PUBLIC_APPWRITE_ENDPOINT', + 'description' => 'Endpoint of Appwrite server', + 'value' => '{apiEndpoint}', + 'placeholder' => '{apiEndpoint}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'EXPO_PUBLIC_APPWRITE_PROJECT_ID', + 'description' => 'Your Appwrite project ID', + 'value' => '{projectId}', + 'placeholder' => '{projectId}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'EXPO_PUBLIC_APPWRITE_PROJECT_NAME', + 'description' => 'Your Appwrite project name', + 'value' => '{projectName}', + 'placeholder' => '{projectName}', + 'required' => true, + 'type' => 'text' + ], + ] + ], [ 'key' => 'starter-for-nextjs', 'name' => 'Next.js starter', @@ -282,6 +323,47 @@ return [ ], ] ], + [ + 'key' => 'starter-for-nuxt', + 'name' => 'Nuxt starter', + 'useCases' => ['starter'], + 'demoImage' => $url . '/console/images/sites/templates/starter-for-nuxt.png', + 'frameworks' => [ + getFramework('NUXT', [ + 'providerRootDirectory' => './', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'starter-for-nuxt', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.1.*', + 'variables' => [ + [ + 'name' => 'NUXT_PUBLIC_APPWRITE_ENDPOINT', + 'description' => 'Endpoint of Appwrite server', + 'value' => '{apiEndpoint}', + 'placeholder' => '{apiEndpoint}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'NUXT_PUBLIC_APPWRITE_PROJECT_ID', + 'description' => 'Your Appwrite project ID', + 'value' => '{projectId}', + 'placeholder' => '{projectId}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'NUXT_PUBLIC_APPWRITE_PROJECT_NAME', + 'description' => 'Your Appwrite project name', + 'value' => '{projectName}', + 'placeholder' => '{projectName}', + 'required' => true, + 'type' => 'text' + ], + ] + ], [ 'key' => 'template-for-event', 'name' => 'Event template', @@ -390,54 +472,6 @@ return [ 'providerVersion' => '0.1.*', 'variables' => [] ], - [ - 'key' => 'nextjs-starter', - 'name' => 'Next.js starter', - 'useCases' => ['starter'], - 'demoImage' => '', - 'frameworks' => [ - getFramework('NEXTJS', [ - 'providerRootDirectory' => './nextjs/starter', - ]), - ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.2.*', - 'variables' => [], - ], - [ - 'key' => 'nuxt-starter', - 'name' => 'Nuxt starter', - 'useCases' => ['starter'], - 'demoImage' => '', - 'frameworks' => [ - getFramework('NUXT', [ - 'providerRootDirectory' => './nuxt/starter', - ]), - ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.2.*', - 'variables' => [], - ], - [ - 'key' => 'sveltekit-starter', - 'name' => 'SvelteKit starter', - 'useCases' => ['starter'], - 'demoImage' => '', - 'frameworks' => [ - getFramework('SVELTEKIT', [ - 'providerRootDirectory' => './sveltekit/starter', - ]), - ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.2.*', - 'variables' => [], - ], [ 'key' => 'astro-starter', 'name' => 'Astro starter', From 26c99dca8452543f20e8bbf798f7360d42d43dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 21 Feb 2025 18:55:59 +0100 Subject: [PATCH 4/4] Add onelink template --- app/config/site-templates.php | 19 +++++++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/config/site-templates.php b/app/config/site-templates.php index 79d230bcb5..fbd4732573 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -117,6 +117,25 @@ function getFramework(string $frameworkEnum, array $overrides) } return [ + [ + 'key' => 'template-for-onelink', + 'name' => 'Onelink template', + 'useCases' => ['starter'], + 'demoImage' => $url . '/console/images/sites/templates/template-for-onelink.png', + 'frameworks' => [ + getFramework('NUXT', [ + 'providerRootDirectory' => './onelink', + 'buildCommand' => 'npm run generate', + 'outputDirectory' => './dist', + 'adapter' => 'static', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates-for-sites', + 'providerOwner' => 'Meldiron', + 'providerVersion' => '0.1.*', + 'variables' => [] + ], [ 'key' => 'starter-for-svelte', 'name' => 'Svelte starter', diff --git a/docker-compose.yml b/docker-compose.yml index 6ad6182bc6..63f4514d47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -205,7 +205,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.3.0-sites-rc.10 + image: appwrite/console:5.3.0-sites-rc.11 restart: unless-stopped networks: - appwrite