> For the complete documentation index, see [llms.txt](https://payana-saas.gitbook.io/payana-saas-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://payana-saas.gitbook.io/payana-saas-docs/deployment/frontend.md).

# Deploy Frontend (Vercel)

Vercel auto-detect Next.js — proses ini jauh lebih ringkas dari Azure.

## Langkah-langkah

1. Login ke [vercel.com](https://vercel.com) pakai akun GitHub.
2. **New Project** → import repo `payana-frontend`.
3. Framework Preset otomatis terdeteksi sebagai **Next.js** — tidak perlu diubah.
4. Tambahkan Environment Variables untuk **Production** (daftar lengkap: [Variabel Lingkungan](/payana-saas-docs/dokumentasi-teknis/variabel-lingkungan.md)) — terutama `NEXT_PUBLIC_BACKEND_URL` dan `NEXT_PUBLIC_PONDER_URL` yang harus menunjuk ke URL Azure App Service dari langkah sebelumnya.
5. **Deploy.**

## Setelah live

* Setiap push ke branch utama otomatis redeploy production.
* Setiap branch/PR lain otomatis dapat preview deployment sendiri — gratis, tanpa konfigurasi tambahan.
* Rollback tersedia satu klik dari dashboard Deployments — tidak perlu command line.

## Menyambungkan balik ke backend

Setelah frontend live dan punya domain final, kembali ke App Settings backend di Azure dan set `FRONTEND_URL` ke domain Vercel itu — dipakai untuk validasi CORS. Backend hanya menerima **satu** origin persis (lihat kode di `payana-backend/src/index.ts`), jadi domain harus sama persis termasuk `https://` dan tanpa garis miring di akhir.

{% hint style="info" %}
Kalau kamu butuh preview deployment Vercel (`*.vercel.app` per-branch) juga bisa memanggil backend, itu butuh perubahan kecil di backend untuk menerima banyak origin atau pola wildcard — bukan konfigurasi bawaan saat ini.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://payana-saas.gitbook.io/payana-saas-docs/deployment/frontend.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
