Skip to content

Commit 586d865

Browse files
committed
Update Vercel migration guide
1 parent bcfdf49 commit 586d865

File tree

1 file changed

+19
-86
lines changed

1 file changed

+19
-86
lines changed

src/routes/docs/products/sites/migrations/vercel/+page.markdoc

Lines changed: 19 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,19 @@ Next, create a new site by connecting your existing repository:
6363
1. In your Appwrite project, select **Sites** from the sidebar
6464
2. Click **Create Site**
6565
3. Select **Connect a repository**
66-
4. Authenticate with your Git provider (GitHub, GitLab, or Bitbucket)
66+
4. Authenticate with GitHub
6767
5. Select the repository containing your Vercel project
68-
6. Choose your production branch (typically `main` or `master`)
68+
6. Choose your production branch (typically `main`)
6969

7070
Appwrite will auto-detect your framework. Verify this is correct or select manually from the dropdown menu.
7171
{% /section %}
7272

7373
# Configure your domain
7474

75-
One of the most significant differences between Vercel and Appwrite is how they handle domain configuration, particularly for apex domains.
76-
77-
# Domain setup comparison
78-
79-
{% only_dark %}
80-
![Domain configuration](/images/docs/sites/dark/add-domain.png)
81-
{% /only_dark %}
82-
{% only_light %}
83-
![Domain configuration](/images/docs/sites/add-domain.png)
84-
{% /only_light %}
75+
One of the differences between Vercel and Appwrite is how they handle domain configuration for apex domains. Vercel uses A records for apex domains, while Appwrite uses nameserver (NS) records. This means you'll need to delegate DNS management to Appwrite.
8576

8677
# Migrating an apex domain
8778

88-
Vercel uses A records for apex domains, while Appwrite uses nameserver (NS) records. This means you'll need to delegate DNS management to Appwrite.
89-
9079
{% section id="prepare-vercel-domain" step=1 title="Prepare your Vercel domain" %}
9180
Before migrating, document your current Vercel DNS configuration:
9281

@@ -185,10 +174,10 @@ Navigate to your site > **Settings** > **Build settings** and configure the foll
185174
- **Rendering:** Select the appropriate rendering mode (Static or SSR)
186175

187176
{% only_dark %}
188-
![Build settings](/images/docs/sites/dark/build-settings.png)
177+
![Build settings](/images/docs/sites/dark/build-settings-install-command.png)
189178
{% /only_dark %}
190179
{% only_light %}
191-
![Build settings](/images/docs/sites/build-settings.png)
180+
![Build settings](/images/docs/sites/build-settings-install-command.png)
192181
{% /only_light %}
193182
{% /section %}
194183

@@ -256,15 +245,15 @@ Vercel automatically provides system variables like `VERCEL_URL`. You'll need to
256245

257246
{% section id="set-env-vars" step=2 title="Set variables in Appwrite" %}
258247
1. Navigate to your site > **Settings** > **Environment variables**
259-
2. Click **Add variable**
260-
3. Enter the key and value for each variable
261-
4. Toggle **Encrypt** for sensitive variables that should be hidden
248+
2. Click the **plus (+)** icon to add a new variable
249+
3. Enter the key and value for each variable. You can optionally import a `.env` file.
250+
4. Toggle **Secret** for sensitive variables that should be hidden
262251

263252
{% only_dark %}
264-
![Environment variables](/images/docs/sites/dark/env-vars.png)
253+
![Environment variables](/images/docs/sites/dark/env-variables.png)
265254
{% /only_dark %}
266255
{% only_light %}
267-
![Environment variables](/images/docs/sites/env-vars.png)
256+
![Environment variables](/images/docs/sites/env-variables.png)
268257
{% /only_light %}
269258
{% /section %}
270259

@@ -372,54 +361,12 @@ export default {
372361
```
373362
{% /section %}
374363

375-
# Configure custom headers
376-
377-
Vercel allows setting custom headers at the platform level through `vercel.json`. Appwrite Sites supports custom headers through your framework's built-in configuration mechanisms.
378-
379-
{% section id="framework-headers" step=1 title="Framework-specific headers" %}
380-
# Next.js
381-
```javascript
382-
// next.config.js
383-
module.exports = {
384-
async headers() {
385-
return [
386-
{
387-
source: '/:path*',
388-
headers: [
389-
{
390-
key: 'X-Custom-Header',
391-
value: 'header-value',
392-
},
393-
],
394-
},
395-
];
396-
},
397-
};
398-
```
399-
400-
# SvelteKit
401-
```javascript
402-
// src/hooks.server.js
403-
export function handle({ event, resolve }) {
404-
return resolve(event, {
405-
transformPageChunk: ({ html }) => html,
406-
preload: {},
407-
filterSerializedResponseHeaders: (name) => true,
408-
responseHeaders: { 'X-Custom-Header': 'header-value' }
409-
});
410-
}
411-
```
412-
413-
# Static sites
414-
For static sites without framework support, consider using client-side solutions or framework-specific configuration files if your static site generator supports them.
415-
{% /section %}
416-
417364
# Migrate serverless functions
418365

419366
There are two approaches to serverless functions when migrating from Vercel to Appwrite:
420367

421368
{% info title="Framework API routes vs. standalone functions" %}
422-
When using frameworks like Next.js, Nuxt, or SvelteKit with SSR enabled, your API routes will work natively within Appwrite Sites, just as they do in Vercel. For standalone serverless functions or more complex use cases, you can use Appwrite Functions as a separate service.
369+
When using frameworks like Next.js, Nuxt, or SvelteKit with SSR enabled, your API routes will work natively within Appwrite Sites, just as they do in Vercel. For standalone serverless functions or more complex use cases, you can use [Appwrite Functions](/docs/functions).
423370
{% /info %}
424371

425372
{% section id="framework-api-routes" step=1 title="Framework API routes" %}
@@ -440,15 +387,12 @@ For standalone serverless functions or more complex use cases:
440387
3. Select a runtime that matches your needs (Node.js, Python, PHP, Ruby, etc.)
441388
4. Create your function code
442389
5. Deploy your function
443-
444-
{% only_dark %}
445-
![Appwrite Functions](/images/docs/functions/dark/create-function.png)
446-
{% /only_dark %}
447-
{% only_light %}
448-
![Appwrite Functions](/images/docs/functions/create-function.png)
449-
{% /only_light %}
450390
{% /section %}
451391

392+
{% arrow_link href="/docs/products/functions/quick-start" %}
393+
Learn how to create and deploy functions
394+
{% /arrow_link %}
395+
452396
{% section id="update-endpoints" step=3 title="API endpoints usage" %}
453397

454398
# Framework API routes
@@ -474,7 +418,7 @@ If you're using standalone Appwrite Functions (outside your site's codebase), yo
474418
import { Client, Functions } from 'appwrite';
475419

476420
const client = new Client()
477-
.setEndpoint('https://cloud.appwrite.io/v1')
421+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
478422
.setProject('your-project-id');
479423

480424
const functions = new Functions(client);
@@ -526,24 +470,13 @@ After completing your migration from Vercel to Appwrite Sites, we recommend:
526470

527471
1. **Test thoroughly** - Verify all routes, functionality, and environment-specific features
528472
2. **Monitor performance** - Check that your site performs as expected on Appwrite
529-
3. **Set up CI/CD** - Configure automatic deployments from your repository
530-
4. **Explore Appwrite services** - Consider integrating with other Appwrite services like Authentication, Databases, and Storage
531-
532-
# Timeouts
533-
534-
Vercel has a default build timeout of 45 minutes. Appwrite Sites has a default request timeout of 15 seconds (max 30 seconds) for runtime requests, which is configurable.
535-
536-
To configure the timeout for runtime requests in Appwrite:
537-
538-
1. Navigate to your site > **Settings** > **Timeout**
539-
2. Set an appropriate time limit (in seconds, max 30)
540-
541-
For build processes, Appwrite Sites provides ample time for your builds to complete. Pro+ users benefit from express builds for quicker deployments and reduced wait times.
473+
3. **Set up CI/CD** - Appwrite already provides git integration and deployment workflows, but you can also use GitHub Actions or any other CI/CD tool to automate your deployments.
474+
4. **Explore Appwrite services** - Consider integrating with other Appwrite services like [Authentication](/docs/products/auth), [Databases](/docs/products/databases), and [Storage](/docs/products/storage)
542475

543476
# Conclusion
544477

545478
This guide has outlined the key steps for migrating from Vercel to Appwrite Sites. You'll find that Git integration and deployment workflows remain largely familiar, making these aspects of migration more approachable for most projects.
546479

547480
While domain configuration and platform-specific features like middleware require some adaptation, the framework-native approaches detailed in this guide help ensure a smooth transition.
548481

549-
For additional help, refer to the [Appwrite documentation](/docs/products/sites) or reach out to the [Appwrite community](https://appwrite.io/discord).
482+
For additional help, refer to the [Sites documentation](/docs/products/sites) or reach out to the Appwrite community on [Discord](https://appwrite.io/discord).

0 commit comments

Comments
 (0)