---
title: "Web tier ntawm Vercel"
description: "Khiav Quire web tier ntawm Vercel nrog worker koom tes."
image: "https://docs.quirelms.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.quirelms.com/hmn/llms.txt
> Use this file to discover all available pages before exploring further.

# Web tier ntawm Vercel

<span id="the-web-tier-on-vercel"></span>

Tus qauv nyob hauv ntu 5 ntawm `docs/architecture/23-ops.md`. Vercel khiav web tier xwb. Lwm yam khiav ntawm companion host uas koj tswj, thiab yuav tsum muaj.

## Xwm txheej hauv release no <!--quire:status-in-this-release-->

Kev teeb tsa twb npaj lawm (`apps/web/vercel.json`, Nitro preset `vercel` thiab kev kuaj thaum pib). Vercel xav tau file storage sib koom (`QUIRE_STORAGE_DRIVER=s3` lossis `azure`), realtime driver uas siv tau hla function instance (`QUIRE_REALTIME_DRIVER=sse` lossis `centrifugo`) thiab email provider siv HTTP. Yog tsis muaj, web tier tsis kam pib thiab log teev txhua qhov chaw uas ploj.

## Cov feem <!--quire:the-pieces-->

| Feem | Qhov chaw khiav |
| --- | --- |
| `web` | Vercel Functions, Bun runtime: nplooj, REST, MCP, LTI thiab webhook txais |
| `worker`, `scheduler`, `collab`, `content` | Companion host: Fly, Railway, ECS lossis koj Docker host nrog `docker/compose.yaml` |
| Postgres | Sab nraud, tom qab transaction pooler: Neon, Supabase lossis RDS nrog PgBouncer |
| Ntaub ntawv | S3 lossis R2. Tsis muaj disk ruaj khov |
| Background jobs | Muab tso nrog pg-boss hauv transaction thov; companion worker khiav. Yog companion worker muaj `QUIRE_QUEUE_DRIVER=vercel`, light jobs (notification tsis teem caij thiab webhook xa) mus ntawm Vercel Queues (`VERCEL_QUEUE_REGION`, `VERCEL_QUEUE_TOKEN`), kom tsis polling pooled Postgres rau lawv |
| Recurring jobs | Companion scheduler. Tsis muaj Vercel Cron route vim cron ua haujlwm hauv function yuav timeout |
| Tracing | OpenTelemetry xa rau collector, `OTEL_EXPORTER_OTLP_ENDPOINT` |

## Yam uas target no ua tsis tau <!--quire:what-this-target-cannot-do-->

Thaum pib, web tier xyuas cov no thiab tsis kam nrog npe txhua teeb meem es tsis tos email xub xa tsis tau:

- **Tsis muaj SMTP.** Vercel thaiv SMTP tawm. Teem `QUIRE_EMAIL_PROVIDER_CONFIG` ua HTTP provider (Postmark, SES, Mailgun, SendGrid lossis Resend). Tsis txais `QUIRE_SMTP_URL`.
- **Tsis muaj local disk.** Tsis txais `QUIRE_STORAGE_DRIVER=local`.
- **Tsis muaj memory sib koom ntawm kev hu.** Tsis txais `QUIRE_REALTIME_DRIVER=inprocess`. Server-sent events txwv raws function timeout; client rov txuas siv cursor, ces tsis poob event, tiam sis tsis muaj presence.
- **Tenant database pinned muaj ciam** kwv yees yim, vim txhua qhov ntxiv ib connection pool hauv environment uas sib koom pool tsis tau.

## Deploy <!--quire:deploying-->

1. Tsim Vercel project ntawm repository nrog **Root Directory** `apps/web`. `apps/web/vercel.json` teeb install/build command (`NITRO_PRESET=vercel`) thiab xa `/sw.js` tsis cache.
2. Teeb environment variables. Siv `docker/.env.example`, tsawg kawg muaj: `QUIRE_DEPLOY_TARGET=vercel`, `QUIRE_APP_ORIGIN`, `QUIRE_CONTENT_ORIGIN`, `QUIRE_PLATFORM_DOMAINS`, `QUIRE_SECRET_KEY`, `QUIRE_MASTER_KEY`, `DATABASE_URL` (chaw pooler), `QUIRE_REPORT_DATABASE_URL`, `QUIRE_AUDIT_DATABASE_URL`, `QUIRE_DATABASE_ID`, `QUIRE_EMAIL_PROVIDER_CONFIG`, `QUIRE_MAIL_FROM`, storage settings thiab `QUIRE_COLLAB_URL` nrog `QUIRE_COLLAB_SIGNING_KEY` taw rau companion collab service.
   `QUIRE_REPORT_DATABASE_URL` yuav tsum yog physical database tib lub uas `DATABASE_URL` taw rau. Rau txhua database tso npe ntxiv, ntxiv nws tus kheej `quire_report` connection URL rau environment web thiab worker, ces tso npe nws lub npe environment ua `env:NAME` hauv platform console. Analytics kaw ruaj yog report URL ploj ntawm database ntawd.
3. Hauv companion host, khiav `docker/compose.yaml` yam tsis muaj `web` service, siv tib `docker/.env`:
   ```sh
   docker compose -f docker/compose.yaml up -d migrate init worker scheduler collab content
   ```
   Migrations khiav ntawm no ua ntej txhawb Vercel deployment txhua zaus.
4. Deploy. Yog teeb tsa tsis kam, function log pib “The web tier did not start on vercel” thiab teev txhua setting uas yuav hloov.

## Upgrade <!--quire:upgrading-->

Ua migration ntawm companion host ua ntej, ces txhawb Vercel deployment tshiab, ces hloov companion workers: qhov kev txiav txim hauv [upgrade.md](/hmn/ops/upgrade/). Instant rollback ntawm Vercel thim code xwb thiab yeej nyab xeeb hauv tib release.

Source: https://docs.quirelms.com/hmn/ops/vercel/index.mdx
