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] 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