From 0de0aa1c4dcedb217956d4546e8c2a9974645459 Mon Sep 17 00:00:00 2001 From: Atharva Deosthale Date: Wed, 19 Nov 2025 02:21:31 +0530 Subject: [PATCH] add one click deployment docs --- src/routes/deploy/+server.ts | 28 ++++ .../docs/products/functions/+layout.svelte | 4 + .../one-click-deployment/+page.markdoc | 123 ++++++++++++++++++ src/routes/docs/products/sites/+layout.svelte | 4 + .../sites/one-click-deployment/+page.markdoc | 123 ++++++++++++++++++ static/images/deploy/dark.svg | 20 +++ static/images/deploy/light.svg | 20 +++ 7 files changed, 322 insertions(+) create mode 100644 src/routes/deploy/+server.ts create mode 100644 src/routes/docs/products/functions/one-click-deployment/+page.markdoc create mode 100644 src/routes/docs/products/sites/one-click-deployment/+page.markdoc create mode 100644 static/images/deploy/dark.svg create mode 100644 static/images/deploy/light.svg diff --git a/src/routes/deploy/+server.ts b/src/routes/deploy/+server.ts new file mode 100644 index 0000000000..acb98ef896 --- /dev/null +++ b/src/routes/deploy/+server.ts @@ -0,0 +1,28 @@ +import type { RequestHandler } from '@sveltejs/kit'; +import { readFile } from 'fs/promises'; +import { join } from 'path'; + +export const GET: RequestHandler = async ({ url }) => { + const variant = url.searchParams.get('variant') || 'dark'; + const filename = variant === 'light' ? 'light.svg' : 'dark.svg'; + const filePath = join(process.cwd(), 'static', 'images', 'deploy', filename); + + try { + const svgContent = await readFile(filePath, 'utf-8'); + + return new Response(svgContent, { + headers: { + 'Content-Type': 'image/svg+xml', + 'Cache-Control': 'public, max-age=31536000, immutable' + } + }); + } catch { + return new Response('SVG file not found', { + status: 404, + headers: { + 'Content-Type': 'text/plain' + } + }); + } +}; + diff --git a/src/routes/docs/products/functions/+layout.svelte b/src/routes/docs/products/functions/+layout.svelte index 0dcc198176..ecbd0e13a3 100644 --- a/src/routes/docs/products/functions/+layout.svelte +++ b/src/routes/docs/products/functions/+layout.svelte @@ -72,6 +72,10 @@ { label: 'Execute', href: '/docs/products/functions/execute' + }, + { + label: 'One-Click Deployment', + href: '/docs/products/functions/one-click-deployment' } ] }, diff --git a/src/routes/docs/products/functions/one-click-deployment/+page.markdoc b/src/routes/docs/products/functions/one-click-deployment/+page.markdoc new file mode 100644 index 0000000000..3688e314bb --- /dev/null +++ b/src/routes/docs/products/functions/one-click-deployment/+page.markdoc @@ -0,0 +1,123 @@ +--- +layout: article +title: One-Click Deployment +description: Make your function available to deploy with one click for other users. +--- + +Appwrite allows you to make your function available to deploy with one click for other users. This is useful if your function is a template or an open-source project. Using one-click deployment link will ensure your function is easy to setup and deploy for other users, with you providing all the necessary information and configuration. + +You may add the deploy link to your GitHub repository's README file or any other documentation you may have. + +# The deploy button {% #the-deploy-button %} + +You may use the deploy button wherever you want to display a button to deploy your function with Appwrite. The button is hosted on the following URL: + +```text +https://appwrite.io/deploy +``` + +By default, the button will be displayed in dark mode. You may change the mode by appending `?variant=light` to the URL. + +# Create deployment link {% #create-deployment-link %} + +You may construct the deploy URL by using the following URL: + +```text +https://cloud.appwrite.io/console/functions/deploy?repo=[GITHUB_REPO_URL] +``` + +If you are self-hosting Appwrite, you may point the URL to your Appwrite instance. + +# Deployment parameters {% #deployment-parameters %} + +You can customize the deployment link by adding query parameters to the URL. The following parameters are available: + +{% table %} +- Parameter +- Description +--- +- `repo` / `repository` +- GitHub repository URL. One of these must be present whenever `template` is absent. +--- +- `name` +- Optional string to override the displayed function name (defaults to the repository name). +--- +- `env` +- Comma-separated list of environment variable keys (e.g., `?env=ENV1,ENV2`). +--- +- `rootDir` +- Optional string to set the root directory. +--- +- `entrypoint` +- Optional string to set the entrypoint file. +--- +- `runtime` +- Optional string to override the runtime (defaults to `node-18.0`). +--- +- `install` +- Optional string to override the install command. +--- +- `build` +- Optional string to override the build command. +--- +- `output` +- Optional string to override the output directory. +{% /table %} + +# Runtimes {% #runtimes %} + +You can provide the runtime to be used with the provided function. Appwrite Functions supports the following runtimes: + +{% table %} +- Language +- Runtime Values +--- +- Node.js +- `node-14.5`, `node-16.0`, `node-18.0`, `node-19.0`, `node-20.0`, `node-21.0`, `node-22` +--- +- PHP +- `php-8.0`, `php-8.1`, `php-8.2`, `php-8.3` +--- +- Ruby +- `ruby-3.0`, `ruby-3.1`, `ruby-3.2`, `ruby-3.3` +--- +- Python +- `python-3.8`, `python-3.9`, `python-3.10`, `python-3.11`, `python-3.12` +--- +- Python (ML) +- `python-ml-3.11`, `python-ml-3.12` +--- +- Deno +- `deno-1.40`, `deno-1.46`, `deno-2.0` +--- +- Dart +- `dart-2.15`, `dart-2.16`, `dart-2.17`, `dart-2.18`, `dart-2.19`, `dart-3.0`, `dart-3.1`, `dart-3.3`, `dart-3.5`, `dart-3.8` +--- +- .NET +- `dotnet-6.0`, `dotnet-7.0`, `dotnet-8.0` +--- +- Java +- `java-8.0`, `java-11.0`, `java-17.0`, `java-18.0`, `java-21.0`, `java-22` +--- +- Swift +- `swift-5.5`, `swift-5.8`, `swift-5.9`, `swift-5.10` +--- +- Kotlin +- `kotlin-1.6`, `kotlin-1.8`, `kotlin-1.9`, `kotlin-2.0` +--- +- C++ +- `cpp-17`, `cpp-20` +--- +- Bun +- `bun-1.0`, `bun-1.1` +--- +- Go +- `go-1.23` +--- +- Static +- `static-1` +--- +- Flutter +- `flutter-3.24`, `flutter-3.27`, `flutter-3.29`, `flutter-3.32` +{% /table %} + diff --git a/src/routes/docs/products/sites/+layout.svelte b/src/routes/docs/products/sites/+layout.svelte index 872e412b84..19b2a8ba58 100644 --- a/src/routes/docs/products/sites/+layout.svelte +++ b/src/routes/docs/products/sites/+layout.svelte @@ -76,6 +76,10 @@ { label: 'Deploy manually', href: '/docs/products/sites/deploy-manually' + }, + { + label: 'One-Click Deployment', + href: '/docs/products/sites/one-click-deployment' } ] }, diff --git a/src/routes/docs/products/sites/one-click-deployment/+page.markdoc b/src/routes/docs/products/sites/one-click-deployment/+page.markdoc new file mode 100644 index 0000000000..9df2bc7898 --- /dev/null +++ b/src/routes/docs/products/sites/one-click-deployment/+page.markdoc @@ -0,0 +1,123 @@ +--- +layout: article +title: One-Click Deployment +description: Make your site available to deploy with one click for other users. +--- + +Appwrite allows you to make your site available to deploy with one click for other users. This is useful if your site is a template or an open-source project. Using one-click deployment link will ensure your site is easy to setup and deploy for other users, with you providing all the necessary information and configuration. + +You may add the deploy link to your GitHub repository's README file or any other documentation you may have. + +# The deploy button {% #the-deploy-button %} + +You may use the deploy button wherever you want to display a button to deploy your site with Appwrite. The button is hosted on the following URL: + +```text +https://appwrite.io/deploy +``` + +By default, the button will be displayed in dark mode. You may change the mode by appending `?variant=light` to the URL. + +# Create deployment link {% #create-deployment-link %} + +You may construct the deploy URL by using the following URL: + +```text +https://cloud.appwrite.io/console/sites/deploy?repo=[GITHUB_REPO_URL] +``` + +If you are self-hosting Appwrite, you may point the URL to your Appwrite instance. + +# Deployment parameters {% #deployment-parameters %} + +You can customize the deployment link by adding query parameters to the URL. The following parameters are available: + +{% table %} +- Parameter +- Description +--- +- `repo` / `repository` +- GitHub repository URL. One of these must be present whenever `template` is absent. +--- +- `template` +- Required when launching from a curated template; expects a Sites template ID such as `starter-for-nextjs`. Not needed if `repo` is present. +--- +- `name` +- Optional string to override the displayed project/site name (defaults to template or repo name). Only shown when `screenshot` is present. +--- +- `tagline` +- Optional short description surfaced in the deploy card (defaults to template tagline when available). Only shown when `screenshot` is present. +--- +- `screenshot` +- Optional image URL to preview the template/repo. +--- +- `env` +- Comma-separated list of environment variable keys (e.g., `?env=ENV1,ENV2`). +--- +- `preset` +- Optional string to override the framework preset (defaults to `nextjs`). +--- +- `install` +- Optional string to override the install command. +--- +- `build` +- Optional string to override the build command. +--- +- `output` +- Optional string to override the output directory. +{% /table %} + +# Presets {% #presets %} + +Appwrite Sites supports the following framework presets. By default, Appwrite will consider the framework of your repository to be Next.js. + +{% table %} +- Preset +- Value +--- +- Analog +- `analog` +--- +- Angular +- `angular` +--- +- Next.js +- `nextjs` +--- +- React +- `react` +--- +- Nuxt +- `nuxt` +--- +- Vue +- `vue` +--- +- SvelteKit +- `sveltekit` +--- +- Astro +- `astro` +--- +- TanStack Start +- `tanstack-start` +--- +- Remix +- `remix` +--- +- Lynx +- `lynx` +--- +- Flutter +- `flutter` +--- +- React Native +- `react-native` +--- +- Vite +- `vite` +--- +- Other +- `other` +{% /table %} + diff --git a/static/images/deploy/dark.svg b/static/images/deploy/dark.svg new file mode 100644 index 0000000000..89223b1e42 --- /dev/null +++ b/static/images/deploy/dark.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/deploy/light.svg b/static/images/deploy/light.svg new file mode 100644 index 0000000000..4bd8e4b996 --- /dev/null +++ b/static/images/deploy/light.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + +