Skip to content

Conversation

@atharvadeosthale
Copy link
Member

@atharvadeosthale atharvadeosthale commented Nov 18, 2025

Summary by CodeRabbit

  • Documentation
    • Added one-click deployment guides for Functions and Sites products.
    • Documentation includes deployment parameters, configuration options, and supported runtimes/frameworks.
    • New navigation links provide convenient access to deployment documentation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

This PR introduces a one-click deployment feature for Appwrite Functions and Sites. It includes: (1) a new GET route handler that serves deployment button SVGs with light/dark variants and caching headers, (2) two new documentation pages detailing the one-click deployment process for Functions and Sites respectively, including deployment parameters, supported runtimes/presets, and deployment URL construction guidance, and (3) navigation updates to both Functions and Sites documentation layouts linking to the new deployment pages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Path resolution security: The +server.ts file constructs file paths using path.join() with a query parameter; ensure no path traversal vulnerabilities exist and variant parameter is properly validated
  • File serving and error handling: Verify the 404 response and caching headers (Cache-Control, ETag if applicable) are correctly set for SVG file serving
  • Documentation accuracy: Skim both new Markdoc pages to ensure parameter descriptions and supported runtimes/presets are correct and consistent across Functions and Sites documentation

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add documentation for one-click deployments' accurately reflects the primary changes: adding new documentation pages and navigation entries for one-click deployment features across multiple product sections (functions and sites).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch one-click-docs

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (5)
src/routes/docs/products/functions/one-click-deployment/+page.markdoc (2)

7-7: Improve clarity of the introduction.

Consider rephrasing for better readability and clarity.

Apply this diff:

-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.
+Appwrite allows you to make your function available for one-click deployment by other users. This is useful if your function is a template or an open-source project. Using a one-click deployment link ensures your function is easy to set up and deploy for other users, with you providing all the necessary information and configuration.

124-124: Remove trailing blank line.

Minor formatting cleanup.

Apply this diff:

-
src/routes/deploy/+server.ts (1)

8-8: Consider using SvelteKit's static asset handling instead of file system access.

Using process.cwd() and file system operations can be unreliable in certain deployment environments (serverless, edge functions). SvelteKit typically serves static assets directly from the static folder without requiring runtime file system access.

Consider one of these approaches:

  1. Serve the SVGs directly from /images/deploy/light.svg and /images/deploy/dark.svg without this route
  2. If dynamic serving is required, use SvelteKit's $app/paths or consider importing the SVGs as modules

If file system access is necessary, verify this works correctly in your deployment environment.

src/routes/docs/products/sites/one-click-deployment/+page.markdoc (2)

7-7: Improve clarity of the introduction.

Consider rephrasing for better readability and clarity, consistent with the Functions documentation.

Apply this diff:

-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.
+Appwrite allows you to make your site available for one-click deployment by other users. This is useful if your site is a template or an open-source project. Using a one-click deployment link ensures your site is easy to set up and deploy for other users, with you providing all the necessary information and configuration.

124-124: Remove trailing blank line.

Minor formatting cleanup.

Apply this diff:

-
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a534d62 and 0de0aa1.

⛔ Files ignored due to path filters (2)
  • static/images/deploy/dark.svg is excluded by !**/*.svg
  • static/images/deploy/light.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • src/routes/deploy/+server.ts (1 hunks)
  • src/routes/docs/products/functions/+layout.svelte (1 hunks)
  • src/routes/docs/products/functions/one-click-deployment/+page.markdoc (1 hunks)
  • src/routes/docs/products/sites/+layout.svelte (1 hunks)
  • src/routes/docs/products/sites/one-click-deployment/+page.markdoc (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-05T14:29:00.422Z
Learnt from: ItzNotABug
Repo: appwrite/website PR: 2362
File: src/routes/(marketing)/(components)/features.svelte:9-13
Timestamp: 2025-09-05T14:29:00.422Z
Learning: In the Appwrite website repository, fragment links (URLs with #anchor) in documentation are handled internally by the system and don't require explicit markdoc anchors or HTML id attributes in the source files.

Applied to files:

  • src/routes/docs/products/functions/one-click-deployment/+page.markdoc
🔇 Additional comments (6)
src/routes/docs/products/functions/+layout.svelte (1)

76-79: LGTM!

The navigation entry is correctly structured and appropriately placed in the Journeys section.

src/routes/docs/products/sites/+layout.svelte (1)

80-83: LGTM!

The navigation entry is correctly structured and appropriately placed in the Journeys section, consistent with the Functions navigation.

src/routes/deploy/+server.ts (2)

16-16: Verify the aggressive caching strategy aligns with update requirements.

The caching header max-age=31536000, immutable sets a 1-year cache that tells browsers the asset will never change. This is appropriate for versioned assets but could cause issues if you need to update the SVG files in the future.

Consider whether:

  • These SVG files will remain static indefinitely
  • You have a versioning strategy if updates are needed
  • A shorter cache duration might be more appropriate

1-27: Verify that the SVG files exist in the expected location.

Ensure the files static/images/deploy/light.svg and static/images/deploy/dark.svg exist and are included in the PR or repository.

Run the following script to verify the SVG files exist:

src/routes/docs/products/sites/one-click-deployment/+page.markdoc (2)

46-49: Clarify the conditional visibility logic for name and tagline parameters.

The statement "Only shown when screenshot is present" for both name and tagline parameters suggests UI behavior that may be confusing. Please verify whether:

  • These parameters are ignored when screenshot is absent
  • They function but aren't displayed in some UI component
  • This is the intended behavior

Consider adding clarification about what "only shown" means in this context.


72-72: Verify the default framework preset behavior.

The documentation states "By default, Appwrite will consider the framework of your repository to be Next.js." Please confirm:

  • Is Next.js always the default, or does Appwrite attempt to auto-detect the framework?
  • Is Next.js the most appropriate default choice for the majority of users?

If auto-detection is available, consider updating the documentation to reflect this capability.

@@ -0,0 +1,123 @@
---
layout: article
title: One-Click Deployment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use sentence case, not title case

Suggested change
title: One-Click Deployment
title: One-click deployment

Same goes for sites

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd confirm with Eldad if it's okay to use this path

We may want to use this in the future for something else

@@ -0,0 +1,123 @@
---
layout: article
title: One-Click Deployment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: One-Click Deployment
title: One-Click deployment

href: '/docs/products/functions/execute'
},
{
label: 'One-Click Deployment',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label: 'One-Click Deployment',
label: 'One-Click deployment',

You may construct the deploy URL by using the following URL:

```text
https://cloud.appwrite.io/console/sites/deploy?repo=[GITHUB_REPO_URL]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing region

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should work without it

href: '/docs/products/sites/deploy-manually'
},
{
label: 'One-Click Deployment',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Any reason we're not using sentence case for the title?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, I'll change that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants