[{"data":1,"prerenderedAt":530},["ShallowReactive",2],{"navigation_docs":3,"-docs-getting-started-deployment":64,"-docs-getting-started-deployment-surround":525},[4,29,49],{"title":5,"path":6,"stem":7,"children":8,"page":28},"Getting Started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction","i-lucide-house",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F1.getting-started\u002F2.installation","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Configuration","\u002Fdocs\u002Fgetting-started\u002Fconfiguration","docs\u002F1.getting-started\u002F3.configuration","i-lucide-sliders-horizontal",{"title":25,"path":26,"stem":27,"icon":18},"Deployment","\u002Fdocs\u002Fgetting-started\u002Fdeployment","docs\u002F1.getting-started\u002F4.deployment",false,{"title":30,"path":31,"stem":32,"children":33,"page":28},"Architecture","\u002Fdocs\u002Farchitecture","docs\u002F2.architecture",[34,39,44],{"title":35,"path":36,"stem":37,"icon":38},"Layers","\u002Fdocs\u002Farchitecture\u002Flayers","docs\u002F2.architecture\u002F1.layers","i-lucide-layers",{"title":40,"path":41,"stem":42,"icon":43},"Multi-tenancy","\u002Fdocs\u002Farchitecture\u002Fmulti-tenancy","docs\u002F2.architecture\u002F2.multi-tenancy","i-lucide-building-2",{"title":45,"path":46,"stem":47,"icon":48},"Testing","\u002Fdocs\u002Farchitecture\u002Ftesting","docs\u002F2.architecture\u002F3.testing","i-lucide-flask-conical",{"title":50,"path":51,"stem":52,"children":53,"page":28},"Reference","\u002Fdocs\u002Freference","docs\u002F3.reference",[54,59],{"title":55,"path":56,"stem":57,"icon":58},"Commands","\u002Fdocs\u002Freference\u002Fcommands","docs\u002F3.reference\u002F1.commands","i-lucide-terminal",{"title":60,"path":61,"stem":62,"icon":63},"Decisions","\u002Fdocs\u002Freference\u002Fdecisions","docs\u002F3.reference\u002F2.decisions","i-lucide-git-branch",{"id":65,"title":25,"body":66,"description":518,"extension":519,"links":520,"meta":521,"navigation":522,"path":26,"seo":523,"stem":27,"__hash__":524},"docs\u002Fdocs\u002F1.getting-started\u002F4.deployment.md",{"type":67,"value":68,"toc":505},"minimark",[69,73,78,81,199,203,206,276,286,294,298,309,313,385,399,403,406,450,464,468,471,498,501],[70,71,72],"p",{},"The build output is Nitro, so the app is not tied to a host. Vercel is the\ndefault because that is where it is tested; everything below works the same\nanywhere Nitro has a preset.",[74,75,77],"h2",{"id":76},"the-order-that-matters","The order that matters",[70,79,80],{},"Deploying the app before the database exists is the usual way to lose an\nafternoon. Do it in this order:",[82,83,85,90,93,97,153,168,172,179,183],"steps",{"level":84},"3",[86,87,89],"h3",{"id":88},"create-the-hosted-supabase-project","Create the hosted Supabase project",[70,91,92],{},"Note the project ref, the URL, the anon key and the service-role key.",[86,94,96],{"id":95},"push-the-schema","Push the schema",[98,99,104],"pre",{"className":100,"code":101,"language":102,"meta":103,"style":103},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm supabase link --project-ref \u003Cyour-ref>\npnpm supabase db push\n","bash","",[105,106,107,140],"code",{"__ignoreMap":103},[108,109,112,116,120,123,126,130,133,137],"span",{"class":110,"line":111},"line",1,[108,113,115],{"class":114},"sBMFI","pnpm",[108,117,119],{"class":118},"sfazB"," supabase",[108,121,122],{"class":118}," link",[108,124,125],{"class":118}," --project-ref",[108,127,129],{"class":128},"sMK4o"," \u003C",[108,131,132],{"class":118},"your-re",[108,134,136],{"class":135},"sTEyZ","f",[108,138,139],{"class":128},">\n",[108,141,143,145,147,150],{"class":110,"line":142},2,[108,144,115],{"class":114},[108,146,119],{"class":118},[108,148,149],{"class":118}," db",[108,151,152],{"class":118}," push\n",[70,154,155,158,159,162,163,167],{},[105,156,157],{},"db push"," applies the migrations in ",[105,160,161],{},"supabase\u002Fmigrations\u002F"," in order. It does\n",[164,165,166],"strong",{},"not"," run the seed — a production database should not contain the demo tenant.",[86,169,171],{"id":170},"set-the-environment-variables","Set the environment variables",[70,173,174,175,178],{},"Whatever your host calls them. ",[105,176,177],{},"pnpm doctor"," reads the same manifest the setup\nwizard writes, so run it locally against your production values first if you\nwant the mistakes to surface on your machine.",[86,180,182],{"id":181},"deploy","Deploy",[98,184,186],{"className":100,"code":185,"language":102,"meta":103,"style":103},"pnpm build     # Nitro output in .output\u002F\n",[105,187,188],{"__ignoreMap":103},[108,189,190,192,195],{"class":110,"line":111},[108,191,115],{"class":114},[108,193,194],{"class":118}," build",[108,196,198],{"class":197},"sHwdD","     # Nitro output in .output\u002F\n",[74,200,202],{"id":201},"environment-variables","Environment variables",[70,204,205],{},"Everything is off unless its flag is set, so a first deploy needs only the\nSupabase keys. Add subsystems once the thing is up.",[207,208,209,222],"table",{},[210,211,212],"thead",{},[213,214,215,219],"tr",{},[216,217,218],"th",{},"Variable",[216,220,221],{},"Notes",[223,224,225,236,246,256,266],"tbody",{},[213,226,227,233],{},[228,229,230],"td",{},[105,231,232],{},"SUPABASE_URL",[228,234,235],{},"From the hosted project",[213,237,238,243],{},[228,239,240],{},[105,241,242],{},"SUPABASE_KEY",[228,244,245],{},"The anon\u002Fpublishable key",[213,247,248,253],{},[228,249,250],{},[105,251,252],{},"SUPABASE_SERVICE_ROLE_KEY",[228,254,255],{},"Server-only. Never expose it to the client.",[213,257,258,263],{},[228,259,260],{},[105,261,262],{},"NUXT_SUPABASE_SECRET_KEY",[228,264,265],{},"Server-only",[213,267,268,273],{},[228,269,270],{},[105,271,272],{},"NUXT_PUBLIC_SITE_URL",[228,274,275],{},"Your canonical origin — used for SEO, sitemap and email links",[277,278,279,281,282,285],"caution",{},[105,280,272],{}," is easy to forget and fails quietly: emails go out with\nlinks to ",[105,283,284],{},"example.com"," and canonicals point at the wrong origin. Set it before\nyou enable notifications.",[70,287,288,289,293],{},"The full subsystem list, with which ones need a third-party account, is on the\n",[290,291,292],"a",{"href":21},"configuration page",".",[74,295,297],{"id":296},"auth-redirect-urls","Auth redirect URLs",[70,299,300,301,304,305,308],{},"Supabase rejects OAuth callbacks and password-reset links that point anywhere it\nwas not told about. In the hosted dashboard, under ",[164,302,303],{},"Authentication → URL\nConfiguration",", set the site URL to your origin and add your callback to the\nredirect allow-list. Locally this is handled by ",[105,306,307],{},"supabase\u002Fconfig.toml","; hosted,\nit is not read.",[74,310,312],{"id":311},"choosing-a-host","Choosing a host",[207,314,315,327],{},[210,316,317],{},[213,318,319,322,325],{},[216,320,321],{},"Host",[216,323,324],{},"Preset",[216,326,221],{},[223,328,329,344,357,369],{},[213,330,331,334,337],{},[228,332,333],{},"Vercel",[228,335,336],{},"auto-detected",[228,338,339,340,343],{},"The default. ",[105,341,342],{},"@vercel\u002Fanalytics"," and speed-insights no-op elsewhere.",[213,345,346,349,354],{},[228,347,348],{},"Cloudflare",[228,350,351],{},[105,352,353],{},"cloudflare-pages",[228,355,356],{},"This documentation site runs on it.",[213,358,359,362,367],{},[228,360,361],{},"Netlify",[228,363,364],{},[105,365,366],{},"netlify",[228,368],{},[213,370,371,374,379],{},[228,372,373],{},"Node \u002F Docker",[228,375,376],{},[105,377,378],{},"node-server",[228,380,381,384],{},[105,382,383],{},".output\u002Fserver\u002Findex.mjs"," and a process manager",[70,386,387,388,391,392,395,396,293],{},"Set one with ",[105,389,390],{},"NITRO_PRESET",", or in ",[105,393,394],{},"nuxt.config.ts"," under ",[105,397,398],{},"nitro.preset",[74,400,402],{"id":401},"migrations-after-the-first-deploy","Migrations after the first deploy",[70,404,405],{},"Never edit a migration that has been applied to a real database — add a new one.\nAfter changing the schema, regenerate the types or the build fails:",[98,407,409],{"className":100,"code":408,"language":102,"meta":103,"style":103},"pnpm supabase migration new add_something\n# edit the file, then:\npnpm supabase db push\npnpm db:types\n",[105,410,411,426,431,442],{"__ignoreMap":103},[108,412,413,415,417,420,423],{"class":110,"line":111},[108,414,115],{"class":114},[108,416,119],{"class":118},[108,418,419],{"class":118}," migration",[108,421,422],{"class":118}," new",[108,424,425],{"class":118}," add_something\n",[108,427,428],{"class":110,"line":142},[108,429,430],{"class":197},"# edit the file, then:\n",[108,432,434,436,438,440],{"class":110,"line":433},3,[108,435,115],{"class":114},[108,437,119],{"class":118},[108,439,149],{"class":118},[108,441,152],{"class":118},[108,443,445,447],{"class":110,"line":444},4,[108,446,115],{"class":114},[108,448,449],{"class":118}," db:types\n",[70,451,452,455,456,459,460,463],{},[105,453,454],{},"pnpm db:types"," regenerates ",[105,457,458],{},"shared\u002Ftypes\u002Fdatabase.types.ts"," from the ",[164,461,462],{},"local","\ndatabase, so keep local and hosted on the same migrations — that is the point of\nnever editing history.",[74,465,467],{"id":466},"webhooks","Webhooks",[70,469,470],{},"Two subsystems need the hosted project to call back into your deployment, so\nthey cannot be configured until the app has a public URL:",[472,473,474,489],"ul",{},[475,476,477,480,481,484,485,488],"li",{},[164,478,479],{},"Notifications"," — a database webhook on ",[105,482,483],{},"notifications"," INSERT pointing at\n",[105,486,487],{},"\u002Fapi\u002Fhooks\u002Fnotification-email",", with your secret header.",[475,490,491,494,495,293],{},[164,492,493],{},"Billing"," — the Polar webhook pointing at ",[105,496,497],{},"\u002Fapi\u002Fhooks\u002Fbilling",[70,499,500],{},"Both are CSRF-exempt by route rule and verified by secret in the handler\ninstead, so the secret is the only thing standing between them and the public.\nTreat it accordingly.",[502,503,504],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":103,"searchDepth":142,"depth":142,"links":506},[507,513,514,515,516,517],{"id":76,"depth":142,"text":77,"children":508},[509,510,511,512],{"id":88,"depth":433,"text":89},{"id":95,"depth":433,"text":96},{"id":170,"depth":433,"text":171},{"id":181,"depth":433,"text":182},{"id":201,"depth":142,"text":202},{"id":296,"depth":142,"text":297},{"id":311,"depth":142,"text":312},{"id":401,"depth":142,"text":402},{"id":466,"depth":142,"text":467},"Getting it onto a real domain, with a hosted database and the migrations applied.","md",null,{},{"icon":18},{"title":25,"description":518},"oRyzjxSTRsocyxJI67Ac_gyjdjabG2-fLk8PS7yAHOc",[526,528],{"title":20,"path":21,"stem":22,"description":527,"icon":23,"children":-1},"Every subsystem, its flag, and what it costs to turn on.",{"title":35,"path":36,"stem":37,"description":529,"icon":38,"children":-1},"How features are organised, and why ~ never means what you think.",1785951589169]