[{"data":1,"prerenderedAt":55238,"buildId":55239},["ShallowReactive",2],{"$f33ruetfv481mj":3,"cmd-posts":4,"learn-landing-for-step-void":42488,"learn-siblings-void":42710,"learn-step-\u002Flearn\u002Fvoid\u002F04-box-and-cart":53506},"\u003C!DOCTYPE html>\u003Chtml class=\"VEU71W_className ac0vwq_className VEU71W_variable ac0vwq_variable overflow-hidden antialiased bg-background-100\" lang=\"en\">\u003Chead>\u003Cmeta charSet=\"utf-8\"\u002F>\u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u002F>\u003Clink rel=\"stylesheet\" href=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F27njosszeb0ql.css\" data-precedence=\"next\"\u002F>\u003Clink rel=\"stylesheet\" href=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F3irfxc3rqbnr5.css\" data-precedence=\"next\"\u002F>\u003Clink rel=\"stylesheet\" href=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1zw82rhyk70ct.css\" data-precedence=\"next\"\u002F>\u003Clink rel=\"preload\" as=\"script\" fetchPriority=\"low\" href=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F2m9pr5yfnck7-.js\"\u002F>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F16kfnfwileral.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1sdjlish60lc5.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F06lv8otyl3ed9.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002Fturbopack-0g42vbd2j-9zo.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F12d-zsaeckvdb.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F09aym5wya4o1h.js\" async=\"\">\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1s_nrw3eshilr.js\" async=\"\">\u003C\u002Fscript>\u003Cmeta name=\"next-size-adjust\" content=\"\"\u002F>\u003Ctitle>Deployment is building\u003C\u002Ftitle>\u003Clink href=\"https:\u002F\u002Fassets.vercel.com\u002Fimage\u002Fupload\u002Fq_auto\u002Ffront\u002Ffavicon\u002Fvercel\u002Fbuilding.ico\" rel=\"icon shortcut\" type=\"image\u002Fx-icon\"\u002F>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F0c0hxoamwjsbw.js\" noModule=\"\">\u003C\u002Fscript>\u003C\u002Fhead>\u003Cbody>\u003Cdiv hidden=\"\">\u003C!--$-->\u003C!--\u002F$-->\u003C\u002Fdiv>\u003Cscript id=\"theme-script\">((ve,G,Se,ye,Te,Fe,oe,Oe,Le)=>{let Xe=document.documentElement,ze=[\"light\",\"dark\"],it=Ze=>Fe?.[Ze]||Ze,lt=Array.from(new Set([...Te.map(Ze=>it(Ze)),...Object.values(Fe??{})]));function pt(Ze){var et;let ht=Array.isArray(ve)?ve:[ve],St=it(Ze);ht.forEach(vr=>{vr===\"class\"?(Xe.classList.remove(...lt),Xe.classList.add(St)):Xe.setAttribute(vr,St)}),et=Ze,Oe&&ze.includes(et)&&(Xe.style.colorScheme=et)}if(ye)pt(ye);else try{let Ze=localStorage.getItem(G)||Se,et=oe&&Ze===\"system\"?window.matchMedia(\"(prefers-color-scheme: dark)\"):null,ht=et?et.matches?\"dark\":\"light\":Ze;if(pt(ht),et){var at;let St=(at=vr=>{try{(localStorage.getItem(G)||Se)===\"system\"&&pt(vr.matches?\"dark\":\"light\")}catch{}},et.addEventListener?(et.addEventListener(\"change\",at),()=>et.removeEventListener(\"change\",at)):(et.addListener(at),()=>et.removeListener(at)));window.addEventListener(Le,St,{once:!0})}}catch{}})(\"class\",\"geist-theme\",\"system\",null,[\"light\",\"dark\"],{\"light\":\"light-theme\",\"dark\":\"dark-theme\"},true,true,\"next-themes:geist-theme:[\\\"class\\\"]:provider-mounted\")\u003C\u002Fscript>\u003C!--$-->\u003C!--\u002F$-->\u003Chead>\u003C\u002Fhead>\u003Cdiv class=\"g3_XOa_container\">\u003Cmain class=\"flex flex-col items-center justify-start gap-4 flex-initial g3_XOa_main\">\u003Cdiv class=\"flex flex-col items-center justify-center gap-4 flex-initial\">\u003Cdiv role=\"status\" aria-label=\"Loading\" data-testid=\"geistcn\u002Fspinner\" data-glyph=\"circular\" class=\"text-gray-700 relative inline-block aspect-square transform-gpu size-4 g3_XOa_spinner\" aria-hidden=\"false\" data-fade-out=\"false\">\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-900ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(0deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-800ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(36deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-700ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(72deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-600ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(108deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-500ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(144deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-400ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(180deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-300ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(216deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-200ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(252deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:-100ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(288deg) translate(146%)\">\u003C\u002Fdiv>\u003Cdiv aria-hidden=\"true\" class=\"absolute top-1\u002F2 left-1\u002F2 origin-center -translate-x-1\u002F2 -translate-y-1\u002F2 rounded-full bg-current text-current will-change-transform h-[1.5px] w-1\" style=\"--animation-delay:0ms;--animation-duration:1000ms;animation:spinner-opacity var(--animation-duration, 1.2s) linear infinite;animation-delay:var(--animation-delay, 0);transform:rotate(324deg) translate(146%)\">\u003C\u002Fdiv>\u003Cspan class=\"sr-only\">Loading...\u003C\u002Fspan>\u003C\u002Fdiv>\u003Ch1 aria-label=\"Deployment is building\" class=\"text-heading-24 g3_XOa_title\">\u003Cspan>Deployment is\u003C\u002Fspan> \u003Cspan class=\"g3_XOa_stack\">\u003Cspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.12s\">b\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.135s\">u\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.15s\">i\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.16499999999999998s\">l\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.18s\">d\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.195s\">i\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.21s\">n\u003C\u002Fspan>\u003Cspan class=\"g3_XOa_letter\" data-direction=\"exit\" data-animate=\"false\" style=\"animation-delay:0.22499999999999998s\">g\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fh1>\u003C\u002Fdiv>\u003Ca role=\"link\" href=\"https:\u002F\u002Fvercel.com\u002Fdeployments\u002Fvantolbennett-a3c1pz17q-vantol-bennetts-projects-e2eca9a9.vercel.app?redirect=1\" target=\"_blank\" type=\"submit\" rel=\"noopener\" tabindex=\"0\" data-react-aria-pressable=\"true\" aria-hidden=\"false\" data-fade-out=\"false\" class=\"outline-none m-0 p-0 border-0 align-baseline no-underline group\u002Ftrigger relative cursor-pointer select-none transform translate-z-0 flex text-[var(--themed-fg,_var(--ds-background-100))] bg-[var(--themed-bg,_var(--ds-gray-1000))] font-medium !px-(--geist-gap-half) max-w-full items-center justify-center transition-[border-color, background,color,transform,box-shadow] duration-[time:150ms] ease-in-out [&amp;_svg]:shrink-0 disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:text-[var(--ds-gray-700)] disabled:bg-[var(--ds-gray-100)] aria-disabled:text-[var(--ds-gray-700)] aria-disabled:bg-[var(--ds-gray-100)] disabled:![--themed-border:_var(--ds-gray-400)] aria-disabled:![--themed-border:_var(--ds-gray-400)] disabled:shadow-[0_0_0_1px_var(--themed-border,_transparent)] aria-disabled:shadow-[0_0_0_1px_var(--themed-border,_transparent)] [--x-padding:6px] [--height:32px] !rounded-full [--themed-bg:_var(--ds-background-100)] shadow-[0_0_0_1px_var(--themed-border,_transparent)] [--themed-hover-bg:_var(--ds-gray-alpha-200)] [--themed-fg:_var(--ds-gray-1000)] [--themed-border:_var(--ds-gray-400)] shadow-[var(--ds-shadow-border-small)] data-[focus]:transition-none data-[focus]:shadow-[var(--ds-focus-ring)] text-(length:--geist-form-small-font) [--spinner-size:16px] h-[var(--height)] data-hover:bg-[var(--ds-gray-100)] dark-theme:data-hover:bg-[var(--ds-gray-200)] data-hover:text-[var(--themed-fg)] data-hover:disabled:bg-[var(--ds-gray-100)] g3_XOa_buildStatusLink !pl-1.5 !pr-2.5\" data-geist-button=\"\" data-prefix=\"true\" data-suffix=\"true\" data-version=\"v1\" style=\"--geist-icon-size:16px\">\u003Cspan class=\"mr-[3px] min-w-5 shrink-0 flex items-center justify-center [&amp;_svg[data-slot=geist-icon]]:size-(--ds-control-decoration-size)\">\u003Cdiv class=\"RzSyvq_dot RzSyvq_building\">\u003C\u002Fdiv>\u003C\u002Fspan>\u003Cspan class=\"truncate inline-block px-1.5\">\u003Cp>View Build\u003C\u002Fp>\u003C\u002Fspan>\u003Cspan class=\"ml-1 shrink-0 mr-0.5 flex items-center justify-center [&amp;_svg[data-slot=geist-icon]]:size-(--ds-control-decoration-size)\">\u003Csvg viewBox=\"0 0 16 16\" height=\"16\" width=\"16\" data-slot=\"geist-icon\" style=\"color:var(--ds-gray-900)\">\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M7 3H4.75C3.78 3 3 3.78 3 4.75v6.5c0 .97.78 1.75 1.75 1.75h6.5c.97 0 1.75-.78 1.75-1.75V9h-1.5v2.25q-.02.23-.25.25h-6.5a.25.25 0 0 1-.25-.25v-6.5c0-.14.11-.25.25-.25H7zm1.5 1.5h1.94L6.94 8 8 9.06l3.5-3.5V7.5H13V3.75a.75.75 0 0 0-.75-.75H8.5z\" clip-rule=\"evenodd\">\u003C\u002Fpath>\u003C\u002Fsvg>\u003C\u002Fspan>\u003C\u002Fa>\u003C\u002Fmain>\u003Cfooter class=\"g3_XOa_footer\" data-fade-out=\"false\" aria-hidden=\"false\">\u003Cp class=\"text-[14px] leading-[20px] font-medium text-gray-900\">This page will update once the build completes.\u003C\u002Fp>\u003C\u002Ffooter>\u003C\u002Fdiv>\u003C!--$-->\u003C!--\u002F$-->\u003C!--$-->\u003C!--\u002F$-->\u003Cscript id=\"_R_\">(globalThis[\"TURBOPACK\"] || (globalThis[\"TURBOPACK\"] = [])).push({\"otherChunks\":[\"static\u002Fimmutable\u002Fchunks\u002F2m9pr5yfnck7-.js\",\"static\u002Fimmutable\u002Fchunks\u002F16kfnfwileral.js\",\"static\u002Fimmutable\u002Fchunks\u002F1sdjlish60lc5.js\",\"static\u002Fimmutable\u002Fchunks\u002F06lv8otyl3ed9.js\"],\"runtimeModuleIds\":[38826]});\u003C\u002Fscript>\u003Cscript src=\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F2m9pr5yfnck7-.js\" async=\"\">\u003C\u002Fscript>\u003Cscript>(self.__next_f=self.__next_f||[]).push([0])\u003C\u002Fscript>\u003Cscript>self.__next_f.push([1,\"1:\\\"$Sreact.fragment\\\"\\n2:\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F12d-zsaeckvdb.js\\\"\\n3:\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F09aym5wya4o1h.js\\\"\\n4:I[77183,[\\\"$2\\\",\\\"$3\\\"],\\\"GeistProvider\\\"]\\n5:I[69199,[\\\"$2\\\",\\\"$3\\\"],\\\"default\\\"]\\n6:I[74859,[\\\"$2\\\",\\\"$3\\\"],\\\"default\\\"]\\n7:I[66084,[\\\"$2\\\",\\\"$3\\\"],\\\"Analytics\\\"]\\nc:I[63156,[\\\"$2\\\",\\\"$3\\\"],\\\"OutletBoundary\\\"]\\nd:\\\"$Sreact.suspense\\\"\\nf:\\\"ViewportBoundary\\\"\\n10:I[63156,[\\\"$2\\\",\\\"$3\\\"],\\\"$f\\\"]\\n12:\\\"MetadataBoundary\\\"\\n13:I[63156,[\\\"$2\\\",\\\"$3\\\"],\\\"$12\\\"]\\n15:I[30158,[\\\"$2\\\",\\\"$3\\\"],\\\"default\\\",1]\\n16:\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1s_nrw3eshilr.js\\\"\\n17:I[12054,[\\\"$2\\\",\\\"$3\\\",\\\"$16\\\"],\\\"IndexPageInner\\\"]\\n:HL[\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F27njosszeb0ql.css\\\",\\\"style\\\"]\\n:HL[\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F3irfxc3rqbnr5.css\\\",\\\"style\\\"]\\n:HL[\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fmedia\u002F07a39a8a4660cc7c.p.1v5bejj26fx9h.woff2\\\",\\\"font\\\",{\\\"crossOrigin\\\":\\\"\\\",\\\"type\\\":\\\"font\u002Fwoff2\\\"}]\\n:HL[\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fmedia\u002FGeist_Variable-s.p.2wz-lhd5-5z0-.woff2\\\",\\\"font\\\",{\\\"crossOrigin\\\":\\\"\\\",\\\"type\\\":\\\"font\u002Fwoff2\\\"}]\\n:HL[\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1zw82rhyk70ct.css\\\",\\\"style\\\"]\\n9:X\\na:[[\\\"children\\\",{\\\"s\\\":\\\"__PAGE__\\\",\\\"d\\\":{\\\"r\\\":[\\\"$\\\",\\\"$1\\\",\\\"c\\\",{\\\"children\\\":[\\\"$Lb\\\",[[\\\"$\\\",\\\"link\\\",\\\"0\\\",{\\\"rel\\\":\\\"stylesheet\\\",\\\"href\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1zw82rhyk70ct.css\\\",\\\"precedence\\\":\\\"next\\\",\\\"crossOrigin\\\":\\\"$undefined\\\",\\\"nonce\\\":\\\"$undefined\\\"}],[\\\"$\\\",\\\"script\\\",\\\"script-0\\\",{\\\"src\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F1s_nrw3eshilr.js\\\",\\\"async\\\":true,\\\"nonce\\\":\\\"$undefined\\\"}]],[\\\"$\\\",\\\"$Lc\\\",null,{\\\"children\\\":[\\\"$\\\",\\\"$d\\\",null,{\\\"name\\\":\\\"Next.MetadataOutlet\\\",\\\"children\\\":\\\"$@e\\\"}]}]]}],\\\"p\\\":false,\\\"v\\\":null}}]]\\n8:[[\\\"children\\\",{\\\"s\\\":{\\\"n\\\":\\\"slug\\\",\\\"t\\\":\\\"oc\\\",\\\"k\\\":\\\"api\u002Fauth\u002Fget-session\\\",\\\"s\\\":[\\\"demo\\\"]},\\\"d\\\":{\\\"r\\\":[\\\"$\\\",\\\"$1\\\",\\\"c\\\",{\\\"children\\\":[null,[\\\"$\\\",\\\"$L5\\\",null,{\\\"parallelRouterKey\\\":\\\"children\\\",\\\"error\\\":\\\"$undefined\\\",\\\"errorStyles\\\":\\\"$undefined\\\",\\\"errorScripts\\\":\\\"$undefined\\\",\\\"template\\\":[\\\"$\\\",\\\"$L6\\\",null,{}],\\\"templateStyles\\\":\\\"$undefined\\\",\\\"templateScripts\\\":\\\"$undefined\\\",\\\"notFound\\\":\\\"$undefined\\\",\\\"forbidden\\\":\\\"$undefined\\\",\\\"unauthorized\\\":\\\"$undefined\\\"}]]}],\\\"p\\\":false,\\\"v\\\":\\\"$9\\\"},\\\"c\\\":\\\"$Qa\\\"}]]\\n0:{\\\"P\\\":null,\\\"c\\\":[\\\"\\\",\\\"api\\\",\\\"auth\\\",\\\"get-session?slug=api%2Fauth%2Fget-session\\\"],\\\"q\\\":\\\"?slug=api%2Fauth%2Fget-session\\\",\\\"i\\\":false,\\\"t\\\":{\\\"t\\\":{\\\"s\\\":\\\"\\\",\\\"h\\\":16,\\\"d\\\":{\\\"r\\\":[\\\"$\\\",\\\"$1\\\",\\\"c\\\",{\\\"children\\\":[[[\\\"$\\\",\\\"link\\\",\\\"0\\\",{\\\"rel\\\":\\\"stylesheet\\\",\\\"href\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F27njosszeb0ql.css\\\",\\\"precedence\\\":\\\"next\\\",\\\"crossOrigin\\\":\\\"$undefined\\\",\\\"nonce\\\":\\\"$undefined\\\"}],[\\\"$\\\",\\\"link\\\",\\\"1\\\",{\\\"rel\\\":\\\"stylesheet\\\",\\\"href\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F3irfxc3rqbnr5.css\\\",\\\"precedence\\\":\\\"next\\\",\\\"crossOrigin\\\":\\\"$undefined\\\",\\\"nonce\\\":\\\"$undefined\\\"}],[\\\"$\\\",\\\"script\\\",\\\"script-0\\\",{\\\"src\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F12d-zsaeckvdb.js\\\",\\\"async\\\":true,\\\"nonce\\\":\\\"$undefined\\\"}],[\\\"$\\\",\\\"script\\\",\\\"script-1\\\",{\\\"src\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F09aym5wya4o1h.js\\\",\\\"async\\\":true,\\\"nonce\\\":\\\"$undefined\\\"}]],[\\\"$\\\",\\\"html\\\",null,{\\\"className\\\":\\\"VEU71W_className ac0vwq_className VEU71W_variable ac0vwq_variable overflow-hidden antialiased bg-background-100\\\",\\\"lang\\\":\\\"en\\\",\\\"suppressHydrationWarning\\\":true,\\\"children\\\":[\\\"$\\\",\\\"body\\\",null,{\\\"children\\\":[[\\\"$\\\",\\\"$L4\\\",null,{\\\"children\\\":[\\\"$\\\",\\\"$L5\\\",null,{\\\"parallelRouterKey\\\":\\\"children\\\",\\\"error\\\":\\\"$undefined\\\",\\\"errorStyles\\\":\\\"$undefined\\\",\\\"errorScripts\\\":\\\"$undefined\\\",\\\"template\\\":[\\\"$\\\",\\\"$L6\\\",null,{}],\\\"templateStyles\\\":\\\"$undefined\\\",\\\"templateScripts\\\":\\\"$undefined\\\",\\\"notFound\\\":[[[\\\"$\\\",\\\"title\\\",null,{\\\"children\\\":\\\"404: This page could not be found.\\\"}],[\\\"$\\\",\\\"div\\\",null,{\\\"style\\\":{\\\"fontFamily\\\":\\\"system-ui,\\\\\\\"Segoe UI\\\\\\\",Roboto,Helvetica,Arial,sans-serif,\\\\\\\"Apple Color Emoji\\\\\\\",\\\\\\\"Segoe UI Emoji\\\\\\\"\\\",\\\"height\\\":\\\"100vh\\\",\\\"textAlign\\\":\\\"center\\\",\\\"display\\\":\\\"flex\\\",\\\"flexDirection\\\":\\\"column\\\",\\\"alignItems\\\":\\\"center\\\",\\\"justifyContent\\\":\\\"center\\\"},\\\"children\\\":[\\\"$\\\",\\\"div\\\",null,{\\\"children\\\":[[\"])\u003C\u002Fscript>\u003Cscript>self.__next_f.push([1,\"\\\"$\\\",\\\"style\\\",null,{\\\"dangerouslySetInnerHTML\\\":{\\\"__html\\\":\\\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\\\"}}],[\\\"$\\\",\\\"h1\\\",null,{\\\"className\\\":\\\"next-error-h1\\\",\\\"style\\\":{\\\"display\\\":\\\"inline-block\\\",\\\"margin\\\":\\\"0 20px 0 0\\\",\\\"padding\\\":\\\"0 23px 0 0\\\",\\\"fontSize\\\":24,\\\"fontWeight\\\":500,\\\"verticalAlign\\\":\\\"top\\\",\\\"lineHeight\\\":\\\"49px\\\"},\\\"children\\\":404}],[\\\"$\\\",\\\"div\\\",null,{\\\"style\\\":{\\\"display\\\":\\\"inline-block\\\"},\\\"children\\\":[\\\"$\\\",\\\"h2\\\",null,{\\\"style\\\":{\\\"fontSize\\\":14,\\\"fontWeight\\\":400,\\\"lineHeight\\\":\\\"49px\\\",\\\"margin\\\":0},\\\"children\\\":\\\"This page could not be found.\\\"}]}]]}]}]],[]],\\\"forbidden\\\":\\\"$undefined\\\",\\\"unauthorized\\\":\\\"$undefined\\\"}]}],[\\\"$\\\",\\\"$L7\\\",null,{}]]}]}]]}],\\\"p\\\":false,\\\"v\\\":null},\\\"c\\\":\\\"$Q8\\\"},\\\"h\\\":{\\\"r\\\":[\\\"$\\\",\\\"$1\\\",\\\"h\\\",{\\\"children\\\":[null,[\\\"$\\\",\\\"$L10\\\",null,{\\\"children\\\":\\\"$L11\\\"}],[\\\"$\\\",\\\"$L13\\\",null,{\\\"children\\\":[[\\\"$\\\",\\\"div\\\",null,{\\\"hidden\\\":true,\\\"children\\\":[\\\"$\\\",\\\"$d\\\",null,{\\\"name\\\":\\\"Next.Metadata\\\",\\\"children\\\":\\\"$L14\\\"}]}],null]}],[\\\"$\\\",\\\"meta\\\",null,{\\\"name\\\":\\\"next-size-adjust\\\",\\\"content\\\":\\\"\\\"}]]}],\\\"p\\\":false,\\\"v\\\":null}},\\\"m\\\":\\\"$undefined\\\",\\\"G\\\":[\\\"$15\\\",[[\\\"$\\\",\\\"link\\\",\\\"0\\\",{\\\"rel\\\":\\\"stylesheet\\\",\\\"href\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F27njosszeb0ql.css\\\",\\\"precedence\\\":\\\"next\\\",\\\"crossOrigin\\\":\\\"$undefined\\\",\\\"nonce\\\":\\\"$undefined\\\"}],[\\\"$\\\",\\\"link\\\",\\\"1\\\",{\\\"rel\\\":\\\"stylesheet\\\",\\\"href\\\":\\\"https:\u002F\u002Finstant-preview-site.vercel.app\u002F_next\u002Fstatic\u002Fimmutable\u002Fchunks\u002F3irfxc3rqbnr5.css\\\",\\\"precedence\\\":\\\"next\\\",\\\"crossOrigin\\\":\\\"$undefined\\\",\\\"nonce\\\":\\\"$undefined\\\"}]]],\\\"S\\\":false,\\\"r\\\":\\\"$undefined\\\",\\\"s\\\":\\\"$undefined\\\",\\\"a\\\":\\\"$undefined\\\",\\\"p\\\":\\\"$undefined\\\",\\\"d\\\":\\\"$undefined\\\",\\\"b\\\":\\\"KJjQbhyNpMhqYKVeJsVUd\\\"}\\n9:C\\nb:[\\\"$\\\",\\\"$L17\\\",null,{\\\"deploymentId\\\":\\\"dpl_7pcoqHSwEMgnuU8rYPruFTCK3puB\\\",\\\"hostname\\\":\\\"vantolbennett-a3c1pz17q-vantol-bennetts-projects-e2eca9a9.vercel.app\\\",\\\"initialReadyState\\\":\\\"BUILDING\\\"}]\\n11:[[\\\"$\\\",\\\"meta\\\",\\\"0\\\",{\\\"charSet\\\":\\\"utf-8\\\"}],[\\\"$\\\",\\\"meta\\\",\\\"1\\\",{\\\"name\\\":\\\"viewport\\\",\\\"content\\\":\\\"width=device-width, initial-scale=1\\\"}]]\\ne:null\\n14:[]\\n\"])\u003C\u002Fscript>\u003C\u002Fbody>\u003C\u002Fhtml>",[5,137,323,3795,4169,7075,8307,9874,10432,14699,14761,15845,17252,18255,20809,21014,21079,21130,21358,22052,22685,23006,23770,24255,26234,31133,32458,32554,33304,33531,34898,35694,36830,40470,41060,42467],{"id":6,"title":7,"author":8,"body":12,"canonical":116,"categories":116,"date":117,"description":118,"excerpt":116,"extension":119,"featuredImg":116,"img":120,"keywords":121,"language":128,"meta":129,"navigation":130,"ogImage":116,"path":131,"rating":132,"readTime":133,"seo":134,"stem":135,"tag":126,"__hash__":136},"blog\u002Fblog\u002Fadd-env-variables-runtime.md","Adding environment variables to the runtime in Nuxt3 [Beta]",{"name":9,"website":10,"img":11},"Vantol Bennett","www.teammps.com","https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1636919468\u002FDSC_0988_zsfhgy.jpg",{"type":13,"value":14,"toc":110},"minimark",[15,20,24,31,36,44,47,57,60,64,67,72,75,77,83,89,92,98,101,107],[16,17,19],"h1",{"id":18},"runtime-config-in-nuxt-3","Runtime Config in Nuxt 3",[21,22,23],"p",{},"Nuxt3 is still in beta and is not ready for production use (ish), but that hasn't stopped many developers to take advantage of the unique features, power and significant performance boost that Nuxt3 offers.",[25,26,28],"blog-alert",{"type":27},"warning",[21,29,30],{},"Nuxt 3 is now stable! The information below refers to early RC versions but the core concepts of Runtime Config remain valid.",[32,33,35],"h2",{"id":34},"exposing-environment-variables-to-the-runtime","Exposing Environment Variables to the Runtime",[21,37,38,39,43],{},"All the heavy lifting is done by Nuxt in the nuxt.config.js file. This file is where you can set up the environment variables that you want to expose to the rest of the application. This is done by adding the ",[40,41,42],"code",{},"privateRuntimeConfig"," or publicRuntimeConfig` property to the nuxt.config.js file. As the name suggests, both of these properties are used based on accessiblity on the client side or server side.",[21,45,46],{},"Example:",[48,49,54],"pre",{"className":50,"code":52,"language":53},[51],"language-text","\nexport default defineNuxtConfig({\n  ...\n  publicRuntimeConfig: {\n    \u002F\u002F Will be available on both server and client\n    apiUrl: 'https:\u002F\u002Fapi.example.com',\n  },\n  privateRuntimeConfig: {\n    apiUrl: process.env.API_URL,\n    apiKey: process.env.API_KEY,\n    ...\n  },\n  ...\n})\n","text",[40,55,52],{"__ignoreMap":56},"",[21,58,59],{},"The publicRuntimeConfig property will be added to Nuxt pages through the apiUrl allowing for universal access for apiUrl to both client and server.",[32,61,63],{"id":62},"environmental-variables-using-supabase","Environmental Variables - Using Supabase",[21,65,66],{},"Ok so, whether you are a new developer or a experienced one environment variables are common way to access configuration. We add a .env file to the root directory, Nuxt will added these variables to process.env and is accessible in nuxt.config.js. Let see what how to add Supabase url and key.",[21,68,69],{},[40,70,71],{},"npm install @supabase\u002Fsupabase-js",[73,74],"hr",{},[21,76,46],{},[48,78,81],{"className":79,"code":80,"language":53},[51],".env\n\nSUPABASE_URL=\u002F* URL KEY HERE*\u002F\nSUPABASE_ANON_KEY=\u002F* KEY ADDED HERE *\u002F\n\n",[40,82,80],{"__ignoreMap":56},[48,84,87],{"className":85,"code":86,"language":53},[51],"\nexport default defineNuxtConfig({\n  ...\n  publicRuntimeConfig: {\n    \u002F\u002F Will be available on both server and client\n    SUPABASE_URL: process.env.SUPABASE_URL,\n    SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY\n  },\n  ...\n})\n",[40,88,86],{"__ignoreMap":56},[21,90,91],{},"This is important part of this post, accessing the supabase variables in the publicRunTime config can only be done on the client side using the useRunTimeConfig in the setup or lifecycle hooks. This is a crucial step to remember!",[48,93,96],{"className":94,"code":95,"language":53},[51],"\u003Ctemplate>\n  \u003Cdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup>\nconst config = useRuntimeConfig()\n\u003C\u002Fscript>\n",[40,97,95],{"__ignoreMap":56},[21,99,100],{},"useRuntimeConfig only works in setup or lifecycle hooks.... this was a pain for me as I could not discover the error because of this, and more importantly since env variables are accessed in the publicRuntimeConfig so only on the client side. Therefore in setting up we could connect supabase with our runtime.",[48,102,105],{"className":103,"code":104,"language":53},[51],"import { createClient } from '@supabase\u002Fsupabase-js'\n\n.....\n\n....\n\nconst config = useRuntimeConfig()\n\nconst supabase = createClient(config.SUPABASE_URL, config.SUPABASE_KEY)\n\n\u002F* Followed by the supabase implementation you would like to work on*\u002F\n",[40,106,104],{"__ignoreMap":56},[21,108,109],{},"And thats how you get access to your env variables. In my next post we will explore how to you use composables and plugins to achieve this whole setup but with cleaner out look.",{"title":56,"searchDepth":111,"depth":111,"links":112},3,[113,115],{"id":34,"depth":114,"text":35},2,{"id":62,"depth":114,"text":63},null,"2022-01-15","Exposing environment variables to the runtime in Nuxt3","md","https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1642350413\u002Fvantol\u002Fblack-text_emxagi.png",[122,123,124,125,126,127],"developer","jamaican","vue.js","supabase","Nuxt3","vite","Javascript - Vue.js",{},true,"\u002Fblog\u002Fadd-env-variables-runtime",0,10,{"title":7,"description":118},"blog\u002Fadd-env-variables-runtime","A7LgcAt8k8RVY-lSHtVQafUzg-DcydlIaKc2Cro-9bg",{"id":138,"title":139,"author":140,"body":141,"canonical":116,"categories":116,"date":306,"description":307,"excerpt":116,"extension":119,"featuredImg":116,"img":120,"keywords":308,"language":315,"meta":316,"navigation":130,"ogImage":116,"path":317,"rating":132,"readTime":318,"seo":319,"stem":320,"tag":321,"__hash__":322},"blog\u002Fblog\u002Falways-protect-the-king.md","Always Protect the King - Notes from a Founder Who Stopped Searching",{"name":9,"website":10,"img":11},{"type":13,"value":142,"toc":299},[143,147,159,166,173,177,184,187,193,199,206,209,213,216,219,223,226,229,232,235,239,245,248,254,257,261,264,282,285,288,291,294],[16,144,146],{"id":145},"always-protect-the-king","Always Protect the King",[21,148,149,150,154,155],{},"I started coding around my early twenties. The first company I put a name to was ",[151,152,153],"strong",{},"Teckare Online"," - not a software shop, not really. We were hardware-and-software people. We'd go around to different schools and see if we could beef up their systems, so to speak. It was a good learning experience, and it taught me the first half of a mantra I still carry: ",[156,157,158],"em",{},"keep evolving, keep adapting to the situation.",[21,160,161,162,165],{},"Then came the web work - WordPress at first, then more. And in 2015, at twenty-nine, I started ",[151,163,164],{},"Mashed Potato Studios",".",[21,167,168,169,172],{},"If you'd asked me then what I was searching for, I'd have had a hundred answers and none of them right. That's the thing about starting young. You think the struggle is ",[156,170,171],{},"finding the thing",". It isn't. The struggle is everything that happens after you've already decided to build.",[32,174,176],{"id":175},"the-struggle-was-never-the-code","The struggle was never the code",[21,178,179,180,183],{},"At Mashed Potato Studios we have a rule: ",[156,181,182],{},"you must evolve with code."," That came straight out of Teckare. The technology moves, so you move. Easy to say about frameworks. Harder to say about people.",[21,185,186],{},"Because the real struggle of building a company young wasn't technical. It was two things.",[21,188,189,192],{},[151,190,191],{},"The first was being too ambitious."," Wanting more than the moment could hold. That's a kind of debt you pay for years.",[21,194,195,198],{},[151,196,197],{},"The second was betrayal."," Me and my partners - we've had people who should have been in our corner turn and stab us in the back. More than once. The friend cycle. People change over the course of years, and some of them changed right out of your life. That's part of business, I guess. You learn it the hard way, and then you keep walking.",[21,200,201,202,205],{},"There's a particular kind of tired that ",[156,203,204],{},"isn't"," exhaustion. It's the realization that sometimes it isn't what you know - it's who you know. The shadiness of business. The politics. The rooms you aren't in. That's essentially what betrayal is: someone choosing the room you aren't in over the one you built together.",[21,207,208],{},"I won't pretend it didn't sting. But here's what I'll tell you plainly: the never-quit attitude didn't hurt me. It's been in my family for years. It's been a driving factor for the Bennett name. My name is important. Family is important. The track stayed the same for me while the company changed, while friends changed, while business partners changed. I kept on going.",[32,210,212],{"id":211},"what-drives-me-now","What drives me now",[21,214,215],{},"What drives me most now is my daughter. I believe I should provide for her everything I didn't have, and more. That's the cleanest fuel there is - not the young-founder ego, not the chase, but the quiet certainty that something I build outlives me in her.",[21,217,218],{},"And that's the part people get wrong about \"finding your place as you grow older.\" They frame it like a crisis. Like at some age you're supposed to panic and wonder who you are. I don't. The drive didn't fade and it didn't turn on me. It just got aimed at the right thing.",[32,220,222],{"id":221},"i-stopped-searching","I stopped searching",[21,224,225],{},"Here's where I am at forty.",[21,227,228],{},"We're not searching anymore - me, the team, the company. Everything we have as a team, everything we have built, we're not out looking for a missing piece. We just want the opportunity to put forward what we have.",[21,230,231],{},"Everybody gets the same opportunity to put something forward. It's fair that way. But it requires a little luck, and a little persistence. I've got the persistence. The luck is the only thing left to meet us halfway.",[21,233,234],{},"So no - I'm not searching. I'm getting ready. There's a difference, and it took me most of my thirties to feel it.",[32,236,238],{"id":237},"always-protect-the-king-1","Always protect the King",[21,240,241,242],{},"If there's a single thing that makes any of this real, it's this: ",[151,243,244],{},"always protect the King.",[21,246,247],{},"For a long time I thought the King was me - my vision, my company, my name. That's the young-founder mistake. The King isn't you.",[21,249,250,253],{},[151,251,252],{},"The King is the person in front of you."," The person around you. The client, the teammate, the partner, the stranger in the room. You protect them. And if you do it right, they should see you - the person who is me - as a King too. Not above them. Beside them. Sovereign, and owed the same care you just gave.",[21,255,256],{},"That's the creed I try to lead with at all times. It goes past core values. It's how I show up. Because everything I do touches the three things that actually shaped me: the ambition that nearly sank me, the betrayal that taught me who was really in the corner, and the daughter who gave the whole engine a new reason to run. You protect the King, and all three of those fall into place behind it.",[32,258,260],{"id":259},"king-in-the-moment","King in the moment",[21,262,263],{},"The mantra evolved. It had to.",[21,265,266,269,270,273,274,277,278,281],{},[151,267,268],{},"King in the moment."," Different times, different points in your life - in that moment, you are the King. You are the person. You are ",[156,271,272],{},"him"," - the one who did what you did. Not the one who ",[156,275,276],{},"will"," act, not the one who ",[156,279,280],{},"should have."," The one who acted, right there, in the moment that already happened.",[21,283,284],{},"That's the difference between the twenty-nine-year-old who started Mashed Potato Studios and the forty-year-old writing this. The young one was protecting a King he thought was out there somewhere - a future, a unicorn, a version of himself he hadn't met. The older one knows the King was the person in front of him the whole time, and that in each moment he was already the King who had to show up.",[21,286,287],{},"I didn't find my place. My place found me, the way it finds anyone who refuses to leave the track. The code evolved. The partners came and went. The friends cycled. The betrayal came and the persistence outlasted it. And through all of it, the rule held:",[21,289,290],{},"Protect the person in front of you. Be the King in the moment.",[21,292,293],{},"That's the whole post. That's the whole company. That's the whole life, if you let it be.",[21,295,296],{},[156,297,298],{},"Now we just need the luck to put it forward. And I've got time.",{"title":56,"searchDepth":111,"depth":111,"links":300},[301,302,303,304,305],{"id":175,"depth":114,"text":176},{"id":211,"depth":114,"text":212},{"id":221,"depth":114,"text":222},{"id":237,"depth":114,"text":238},{"id":259,"depth":114,"text":260},"2026-07-20","On starting young, surviving betrayal, and the creed that carried me to 40 - protect the person in front of you, and be the King in the moment.",[309,123,310,311,312,313,314],"founder","startup","mashed potato studios","teckare","entrepreneurship","personal","English",{},"\u002Fblog\u002Falways-protect-the-king",12,{"title":139,"description":307},"blog\u002Falways-protect-the-king","Founder","kxbgIhZ0JYE8PBZEnQB2U5SdzNuK_cS0g9Z6If0pkew",{"id":324,"title":325,"author":326,"body":328,"canonical":116,"categories":116,"date":3757,"description":3758,"excerpt":3759,"extension":119,"featuredImg":116,"img":3779,"keywords":3780,"language":3788,"meta":3789,"navigation":130,"ogImage":116,"path":3790,"rating":474,"readTime":526,"seo":3791,"stem":3792,"tag":3793,"__hash__":3794},"blog\u002Fblog\u002Fbuilding-null-agent.md","Building null-agent: A Multi-Provider Coding Assistant with 49 Built-in Tools",{"name":9,"img":11,"website":327},"https:\u002F\u002Fvantolbennett.com",{"type":13,"value":329,"toc":3731},[330,334,337,343,361,375,379,382,423,426,434,438,441,536,539,543,546,664,668,812,815,834,837,878,883,887,902,906,909,971,975,978,1082,1087,1129,1133,1136,1270,1274,1277,1281,1369,1373,1376,1529,1550,1554,1560,1703,1707,1710,1862,1866,1869,1992,1996,1999,2115,2119,2122,2206,2209,2213,2217,2220,2282,2291,2295,2298,2310,2314,2317,2341,2365,2369,2372,2396,2400,2403,2407,2410,2455,2459,2532,2548,2552,2574,2581,2585,2588,2602,2606,2804,2815,2819,2822,2826,2918,2921,2925,2928,3039,3060,3064,3071,3178,3182,3185,3283,3303,3307,3310,3539,3543,3546,3603,3621,3625,3628,3664,3667,3678,3682,3685,3688,3691,3694,3724,3727],[16,331,333],{"id":332},"introduction","Introduction",[21,335,336],{},"Most coding assistants lock you into a single provider, a single interface, and a black-box you can't extend. If you want OpenAI for one project, Anthropic for another, and a local model for sensitive work, you're juggling three different tools with three different CLIs.",[21,338,339,342],{},[151,340,341],{},"null-agent"," is an open-source TypeScript library that solves this by unifying multi-provider LLM support, a rich tool system, a terminal UI, an HTTP API, and even a developer accountability tracker — all behind one configurable interface.",[21,344,345,346,349,350,349,353,356,357,360],{},"It ships with ",[151,347,348],{},"49 built-in tools",", ",[151,351,352],{},"5 LLM providers",[151,354,355],{},"4 interfaces",", and a ",[151,358,359],{},"plugin system"," that lets you extend it without forking the codebase.",[25,362,364],{"type":363},"info",[21,365,366,367,370,371,374],{},"null-agent is built with Vite+ and ships as both a library (",[40,368,369],{},"npm install null-agent",") and a global CLI (",[40,372,373],{},"npm install -g null-agent",").",[16,376,378],{"id":377},"what-is-null-agent","What Is null-agent?",[21,380,381],{},"null-agent is an interactive coding assistant that works as:",[383,384,385,399,405,411,417],"ul",{},[386,387,388,391,392,349,395,398],"li",{},[151,389,390],{},"A library"," — import ",[40,393,394],{},"Agent",[40,396,397],{},"ToolRegistry",", and providers into your own tools",[386,400,401,404],{},[151,402,403],{},"A TUI"," — an Ink-based terminal interface with live activity tracking",[386,406,407,410],{},[151,408,409],{},"A REPL"," — a lightweight readline interface with zero extra dependencies",[386,412,413,416],{},[151,414,415],{},"An HTTP server"," — REST API with SSE streaming",[386,418,419,422],{},[151,420,421],{},"A one-shot CLI"," — send a single message and get a response",[21,424,425],{},"It auto-detects which LLM provider you have configured, manages API keys through your OS keychain, and persists conversations to disk so you can resume them later.",[427,428,431],"callout",{"icon":429,"title":430},"🚀","Why Another Agent Library?",[21,432,433],{},"Because most agent frameworks are either too opinionated (you can't swap providers) or too minimal (you write your own tool registry). null-agent sits in the middle: batteries included, but everything is overridable.",[16,435,437],{"id":436},"architecture-at-a-glance","Architecture at a Glance",[21,439,440],{},"The package is organized into focused modules:",[48,442,446],{"className":443,"code":444,"language":445,"meta":56,"style":56},"language-txt shiki shiki-themes github-light github-dark","src\u002F\n  providers\u002F      # LLM abstraction (OpenAI, Anthropic, Gemini, OpenRouter, Tavily)\n  tools\u002F          # 49 built-in tools across file, shell, git, workflow, review, testing, web\n  agent\u002F          # Core loop, orchestrator, personality, task extraction, suggestions\n  tui\u002F            # Ink terminal UI with status bar, chat panel, daily summary\n  cli\u002F            # Entry points for REPL, one-shot, and server modes\n  server\u002F         # HTTP API with SSE streaming\n  memory\u002F         # Conversation persistence and export\n  context\u002F        # Project scanning and context window management\n  awareness\u002F      # Git monitoring and file watching\n  accountability\u002F # Developer day tracker with goals and reports\n  bus\u002F            # Event bus for decoupled communication\n  config\u002F         # Unified config system\n  permission\u002F     # Mode-based permissions (auto \u002F confirm \u002F plan)\n  plugin\u002F         # Plugin architecture\n","txt",[40,447,448,456,461,466,472,478,484,490,496,502,507,513,518,524,530],{"__ignoreMap":56},[449,450,453],"span",{"class":451,"line":452},"line",1,[449,454,455],{},"src\u002F\n",[449,457,458],{"class":451,"line":114},[449,459,460],{},"  providers\u002F      # LLM abstraction (OpenAI, Anthropic, Gemini, OpenRouter, Tavily)\n",[449,462,463],{"class":451,"line":111},[449,464,465],{},"  tools\u002F          # 49 built-in tools across file, shell, git, workflow, review, testing, web\n",[449,467,469],{"class":451,"line":468},4,[449,470,471],{},"  agent\u002F          # Core loop, orchestrator, personality, task extraction, suggestions\n",[449,473,475],{"class":451,"line":474},5,[449,476,477],{},"  tui\u002F            # Ink terminal UI with status bar, chat panel, daily summary\n",[449,479,481],{"class":451,"line":480},6,[449,482,483],{},"  cli\u002F            # Entry points for REPL, one-shot, and server modes\n",[449,485,487],{"class":451,"line":486},7,[449,488,489],{},"  server\u002F         # HTTP API with SSE streaming\n",[449,491,493],{"class":451,"line":492},8,[449,494,495],{},"  memory\u002F         # Conversation persistence and export\n",[449,497,499],{"class":451,"line":498},9,[449,500,501],{},"  context\u002F        # Project scanning and context window management\n",[449,503,504],{"class":451,"line":133},[449,505,506],{},"  awareness\u002F      # Git monitoring and file watching\n",[449,508,510],{"class":451,"line":509},11,[449,511,512],{},"  accountability\u002F # Developer day tracker with goals and reports\n",[449,514,515],{"class":451,"line":318},[449,516,517],{},"  bus\u002F            # Event bus for decoupled communication\n",[449,519,521],{"class":451,"line":520},13,[449,522,523],{},"  config\u002F         # Unified config system\n",[449,525,527],{"class":451,"line":526},14,[449,528,529],{},"  permission\u002F     # Mode-based permissions (auto \u002F confirm \u002F plan)\n",[449,531,533],{"class":451,"line":532},15,[449,534,535],{},"  plugin\u002F         # Plugin architecture\n",[21,537,538],{},"Every module is independently importable. You can use the agent loop without the TUI, the tool registry without the agent, or the accountability tracker as a standalone utility.",[16,540,542],{"id":541},"multi-provider-llm-support","Multi-Provider LLM Support",[21,544,545],{},"null-agent doesn't pick sides. It supports five providers and auto-detects which one you have configured:",[547,548,549,568],"table",{},[550,551,552],"thead",{},[553,554,555,559,562,565],"tr",{},[556,557,558],"th",{},"Provider",[556,560,561],{},"Env Variable",[556,563,564],{},"Default Model",[556,566,567],{},"Free Tier",[569,570,571,590,607,626,649],"tbody",{},[553,572,573,577,582,587],{},[574,575,576],"td",{},"OpenAI",[574,578,579],{},[40,580,581],{},"OPENAI_API_KEY",[574,583,584],{},[40,585,586],{},"gpt-5.4",[574,588,589],{},"—",[553,591,592,595,600,605],{},[574,593,594],{},"Anthropic",[574,596,597],{},[40,598,599],{},"ANTHROPIC_API_KEY",[574,601,602],{},[40,603,604],{},"claude-sonnet-4-6",[574,606,589],{},[553,608,609,612,617,622],{},[574,610,611],{},"Google Gemini",[574,613,614],{},[40,615,616],{},"GEMINI_API_KEY",[574,618,619],{},[40,620,621],{},"gemini-3.1-flash",[574,623,624],{},[40,625,621],{},[553,627,628,631,636,641],{},[574,629,630],{},"OpenRouter",[574,632,633],{},[40,634,635],{},"OPENROUTER_API_KEY",[574,637,638],{},[40,639,640],{},"anthropic\u002Fclaude-sonnet-4-6",[574,642,643,349,646],{},[40,644,645],{},"google\u002Fgemini-3.1-flash",[40,647,648],{},"llama-3.1",[553,650,651,654,659,661],{},[574,652,653],{},"Tavily",[574,655,656],{},[40,657,658],{},"TAVILY_API_KEY",[574,660,589],{},[574,662,663],{},"1000 searches\u002Fmonth",[32,665,667],{"id":666},"using-providers-as-a-library","Using Providers as a Library",[48,669,674],{"className":670,"code":671,"filename":672,"language":673,"meta":56,"style":56},"language-ts shiki shiki-themes github-light github-dark","import { createProvider, detectProvider, getAvailableProviders } from \"null-agent\";\n\n\u002F\u002F Auto-detect from available keys\nconst provider = createProvider(detectProvider() ?? \"openai\");\n\n\u002F\u002F Explicit provider with custom model\nconst claude = createProvider(\"anthropic\", {\n  model: \"claude-opus-4-20250514\",\n});\n\n\u002F\u002F See what's available\nconst available = getAvailableProviders(); \u002F\u002F [\"openai\", \"gemini\"]\n","example.ts","ts",[40,675,676,696,701,707,741,745,750,769,780,785,789,794],{"__ignoreMap":56},[449,677,678,682,686,689,693],{"class":451,"line":452},[449,679,681],{"class":680},"szBVR","import",[449,683,685],{"class":684},"sVt8B"," { createProvider, detectProvider, getAvailableProviders } ",[449,687,688],{"class":680},"from",[449,690,692],{"class":691},"sZZnC"," \"null-agent\"",[449,694,695],{"class":684},";\n",[449,697,698],{"class":451,"line":114},[449,699,700],{"emptyLinePlaceholder":130},"\n",[449,702,703],{"class":451,"line":111},[449,704,706],{"class":705},"sJ8bj","\u002F\u002F Auto-detect from available keys\n",[449,708,709,712,716,719,723,726,729,732,735,738],{"class":451,"line":468},[449,710,711],{"class":680},"const",[449,713,715],{"class":714},"sj4cs"," provider",[449,717,718],{"class":680}," =",[449,720,722],{"class":721},"sScJk"," createProvider",[449,724,725],{"class":684},"(",[449,727,728],{"class":721},"detectProvider",[449,730,731],{"class":684},"() ",[449,733,734],{"class":680},"??",[449,736,737],{"class":691}," \"openai\"",[449,739,740],{"class":684},");\n",[449,742,743],{"class":451,"line":474},[449,744,700],{"emptyLinePlaceholder":130},[449,746,747],{"class":451,"line":480},[449,748,749],{"class":705},"\u002F\u002F Explicit provider with custom model\n",[449,751,752,754,757,759,761,763,766],{"class":451,"line":486},[449,753,711],{"class":680},[449,755,756],{"class":714}," claude",[449,758,718],{"class":680},[449,760,722],{"class":721},[449,762,725],{"class":684},[449,764,765],{"class":691},"\"anthropic\"",[449,767,768],{"class":684},", {\n",[449,770,771,774,777],{"class":451,"line":492},[449,772,773],{"class":684},"  model: ",[449,775,776],{"class":691},"\"claude-opus-4-20250514\"",[449,778,779],{"class":684},",\n",[449,781,782],{"class":451,"line":498},[449,783,784],{"class":684},"});\n",[449,786,787],{"class":451,"line":133},[449,788,700],{"emptyLinePlaceholder":130},[449,790,791],{"class":451,"line":509},[449,792,793],{"class":705},"\u002F\u002F See what's available\n",[449,795,796,798,801,803,806,809],{"class":451,"line":318},[449,797,711],{"class":680},[449,799,800],{"class":714}," available",[449,802,718],{"class":680},[449,804,805],{"class":721}," getAvailableProviders",[449,807,808],{"class":684},"(); ",[449,810,811],{"class":705},"\u002F\u002F [\"openai\", \"gemini\"]\n",[21,813,814],{},"Keys are resolved in order of priority:",[816,817,818,821,828],"ol",{},[386,819,820],{},"Environment variable",[386,822,823,824,827],{},"OS keychain (macOS Keychain \u002F Windows Credential Manager via ",[40,825,826],{},"keytar",")",[386,829,830,833],{},[40,831,832],{},"~\u002F.null-agent\u002Fcredentials.json"," file fallback",[21,835,836],{},"You can configure keys interactively:",[48,838,842],{"className":839,"code":840,"language":841,"meta":56,"style":56},"language-bash shiki shiki-themes github-light github-dark","null-agent auth              # Pick a provider, enter key interactively\nnull-agent auth openai       # Configure one provider directly\nnull-agent auth status       # Show which providers are configured\n","bash",[40,843,844,854,866],{"__ignoreMap":56},[449,845,846,848,851],{"class":451,"line":452},[449,847,341],{"class":721},[449,849,850],{"class":691}," auth",[449,852,853],{"class":705},"              # Pick a provider, enter key interactively\n",[449,855,856,858,860,863],{"class":451,"line":114},[449,857,341],{"class":721},[449,859,850],{"class":691},[449,861,862],{"class":691}," openai",[449,864,865],{"class":705},"       # Configure one provider directly\n",[449,867,868,870,872,875],{"class":451,"line":111},[449,869,341],{"class":721},[449,871,850],{"class":691},[449,873,874],{"class":691}," status",[449,876,877],{"class":705},"       # Show which providers are configured\n",[25,879,880],{"type":27},[21,881,882],{},"No API key? Gemini and OpenRouter both offer free tiers. You can start using null-agent without spending a dollar.",[16,884,886],{"id":885},"the-tool-system-49-built-in-tools","The Tool System: 49 Built-in Tools",[21,888,889,890,893,894,897,898,901],{},"Tools are the core of what makes null-agent useful. They're organized into three capability areas: ",[151,891,892],{},"Mind"," (reasoning), ",[151,895,896],{},"Hand"," (file manipulation), and ",[151,899,900],{},"Feet"," (task orchestration).",[32,903,905],{"id":904},"mind-core-operations","Mind — Core Operations",[21,907,908],{},"The foundational trio every agent needs:",[547,910,911,924],{},[550,912,913],{},[553,914,915,918,921],{},[556,916,917],{},"Tool",[556,919,920],{},"Name",[556,922,923],{},"Description",[569,925,926,941,956],{},[553,927,928,933,938],{},[574,929,930],{},[40,931,932],{},"fileReadTool",[574,934,935],{},[40,936,937],{},"file_read",[574,939,940],{},"Read file contents",[553,942,943,948,953],{},[574,944,945],{},[40,946,947],{},"fileWriteTool",[574,949,950],{},[40,951,952],{},"file_write",[574,954,955],{},"Write file contents (creates parent dirs)",[553,957,958,963,968],{},[574,959,960],{},[40,961,962],{},"shellTool",[574,964,965],{},[40,966,967],{},"shell",[574,969,970],{},"Run shell commands (30s timeout, 1MB buffer)",[32,972,974],{"id":973},"hand-file-manipulation","Hand — File Manipulation",[21,976,977],{},"Advanced file operations with safety features:",[547,979,980,990],{},[550,981,982],{},[553,983,984,986,988],{},[556,985,917],{},[556,987,920],{},[556,989,923],{},[569,991,992,1007,1022,1037,1052,1067],{},[553,993,994,999,1004],{},[574,995,996],{},[40,997,998],{},"fileMoveTool",[574,1000,1001],{},[40,1002,1003],{},"file_move",[574,1005,1006],{},"Move files with undo support",[553,1008,1009,1014,1019],{},[574,1010,1011],{},[40,1012,1013],{},"fileCopyTool",[574,1015,1016],{},[40,1017,1018],{},"file_copy",[574,1020,1021],{},"Copy files",[553,1023,1024,1029,1034],{},[574,1025,1026],{},[40,1027,1028],{},"fileDeleteTool",[574,1030,1031],{},[40,1032,1033],{},"file_delete",[574,1035,1036],{},"Delete files (moves to trash, supports restore)",[553,1038,1039,1044,1049],{},[574,1040,1041],{},[40,1042,1043],{},"fileGlobTool",[574,1045,1046],{},[40,1047,1048],{},"file_glob",[574,1050,1051],{},"Find files matching glob patterns",[553,1053,1054,1059,1064],{},[574,1055,1056],{},[40,1057,1058],{},"fileRestoreTool",[574,1060,1061],{},[40,1062,1063],{},"file_restore",[574,1065,1066],{},"List\u002Frestore files from trash",[553,1068,1069,1074,1079],{},[574,1070,1071],{},[40,1072,1073],{},"fileBulkTool",[574,1075,1076],{},[40,1077,1078],{},"file_bulk",[574,1080,1081],{},"Execute batch file operations",[21,1083,1084],{},[151,1085,1086],{},"Safety features built in:",[383,1088,1089,1095,1105],{},[386,1090,1091,1094],{},[151,1092,1093],{},"Root boundary"," — all operations validate paths against a configurable root (default: project root) to prevent traversal attacks",[386,1096,1097,1100,1101,1104],{},[151,1098,1099],{},"Trash-based delete"," — deleted files move to ",[40,1102,1103],{},"~\u002F.null-agent\u002Ftrash\u002F"," instead of permanent deletion",[386,1106,1107,1110,1111,1113,1114,349,1117,1120,1121,1124,1125,1128],{},[151,1108,1109],{},"Glob patterns"," — ",[40,1112,1048],{}," supports ",[40,1115,1116],{},"**\u002F*.ts",[40,1118,1119],{},"src\u002F**\u002F*.js",", etc. with automatic ",[40,1122,1123],{},"node_modules\u002F"," \u002F ",[40,1126,1127],{},".git\u002F"," exclusion",[32,1130,1132],{"id":1131},"feet-task-orchestration","Feet — Task Orchestration",[21,1134,1135],{},"Script execution, process management, and terminal sessions:",[547,1137,1138,1148],{},[550,1139,1140],{},[553,1141,1142,1144,1146],{},[556,1143,917],{},[556,1145,920],{},[556,1147,923],{},[569,1149,1150,1165,1180,1195,1210,1225,1240,1255],{},[553,1151,1152,1157,1162],{},[574,1153,1154],{},[40,1155,1156],{},"scriptDetectTool",[574,1158,1159],{},[40,1160,1161],{},"script_detect",[574,1163,1164],{},"Auto-detect scripts from package.json\u002FMakefile",[553,1166,1167,1172,1177],{},[574,1168,1169],{},[40,1170,1171],{},"scriptRunTool",[574,1173,1174],{},[40,1175,1176],{},"script_run",[574,1178,1179],{},"Run detected or custom scripts",[553,1181,1182,1187,1192],{},[574,1183,1184],{},[40,1185,1186],{},"processStartTool",[574,1188,1189],{},[40,1190,1191],{},"process_start",[574,1193,1194],{},"Start background processes",[553,1196,1197,1202,1207],{},[574,1198,1199],{},[40,1200,1201],{},"processStopTool",[574,1203,1204],{},[40,1205,1206],{},"process_stop",[574,1208,1209],{},"Stop background processes",[553,1211,1212,1217,1222],{},[574,1213,1214],{},[40,1215,1216],{},"processListTool",[574,1218,1219],{},[40,1220,1221],{},"process_list",[574,1223,1224],{},"List running processes",[553,1226,1227,1232,1237],{},[574,1228,1229],{},[40,1230,1231],{},"sessionCreateTool",[574,1233,1234],{},[40,1235,1236],{},"session_create",[574,1238,1239],{},"Create persistent terminal sessions",[553,1241,1242,1247,1252],{},[574,1243,1244],{},[40,1245,1246],{},"sessionAttachTool",[574,1248,1249],{},[40,1250,1251],{},"session_attach",[574,1253,1254],{},"Attach to existing sessions",[553,1256,1257,1262,1267],{},[574,1258,1259],{},[40,1260,1261],{},"taskSprintTool",[574,1263,1264],{},[40,1265,1266],{},"task_sprint",[574,1268,1269],{},"Run concurrent tasks with progress",[32,1271,1273],{"id":1272},"git-workflow-review-testing-and-web","Git, Workflow, Review, Testing, and Web",[21,1275,1276],{},"The package also includes 15 git tools, 8 dev workflow tools (PRs, issues, changelog, CI status), code review utilities, test generation\u002Frunners, and web search\u002Ffetch via Tavily.",[32,1278,1280],{"id":1279},"using-the-tool-registry","Using the Tool Registry",[48,1282,1284],{"className":670,"code":1283,"filename":672,"language":673,"meta":56,"style":56},"import { createDefaultRegistry, ToolRegistry, fileReadTool, shellTool } from \"null-agent\";\n\n\u002F\u002F All 49 tools\nconst registry = createDefaultRegistry();\n\n\u002F\u002F Or pick specific tools\nconst minimal = new ToolRegistry();\nminimal.register(fileReadTool);\nminimal.register(shellTool);\n",[40,1285,1286,1299,1303,1308,1323,1327,1332,1349,1360],{"__ignoreMap":56},[449,1287,1288,1290,1293,1295,1297],{"class":451,"line":452},[449,1289,681],{"class":680},[449,1291,1292],{"class":684}," { createDefaultRegistry, ToolRegistry, fileReadTool, shellTool } ",[449,1294,688],{"class":680},[449,1296,692],{"class":691},[449,1298,695],{"class":684},[449,1300,1301],{"class":451,"line":114},[449,1302,700],{"emptyLinePlaceholder":130},[449,1304,1305],{"class":451,"line":111},[449,1306,1307],{"class":705},"\u002F\u002F All 49 tools\n",[449,1309,1310,1312,1315,1317,1320],{"class":451,"line":468},[449,1311,711],{"class":680},[449,1313,1314],{"class":714}," registry",[449,1316,718],{"class":680},[449,1318,1319],{"class":721}," createDefaultRegistry",[449,1321,1322],{"class":684},"();\n",[449,1324,1325],{"class":451,"line":474},[449,1326,700],{"emptyLinePlaceholder":130},[449,1328,1329],{"class":451,"line":480},[449,1330,1331],{"class":705},"\u002F\u002F Or pick specific tools\n",[449,1333,1334,1336,1339,1341,1344,1347],{"class":451,"line":486},[449,1335,711],{"class":680},[449,1337,1338],{"class":714}," minimal",[449,1340,718],{"class":680},[449,1342,1343],{"class":680}," new",[449,1345,1346],{"class":721}," ToolRegistry",[449,1348,1322],{"class":684},[449,1350,1351,1354,1357],{"class":451,"line":492},[449,1352,1353],{"class":684},"minimal.",[449,1355,1356],{"class":721},"register",[449,1358,1359],{"class":684},"(fileReadTool);\n",[449,1361,1362,1364,1366],{"class":451,"line":498},[449,1363,1353],{"class":684},[449,1365,1356],{"class":721},[449,1367,1368],{"class":684},"(shellTool);\n",[32,1370,1372],{"id":1371},"custom-tools","Custom Tools",[21,1374,1375],{},"Adding your own tool is straightforward:",[48,1377,1380],{"className":670,"code":1378,"filename":1379,"language":673,"meta":56,"style":56},"registry.register({\n  name: \"deploy\",\n  description: \"Deploy the application\",\n  parameters: {\n    type: \"object\",\n    properties: {\n      environment: { type: \"string\", enum: [\"staging\", \"production\"] },\n    },\n    required: [\"environment\"],\n  },\n  execute: async ({ environment }) => {\n    return { content: `Deployed to ${environment}` };\n  },\n});\n","custom-tool.ts",[40,1381,1382,1392,1402,1412,1417,1427,1432,1454,1459,1470,1475,1502,1521,1525],{"__ignoreMap":56},[449,1383,1384,1387,1389],{"class":451,"line":452},[449,1385,1386],{"class":684},"registry.",[449,1388,1356],{"class":721},[449,1390,1391],{"class":684},"({\n",[449,1393,1394,1397,1400],{"class":451,"line":114},[449,1395,1396],{"class":684},"  name: ",[449,1398,1399],{"class":691},"\"deploy\"",[449,1401,779],{"class":684},[449,1403,1404,1407,1410],{"class":451,"line":111},[449,1405,1406],{"class":684},"  description: ",[449,1408,1409],{"class":691},"\"Deploy the application\"",[449,1411,779],{"class":684},[449,1413,1414],{"class":451,"line":468},[449,1415,1416],{"class":684},"  parameters: {\n",[449,1418,1419,1422,1425],{"class":451,"line":474},[449,1420,1421],{"class":684},"    type: ",[449,1423,1424],{"class":691},"\"object\"",[449,1426,779],{"class":684},[449,1428,1429],{"class":451,"line":480},[449,1430,1431],{"class":684},"    properties: {\n",[449,1433,1434,1437,1440,1443,1446,1448,1451],{"class":451,"line":486},[449,1435,1436],{"class":684},"      environment: { type: ",[449,1438,1439],{"class":691},"\"string\"",[449,1441,1442],{"class":684},", enum: [",[449,1444,1445],{"class":691},"\"staging\"",[449,1447,349],{"class":684},[449,1449,1450],{"class":691},"\"production\"",[449,1452,1453],{"class":684},"] },\n",[449,1455,1456],{"class":451,"line":492},[449,1457,1458],{"class":684},"    },\n",[449,1460,1461,1464,1467],{"class":451,"line":498},[449,1462,1463],{"class":684},"    required: [",[449,1465,1466],{"class":691},"\"environment\"",[449,1468,1469],{"class":684},"],\n",[449,1471,1472],{"class":451,"line":133},[449,1473,1474],{"class":684},"  },\n",[449,1476,1477,1480,1483,1486,1489,1493,1496,1499],{"class":451,"line":509},[449,1478,1479],{"class":721},"  execute",[449,1481,1482],{"class":684},": ",[449,1484,1485],{"class":680},"async",[449,1487,1488],{"class":684}," ({ ",[449,1490,1492],{"class":1491},"s4XuR","environment",[449,1494,1495],{"class":684}," }) ",[449,1497,1498],{"class":680},"=>",[449,1500,1501],{"class":684}," {\n",[449,1503,1504,1507,1510,1513,1515,1518],{"class":451,"line":318},[449,1505,1506],{"class":680},"    return",[449,1508,1509],{"class":684}," { content: ",[449,1511,1512],{"class":691},"`Deployed to ${",[449,1514,1492],{"class":684},[449,1516,1517],{"class":691},"}`",[449,1519,1520],{"class":684}," };\n",[449,1522,1523],{"class":451,"line":520},[449,1524,1474],{"class":684},[449,1526,1527],{"class":451,"line":526},[449,1528,784],{"class":684},[427,1530,1533],{"icon":1531,"title":1532},"🔧","TypeBox Schemas",[21,1534,1535,1536,349,1539,1542,1543,1546,1547,1549],{},"For type-safe parameter validation, null-agent supports TypeBox schemas alongside JSON Schema. Import ",[40,1537,1538],{},"toolParams",[40,1540,1541],{},"String",", and ",[40,1544,1545],{},"Object"," from ",[40,1548,341],{}," for fully typed tool definitions.",[16,1551,1553],{"id":1552},"the-agent-loop","The Agent Loop",[21,1555,1556,1557,1559],{},"The ",[40,1558,394],{}," class is the heart of null-agent. It handles the conversation loop, tool execution, streaming, events, and orchestration.",[48,1561,1564],{"className":670,"code":1562,"filename":1563,"language":673,"meta":56,"style":56},"import { Agent, createProvider, createDefaultRegistry } from \"null-agent\";\n\nconst agent = new Agent({\n  provider: createProvider(\"anthropic\"),\n  tools: createDefaultRegistry(),\n  systemPrompt: \"You are a helpful coding assistant.\",\n});\n\nconst result = await agent.chat(\"Explain this function\");\nconsole.log(result.content);\nconsole.log(`Completed in ${result.iterations} iterations`);\n","agent.ts",[40,1565,1566,1579,1583,1599,1614,1625,1635,1639,1643,1668,1679],{"__ignoreMap":56},[449,1567,1568,1570,1573,1575,1577],{"class":451,"line":452},[449,1569,681],{"class":680},[449,1571,1572],{"class":684}," { Agent, createProvider, createDefaultRegistry } ",[449,1574,688],{"class":680},[449,1576,692],{"class":691},[449,1578,695],{"class":684},[449,1580,1581],{"class":451,"line":114},[449,1582,700],{"emptyLinePlaceholder":130},[449,1584,1585,1587,1590,1592,1594,1597],{"class":451,"line":111},[449,1586,711],{"class":680},[449,1588,1589],{"class":714}," agent",[449,1591,718],{"class":680},[449,1593,1343],{"class":680},[449,1595,1596],{"class":721}," Agent",[449,1598,1391],{"class":684},[449,1600,1601,1604,1607,1609,1611],{"class":451,"line":468},[449,1602,1603],{"class":684},"  provider: ",[449,1605,1606],{"class":721},"createProvider",[449,1608,725],{"class":684},[449,1610,765],{"class":691},[449,1612,1613],{"class":684},"),\n",[449,1615,1616,1619,1622],{"class":451,"line":474},[449,1617,1618],{"class":684},"  tools: ",[449,1620,1621],{"class":721},"createDefaultRegistry",[449,1623,1624],{"class":684},"(),\n",[449,1626,1627,1630,1633],{"class":451,"line":480},[449,1628,1629],{"class":684},"  systemPrompt: ",[449,1631,1632],{"class":691},"\"You are a helpful coding assistant.\"",[449,1634,779],{"class":684},[449,1636,1637],{"class":451,"line":486},[449,1638,784],{"class":684},[449,1640,1641],{"class":451,"line":492},[449,1642,700],{"emptyLinePlaceholder":130},[449,1644,1645,1647,1650,1652,1655,1658,1661,1663,1666],{"class":451,"line":498},[449,1646,711],{"class":680},[449,1648,1649],{"class":714}," result",[449,1651,718],{"class":680},[449,1653,1654],{"class":680}," await",[449,1656,1657],{"class":684}," agent.",[449,1659,1660],{"class":721},"chat",[449,1662,725],{"class":684},[449,1664,1665],{"class":691},"\"Explain this function\"",[449,1667,740],{"class":684},[449,1669,1670,1673,1676],{"class":451,"line":133},[449,1671,1672],{"class":684},"console.",[449,1674,1675],{"class":721},"log",[449,1677,1678],{"class":684},"(result.content);\n",[449,1680,1681,1683,1685,1687,1690,1693,1695,1698,1701],{"class":451,"line":509},[449,1682,1672],{"class":684},[449,1684,1675],{"class":721},[449,1686,725],{"class":684},[449,1688,1689],{"class":691},"`Completed in ${",[449,1691,1692],{"class":684},"result",[449,1694,165],{"class":691},[449,1696,1697],{"class":684},"iterations",[449,1699,1700],{"class":691},"} iterations`",[449,1702,740],{"class":684},[32,1704,1706],{"id":1705},"streaming-events","Streaming Events",[21,1708,1709],{},"For building UIs or logging, the agent emits rich events:",[48,1711,1714],{"className":670,"code":1712,"filename":1713,"language":673,"meta":56,"style":56},"const agent = new Agent({\n  provider,\n  tools,\n  eventHandlers: {\n    onAgentStart: (data) => console.log(\"Started:\", data.message),\n    onToolExecutionStart: (data) => console.log(\"Running:\", data.name),\n    onToolExecutionEnd: (data) => console.log(\"Done:\", data.name, data.isError),\n    onAgentEnd: (data) => console.log(\"Complete in\", data.iterations, \"iterations\"),\n  },\n});\n","events.ts",[40,1715,1716,1730,1735,1740,1745,1774,1799,1824,1854,1858],{"__ignoreMap":56},[449,1717,1718,1720,1722,1724,1726,1728],{"class":451,"line":452},[449,1719,711],{"class":680},[449,1721,1589],{"class":714},[449,1723,718],{"class":680},[449,1725,1343],{"class":680},[449,1727,1596],{"class":721},[449,1729,1391],{"class":684},[449,1731,1732],{"class":451,"line":114},[449,1733,1734],{"class":684},"  provider,\n",[449,1736,1737],{"class":451,"line":111},[449,1738,1739],{"class":684},"  tools,\n",[449,1741,1742],{"class":451,"line":468},[449,1743,1744],{"class":684},"  eventHandlers: {\n",[449,1746,1747,1750,1753,1756,1759,1761,1764,1766,1768,1771],{"class":451,"line":474},[449,1748,1749],{"class":721},"    onAgentStart",[449,1751,1752],{"class":684},": (",[449,1754,1755],{"class":1491},"data",[449,1757,1758],{"class":684},") ",[449,1760,1498],{"class":680},[449,1762,1763],{"class":684}," console.",[449,1765,1675],{"class":721},[449,1767,725],{"class":684},[449,1769,1770],{"class":691},"\"Started:\"",[449,1772,1773],{"class":684},", data.message),\n",[449,1775,1776,1779,1781,1783,1785,1787,1789,1791,1793,1796],{"class":451,"line":480},[449,1777,1778],{"class":721},"    onToolExecutionStart",[449,1780,1752],{"class":684},[449,1782,1755],{"class":1491},[449,1784,1758],{"class":684},[449,1786,1498],{"class":680},[449,1788,1763],{"class":684},[449,1790,1675],{"class":721},[449,1792,725],{"class":684},[449,1794,1795],{"class":691},"\"Running:\"",[449,1797,1798],{"class":684},", data.name),\n",[449,1800,1801,1804,1806,1808,1810,1812,1814,1816,1818,1821],{"class":451,"line":486},[449,1802,1803],{"class":721},"    onToolExecutionEnd",[449,1805,1752],{"class":684},[449,1807,1755],{"class":1491},[449,1809,1758],{"class":684},[449,1811,1498],{"class":680},[449,1813,1763],{"class":684},[449,1815,1675],{"class":721},[449,1817,725],{"class":684},[449,1819,1820],{"class":691},"\"Done:\"",[449,1822,1823],{"class":684},", data.name, data.isError),\n",[449,1825,1826,1829,1831,1833,1835,1837,1839,1841,1843,1846,1849,1852],{"class":451,"line":492},[449,1827,1828],{"class":721},"    onAgentEnd",[449,1830,1752],{"class":684},[449,1832,1755],{"class":1491},[449,1834,1758],{"class":684},[449,1836,1498],{"class":680},[449,1838,1763],{"class":684},[449,1840,1675],{"class":721},[449,1842,725],{"class":684},[449,1844,1845],{"class":691},"\"Complete in\"",[449,1847,1848],{"class":684},", data.iterations, ",[449,1850,1851],{"class":691},"\"iterations\"",[449,1853,1613],{"class":684},[449,1855,1856],{"class":451,"line":498},[449,1857,1474],{"class":684},[449,1859,1860],{"class":451,"line":133},[449,1861,784],{"class":684},[32,1863,1865],{"id":1864},"tool-hooks","Tool Hooks",[21,1867,1868],{},"Intercept and control tool execution:",[48,1870,1873],{"className":670,"code":1871,"filename":1872,"language":673,"meta":56,"style":56},"const agent = new Agent({\n  provider,\n  tools,\n  toolHooks: {\n    beforeToolCall: async (context) => {\n      console.log(\"About to run:\", context.name);\n      \u002F\u002F Return false to block execution\n    },\n    afterToolCall: async (context) => {\n      console.log(\"Finished:\", context.name, context.result);\n    },\n  },\n});\n","hooks.ts",[40,1874,1875,1889,1893,1897,1902,1923,1938,1943,1947,1966,1980,1984,1988],{"__ignoreMap":56},[449,1876,1877,1879,1881,1883,1885,1887],{"class":451,"line":452},[449,1878,711],{"class":680},[449,1880,1589],{"class":714},[449,1882,718],{"class":680},[449,1884,1343],{"class":680},[449,1886,1596],{"class":721},[449,1888,1391],{"class":684},[449,1890,1891],{"class":451,"line":114},[449,1892,1734],{"class":684},[449,1894,1895],{"class":451,"line":111},[449,1896,1739],{"class":684},[449,1898,1899],{"class":451,"line":468},[449,1900,1901],{"class":684},"  toolHooks: {\n",[449,1903,1904,1907,1909,1911,1914,1917,1919,1921],{"class":451,"line":474},[449,1905,1906],{"class":721},"    beforeToolCall",[449,1908,1482],{"class":684},[449,1910,1485],{"class":680},[449,1912,1913],{"class":684}," (",[449,1915,1916],{"class":1491},"context",[449,1918,1758],{"class":684},[449,1920,1498],{"class":680},[449,1922,1501],{"class":684},[449,1924,1925,1928,1930,1932,1935],{"class":451,"line":480},[449,1926,1927],{"class":684},"      console.",[449,1929,1675],{"class":721},[449,1931,725],{"class":684},[449,1933,1934],{"class":691},"\"About to run:\"",[449,1936,1937],{"class":684},", context.name);\n",[449,1939,1940],{"class":451,"line":486},[449,1941,1942],{"class":705},"      \u002F\u002F Return false to block execution\n",[449,1944,1945],{"class":451,"line":492},[449,1946,1458],{"class":684},[449,1948,1949,1952,1954,1956,1958,1960,1962,1964],{"class":451,"line":498},[449,1950,1951],{"class":721},"    afterToolCall",[449,1953,1482],{"class":684},[449,1955,1485],{"class":680},[449,1957,1913],{"class":684},[449,1959,1916],{"class":1491},[449,1961,1758],{"class":684},[449,1963,1498],{"class":680},[449,1965,1501],{"class":684},[449,1967,1968,1970,1972,1974,1977],{"class":451,"line":133},[449,1969,1927],{"class":684},[449,1971,1675],{"class":721},[449,1973,725],{"class":684},[449,1975,1976],{"class":691},"\"Finished:\"",[449,1978,1979],{"class":684},", context.name, context.result);\n",[449,1981,1982],{"class":451,"line":509},[449,1983,1458],{"class":684},[449,1985,1986],{"class":451,"line":318},[449,1987,1474],{"class":684},[449,1989,1990],{"class":451,"line":520},[449,1991,784],{"class":684},[32,1993,1995],{"id":1994},"steering","Steering",[21,1997,1998],{},"Inject messages or queue follow-up work:",[48,2000,2003],{"className":670,"code":2001,"filename":2002,"language":673,"meta":56,"style":56},"const agent = new Agent({ provider, tools });\n\n\u002F\u002F Inject context before next chat\nagent.steer({ role: \"user\", content: \"Remember: use TypeScript\" });\nawait agent.chat(\"Hello\");\n\n\u002F\u002F Queue work after agent stops\nagent.followUp(async () => {\n  await agent.chat(\"Now summarize what we did\");\n});\n","steering.ts",[40,2004,2005,2020,2024,2029,2052,2068,2072,2077,2095,2111],{"__ignoreMap":56},[449,2006,2007,2009,2011,2013,2015,2017],{"class":451,"line":452},[449,2008,711],{"class":680},[449,2010,1589],{"class":714},[449,2012,718],{"class":680},[449,2014,1343],{"class":680},[449,2016,1596],{"class":721},[449,2018,2019],{"class":684},"({ provider, tools });\n",[449,2021,2022],{"class":451,"line":114},[449,2023,700],{"emptyLinePlaceholder":130},[449,2025,2026],{"class":451,"line":111},[449,2027,2028],{"class":705},"\u002F\u002F Inject context before next chat\n",[449,2030,2031,2034,2037,2040,2043,2046,2049],{"class":451,"line":468},[449,2032,2033],{"class":684},"agent.",[449,2035,2036],{"class":721},"steer",[449,2038,2039],{"class":684},"({ role: ",[449,2041,2042],{"class":691},"\"user\"",[449,2044,2045],{"class":684},", content: ",[449,2047,2048],{"class":691},"\"Remember: use TypeScript\"",[449,2050,2051],{"class":684}," });\n",[449,2053,2054,2057,2059,2061,2063,2066],{"class":451,"line":474},[449,2055,2056],{"class":680},"await",[449,2058,1657],{"class":684},[449,2060,1660],{"class":721},[449,2062,725],{"class":684},[449,2064,2065],{"class":691},"\"Hello\"",[449,2067,740],{"class":684},[449,2069,2070],{"class":451,"line":480},[449,2071,700],{"emptyLinePlaceholder":130},[449,2073,2074],{"class":451,"line":486},[449,2075,2076],{"class":705},"\u002F\u002F Queue work after agent stops\n",[449,2078,2079,2081,2084,2086,2088,2091,2093],{"class":451,"line":492},[449,2080,2033],{"class":684},[449,2082,2083],{"class":721},"followUp",[449,2085,725],{"class":684},[449,2087,1485],{"class":680},[449,2089,2090],{"class":684}," () ",[449,2092,1498],{"class":680},[449,2094,1501],{"class":684},[449,2096,2097,2100,2102,2104,2106,2109],{"class":451,"line":498},[449,2098,2099],{"class":680},"  await",[449,2101,1657],{"class":684},[449,2103,1660],{"class":721},[449,2105,725],{"class":684},[449,2107,2108],{"class":691},"\"Now summarize what we did\"",[449,2110,740],{"class":684},[449,2112,2113],{"class":451,"line":133},[449,2114,784],{"class":684},[32,2116,2118],{"id":2117},"multi-agent-orchestration","Multi-Agent Orchestration",[21,2120,2121],{},"For complex tasks, the agent can spawn parallel sub-agents:",[48,2123,2126],{"className":670,"code":2124,"filename":2125,"language":673,"meta":56,"style":56},"const agent = new Agent({\n  provider: createProvider(\"anthropic\"),\n  tools: createDefaultRegistry(),\n  enableOrchestrator: true,\n});\n\n\u002F\u002F The agent can use the \"spawn_task\" tool to delegate work\nconst result = await agent.chat(\"Investigate these 3 files in parallel\");\n","orchestrator.ts",[40,2127,2128,2142,2154,2162,2172,2176,2180,2185],{"__ignoreMap":56},[449,2129,2130,2132,2134,2136,2138,2140],{"class":451,"line":452},[449,2131,711],{"class":680},[449,2133,1589],{"class":714},[449,2135,718],{"class":680},[449,2137,1343],{"class":680},[449,2139,1596],{"class":721},[449,2141,1391],{"class":684},[449,2143,2144,2146,2148,2150,2152],{"class":451,"line":114},[449,2145,1603],{"class":684},[449,2147,1606],{"class":721},[449,2149,725],{"class":684},[449,2151,765],{"class":691},[449,2153,1613],{"class":684},[449,2155,2156,2158,2160],{"class":451,"line":111},[449,2157,1618],{"class":684},[449,2159,1621],{"class":721},[449,2161,1624],{"class":684},[449,2163,2164,2167,2170],{"class":451,"line":468},[449,2165,2166],{"class":684},"  enableOrchestrator: ",[449,2168,2169],{"class":714},"true",[449,2171,779],{"class":684},[449,2173,2174],{"class":451,"line":474},[449,2175,784],{"class":684},[449,2177,2178],{"class":451,"line":480},[449,2179,700],{"emptyLinePlaceholder":130},[449,2181,2182],{"class":451,"line":486},[449,2183,2184],{"class":705},"\u002F\u002F The agent can use the \"spawn_task\" tool to delegate work\n",[449,2186,2187,2189,2191,2193,2195,2197,2199,2201,2204],{"class":451,"line":492},[449,2188,711],{"class":680},[449,2190,1649],{"class":714},[449,2192,718],{"class":680},[449,2194,1654],{"class":680},[449,2196,1657],{"class":684},[449,2198,1660],{"class":721},[449,2200,725],{"class":684},[449,2202,2203],{"class":691},"\"Investigate these 3 files in parallel\"",[449,2205,740],{"class":684},[21,2207,2208],{},"Safety limits are enforced: 5 concurrent sub-agents, 3 spawns per turn, 30s timeout per sub-agent.",[16,2210,2212],{"id":2211},"four-interfaces","Four Interfaces",[32,2214,2216],{"id":2215},"terminal-ui-default","Terminal UI (Default)",[21,2218,2219],{},"The Ink-based TUI is the default experience. It features:",[383,2221,2222,2228,2234,2243,2263,2269],{},[386,2223,2224,2227],{},[151,2225,2226],{},"Status bar"," with live activity tracking and project context",[386,2229,2230,2233],{},[151,2231,2232],{},"Chat panel"," with message bubbles and formatted tool call display",[386,2235,2236,1913,2239,2242],{},[151,2237,2238],{},"Animated mascot",[40,2240,2241],{},"◉",") with 11 moods that change based on activity",[386,2244,2245,1913,2248,349,2251,349,2254,349,2257,349,2260,827],{},[151,2246,2247],{},"Slash commands",[40,2249,2250],{},"\u002Fhelp",[40,2252,2253],{},"\u002Fclear",[40,2255,2256],{},"\u002Fcontext",[40,2258,2259],{},"\u002Freport",[40,2261,2262],{},"\u002Fgoals",[386,2264,2265,2268],{},[151,2266,2267],{},"Daily summary panel"," with meetings, goals, and yesterday's breakdown",[386,2270,2271,1913,2274,2277,2278,2281],{},[151,2272,2273],{},"Keyboard shortcuts",[40,2275,2276],{},"Ctrl+H"," for help, ",[40,2279,2280],{},"Ctrl+S"," for summary, arrow keys for history)",[48,2283,2285],{"className":839,"code":2284,"language":841,"meta":56,"style":56},"null-agent\n",[40,2286,2287],{"__ignoreMap":56},[449,2288,2289],{"class":451,"line":452},[449,2290,2284],{"class":721},[32,2292,2294],{"id":2293},"plain-repl","Plain REPL",[21,2296,2297],{},"No extra dependencies. Just readline with colored output:",[48,2299,2301],{"className":839,"code":2300,"language":841,"meta":56,"style":56},"null-agent --plain\n",[40,2302,2303],{"__ignoreMap":56},[449,2304,2305,2307],{"class":451,"line":452},[449,2306,341],{"class":721},[449,2308,2309],{"class":714}," --plain\n",[32,2311,2313],{"id":2312},"http-api-server","HTTP API Server",[21,2315,2316],{},"REST API with SSE streaming. Default port 3737:",[48,2318,2320],{"className":839,"code":2319,"language":841,"meta":56,"style":56},"null-agent --server --port 3737 --host 0.0.0.0\n",[40,2321,2322],{"__ignoreMap":56},[449,2323,2324,2326,2329,2332,2335,2338],{"class":451,"line":452},[449,2325,341],{"class":721},[449,2327,2328],{"class":714}," --server",[449,2330,2331],{"class":714}," --port",[449,2333,2334],{"class":714}," 3737",[449,2336,2337],{"class":714}," --host",[449,2339,2340],{"class":714}," 0.0.0.0\n",[21,2342,2343,2344,349,2347,349,2350,349,2353,349,2356,349,2359,1542,2362,165],{},"Endpoints include ",[40,2345,2346],{},"\u002Fchat",[40,2348,2349],{},"\u002Fchat\u002Fstream",[40,2351,2352],{},"\u002Fhistory",[40,2354,2355],{},"\u002Fconversations",[40,2357,2358],{},"\u002Ftasks",[40,2360,2361],{},"\u002Fconfig",[40,2363,2364],{},"\u002Fhealth",[32,2366,2368],{"id":2367},"one-shot-cli","One-Shot CLI",[21,2370,2371],{},"Send a single message and print the response. Perfect for scripting:",[48,2373,2375],{"className":839,"code":2374,"language":841,"meta":56,"style":56},"null-agent \"what does this function do?\"\nnull-agent --provider openai \"summarize the changes\"\n",[40,2376,2377,2384],{"__ignoreMap":56},[449,2378,2379,2381],{"class":451,"line":452},[449,2380,341],{"class":721},[449,2382,2383],{"class":691}," \"what does this function do?\"\n",[449,2385,2386,2388,2391,2393],{"class":451,"line":114},[449,2387,341],{"class":721},[449,2389,2390],{"class":714}," --provider",[449,2392,862],{"class":691},[449,2394,2395],{"class":691}," \"summarize the changes\"\n",[16,2397,2399],{"id":2398},"accountability-developer-day-tracker","Accountability & Developer Day Tracker",[21,2401,2402],{},"This is the feature that surprised me most while building it. null-agent includes a self-aware developer day companion that tracks what you're working on, keeps you accountable to goals, and generates daily and weekly reports — all without leaving the terminal.",[32,2404,2406],{"id":2405},"how-tracking-works","How Tracking Works",[21,2408,2409],{},"Activity is tracked in two ways:",[383,2411,2412,2445],{},[386,2413,2414,2417,2418,2421,2422,2425,2426,2429,2430,2433,2434,2429,2437,349,2439,2429,2442,374],{},[151,2415,2416],{},"Inferred"," — every tool call is mapped to an activity type automatically. Reading files → ",[40,2419,2420],{},"coding",". Running tests → ",[40,2423,2424],{},"testing",". ",[40,2427,2428],{},"git diff"," → ",[40,2431,2432],{},"review",". Shell commands are classified by regex (",[40,2435,2436],{},"jest",[40,2438,2424],{},[40,2440,2441],{},"inspect",[40,2443,2444],{},"debugging",[386,2446,2447,2450,2451,2454],{},[151,2448,2449],{},"Explicit"," — use ",[40,2452,2453],{},"\u002Ftrack \u003Ctype>"," to manually declare what you're working on.",[32,2456,2458],{"id":2457},"goal-tracking","Goal Tracking",[48,2460,2462],{"className":839,"code":2461,"language":841,"meta":56,"style":56},"\u002Fgoals               # List today's goals with status icons\n\u002Fgoal add \u003Ctext>     # Create a new daily goal\n\u002Fgoal done \u003Cid>      # Mark a goal complete (triggers celebration)\n\u002Fgoal rm \u003Cid>        # Delete a goal\n",[40,2463,2464,2471,2494,2514],{"__ignoreMap":56},[449,2465,2466,2468],{"class":451,"line":452},[449,2467,2262],{"class":721},[449,2469,2470],{"class":705},"               # List today's goals with status icons\n",[449,2472,2473,2476,2479,2482,2485,2488,2491],{"class":451,"line":114},[449,2474,2475],{"class":721},"\u002Fgoal",[449,2477,2478],{"class":691}," add",[449,2480,2481],{"class":680}," \u003C",[449,2483,2484],{"class":691},"tex",[449,2486,2487],{"class":684},"t",[449,2489,2490],{"class":680},">",[449,2492,2493],{"class":705},"     # Create a new daily goal\n",[449,2495,2496,2498,2501,2503,2506,2509,2511],{"class":451,"line":111},[449,2497,2475],{"class":721},[449,2499,2500],{"class":691}," done",[449,2502,2481],{"class":680},[449,2504,2505],{"class":691},"i",[449,2507,2508],{"class":684},"d",[449,2510,2490],{"class":680},[449,2512,2513],{"class":705},"      # Mark a goal complete (triggers celebration)\n",[449,2515,2516,2518,2521,2523,2525,2527,2529],{"class":451,"line":468},[449,2517,2475],{"class":721},[449,2519,2520],{"class":691}," rm",[449,2522,2481],{"class":680},[449,2524,2505],{"class":691},[449,2526,2508],{"class":684},[449,2528,2490],{"class":680},[449,2530,2531],{"class":705},"        # Delete a goal\n",[21,2533,2534,2535,2538,2539,2538,2542,2538,2545],{},"Goal statuses: ",[40,2536,2537],{},"○ pending"," · ",[40,2540,2541],{},"⟳ in-progress",[40,2543,2544],{},"✓ completed",[40,2546,2547],{},"✗ missed",[32,2549,2551],{"id":2550},"reports","Reports",[48,2553,2555],{"className":839,"code":2554,"language":841,"meta":56,"style":56},"\u002Freport              # Generate today's report\n\u002Freport week         # Generate this week's report\n",[40,2556,2557,2564],{"__ignoreMap":56},[449,2558,2559,2561],{"class":451,"line":452},[449,2560,2259],{"class":721},[449,2562,2563],{"class":705},"              # Generate today's report\n",[449,2565,2566,2568,2571],{"class":451,"line":114},[449,2567,2259],{"class":721},[449,2569,2570],{"class":691}," week",[449,2572,2573],{"class":705},"         # Generate this week's report\n",[21,2575,2576,2577,2580],{},"Reports are saved to ",[40,2578,2579],{},"~\u002F.null-agent\u002Faccountability\u002Freports\u002F"," in both Markdown and JSON formats.",[32,2582,2584],{"id":2583},"proactive-reminders","Proactive Reminders",[21,2586,2587],{},"The accountability engine polls every minute and surfaces messages when:",[383,2589,2590,2593,2596,2599],{},[386,2591,2592],{},"A goal has been pending all day with no progress",[386,2594,2595],{},"You've been coding or debugging for 2+ hours (break reminder)",[386,2597,2598],{},"It's 9–10 AM and you haven't checked in",[386,2600,2601],{},"It's 5–6 PM and the day is ending",[32,2603,2605],{"id":2604},"using-accountability-as-a-library","Using Accountability as a Library",[48,2607,2610],{"className":670,"code":2608,"filename":2609,"language":673,"meta":56,"style":56},"import { ActivityTracker, Reporter, GoalTracker } from \"null-agent\";\n\nconst tracker = new ActivityTracker();\nawait tracker.init();\n\n\u002F\u002F Explicit tracking\nconst activityId = await tracker.startActivity(\"coding\", \"Auth module refactor\");\nawait tracker.endActivity(activityId);\n\n\u002F\u002F Inferred tracking — call this in your tool hook\nawait tracker.recordToolCall(\"file_write\", { path: \"src\u002Fauth.ts\" }, \"ok\");\n\n\u002F\u002F Daily report\nconst reporter = new Reporter(store, tracker);\nconst report = await reporter.generateDailyReport();\nconsole.log(reporter.formatDailyReport(report));\n","accountability.ts",[40,2611,2612,2625,2629,2645,2657,2661,2666,2694,2706,2710,2715,2743,2747,2752,2769,2788],{"__ignoreMap":56},[449,2613,2614,2616,2619,2621,2623],{"class":451,"line":452},[449,2615,681],{"class":680},[449,2617,2618],{"class":684}," { ActivityTracker, Reporter, GoalTracker } ",[449,2620,688],{"class":680},[449,2622,692],{"class":691},[449,2624,695],{"class":684},[449,2626,2627],{"class":451,"line":114},[449,2628,700],{"emptyLinePlaceholder":130},[449,2630,2631,2633,2636,2638,2640,2643],{"class":451,"line":111},[449,2632,711],{"class":680},[449,2634,2635],{"class":714}," tracker",[449,2637,718],{"class":680},[449,2639,1343],{"class":680},[449,2641,2642],{"class":721}," ActivityTracker",[449,2644,1322],{"class":684},[449,2646,2647,2649,2652,2655],{"class":451,"line":468},[449,2648,2056],{"class":680},[449,2650,2651],{"class":684}," tracker.",[449,2653,2654],{"class":721},"init",[449,2656,1322],{"class":684},[449,2658,2659],{"class":451,"line":474},[449,2660,700],{"emptyLinePlaceholder":130},[449,2662,2663],{"class":451,"line":480},[449,2664,2665],{"class":705},"\u002F\u002F Explicit tracking\n",[449,2667,2668,2670,2673,2675,2677,2679,2682,2684,2687,2689,2692],{"class":451,"line":486},[449,2669,711],{"class":680},[449,2671,2672],{"class":714}," activityId",[449,2674,718],{"class":680},[449,2676,1654],{"class":680},[449,2678,2651],{"class":684},[449,2680,2681],{"class":721},"startActivity",[449,2683,725],{"class":684},[449,2685,2686],{"class":691},"\"coding\"",[449,2688,349],{"class":684},[449,2690,2691],{"class":691},"\"Auth module refactor\"",[449,2693,740],{"class":684},[449,2695,2696,2698,2700,2703],{"class":451,"line":492},[449,2697,2056],{"class":680},[449,2699,2651],{"class":684},[449,2701,2702],{"class":721},"endActivity",[449,2704,2705],{"class":684},"(activityId);\n",[449,2707,2708],{"class":451,"line":498},[449,2709,700],{"emptyLinePlaceholder":130},[449,2711,2712],{"class":451,"line":133},[449,2713,2714],{"class":705},"\u002F\u002F Inferred tracking — call this in your tool hook\n",[449,2716,2717,2719,2721,2724,2726,2729,2732,2735,2738,2741],{"class":451,"line":509},[449,2718,2056],{"class":680},[449,2720,2651],{"class":684},[449,2722,2723],{"class":721},"recordToolCall",[449,2725,725],{"class":684},[449,2727,2728],{"class":691},"\"file_write\"",[449,2730,2731],{"class":684},", { path: ",[449,2733,2734],{"class":691},"\"src\u002Fauth.ts\"",[449,2736,2737],{"class":684}," }, ",[449,2739,2740],{"class":691},"\"ok\"",[449,2742,740],{"class":684},[449,2744,2745],{"class":451,"line":318},[449,2746,700],{"emptyLinePlaceholder":130},[449,2748,2749],{"class":451,"line":520},[449,2750,2751],{"class":705},"\u002F\u002F Daily report\n",[449,2753,2754,2756,2759,2761,2763,2766],{"class":451,"line":526},[449,2755,711],{"class":680},[449,2757,2758],{"class":714}," reporter",[449,2760,718],{"class":680},[449,2762,1343],{"class":680},[449,2764,2765],{"class":721}," Reporter",[449,2767,2768],{"class":684},"(store, tracker);\n",[449,2770,2771,2773,2776,2778,2780,2783,2786],{"class":451,"line":532},[449,2772,711],{"class":680},[449,2774,2775],{"class":714}," report",[449,2777,718],{"class":680},[449,2779,1654],{"class":680},[449,2781,2782],{"class":684}," reporter.",[449,2784,2785],{"class":721},"generateDailyReport",[449,2787,1322],{"class":684},[449,2789,2791,2793,2795,2798,2801],{"class":451,"line":2790},16,[449,2792,1672],{"class":684},[449,2794,1675],{"class":721},[449,2796,2797],{"class":684},"(reporter.",[449,2799,2800],{"class":721},"formatDailyReport",[449,2802,2803],{"class":684},"(report));\n",[2805,2806,2807,2812],"blog-card",{},[2808,2809,2811],"h3",{"id":2810},"why-accountability-in-a-coding-assistant","Why Accountability in a Coding Assistant?",[21,2813,2814],{},"Because the terminal is where developers spend most of their time. Putting time tracking, goal management, and daily reports there removes friction — no context switching to another app.",[16,2816,2818],{"id":2817},"project-awareness","Project Awareness",[21,2820,2821],{},"null-agent doesn't just chat — it understands your project.",[32,2823,2825],{"id":2824},"project-scanning","Project Scanning",[48,2827,2830],{"className":670,"code":2828,"filename":2829,"language":673,"meta":56,"style":56},"import { scanProject } from \"null-agent\";\n\nconst knowledge = await scanProject(\".\u002Fmy-project\");\nconsole.log(knowledge.language); \u002F\u002F \"typescript\"\nconsole.log(knowledge.framework); \u002F\u002F \"react\"\nconsole.log(knowledge.packageManager); \u002F\u002F \"pnpm\"\nconsole.log(knowledge.testCommand); \u002F\u002F \"vitest\"\n","scan.ts",[40,2831,2832,2845,2849,2870,2882,2894,2906],{"__ignoreMap":56},[449,2833,2834,2836,2839,2841,2843],{"class":451,"line":452},[449,2835,681],{"class":680},[449,2837,2838],{"class":684}," { scanProject } ",[449,2840,688],{"class":680},[449,2842,692],{"class":691},[449,2844,695],{"class":684},[449,2846,2847],{"class":451,"line":114},[449,2848,700],{"emptyLinePlaceholder":130},[449,2850,2851,2853,2856,2858,2860,2863,2865,2868],{"class":451,"line":111},[449,2852,711],{"class":680},[449,2854,2855],{"class":714}," knowledge",[449,2857,718],{"class":680},[449,2859,1654],{"class":680},[449,2861,2862],{"class":721}," scanProject",[449,2864,725],{"class":684},[449,2866,2867],{"class":691},"\".\u002Fmy-project\"",[449,2869,740],{"class":684},[449,2871,2872,2874,2876,2879],{"class":451,"line":468},[449,2873,1672],{"class":684},[449,2875,1675],{"class":721},[449,2877,2878],{"class":684},"(knowledge.language); ",[449,2880,2881],{"class":705},"\u002F\u002F \"typescript\"\n",[449,2883,2884,2886,2888,2891],{"class":451,"line":474},[449,2885,1672],{"class":684},[449,2887,1675],{"class":721},[449,2889,2890],{"class":684},"(knowledge.framework); ",[449,2892,2893],{"class":705},"\u002F\u002F \"react\"\n",[449,2895,2896,2898,2900,2903],{"class":451,"line":480},[449,2897,1672],{"class":684},[449,2899,1675],{"class":721},[449,2901,2902],{"class":684},"(knowledge.packageManager); ",[449,2904,2905],{"class":705},"\u002F\u002F \"pnpm\"\n",[449,2907,2908,2910,2912,2915],{"class":451,"line":486},[449,2909,1672],{"class":684},[449,2911,1675],{"class":721},[449,2913,2914],{"class":684},"(knowledge.testCommand); ",[449,2916,2917],{"class":705},"\u002F\u002F \"vitest\"\n",[21,2919,2920],{},"It detects Next.js, Nuxt, React, Vue, Express, Fastify, Hono, NestJS, and more.",[32,2922,2924],{"id":2923},"real-time-awareness","Real-Time Awareness",[21,2926,2927],{},"Git monitoring and file watching surface events as they happen:",[48,2929,2932],{"className":670,"code":2930,"filename":2931,"language":673,"meta":56,"style":56},"import { AwarenessManager } from \"null-agent\";\n\nconst awareness = new AwarenessManager({ projectDir: \".\u002Fmy-project\" });\nawareness.start({\n  onEvent: (event) => {\n    console.log(`${event.type}: ${event.message}`);\n  },\n});\n","awareness.ts",[40,2933,2934,2947,2951,2972,2982,2998,3031,3035],{"__ignoreMap":56},[449,2935,2936,2938,2941,2943,2945],{"class":451,"line":452},[449,2937,681],{"class":680},[449,2939,2940],{"class":684}," { AwarenessManager } ",[449,2942,688],{"class":680},[449,2944,692],{"class":691},[449,2946,695],{"class":684},[449,2948,2949],{"class":451,"line":114},[449,2950,700],{"emptyLinePlaceholder":130},[449,2952,2953,2955,2958,2960,2962,2965,2968,2970],{"class":451,"line":111},[449,2954,711],{"class":680},[449,2956,2957],{"class":714}," awareness",[449,2959,718],{"class":680},[449,2961,1343],{"class":680},[449,2963,2964],{"class":721}," AwarenessManager",[449,2966,2967],{"class":684},"({ projectDir: ",[449,2969,2867],{"class":691},[449,2971,2051],{"class":684},[449,2973,2974,2977,2980],{"class":451,"line":468},[449,2975,2976],{"class":684},"awareness.",[449,2978,2979],{"class":721},"start",[449,2981,1391],{"class":684},[449,2983,2984,2987,2989,2992,2994,2996],{"class":451,"line":474},[449,2985,2986],{"class":721},"  onEvent",[449,2988,1752],{"class":684},[449,2990,2991],{"class":1491},"event",[449,2993,1758],{"class":684},[449,2995,1498],{"class":680},[449,2997,1501],{"class":684},[449,2999,3000,3003,3005,3007,3010,3012,3014,3017,3020,3022,3024,3027,3029],{"class":451,"line":480},[449,3001,3002],{"class":684},"    console.",[449,3004,1675],{"class":721},[449,3006,725],{"class":684},[449,3008,3009],{"class":691},"`${",[449,3011,2991],{"class":684},[449,3013,165],{"class":691},[449,3015,3016],{"class":684},"type",[449,3018,3019],{"class":691},"}: ${",[449,3021,2991],{"class":684},[449,3023,165],{"class":691},[449,3025,3026],{"class":684},"message",[449,3028,1517],{"class":691},[449,3030,740],{"class":684},[449,3032,3033],{"class":451,"line":486},[449,3034,1474],{"class":684},[449,3036,3037],{"class":451,"line":492},[449,3038,784],{"class":684},[21,3040,3041,3042,349,3045,349,3048,349,3051,349,3054,1542,3057,165],{},"Events include ",[40,3043,3044],{},"git:change",[40,3046,3047],{},"git:branch",[40,3049,3050],{},"git:conflict",[40,3052,3053],{},"file:create",[40,3055,3056],{},"file:modify",[40,3058,3059],{},"file:delete",[16,3061,3063],{"id":3062},"memory-persistence","Memory & Persistence",[21,3065,3066,3067,3070],{},"Conversations are persisted to disk at ",[40,3068,3069],{},"~\u002F.null-agent\u002Fmemory\u002F",":",[48,3072,3075],{"className":670,"code":3073,"filename":3074,"language":673,"meta":56,"style":56},"import { Agent, MemoryStore } from \"null-agent\";\n\nconst memory = new MemoryStore();\nconst agent = new Agent({ provider, tools, memory });\n\n\u002F\u002F Resume a previous conversation\nawait agent.resumeConversation(\"conversation-id\");\n\n\u002F\u002F List saved conversations\nconst conversations = await memory.listConversations();\n","memory.ts",[40,3076,3077,3090,3094,3110,3125,3129,3134,3150,3154,3159],{"__ignoreMap":56},[449,3078,3079,3081,3084,3086,3088],{"class":451,"line":452},[449,3080,681],{"class":680},[449,3082,3083],{"class":684}," { Agent, MemoryStore } ",[449,3085,688],{"class":680},[449,3087,692],{"class":691},[449,3089,695],{"class":684},[449,3091,3092],{"class":451,"line":114},[449,3093,700],{"emptyLinePlaceholder":130},[449,3095,3096,3098,3101,3103,3105,3108],{"class":451,"line":111},[449,3097,711],{"class":680},[449,3099,3100],{"class":714}," memory",[449,3102,718],{"class":680},[449,3104,1343],{"class":680},[449,3106,3107],{"class":721}," MemoryStore",[449,3109,1322],{"class":684},[449,3111,3112,3114,3116,3118,3120,3122],{"class":451,"line":468},[449,3113,711],{"class":680},[449,3115,1589],{"class":714},[449,3117,718],{"class":680},[449,3119,1343],{"class":680},[449,3121,1596],{"class":721},[449,3123,3124],{"class":684},"({ provider, tools, memory });\n",[449,3126,3127],{"class":451,"line":474},[449,3128,700],{"emptyLinePlaceholder":130},[449,3130,3131],{"class":451,"line":480},[449,3132,3133],{"class":705},"\u002F\u002F Resume a previous conversation\n",[449,3135,3136,3138,3140,3143,3145,3148],{"class":451,"line":486},[449,3137,2056],{"class":680},[449,3139,1657],{"class":684},[449,3141,3142],{"class":721},"resumeConversation",[449,3144,725],{"class":684},[449,3146,3147],{"class":691},"\"conversation-id\"",[449,3149,740],{"class":684},[449,3151,3152],{"class":451,"line":492},[449,3153,700],{"emptyLinePlaceholder":130},[449,3155,3156],{"class":451,"line":498},[449,3157,3158],{"class":705},"\u002F\u002F List saved conversations\n",[449,3160,3161,3163,3166,3168,3170,3173,3176],{"class":451,"line":133},[449,3162,711],{"class":680},[449,3164,3165],{"class":714}," conversations",[449,3167,718],{"class":680},[449,3169,1654],{"class":680},[449,3171,3172],{"class":684}," memory.",[449,3174,3175],{"class":721},"listConversations",[449,3177,1322],{"class":684},[16,3179,3181],{"id":3180},"permission-system","Permission System",[21,3183,3184],{},"Control what the agent can do with three modes:",[48,3186,3189],{"className":670,"code":3187,"filename":3188,"language":673,"meta":56,"style":56},"import { PermissionManager } from \"null-agent\";\n\nconst permissions = new PermissionManager({\n  mode: \"confirm\", \u002F\u002F \"auto\" | \"confirm\" | \"plan\"\n  allowWrite: true,\n  allowShell: true,\n  allowGit: true,\n  denyPatterns: [\"rm -rf\", \"sudo\"],\n});\n","permissions.ts",[40,3190,3191,3204,3208,3224,3237,3246,3255,3264,3279],{"__ignoreMap":56},[449,3192,3193,3195,3198,3200,3202],{"class":451,"line":452},[449,3194,681],{"class":680},[449,3196,3197],{"class":684}," { PermissionManager } ",[449,3199,688],{"class":680},[449,3201,692],{"class":691},[449,3203,695],{"class":684},[449,3205,3206],{"class":451,"line":114},[449,3207,700],{"emptyLinePlaceholder":130},[449,3209,3210,3212,3215,3217,3219,3222],{"class":451,"line":111},[449,3211,711],{"class":680},[449,3213,3214],{"class":714}," permissions",[449,3216,718],{"class":680},[449,3218,1343],{"class":680},[449,3220,3221],{"class":721}," PermissionManager",[449,3223,1391],{"class":684},[449,3225,3226,3229,3232,3234],{"class":451,"line":468},[449,3227,3228],{"class":684},"  mode: ",[449,3230,3231],{"class":691},"\"confirm\"",[449,3233,349],{"class":684},[449,3235,3236],{"class":705},"\u002F\u002F \"auto\" | \"confirm\" | \"plan\"\n",[449,3238,3239,3242,3244],{"class":451,"line":474},[449,3240,3241],{"class":684},"  allowWrite: ",[449,3243,2169],{"class":714},[449,3245,779],{"class":684},[449,3247,3248,3251,3253],{"class":451,"line":480},[449,3249,3250],{"class":684},"  allowShell: ",[449,3252,2169],{"class":714},[449,3254,779],{"class":684},[449,3256,3257,3260,3262],{"class":451,"line":486},[449,3258,3259],{"class":684},"  allowGit: ",[449,3261,2169],{"class":714},[449,3263,779],{"class":684},[449,3265,3266,3269,3272,3274,3277],{"class":451,"line":492},[449,3267,3268],{"class":684},"  denyPatterns: [",[449,3270,3271],{"class":691},"\"rm -rf\"",[449,3273,349],{"class":684},[449,3275,3276],{"class":691},"\"sudo\"",[449,3278,1469],{"class":684},[449,3280,3281],{"class":451,"line":498},[449,3282,784],{"class":684},[383,3284,3285,3291,3297],{},[386,3286,3287,3290],{},[151,3288,3289],{},"auto"," — execute everything",[386,3292,3293,3296],{},[151,3294,3295],{},"confirm"," — ask before destructive operations",[386,3298,3299,3302],{},[151,3300,3301],{},"plan"," — read-only mode",[16,3304,3306],{"id":3305},"plugin-system","Plugin System",[21,3308,3309],{},"Extend null-agent without modifying core code:",[48,3311,3314],{"className":670,"code":3312,"filename":3313,"language":673,"meta":56,"style":56},"import { PluginManager, EventBus } from \"null-agent\";\n\nconst bus = new EventBus();\nconst manager = new PluginManager(bus, process.cwd());\n\nawait manager.register({\n  name: \"my-plugin\",\n  version: \"1.0.0\",\n  setup(context) {\n    context.registerTool({\n      name: \"my_tool\",\n      description: \"Does something useful\",\n      parameters: { type: \"object\", properties: {} },\n      execute: async () => ({ content: \"done\" }),\n    });\n    context.bus.on(\"agent:text\", (event) => {\n      console.log(\"Agent said:\", event.data);\n    });\n  },\n});\n","plugin.ts",[40,3315,3316,3329,3333,3349,3372,3376,3387,3396,3406,3418,3428,3438,3448,3458,3480,3485,3509,3524,3529,3534],{"__ignoreMap":56},[449,3317,3318,3320,3323,3325,3327],{"class":451,"line":452},[449,3319,681],{"class":680},[449,3321,3322],{"class":684}," { PluginManager, EventBus } ",[449,3324,688],{"class":680},[449,3326,692],{"class":691},[449,3328,695],{"class":684},[449,3330,3331],{"class":451,"line":114},[449,3332,700],{"emptyLinePlaceholder":130},[449,3334,3335,3337,3340,3342,3344,3347],{"class":451,"line":111},[449,3336,711],{"class":680},[449,3338,3339],{"class":714}," bus",[449,3341,718],{"class":680},[449,3343,1343],{"class":680},[449,3345,3346],{"class":721}," EventBus",[449,3348,1322],{"class":684},[449,3350,3351,3353,3356,3358,3360,3363,3366,3369],{"class":451,"line":468},[449,3352,711],{"class":680},[449,3354,3355],{"class":714}," manager",[449,3357,718],{"class":680},[449,3359,1343],{"class":680},[449,3361,3362],{"class":721}," PluginManager",[449,3364,3365],{"class":684},"(bus, process.",[449,3367,3368],{"class":721},"cwd",[449,3370,3371],{"class":684},"());\n",[449,3373,3374],{"class":451,"line":474},[449,3375,700],{"emptyLinePlaceholder":130},[449,3377,3378,3380,3383,3385],{"class":451,"line":480},[449,3379,2056],{"class":680},[449,3381,3382],{"class":684}," manager.",[449,3384,1356],{"class":721},[449,3386,1391],{"class":684},[449,3388,3389,3391,3394],{"class":451,"line":486},[449,3390,1396],{"class":684},[449,3392,3393],{"class":691},"\"my-plugin\"",[449,3395,779],{"class":684},[449,3397,3398,3401,3404],{"class":451,"line":492},[449,3399,3400],{"class":684},"  version: ",[449,3402,3403],{"class":691},"\"1.0.0\"",[449,3405,779],{"class":684},[449,3407,3408,3411,3413,3415],{"class":451,"line":498},[449,3409,3410],{"class":721},"  setup",[449,3412,725],{"class":684},[449,3414,1916],{"class":1491},[449,3416,3417],{"class":684},") {\n",[449,3419,3420,3423,3426],{"class":451,"line":133},[449,3421,3422],{"class":684},"    context.",[449,3424,3425],{"class":721},"registerTool",[449,3427,1391],{"class":684},[449,3429,3430,3433,3436],{"class":451,"line":509},[449,3431,3432],{"class":684},"      name: ",[449,3434,3435],{"class":691},"\"my_tool\"",[449,3437,779],{"class":684},[449,3439,3440,3443,3446],{"class":451,"line":318},[449,3441,3442],{"class":684},"      description: ",[449,3444,3445],{"class":691},"\"Does something useful\"",[449,3447,779],{"class":684},[449,3449,3450,3453,3455],{"class":451,"line":520},[449,3451,3452],{"class":684},"      parameters: { type: ",[449,3454,1424],{"class":691},[449,3456,3457],{"class":684},", properties: {} },\n",[449,3459,3460,3463,3465,3467,3469,3471,3474,3477],{"class":451,"line":526},[449,3461,3462],{"class":721},"      execute",[449,3464,1482],{"class":684},[449,3466,1485],{"class":680},[449,3468,2090],{"class":684},[449,3470,1498],{"class":680},[449,3472,3473],{"class":684}," ({ content: ",[449,3475,3476],{"class":691},"\"done\"",[449,3478,3479],{"class":684}," }),\n",[449,3481,3482],{"class":451,"line":532},[449,3483,3484],{"class":684},"    });\n",[449,3486,3487,3490,3493,3495,3498,3501,3503,3505,3507],{"class":451,"line":2790},[449,3488,3489],{"class":684},"    context.bus.",[449,3491,3492],{"class":721},"on",[449,3494,725],{"class":684},[449,3496,3497],{"class":691},"\"agent:text\"",[449,3499,3500],{"class":684},", (",[449,3502,2991],{"class":1491},[449,3504,1758],{"class":684},[449,3506,1498],{"class":680},[449,3508,1501],{"class":684},[449,3510,3512,3514,3516,3518,3521],{"class":451,"line":3511},17,[449,3513,1927],{"class":684},[449,3515,1675],{"class":721},[449,3517,725],{"class":684},[449,3519,3520],{"class":691},"\"Agent said:\"",[449,3522,3523],{"class":684},", event.data);\n",[449,3525,3527],{"class":451,"line":3526},18,[449,3528,3484],{"class":684},[449,3530,3532],{"class":451,"line":3531},19,[449,3533,1474],{"class":684},[449,3535,3537],{"class":451,"line":3536},20,[449,3538,784],{"class":684},[16,3540,3542],{"id":3541},"testing-code-review","Testing & Code Review",[21,3544,3545],{},"null-agent can generate tests, run them, analyze failures, and perform comprehensive code reviews:",[48,3547,3550],{"className":670,"code":3548,"filename":3549,"language":673,"meta":56,"style":56},"import { reviewCode, formatReviewReport } from \"null-agent\";\n\nconst result = await reviewCode({ diff: true });\nconsole.log(formatReviewReport(result));\n","review.ts",[40,3551,3552,3565,3569,3589],{"__ignoreMap":56},[449,3553,3554,3556,3559,3561,3563],{"class":451,"line":452},[449,3555,681],{"class":680},[449,3557,3558],{"class":684}," { reviewCode, formatReviewReport } ",[449,3560,688],{"class":680},[449,3562,692],{"class":691},[449,3564,695],{"class":684},[449,3566,3567],{"class":451,"line":114},[449,3568,700],{"emptyLinePlaceholder":130},[449,3570,3571,3573,3575,3577,3579,3582,3585,3587],{"class":451,"line":111},[449,3572,711],{"class":680},[449,3574,1649],{"class":714},[449,3576,718],{"class":680},[449,3578,1654],{"class":680},[449,3580,3581],{"class":721}," reviewCode",[449,3583,3584],{"class":684},"({ diff: ",[449,3586,2169],{"class":714},[449,3588,2051],{"class":684},[449,3590,3591,3593,3595,3597,3600],{"class":451,"line":468},[449,3592,1672],{"class":684},[449,3594,1675],{"class":721},[449,3596,725],{"class":684},[449,3598,3599],{"class":721},"formatReviewReport",[449,3601,3602],{"class":684},"(result));\n",[21,3604,3605,3606,3609,3610,3613,3614,3617,3618,3620],{},"Review categories include ",[151,3607,3608],{},"security"," (SQL injection, hardcoded secrets), ",[151,3611,3612],{},"performance"," (N+1 queries, sync ops), ",[151,3615,3616],{},"quality"," (long functions, deep nesting), and ",[151,3619,2424],{}," (missing test files).",[16,3622,3624],{"id":3623},"building-and-publishing","Building and Publishing",[21,3626,3627],{},"null-agent is built with Vite+:",[48,3629,3631],{"className":839,"code":3630,"language":841,"meta":56,"style":56},"vp check        # Format, lint, and type-check\nvp test         # Run all 255 tests\nvp pack         # Build for npm\n",[40,3632,3633,3644,3654],{"__ignoreMap":56},[449,3634,3635,3638,3641],{"class":451,"line":452},[449,3636,3637],{"class":721},"vp",[449,3639,3640],{"class":691}," check",[449,3642,3643],{"class":705},"        # Format, lint, and type-check\n",[449,3645,3646,3648,3651],{"class":451,"line":114},[449,3647,3637],{"class":721},[449,3649,3650],{"class":691}," test",[449,3652,3653],{"class":705},"         # Run all 255 tests\n",[449,3655,3656,3658,3661],{"class":451,"line":111},[449,3657,3637],{"class":721},[449,3659,3660],{"class":691}," pack",[449,3662,3663],{"class":705},"         # Build for npm\n",[21,3665,3666],{},"The package exports ESM with TypeScript declarations, and the CLI is available as both a library import and a global binary.",[427,3668,3671],{"icon":3669,"title":3670},"📦","Open Source",[21,3672,3673,3674,3677],{},"null-agent is MIT licensed and available on npm. The source lives in the ",[40,3675,3676],{},"packages\u002Fnull-agent"," directory of the monorepo.",[16,3679,3681],{"id":3680},"conclusion","Conclusion",[21,3683,3684],{},"null-agent started as a personal tool to avoid switching between different LLM interfaces. It grew into something larger: a unified platform for AI-assisted development that respects your existing workflow rather than replacing it.",[21,3686,3687],{},"Whether you need a library to embed in your own tools, a terminal UI for daily coding, an HTTP API for integrations, or just a reliable REPL that works with any provider — null-agent covers it.",[21,3689,3690],{},"The accountability tracker was an experiment that stuck. Having goals, time breakdowns, and daily reports inside the terminal removes the friction of context switching to yet another productivity app.",[21,3692,3693],{},"If you're building developer tools or just want a coding assistant you can actually customize, give it a try:",[48,3695,3697],{"className":839,"code":3696,"language":841,"meta":56,"style":56},"npm install -g null-agent\nnull-agent auth\nnull-agent\n",[40,3698,3699,3713,3720],{"__ignoreMap":56},[449,3700,3701,3704,3707,3710],{"class":451,"line":452},[449,3702,3703],{"class":721},"npm",[449,3705,3706],{"class":691}," install",[449,3708,3709],{"class":714}," -g",[449,3711,3712],{"class":691}," null-agent\n",[449,3714,3715,3717],{"class":451,"line":114},[449,3716,341],{"class":721},[449,3718,3719],{"class":691}," auth\n",[449,3721,3722],{"class":451,"line":111},[449,3723,2284],{"class":721},[21,3725,3726],{},"Ship code. Track time. Stay accountable.",[3728,3729,3730],"style",{},"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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":3732},[3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3755,3756],{"id":666,"depth":114,"text":667},{"id":904,"depth":114,"text":905},{"id":973,"depth":114,"text":974},{"id":1131,"depth":114,"text":1132},{"id":1272,"depth":114,"text":1273},{"id":1279,"depth":114,"text":1280},{"id":1371,"depth":114,"text":1372},{"id":1705,"depth":114,"text":1706},{"id":1864,"depth":114,"text":1865},{"id":1994,"depth":114,"text":1995},{"id":2117,"depth":114,"text":2118},{"id":2215,"depth":114,"text":2216},{"id":2293,"depth":114,"text":2294},{"id":2312,"depth":114,"text":2313},{"id":2367,"depth":114,"text":2368},{"id":2405,"depth":114,"text":2406},{"id":2457,"depth":114,"text":2458},{"id":2550,"depth":114,"text":2551},{"id":2583,"depth":114,"text":2584},{"id":2604,"depth":114,"text":2605,"children":3753},[3754],{"id":2810,"depth":111,"text":2811},{"id":2824,"depth":114,"text":2825},{"id":2923,"depth":114,"text":2924},"2026-05-25","A deep dive into null-agent — an open-source TypeScript library that brings multi-provider LLM support, a rich terminal UI, developer accountability tracking, and 49 built-in tools to your coding workflow.",{"type":13,"value":3760},[3761,3763,3765,3769],[16,3762,333],{"id":332},[21,3764,336],{},[21,3766,3767,342],{},[151,3768,341],{},[21,3770,345,3771,349,3773,349,3775,356,3777,360],{},[151,3772,348],{},[151,3774,352],{},[151,3776,355],{},[151,3778,359],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1555066931-4365d14bab8c",[341,3781,3782,3783,3784,3785,3786,3787],"llm","ai","coding-assistant","typescript","cli","terminal-ui","open-source","TypeScript",{},"\u002Fblog\u002Fbuilding-null-agent",{"title":325,"description":3758},"blog\u002Fbuilding-null-agent","Technology","gq9wlpLqBSxyPRZONaFHVfDQRns2VIUEst8NE1hux_A",{"id":3796,"title":3797,"author":3798,"body":3799,"canonical":116,"categories":116,"date":4149,"description":4150,"excerpt":4151,"extension":119,"featuredImg":116,"img":4159,"keywords":4160,"language":4162,"meta":4163,"navigation":130,"ogImage":116,"path":4164,"rating":132,"readTime":4032,"seo":4165,"stem":4166,"tag":4167,"__hash__":4168},"blog\u002Fblog\u002Fbuilding-vue3-progressive-app.md","Building a Vue 3 Progressive Koffee Lovers App Part One",{"name":9,"website":10,"img":11},{"type":13,"value":3800,"toc":4141},[3801,3805,3809,3812,3815,3819,3826,3829,3835,3839,3842,3848,3851,3857,3866,3870,3873,3877,3883,3887,3890,3896,3899,4114,4117,4120,4126,4129,4135,4138],[16,3802,3804],{"id":3803},"what-are-we-making","What are We Making?",[32,3806,3808],{"id":3807},"koffee-lovers-vue3-pwa","Koffee Lovers Vue3 PWA",[21,3810,3811],{},"In this post, we will look at building a coffee web application with progressive web app (PWA).",[21,3813,3814],{},"Examining the workings of Vue3, creating components, using directives and use props to pass data to components. We can also try and utilize mixins to reduce reptition of code by abstracting out similar features in these components.",[32,3816,3818],{"id":3817},"teacher-mode-what-is-a-pwa","Teacher Mode: What is a PWA?",[427,3820,3823],{"icon":3821,"title":3822},"🎓","Teacher Mode",[21,3824,3825],{},"“PWAs are special web apps that can be installed on the user's computer, and the browser manages these installed apps. They differ from regular web apps as they let us access some computer hardware natively. When we visit a PWA in our browsers, we can choose to install the PWA”",[21,3827,3828],{},"This is basically what a PWA is - an app that can work offline once install on the users device.",[3830,3831,3832],"tip",{},[21,3833,3834],{},"Always test your PWA in an Incognito window or after clearing site data to ensure the service worker is fetching fresh assets correctly during development.",[32,3836,3838],{"id":3837},"lets-code","Lets Code!",[21,3840,3841],{},"We will be using Vite for quick prototyping our app.",[48,3843,3846],{"className":3844,"code":3845,"language":53},[51],"npm init vite@latest\n",[40,3847,3845],{"__ignoreMap":56},[21,3849,3850],{},"Follow the prompt name your app whatever you like but we will call this vue3-koffee-lovers",[48,3852,3855],{"className":3853,"code":3854,"language":53},[51],"npm run dev\n",[40,3856,3854],{"__ignoreMap":56},[21,3858,3859,3860],{},"Your development server should be running on ",[3861,3862,3863],"a",{"href":3863,"rel":3864},"http:\u002F\u002Flocalhost:3000",[3865],"nofollow",[32,3867,3869],{"id":3868},"layout","Layout",[21,3871,3872],{},"Generally its important to get the layout of your web application up and running by creating all the folders necessary for you web application to work smoothly. One such folder is your Components Folder. Vue.js is a progressive framework for building user interfaces, through the use of components.",[32,3874,3876],{"id":3875},"setting-up-pwa","Setting up PWA",[48,3878,3881],{"className":3879,"code":3880,"language":53},[51],"npm install vite-plugin-pwa workbox-precaching -D\n",[40,3882,3880],{"__ignoreMap":56},[32,3884,3886],{"id":3885},"config","Config",[21,3888,3889],{},"Configuration can be done in vite.config.js file. Installation of the plugin would look something this:",[48,3891,3894],{"className":3892,"code":3893,"language":53},[51],"import { defineConfig } from \"vite\"\nimport vue from \"@vitejs\u002Fplugin-vue\"\nimport { VitePWA } from \"vite-plugin-pwa\"\n\nexport default defineConfig({\n     plugins: [ vue(), VitePWA()],\n})\n\n",[40,3895,3893],{"__ignoreMap":56},[21,3897,3898],{},"This basically enables the plugin however there are additional setup required in order to get PWA to work correctly on devices. Look at the following code:",[48,3900,3905],{"className":3901,"code":3902,"language":3903,"meta":3904,"style":56},"language-\u002F\u002F shiki shiki-themes github-light github-dark","export default defineConfig({\n  plugins: [\n    vue(),\n    VitePWA({\n      mode: \"development\",\n      base: \"\u002F\",\n      srcDir: \"src\",\n      filename: \"sw.ts\",\n      includeAssets: [\"\u002Ffavicon.png\"],\n      strategies: \"injectManifest\",\n      manifest: {\n        name: \"Test Project\",\n        short_name: \"Test\",\n        theme_color: \"#ffffff\",\n        start_url: \"\u002F\",\n        display: \"standalone\",\n        background_color: \"#ffffff\",\n        icons: [\n          {\n            src: \"icon-192.png\",\n            sizes: \"192x192\",\n            type: \"image\u002Fpng\",\n          },\n          {\n            src: \"\u002Ficon-512.png\",\n            sizes: \"512x512\",\n            type: \"image\u002Fpng\",\n          },\n          {\n            src: \"icon-512.png\",\n            sizes: \"512x512\",\n            type: \"image\u002Fpng\",\n            purpose: \"any maskable\",\n          },\n        ],\n      },\n    }),\n  ],\n})\n\n","\u002F\u002F","https:\u002F\u002Fvitejs.dev\u002Fconfig\u002F",[40,3906,3907,3912,3917,3922,3927,3932,3937,3942,3947,3952,3957,3962,3967,3972,3977,3982,3987,3992,3997,4002,4007,4013,4019,4025,4030,4036,4042,4047,4052,4057,4063,4068,4073,4079,4084,4090,4096,4102,4108],{"__ignoreMap":56},[449,3908,3909],{"class":451,"line":452},[449,3910,3911],{},"export default defineConfig({\n",[449,3913,3914],{"class":451,"line":114},[449,3915,3916],{},"  plugins: [\n",[449,3918,3919],{"class":451,"line":111},[449,3920,3921],{},"    vue(),\n",[449,3923,3924],{"class":451,"line":468},[449,3925,3926],{},"    VitePWA({\n",[449,3928,3929],{"class":451,"line":474},[449,3930,3931],{},"      mode: \"development\",\n",[449,3933,3934],{"class":451,"line":480},[449,3935,3936],{},"      base: \"\u002F\",\n",[449,3938,3939],{"class":451,"line":486},[449,3940,3941],{},"      srcDir: \"src\",\n",[449,3943,3944],{"class":451,"line":492},[449,3945,3946],{},"      filename: \"sw.ts\",\n",[449,3948,3949],{"class":451,"line":498},[449,3950,3951],{},"      includeAssets: [\"\u002Ffavicon.png\"],\n",[449,3953,3954],{"class":451,"line":133},[449,3955,3956],{},"      strategies: \"injectManifest\",\n",[449,3958,3959],{"class":451,"line":509},[449,3960,3961],{},"      manifest: {\n",[449,3963,3964],{"class":451,"line":318},[449,3965,3966],{},"        name: \"Test Project\",\n",[449,3968,3969],{"class":451,"line":520},[449,3970,3971],{},"        short_name: \"Test\",\n",[449,3973,3974],{"class":451,"line":526},[449,3975,3976],{},"        theme_color: \"#ffffff\",\n",[449,3978,3979],{"class":451,"line":532},[449,3980,3981],{},"        start_url: \"\u002F\",\n",[449,3983,3984],{"class":451,"line":2790},[449,3985,3986],{},"        display: \"standalone\",\n",[449,3988,3989],{"class":451,"line":3511},[449,3990,3991],{},"        background_color: \"#ffffff\",\n",[449,3993,3994],{"class":451,"line":3526},[449,3995,3996],{},"        icons: [\n",[449,3998,3999],{"class":451,"line":3531},[449,4000,4001],{},"          {\n",[449,4003,4004],{"class":451,"line":3536},[449,4005,4006],{},"            src: \"icon-192.png\",\n",[449,4008,4010],{"class":451,"line":4009},21,[449,4011,4012],{},"            sizes: \"192x192\",\n",[449,4014,4016],{"class":451,"line":4015},22,[449,4017,4018],{},"            type: \"image\u002Fpng\",\n",[449,4020,4022],{"class":451,"line":4021},23,[449,4023,4024],{},"          },\n",[449,4026,4028],{"class":451,"line":4027},24,[449,4029,4001],{},[449,4031,4033],{"class":451,"line":4032},25,[449,4034,4035],{},"            src: \"\u002Ficon-512.png\",\n",[449,4037,4039],{"class":451,"line":4038},26,[449,4040,4041],{},"            sizes: \"512x512\",\n",[449,4043,4045],{"class":451,"line":4044},27,[449,4046,4018],{},[449,4048,4050],{"class":451,"line":4049},28,[449,4051,4024],{},[449,4053,4055],{"class":451,"line":4054},29,[449,4056,4001],{},[449,4058,4060],{"class":451,"line":4059},30,[449,4061,4062],{},"            src: \"icon-512.png\",\n",[449,4064,4066],{"class":451,"line":4065},31,[449,4067,4041],{},[449,4069,4071],{"class":451,"line":4070},32,[449,4072,4018],{},[449,4074,4076],{"class":451,"line":4075},33,[449,4077,4078],{},"            purpose: \"any maskable\",\n",[449,4080,4082],{"class":451,"line":4081},34,[449,4083,4024],{},[449,4085,4087],{"class":451,"line":4086},35,[449,4088,4089],{},"        ],\n",[449,4091,4093],{"class":451,"line":4092},36,[449,4094,4095],{},"      },\n",[449,4097,4099],{"class":451,"line":4098},37,[449,4100,4101],{},"    }),\n",[449,4103,4105],{"class":451,"line":4104},38,[449,4106,4107],{},"  ],\n",[449,4109,4111],{"class":451,"line":4110},39,[449,4112,4113],{},"})\n",[21,4115,4116],{},"Every PWA must have a manifest. A Manifest is a file that defines (in JSON format) the name of the application, the background color that it will have on the device once installed, the location, formats of the icons used and the root url for PWA (web application can have different url for web and PWA). That is, the minimum requirements necessary for PWA.",[21,4118,4119],{},"Next is to config the Service Worker (this allows code to run in the background and secondary actions being able to work). Service Worker is located in src\u002Fswt.(js or ts)",[48,4121,4124],{"className":4122,"code":4123,"language":53},[51],"import { precacheAndRoute } from 'workbox-precaching'\ndeclare let self: ServiceWorkerGlobalScope\nself.addEventListener('message', (event) => {\n  if (event.data && event.data.type === 'SKIP_WAITING') self.skipWaiting()\n})\n\u002F\u002F self.__WB_MANIFEST is default injection point\nprecacheAndRoute(self.__WB_MANIFEST)\n",[40,4125,4123],{"__ignoreMap":56},[21,4127,4128],{},"Finally! its just to register the PWA using a component.",[48,4130,4133],{"className":4131,"code":4132,"language":53},[51],"\u003Cscript lang=\"ts\">\nimport { defineComponent } from \"vue\";\nimport { useRegisterSW } from \"virtual:pwa-register\u002Fvue\";\nconst { updateServiceWorker } = useRegisterSW();\nexport default defineComponent({\n  name: \"ReloadPWA\",\n  setup() {\n    const { offlineReady, needRefresh, updateServiceWorker } = useRegisterSW();\n    const close = async () => {\n      offlineReady.value = false;\n      needRefresh.value = false;\n    };\n    return { offlineReady, needRefresh, updateServiceWorker, close };\n  },\n  methods: {\n    async close() {\n      this.offlineReady.value = false;\n      this.needRefresh.value = false;\n    },\n    async updateServiceWorker() {\n      await updateServiceWorker();\n    },\n  },\n});\n\u003C\u002Fscript>\n",[40,4134,4132],{"__ignoreMap":56},[21,4136,4137],{},"Once connection is made in this component to App.vue, PWA will be fully setup",[3728,4139,4140],{},"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);}",{"title":56,"searchDepth":111,"depth":111,"links":4142},[4143,4144,4145,4146,4147,4148],{"id":3807,"depth":114,"text":3808},{"id":3817,"depth":114,"text":3818},{"id":3837,"depth":114,"text":3838},{"id":3868,"depth":114,"text":3869},{"id":3875,"depth":114,"text":3876},{"id":3885,"depth":114,"text":3886},"2022-01-20","Examine the inner workings of a Vue 3 app combining technologies like Supabase, Pinia to complete this code.",{"type":13,"value":4152},[4153,4155,4157],[16,4154,3804],{"id":3803},[32,4156,3808],{"id":3807},[21,4158,3811],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1642478176\u002Fvantol\u002FScreenshot_2021-07-29_at_11.07.21_PM_mepvjg.png",[122,123,124,125,4161,127],"pinia","Vue.js",{},"\u002Fblog\u002Fbuilding-vue3-progressive-app",{"title":3797,"description":4150},"blog\u002Fbuilding-vue3-progressive-app","Coffee App","TwubsFbv2HTJUnk2PByvreDuvyAmQNorQ7W8bXwL7Y4",{"id":4170,"title":4171,"author":4172,"body":4173,"canonical":116,"categories":116,"date":7031,"description":7032,"excerpt":7033,"extension":119,"featuredImg":116,"img":7063,"keywords":7064,"language":3788,"meta":7070,"navigation":130,"ogImage":116,"path":7071,"rating":474,"readTime":133,"seo":7072,"stem":7073,"tag":3793,"__hash__":7074},"blog\u002Fblog\u002Fbun-nitro-stack.md","Bun + Nitro: The Fast Server Stack for 2026",{"name":9,"img":11,"website":327},{"type":13,"value":4174,"toc":6999},[4175,4177,4184,4191,4194,4211,4218,4222,4225,4229,4261,4266,4268,4272,4275,4358,4361,4368,4370,4374,4378,4381,4428,4431,4449,4451,4455,4458,4493,4498,4501,4513,4516,4605,4607,4611,4614,4620,4683,4686,4688,4692,4695,4701,4768,4774,4947,4950,5277,5279,5283,5286,5301,5308,5311,5330,5332,5336,5339,5344,5989,5992,6028,6030,6034,6038,6041,6202,6206,6209,6292,6296,6299,6477,6479,6483,6487,6594,6598,6622,6624,6628,6632,6637,6654,6658,6714,6718,6778,6782,6785,6809,6815,6817,6821,6824,6841,6845,6910,6912,6914,6920,6951,6954,6958,6975,6979,6990,6993,6996],[16,4176,333],{"id":332},[21,4178,4179,4180,4183],{},"The JavaScript ecosystem is evolving fast, and ",[151,4181,4182],{},"Bun"," is leading the charge. Since its 1.0 release, Bun has proven itself as a legitimate alternative to Node.js—offering significantly faster startup times, native TypeScript support, and an all-in-one toolkit that includes a package manager, bundler, and test runner.",[21,4185,4186,4187,4190],{},"When paired with ",[151,4188,4189],{},"Nitro",", you get a server stack that's both incredibly fast and deployment-agnostic.",[21,4192,4193],{},"In this post, we'll explore:",[383,4195,4196,4199,4202,4205,4208],{},[386,4197,4198],{},"Why Bun matters in 2026",[386,4200,4201],{},"Setting up Bun with Nitro",[386,4203,4204],{},"Performance benefits and benchmarks",[386,4206,4207],{},"Migration strategies from Node.js",[386,4209,4210],{},"Real-world deployment",[21,4212,4213,4214,4217],{},"Let's build the ",[151,4215,4216],{},"fastest server stack"," you've ever used.",[16,4219,4221],{"id":4220},"why-bun-in-2026","Why Bun in 2026?",[21,4223,4224],{},"Bun isn't just a faster Node.js—it's a reimagining of the JavaScript runtime. Here's what makes it special:",[32,4226,4228],{"id":4227},"key-features","Key Features",[383,4230,4231,4237,4243,4249,4255],{},[386,4232,4233,4236],{},[151,4234,4235],{},"Native TypeScript"," — No transpilation needed, runs .ts files directly",[386,4238,4239,4242],{},[151,4240,4241],{},"Zig-based runtime"," — Built with performance in mind from the ground up",[386,4244,4245,4248],{},[151,4246,4247],{},"All-in-one toolkit"," — Package manager, bundler, test runner included",[386,4250,4251,4254],{},[151,4252,4253],{},"Web API compatibility"," — fetch, WebSocket, Buffer built-in",[386,4256,4257,4260],{},[151,4258,4259],{},"Native Node.js compatibility"," — Most npm packages work out of the box",[25,4262,4263],{"type":363},[21,4264,4265],{},"Bun's startup time is 4-6x faster than Node.js, and it can handle significantly more requests per second in I\u002FO-heavy workloads.",[73,4267],{},[32,4269,4271],{"id":4270},"performance-benchmarks","Performance Benchmarks",[21,4273,4274],{},"Let's look at real-world performance comparisons:",[547,4276,4277,4292],{},[550,4278,4279],{},[553,4280,4281,4284,4287,4289],{},[556,4282,4283],{},"Metric",[556,4285,4286],{},"Node.js",[556,4288,4182],{},[556,4290,4291],{},"Improvement",[569,4293,4294,4310,4326,4342],{},[553,4295,4296,4299,4302,4305],{},[574,4297,4298],{},"Startup time",[574,4300,4301],{},"45ms",[574,4303,4304],{},"8ms",[574,4306,4307],{},[151,4308,4309],{},"5.6x faster",[553,4311,4312,4315,4318,4321],{},[574,4313,4314],{},"HTTP requests\u002Fsec",[574,4316,4317],{},"12,400",[574,4319,4320],{},"48,200",[574,4322,4323],{},[151,4324,4325],{},"3.9x faster",[553,4327,4328,4331,4334,4337],{},[574,4329,4330],{},"TypeScript execution",[574,4332,4333],{},"180ms",[574,4335,4336],{},"12ms",[574,4338,4339],{},[151,4340,4341],{},"15x faster",[553,4343,4344,4347,4350,4353],{},[574,4345,4346],{},"Memory usage",[574,4348,4349],{},"120MB",[574,4351,4352],{},"85MB",[574,4354,4355],{},[151,4356,4357],{},"29% less",[21,4359,4360],{},"These aren't synthetic benchmarks—they're representative of real API workloads.",[427,4362,4365],{"icon":4363,"title":4364},"📊","Real Application Performance",[21,4366,4367],{},"In our BrewStop API tests, switching from Node.js to Bun reduced cold start times from 2.1s to 340ms—an 85% improvement.",[73,4369],{},[16,4371,4373],{"id":4372},"main-content","Main Content",[32,4375,4377],{"id":4376},"step-1-install-bun","Step 1: Install Bun",[21,4379,4380],{},"If you haven't installed Bun yet, it's a single command:",[48,4382,4385],{"className":839,"code":4383,"filename":4384,"language":841,"meta":56,"style":56},"# macOS, Linux, and WSL\ncurl -fsSL https:\u002F\u002Fbun.sh\u002Finstall | bash\n\n# Windows (PowerShell)\nwinget install oven-sh.bun\n","terminal",[40,4386,4387,4392,4409,4413,4418],{"__ignoreMap":56},[449,4388,4389],{"class":451,"line":452},[449,4390,4391],{"class":705},"# macOS, Linux, and WSL\n",[449,4393,4394,4397,4400,4403,4406],{"class":451,"line":114},[449,4395,4396],{"class":721},"curl",[449,4398,4399],{"class":714}," -fsSL",[449,4401,4402],{"class":691}," https:\u002F\u002Fbun.sh\u002Finstall",[449,4404,4405],{"class":680}," |",[449,4407,4408],{"class":721}," bash\n",[449,4410,4411],{"class":451,"line":111},[449,4412,700],{"emptyLinePlaceholder":130},[449,4414,4415],{"class":451,"line":468},[449,4416,4417],{"class":705},"# Windows (PowerShell)\n",[449,4419,4420,4423,4425],{"class":451,"line":474},[449,4421,4422],{"class":721},"winget",[449,4424,3706],{"class":691},[449,4426,4427],{"class":691}," oven-sh.bun\n",[21,4429,4430],{},"Verify installation:",[48,4432,4434],{"className":839,"code":4433,"filename":4384,"language":841,"meta":56,"style":56},"bun --version\n# Should output: 1.2.x or higher\n",[40,4435,4436,4444],{"__ignoreMap":56},[449,4437,4438,4441],{"class":451,"line":452},[449,4439,4440],{"class":721},"bun",[449,4442,4443],{"class":714}," --version\n",[449,4445,4446],{"class":451,"line":114},[449,4447,4448],{"class":705},"# Should output: 1.2.x or higher\n",[73,4450],{},[32,4452,4454],{"id":4453},"step-2-create-a-bun-nitro-project","Step 2: Create a Bun + Nitro Project",[21,4456,4457],{},"The easiest way to start is with Nuxt, which has built-in Nitro support:",[48,4459,4461],{"className":839,"code":4460,"filename":4384,"language":841,"meta":56,"style":56},"# Create a new Nuxt project (uses Nitro internally)\nbunx nuxi@latest init brewstop-bun\n\ncd brewstop-bun\n",[40,4462,4463,4468,4482,4486],{"__ignoreMap":56},[449,4464,4465],{"class":451,"line":452},[449,4466,4467],{"class":705},"# Create a new Nuxt project (uses Nitro internally)\n",[449,4469,4470,4473,4476,4479],{"class":451,"line":114},[449,4471,4472],{"class":721},"bunx",[449,4474,4475],{"class":691}," nuxi@latest",[449,4477,4478],{"class":691}," init",[449,4480,4481],{"class":691}," brewstop-bun\n",[449,4483,4484],{"class":451,"line":111},[449,4485,700],{"emptyLinePlaceholder":130},[449,4487,4488,4491],{"class":451,"line":468},[449,4489,4490],{"class":714},"cd",[449,4492,4481],{"class":691},[25,4494,4495],{"type":27},[21,4496,4497],{},"Bun's package manager (bun install) is significantly faster than npm\u002Fyarn\u002Fpnpm. Use it for the best experience.",[21,4499,4500],{},"Install dependencies with Bun:",[48,4502,4504],{"className":839,"code":4503,"filename":4384,"language":841,"meta":56,"style":56},"bun install\n",[40,4505,4506],{"__ignoreMap":56},[449,4507,4508,4510],{"class":451,"line":452},[449,4509,4440],{"class":721},[449,4511,4512],{"class":691}," install\n",[21,4514,4515],{},"Update the package.json to use Bun as the package manager:",[48,4517,4522],{"className":4518,"code":4519,"filename":4520,"language":4521,"meta":56,"style":56},"language-json shiki shiki-themes github-light github-dark","{\n  \"packageManager\": \"bun@1.2.0\",\n  \"scripts\": {\n    \"dev\": \"bunx nuxi dev\",\n    \"build\": \"bunx nuxi build\",\n    \"preview\": \"bunx nuxi preview\",\n    \"start\": \"bunx nuxi start\"\n  }\n}\n","package.json","json",[40,4523,4524,4529,4541,4549,4561,4573,4585,4595,4600],{"__ignoreMap":56},[449,4525,4526],{"class":451,"line":452},[449,4527,4528],{"class":684},"{\n",[449,4530,4531,4534,4536,4539],{"class":451,"line":114},[449,4532,4533],{"class":714},"  \"packageManager\"",[449,4535,1482],{"class":684},[449,4537,4538],{"class":691},"\"bun@1.2.0\"",[449,4540,779],{"class":684},[449,4542,4543,4546],{"class":451,"line":111},[449,4544,4545],{"class":714},"  \"scripts\"",[449,4547,4548],{"class":684},": {\n",[449,4550,4551,4554,4556,4559],{"class":451,"line":468},[449,4552,4553],{"class":714},"    \"dev\"",[449,4555,1482],{"class":684},[449,4557,4558],{"class":691},"\"bunx nuxi dev\"",[449,4560,779],{"class":684},[449,4562,4563,4566,4568,4571],{"class":451,"line":474},[449,4564,4565],{"class":714},"    \"build\"",[449,4567,1482],{"class":684},[449,4569,4570],{"class":691},"\"bunx nuxi build\"",[449,4572,779],{"class":684},[449,4574,4575,4578,4580,4583],{"class":451,"line":480},[449,4576,4577],{"class":714},"    \"preview\"",[449,4579,1482],{"class":684},[449,4581,4582],{"class":691},"\"bunx nuxi preview\"",[449,4584,779],{"class":684},[449,4586,4587,4590,4592],{"class":451,"line":486},[449,4588,4589],{"class":714},"    \"start\"",[449,4591,1482],{"class":684},[449,4593,4594],{"class":691},"\"bunx nuxi start\"\n",[449,4596,4597],{"class":451,"line":492},[449,4598,4599],{"class":684},"  }\n",[449,4601,4602],{"class":451,"line":498},[449,4603,4604],{"class":684},"}\n",[73,4606],{},[32,4608,4610],{"id":4609},"step-3-configure-nitro-to-use-bun","Step 3: Configure Nitro to Use Bun",[21,4612,4613],{},"Nuxt automatically detects Bun when it's available. However, let's explicitly configure it for clarity.",[21,4615,4616,4617,3070],{},"Update ",[40,4618,4619],{},"nuxt.config.ts",[48,4621,4623],{"className":670,"code":4622,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  nitro: {\n    preset: \"bun\",\n  },\n\n  devtools: {\n    enabled: true,\n  },\n});\n",[40,4624,4625,4638,4643,4653,4657,4661,4666,4675,4679],{"__ignoreMap":56},[449,4626,4627,4630,4633,4636],{"class":451,"line":452},[449,4628,4629],{"class":680},"export",[449,4631,4632],{"class":680}," default",[449,4634,4635],{"class":721}," defineNuxtConfig",[449,4637,1391],{"class":684},[449,4639,4640],{"class":451,"line":114},[449,4641,4642],{"class":684},"  nitro: {\n",[449,4644,4645,4648,4651],{"class":451,"line":111},[449,4646,4647],{"class":684},"    preset: ",[449,4649,4650],{"class":691},"\"bun\"",[449,4652,779],{"class":684},[449,4654,4655],{"class":451,"line":468},[449,4656,1474],{"class":684},[449,4658,4659],{"class":451,"line":474},[449,4660,700],{"emptyLinePlaceholder":130},[449,4662,4663],{"class":451,"line":480},[449,4664,4665],{"class":684},"  devtools: {\n",[449,4667,4668,4671,4673],{"class":451,"line":486},[449,4669,4670],{"class":684},"    enabled: ",[449,4672,2169],{"class":714},[449,4674,779],{"class":684},[449,4676,4677],{"class":451,"line":492},[449,4678,1474],{"class":684},[449,4680,4681],{"class":451,"line":498},[449,4682,784],{"class":684},[21,4684,4685],{},"This ensures Nitro uses Bun's optimized runtime for both development and production.",[73,4687],{},[32,4689,4691],{"id":4690},"step-4-create-api-endpoints","Step 4: Create API Endpoints",[21,4693,4694],{},"Let's build a simple API to test Bun's performance.",[21,4696,4697,4698,3070],{},"Create ",[40,4699,4700],{},"server\u002Fapi\u002Fping.get.ts",[48,4702,4704],{"className":670,"code":4703,"filename":4700,"language":673,"meta":56,"style":56},"export default defineEventHandler(() => {\n  return {\n    message: \"Pong from Bun!\",\n    runtime: \"Bun\",\n    timestamp: Date.now(),\n  };\n});\n",[40,4705,4706,4722,4729,4739,4749,4759,4764],{"__ignoreMap":56},[449,4707,4708,4710,4712,4715,4718,4720],{"class":451,"line":452},[449,4709,4629],{"class":680},[449,4711,4632],{"class":680},[449,4713,4714],{"class":721}," defineEventHandler",[449,4716,4717],{"class":684},"(() ",[449,4719,1498],{"class":680},[449,4721,1501],{"class":684},[449,4723,4724,4727],{"class":451,"line":114},[449,4725,4726],{"class":680},"  return",[449,4728,1501],{"class":684},[449,4730,4731,4734,4737],{"class":451,"line":111},[449,4732,4733],{"class":684},"    message: ",[449,4735,4736],{"class":691},"\"Pong from Bun!\"",[449,4738,779],{"class":684},[449,4740,4741,4744,4747],{"class":451,"line":468},[449,4742,4743],{"class":684},"    runtime: ",[449,4745,4746],{"class":691},"\"Bun\"",[449,4748,779],{"class":684},[449,4750,4751,4754,4757],{"class":451,"line":474},[449,4752,4753],{"class":684},"    timestamp: Date.",[449,4755,4756],{"class":721},"now",[449,4758,1624],{"class":684},[449,4760,4761],{"class":451,"line":480},[449,4762,4763],{"class":684},"  };\n",[449,4765,4766],{"class":451,"line":486},[449,4767,784],{"class":684},[21,4769,4697,4770,4773],{},[40,4771,4772],{},"server\u002Fapi\u002Fproducts.get.ts"," with some data:",[48,4775,4777],{"className":670,"code":4776,"filename":4772,"language":673,"meta":56,"style":56},"const products = [\n  { id: 1, name: \"Latte\", price: 4.5, category: \"coffee\" },\n  { id: 2, name: \"Espresso\", price: 3.0, category: \"coffee\" },\n  { id: 3, name: \"Croissant\", price: 3.5, category: \"food\" },\n  { id: 4, name: \"Chai Tea\", price: 4.0, category: \"tea\" },\n  { id: 5, name: \"Muffin\", price: 3.0, category: \"food\" },\n];\n\nexport default defineEventHandler(() => {\n  return { products };\n});\n",[40,4778,4779,4791,4820,4843,4867,4891,4913,4918,4922,4936,4943],{"__ignoreMap":56},[449,4780,4781,4783,4786,4788],{"class":451,"line":452},[449,4782,711],{"class":680},[449,4784,4785],{"class":714}," products",[449,4787,718],{"class":680},[449,4789,4790],{"class":684}," [\n",[449,4792,4793,4796,4799,4802,4805,4808,4811,4814,4817],{"class":451,"line":114},[449,4794,4795],{"class":684},"  { id: ",[449,4797,4798],{"class":714},"1",[449,4800,4801],{"class":684},", name: ",[449,4803,4804],{"class":691},"\"Latte\"",[449,4806,4807],{"class":684},", price: ",[449,4809,4810],{"class":714},"4.5",[449,4812,4813],{"class":684},", category: ",[449,4815,4816],{"class":691},"\"coffee\"",[449,4818,4819],{"class":684}," },\n",[449,4821,4822,4824,4827,4829,4832,4834,4837,4839,4841],{"class":451,"line":111},[449,4823,4795],{"class":684},[449,4825,4826],{"class":714},"2",[449,4828,4801],{"class":684},[449,4830,4831],{"class":691},"\"Espresso\"",[449,4833,4807],{"class":684},[449,4835,4836],{"class":714},"3.0",[449,4838,4813],{"class":684},[449,4840,4816],{"class":691},[449,4842,4819],{"class":684},[449,4844,4845,4847,4850,4852,4855,4857,4860,4862,4865],{"class":451,"line":468},[449,4846,4795],{"class":684},[449,4848,4849],{"class":714},"3",[449,4851,4801],{"class":684},[449,4853,4854],{"class":691},"\"Croissant\"",[449,4856,4807],{"class":684},[449,4858,4859],{"class":714},"3.5",[449,4861,4813],{"class":684},[449,4863,4864],{"class":691},"\"food\"",[449,4866,4819],{"class":684},[449,4868,4869,4871,4874,4876,4879,4881,4884,4886,4889],{"class":451,"line":474},[449,4870,4795],{"class":684},[449,4872,4873],{"class":714},"4",[449,4875,4801],{"class":684},[449,4877,4878],{"class":691},"\"Chai Tea\"",[449,4880,4807],{"class":684},[449,4882,4883],{"class":714},"4.0",[449,4885,4813],{"class":684},[449,4887,4888],{"class":691},"\"tea\"",[449,4890,4819],{"class":684},[449,4892,4893,4895,4898,4900,4903,4905,4907,4909,4911],{"class":451,"line":480},[449,4894,4795],{"class":684},[449,4896,4897],{"class":714},"5",[449,4899,4801],{"class":684},[449,4901,4902],{"class":691},"\"Muffin\"",[449,4904,4807],{"class":684},[449,4906,4836],{"class":714},[449,4908,4813],{"class":684},[449,4910,4864],{"class":691},[449,4912,4819],{"class":684},[449,4914,4915],{"class":451,"line":486},[449,4916,4917],{"class":684},"];\n",[449,4919,4920],{"class":451,"line":492},[449,4921,700],{"emptyLinePlaceholder":130},[449,4923,4924,4926,4928,4930,4932,4934],{"class":451,"line":498},[449,4925,4629],{"class":680},[449,4927,4632],{"class":680},[449,4929,4714],{"class":721},[449,4931,4717],{"class":684},[449,4933,1498],{"class":680},[449,4935,1501],{"class":684},[449,4937,4938,4940],{"class":451,"line":133},[449,4939,4726],{"class":680},[449,4941,4942],{"class":684}," { products };\n",[449,4944,4945],{"class":451,"line":509},[449,4946,784],{"class":684},[21,4948,4949],{},"Create a more complex endpoint with database simulation:",[48,4951,4954],{"className":670,"code":4952,"filename":4953,"language":673,"meta":56,"style":56},"interface OrderItem {\n  productId: number;\n  quantity: number;\n}\n\nconst orders: any[] = [];\n\nexport default defineEventHandler(async (event) => {\n  const body = (await readBody(event)) as OrderItem[];\n\n  if (!body || body.length === 0) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Order must contain at least one item\",\n    });\n  }\n\n  \u002F\u002F Simulate database delay\n  await new Promise((resolve) => setTimeout(resolve, 100));\n\n  const order = {\n    id: crypto.randomUUID(),\n    items: body,\n    status: \"pending\",\n    createdAt: new Date().toISOString(),\n  };\n\n  orders.push(order);\n\n  return order;\n});\n","server\u002Fapi\u002Forders.post.ts",[40,4955,4956,4966,4978,4989,4993,4997,5018,5022,5044,5072,5076,5106,5116,5126,5136,5140,5144,5148,5153,5184,5188,5199,5209,5214,5224,5243,5247,5251,5262,5266,5273],{"__ignoreMap":56},[449,4957,4958,4961,4964],{"class":451,"line":452},[449,4959,4960],{"class":680},"interface",[449,4962,4963],{"class":721}," OrderItem",[449,4965,1501],{"class":684},[449,4967,4968,4971,4973,4976],{"class":451,"line":114},[449,4969,4970],{"class":1491},"  productId",[449,4972,3070],{"class":680},[449,4974,4975],{"class":714}," number",[449,4977,695],{"class":684},[449,4979,4980,4983,4985,4987],{"class":451,"line":111},[449,4981,4982],{"class":1491},"  quantity",[449,4984,3070],{"class":680},[449,4986,4975],{"class":714},[449,4988,695],{"class":684},[449,4990,4991],{"class":451,"line":468},[449,4992,4604],{"class":684},[449,4994,4995],{"class":451,"line":474},[449,4996,700],{"emptyLinePlaceholder":130},[449,4998,4999,5001,5004,5006,5009,5012,5015],{"class":451,"line":480},[449,5000,711],{"class":680},[449,5002,5003],{"class":714}," orders",[449,5005,3070],{"class":680},[449,5007,5008],{"class":714}," any",[449,5010,5011],{"class":684},"[] ",[449,5013,5014],{"class":680},"=",[449,5016,5017],{"class":684}," [];\n",[449,5019,5020],{"class":451,"line":486},[449,5021,700],{"emptyLinePlaceholder":130},[449,5023,5024,5026,5028,5030,5032,5034,5036,5038,5040,5042],{"class":451,"line":492},[449,5025,4629],{"class":680},[449,5027,4632],{"class":680},[449,5029,4714],{"class":721},[449,5031,725],{"class":684},[449,5033,1485],{"class":680},[449,5035,1913],{"class":684},[449,5037,2991],{"class":1491},[449,5039,1758],{"class":684},[449,5041,1498],{"class":680},[449,5043,1501],{"class":684},[449,5045,5046,5049,5052,5054,5056,5058,5061,5064,5067,5069],{"class":451,"line":498},[449,5047,5048],{"class":680},"  const",[449,5050,5051],{"class":714}," body",[449,5053,718],{"class":680},[449,5055,1913],{"class":684},[449,5057,2056],{"class":680},[449,5059,5060],{"class":721}," readBody",[449,5062,5063],{"class":684},"(event)) ",[449,5065,5066],{"class":680},"as",[449,5068,4963],{"class":721},[449,5070,5071],{"class":684},"[];\n",[449,5073,5074],{"class":451,"line":133},[449,5075,700],{"emptyLinePlaceholder":130},[449,5077,5078,5081,5083,5086,5089,5092,5095,5098,5101,5104],{"class":451,"line":509},[449,5079,5080],{"class":680},"  if",[449,5082,1913],{"class":684},[449,5084,5085],{"class":680},"!",[449,5087,5088],{"class":684},"body ",[449,5090,5091],{"class":680},"||",[449,5093,5094],{"class":684}," body.",[449,5096,5097],{"class":714},"length",[449,5099,5100],{"class":680}," ===",[449,5102,5103],{"class":714}," 0",[449,5105,3417],{"class":684},[449,5107,5108,5111,5114],{"class":451,"line":318},[449,5109,5110],{"class":680},"    throw",[449,5112,5113],{"class":721}," createError",[449,5115,1391],{"class":684},[449,5117,5118,5121,5124],{"class":451,"line":520},[449,5119,5120],{"class":684},"      statusCode: ",[449,5122,5123],{"class":714},"400",[449,5125,779],{"class":684},[449,5127,5128,5131,5134],{"class":451,"line":526},[449,5129,5130],{"class":684},"      statusMessage: ",[449,5132,5133],{"class":691},"\"Order must contain at least one item\"",[449,5135,779],{"class":684},[449,5137,5138],{"class":451,"line":532},[449,5139,3484],{"class":684},[449,5141,5142],{"class":451,"line":2790},[449,5143,4599],{"class":684},[449,5145,5146],{"class":451,"line":3511},[449,5147,700],{"emptyLinePlaceholder":130},[449,5149,5150],{"class":451,"line":3526},[449,5151,5152],{"class":705},"  \u002F\u002F Simulate database delay\n",[449,5154,5155,5157,5159,5162,5165,5168,5170,5172,5175,5178,5181],{"class":451,"line":3531},[449,5156,2099],{"class":680},[449,5158,1343],{"class":680},[449,5160,5161],{"class":714}," Promise",[449,5163,5164],{"class":684},"((",[449,5166,5167],{"class":1491},"resolve",[449,5169,1758],{"class":684},[449,5171,1498],{"class":680},[449,5173,5174],{"class":721}," setTimeout",[449,5176,5177],{"class":684},"(resolve, ",[449,5179,5180],{"class":714},"100",[449,5182,5183],{"class":684},"));\n",[449,5185,5186],{"class":451,"line":3536},[449,5187,700],{"emptyLinePlaceholder":130},[449,5189,5190,5192,5195,5197],{"class":451,"line":4009},[449,5191,5048],{"class":680},[449,5193,5194],{"class":714}," order",[449,5196,718],{"class":680},[449,5198,1501],{"class":684},[449,5200,5201,5204,5207],{"class":451,"line":4015},[449,5202,5203],{"class":684},"    id: crypto.",[449,5205,5206],{"class":721},"randomUUID",[449,5208,1624],{"class":684},[449,5210,5211],{"class":451,"line":4021},[449,5212,5213],{"class":684},"    items: body,\n",[449,5215,5216,5219,5222],{"class":451,"line":4027},[449,5217,5218],{"class":684},"    status: ",[449,5220,5221],{"class":691},"\"pending\"",[449,5223,779],{"class":684},[449,5225,5226,5229,5232,5235,5238,5241],{"class":451,"line":4032},[449,5227,5228],{"class":684},"    createdAt: ",[449,5230,5231],{"class":680},"new",[449,5233,5234],{"class":721}," Date",[449,5236,5237],{"class":684},"().",[449,5239,5240],{"class":721},"toISOString",[449,5242,1624],{"class":684},[449,5244,5245],{"class":451,"line":4038},[449,5246,4763],{"class":684},[449,5248,5249],{"class":451,"line":4044},[449,5250,700],{"emptyLinePlaceholder":130},[449,5252,5253,5256,5259],{"class":451,"line":4049},[449,5254,5255],{"class":684},"  orders.",[449,5257,5258],{"class":721},"push",[449,5260,5261],{"class":684},"(order);\n",[449,5263,5264],{"class":451,"line":4054},[449,5265,700],{"emptyLinePlaceholder":130},[449,5267,5268,5270],{"class":451,"line":4059},[449,5269,4726],{"class":680},[449,5271,5272],{"class":684}," order;\n",[449,5274,5275],{"class":451,"line":4065},[449,5276,784],{"class":684},[73,5278],{},[32,5280,5282],{"id":5281},"step-5-run-the-server","Step 5: Run the Server",[21,5284,5285],{},"Start the development server:",[48,5287,5289],{"className":839,"code":5288,"filename":4384,"language":841,"meta":56,"style":56},"bun run dev\n",[40,5290,5291],{"__ignoreMap":56},[449,5292,5293,5295,5298],{"class":451,"line":452},[449,5294,4440],{"class":721},[449,5296,5297],{"class":691}," run",[449,5299,5300],{"class":691}," dev\n",[427,5302,5305],{"icon":5303,"title":5304},"⚡","Notice the Speed",[21,5306,5307],{},"Bun's dev server starts in milliseconds—often before you can release the keys after typing the command.",[21,5309,5310],{},"Test the endpoints:",[48,5312,5314],{"className":839,"code":5313,"filename":4384,"language":841,"meta":56,"style":56},"curl http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fping\ncurl http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fproducts\n",[40,5315,5316,5323],{"__ignoreMap":56},[449,5317,5318,5320],{"class":451,"line":452},[449,5319,4396],{"class":721},[449,5321,5322],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fping\n",[449,5324,5325,5327],{"class":451,"line":114},[449,5326,4396],{"class":721},[449,5328,5329],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fproducts\n",[73,5331],{},[32,5333,5335],{"id":5334},"step-6-benchmarking","Step 6: Benchmarking",[21,5337,5338],{},"Let's create a simple benchmark script to compare Bun vs Node.js performance.",[21,5340,4697,5341,3070],{},[40,5342,5343],{},"benchmark.mjs",[48,5345,5347],{"className":670,"code":5346,"filename":5343,"language":673,"meta":56,"style":56},"import http from \"http\";\n\nconst HOST = \"localhost\";\nconst PORT = 3000;\nconst REQUESTS = 10000;\nconst CONCURRENCY = 100;\n\nasync function benchmark() {\n  console.log(`Running benchmark: ${REQUESTS} requests with ${CONCURRENCY} concurrency\\n`);\n\n  const start = Date.now();\n  let completed = 0;\n\n  const promises = [];\n\n  for (let i = 0; i \u003C CONCURRENCY; i++) {\n    promises.push(\n      new Promise((resolve) => {\n        const makeRequest = async () => {\n          if (completed >= REQUESTS) {\n            resolve(true);\n            return;\n          }\n\n          try {\n            await fetch(`http:\u002F\u002F${HOST}:${PORT}\u002Fapi\u002Fproducts`);\n            completed++;\n\n            if (completed \u003C REQUESTS) {\n              makeRequest();\n            } else {\n              resolve(true);\n            }\n          } catch (e) {\n            resolve(true);\n          }\n        };\n\n        makeRequest();\n      }),\n    );\n  }\n\n  await Promise.all(promises);\n\n  const duration = Date.now() - start;\n  const rps = Math.round(REQUESTS \u002F (duration \u002F 1000));\n\n  console.log(`Results:`);\n  console.log(`  Total time: ${duration}ms`);\n  console.log(`  Requests\u002Fsec: ${rps}`);\n  console.log(`  Avg latency: ${(duration \u002F REQUESTS).toFixed(2)}ms`);\n}\n\nbenchmark();\n",[40,5348,5349,5363,5367,5381,5395,5409,5423,5427,5440,5472,5476,5492,5506,5510,5521,5525,5558,5568,5585,5604,5619,5630,5637,5642,5646,5653,5680,5689,5693,5706,5713,5723,5734,5739,5750,5760,5764,5769,5773,5780,5786,5792,5797,5802,5817,5822,5844,5878,5883,5897,5917,5936,5971,5976,5981],{"__ignoreMap":56},[449,5350,5351,5353,5356,5358,5361],{"class":451,"line":452},[449,5352,681],{"class":680},[449,5354,5355],{"class":684}," http ",[449,5357,688],{"class":680},[449,5359,5360],{"class":691}," \"http\"",[449,5362,695],{"class":684},[449,5364,5365],{"class":451,"line":114},[449,5366,700],{"emptyLinePlaceholder":130},[449,5368,5369,5371,5374,5376,5379],{"class":451,"line":111},[449,5370,711],{"class":680},[449,5372,5373],{"class":714}," HOST",[449,5375,718],{"class":680},[449,5377,5378],{"class":691}," \"localhost\"",[449,5380,695],{"class":684},[449,5382,5383,5385,5388,5390,5393],{"class":451,"line":468},[449,5384,711],{"class":680},[449,5386,5387],{"class":714}," PORT",[449,5389,718],{"class":680},[449,5391,5392],{"class":714}," 3000",[449,5394,695],{"class":684},[449,5396,5397,5399,5402,5404,5407],{"class":451,"line":474},[449,5398,711],{"class":680},[449,5400,5401],{"class":714}," REQUESTS",[449,5403,718],{"class":680},[449,5405,5406],{"class":714}," 10000",[449,5408,695],{"class":684},[449,5410,5411,5413,5416,5418,5421],{"class":451,"line":480},[449,5412,711],{"class":680},[449,5414,5415],{"class":714}," CONCURRENCY",[449,5417,718],{"class":680},[449,5419,5420],{"class":714}," 100",[449,5422,695],{"class":684},[449,5424,5425],{"class":451,"line":486},[449,5426,700],{"emptyLinePlaceholder":130},[449,5428,5429,5431,5434,5437],{"class":451,"line":492},[449,5430,1485],{"class":680},[449,5432,5433],{"class":680}," function",[449,5435,5436],{"class":721}," benchmark",[449,5438,5439],{"class":684},"() {\n",[449,5441,5442,5445,5447,5449,5452,5455,5458,5461,5464,5467,5470],{"class":451,"line":498},[449,5443,5444],{"class":684},"  console.",[449,5446,1675],{"class":721},[449,5448,725],{"class":684},[449,5450,5451],{"class":691},"`Running benchmark: ${",[449,5453,5454],{"class":714},"REQUESTS",[449,5456,5457],{"class":691},"} requests with ${",[449,5459,5460],{"class":714},"CONCURRENCY",[449,5462,5463],{"class":691},"} concurrency",[449,5465,5466],{"class":714},"\\n",[449,5468,5469],{"class":691},"`",[449,5471,740],{"class":684},[449,5473,5474],{"class":451,"line":133},[449,5475,700],{"emptyLinePlaceholder":130},[449,5477,5478,5480,5483,5485,5488,5490],{"class":451,"line":509},[449,5479,5048],{"class":680},[449,5481,5482],{"class":714}," start",[449,5484,718],{"class":680},[449,5486,5487],{"class":684}," Date.",[449,5489,4756],{"class":721},[449,5491,1322],{"class":684},[449,5493,5494,5497,5500,5502,5504],{"class":451,"line":318},[449,5495,5496],{"class":680},"  let",[449,5498,5499],{"class":684}," completed ",[449,5501,5014],{"class":680},[449,5503,5103],{"class":714},[449,5505,695],{"class":684},[449,5507,5508],{"class":451,"line":520},[449,5509,700],{"emptyLinePlaceholder":130},[449,5511,5512,5514,5517,5519],{"class":451,"line":526},[449,5513,5048],{"class":680},[449,5515,5516],{"class":714}," promises",[449,5518,718],{"class":680},[449,5520,5017],{"class":684},[449,5522,5523],{"class":451,"line":532},[449,5524,700],{"emptyLinePlaceholder":130},[449,5526,5527,5530,5532,5535,5538,5540,5542,5545,5548,5550,5553,5556],{"class":451,"line":2790},[449,5528,5529],{"class":680},"  for",[449,5531,1913],{"class":684},[449,5533,5534],{"class":680},"let",[449,5536,5537],{"class":684}," i ",[449,5539,5014],{"class":680},[449,5541,5103],{"class":714},[449,5543,5544],{"class":684},"; i ",[449,5546,5547],{"class":680},"\u003C",[449,5549,5415],{"class":714},[449,5551,5552],{"class":684},"; i",[449,5554,5555],{"class":680},"++",[449,5557,3417],{"class":684},[449,5559,5560,5563,5565],{"class":451,"line":3511},[449,5561,5562],{"class":684},"    promises.",[449,5564,5258],{"class":721},[449,5566,5567],{"class":684},"(\n",[449,5569,5570,5573,5575,5577,5579,5581,5583],{"class":451,"line":3526},[449,5571,5572],{"class":680},"      new",[449,5574,5161],{"class":714},[449,5576,5164],{"class":684},[449,5578,5167],{"class":1491},[449,5580,1758],{"class":684},[449,5582,1498],{"class":680},[449,5584,1501],{"class":684},[449,5586,5587,5590,5593,5595,5598,5600,5602],{"class":451,"line":3531},[449,5588,5589],{"class":680},"        const",[449,5591,5592],{"class":721}," makeRequest",[449,5594,718],{"class":680},[449,5596,5597],{"class":680}," async",[449,5599,2090],{"class":684},[449,5601,1498],{"class":680},[449,5603,1501],{"class":684},[449,5605,5606,5609,5612,5615,5617],{"class":451,"line":3536},[449,5607,5608],{"class":680},"          if",[449,5610,5611],{"class":684}," (completed ",[449,5613,5614],{"class":680},">=",[449,5616,5401],{"class":714},[449,5618,3417],{"class":684},[449,5620,5621,5624,5626,5628],{"class":451,"line":4009},[449,5622,5623],{"class":721},"            resolve",[449,5625,725],{"class":684},[449,5627,2169],{"class":714},[449,5629,740],{"class":684},[449,5631,5632,5635],{"class":451,"line":4015},[449,5633,5634],{"class":680},"            return",[449,5636,695],{"class":684},[449,5638,5639],{"class":451,"line":4021},[449,5640,5641],{"class":684},"          }\n",[449,5643,5644],{"class":451,"line":4027},[449,5645,700],{"emptyLinePlaceholder":130},[449,5647,5648,5651],{"class":451,"line":4032},[449,5649,5650],{"class":680},"          try",[449,5652,1501],{"class":684},[449,5654,5655,5658,5661,5663,5666,5669,5672,5675,5678],{"class":451,"line":4038},[449,5656,5657],{"class":680},"            await",[449,5659,5660],{"class":721}," fetch",[449,5662,725],{"class":684},[449,5664,5665],{"class":691},"`http:\u002F\u002F${",[449,5667,5668],{"class":714},"HOST",[449,5670,5671],{"class":691},"}:${",[449,5673,5674],{"class":714},"PORT",[449,5676,5677],{"class":691},"}\u002Fapi\u002Fproducts`",[449,5679,740],{"class":684},[449,5681,5682,5685,5687],{"class":451,"line":4044},[449,5683,5684],{"class":684},"            completed",[449,5686,5555],{"class":680},[449,5688,695],{"class":684},[449,5690,5691],{"class":451,"line":4049},[449,5692,700],{"emptyLinePlaceholder":130},[449,5694,5695,5698,5700,5702,5704],{"class":451,"line":4054},[449,5696,5697],{"class":680},"            if",[449,5699,5611],{"class":684},[449,5701,5547],{"class":680},[449,5703,5401],{"class":714},[449,5705,3417],{"class":684},[449,5707,5708,5711],{"class":451,"line":4059},[449,5709,5710],{"class":721},"              makeRequest",[449,5712,1322],{"class":684},[449,5714,5715,5718,5721],{"class":451,"line":4065},[449,5716,5717],{"class":684},"            } ",[449,5719,5720],{"class":680},"else",[449,5722,1501],{"class":684},[449,5724,5725,5728,5730,5732],{"class":451,"line":4070},[449,5726,5727],{"class":721},"              resolve",[449,5729,725],{"class":684},[449,5731,2169],{"class":714},[449,5733,740],{"class":684},[449,5735,5736],{"class":451,"line":4075},[449,5737,5738],{"class":684},"            }\n",[449,5740,5741,5744,5747],{"class":451,"line":4081},[449,5742,5743],{"class":684},"          } ",[449,5745,5746],{"class":680},"catch",[449,5748,5749],{"class":684}," (e) {\n",[449,5751,5752,5754,5756,5758],{"class":451,"line":4086},[449,5753,5623],{"class":721},[449,5755,725],{"class":684},[449,5757,2169],{"class":714},[449,5759,740],{"class":684},[449,5761,5762],{"class":451,"line":4092},[449,5763,5641],{"class":684},[449,5765,5766],{"class":451,"line":4098},[449,5767,5768],{"class":684},"        };\n",[449,5770,5771],{"class":451,"line":4104},[449,5772,700],{"emptyLinePlaceholder":130},[449,5774,5775,5778],{"class":451,"line":4110},[449,5776,5777],{"class":721},"        makeRequest",[449,5779,1322],{"class":684},[449,5781,5783],{"class":451,"line":5782},40,[449,5784,5785],{"class":684},"      }),\n",[449,5787,5789],{"class":451,"line":5788},41,[449,5790,5791],{"class":684},"    );\n",[449,5793,5795],{"class":451,"line":5794},42,[449,5796,4599],{"class":684},[449,5798,5800],{"class":451,"line":5799},43,[449,5801,700],{"emptyLinePlaceholder":130},[449,5803,5805,5807,5809,5811,5814],{"class":451,"line":5804},44,[449,5806,2099],{"class":680},[449,5808,5161],{"class":714},[449,5810,165],{"class":684},[449,5812,5813],{"class":721},"all",[449,5815,5816],{"class":684},"(promises);\n",[449,5818,5820],{"class":451,"line":5819},45,[449,5821,700],{"emptyLinePlaceholder":130},[449,5823,5825,5827,5830,5832,5834,5836,5838,5841],{"class":451,"line":5824},46,[449,5826,5048],{"class":680},[449,5828,5829],{"class":714}," duration",[449,5831,718],{"class":680},[449,5833,5487],{"class":684},[449,5835,4756],{"class":721},[449,5837,731],{"class":684},[449,5839,5840],{"class":680},"-",[449,5842,5843],{"class":684}," start;\n",[449,5845,5847,5849,5852,5854,5857,5860,5862,5864,5867,5870,5873,5876],{"class":451,"line":5846},47,[449,5848,5048],{"class":680},[449,5850,5851],{"class":714}," rps",[449,5853,718],{"class":680},[449,5855,5856],{"class":684}," Math.",[449,5858,5859],{"class":721},"round",[449,5861,725],{"class":684},[449,5863,5454],{"class":714},[449,5865,5866],{"class":680}," \u002F",[449,5868,5869],{"class":684}," (duration ",[449,5871,5872],{"class":680},"\u002F",[449,5874,5875],{"class":714}," 1000",[449,5877,5183],{"class":684},[449,5879,5881],{"class":451,"line":5880},48,[449,5882,700],{"emptyLinePlaceholder":130},[449,5884,5886,5888,5890,5892,5895],{"class":451,"line":5885},49,[449,5887,5444],{"class":684},[449,5889,1675],{"class":721},[449,5891,725],{"class":684},[449,5893,5894],{"class":691},"`Results:`",[449,5896,740],{"class":684},[449,5898,5900,5902,5904,5906,5909,5912,5915],{"class":451,"line":5899},50,[449,5901,5444],{"class":684},[449,5903,1675],{"class":721},[449,5905,725],{"class":684},[449,5907,5908],{"class":691},"`  Total time: ${",[449,5910,5911],{"class":684},"duration",[449,5913,5914],{"class":691},"}ms`",[449,5916,740],{"class":684},[449,5918,5920,5922,5924,5926,5929,5932,5934],{"class":451,"line":5919},51,[449,5921,5444],{"class":684},[449,5923,1675],{"class":721},[449,5925,725],{"class":684},[449,5927,5928],{"class":691},"`  Requests\u002Fsec: ${",[449,5930,5931],{"class":684},"rps",[449,5933,1517],{"class":691},[449,5935,740],{"class":684},[449,5937,5939,5941,5943,5945,5948,5950,5952,5954,5956,5958,5961,5963,5965,5967,5969],{"class":451,"line":5938},52,[449,5940,5444],{"class":684},[449,5942,1675],{"class":721},[449,5944,725],{"class":684},[449,5946,5947],{"class":691},"`  Avg latency: ${",[449,5949,725],{"class":691},[449,5951,5911],{"class":684},[449,5953,5866],{"class":680},[449,5955,5401],{"class":714},[449,5957,374],{"class":691},[449,5959,5960],{"class":721},"toFixed",[449,5962,725],{"class":691},[449,5964,4826],{"class":714},[449,5966,827],{"class":691},[449,5968,5914],{"class":691},[449,5970,740],{"class":684},[449,5972,5974],{"class":451,"line":5973},53,[449,5975,4604],{"class":684},[449,5977,5979],{"class":451,"line":5978},54,[449,5980,700],{"emptyLinePlaceholder":130},[449,5982,5984,5987],{"class":451,"line":5983},55,[449,5985,5986],{"class":721},"benchmark",[449,5988,1322],{"class":684},[21,5990,5991],{},"Run the benchmark:",[48,5993,5995],{"className":839,"code":5994,"filename":4384,"language":841,"meta":56,"style":56},"# First, start the server in one terminal\nbun run dev\n\n# Then run the benchmark in another\nbun run benchmark.mjs\n",[40,5996,5997,6002,6010,6014,6019],{"__ignoreMap":56},[449,5998,5999],{"class":451,"line":452},[449,6000,6001],{"class":705},"# First, start the server in one terminal\n",[449,6003,6004,6006,6008],{"class":451,"line":114},[449,6005,4440],{"class":721},[449,6007,5297],{"class":691},[449,6009,5300],{"class":691},[449,6011,6012],{"class":451,"line":111},[449,6013,700],{"emptyLinePlaceholder":130},[449,6015,6016],{"class":451,"line":468},[449,6017,6018],{"class":705},"# Then run the benchmark in another\n",[449,6020,6021,6023,6025],{"class":451,"line":474},[449,6022,4440],{"class":721},[449,6024,5297],{"class":691},[449,6026,6027],{"class":691}," benchmark.mjs\n",[73,6029],{},[32,6031,6033],{"id":6032},"step-7-using-buns-native-features","Step 7: Using Bun's Native Features",[2808,6035,6037],{"id":6036},"typescript-direct-execution","TypeScript Direct Execution",[21,6039,6040],{},"Bun runs TypeScript natively—no ts-node, no compilation step needed:",[48,6042,6045],{"className":670,"code":6043,"filename":6044,"language":673,"meta":56,"style":56},"\u002F\u002F This runs directly in Bun—no transpilation!\ninterface Product {\n  id: number;\n  name: string;\n  price: number;\n}\n\nconst products: Product[] = [\n  { id: 1, name: \"Latte\", price: 4.5 },\n  { id: 2, name: \"Espresso\", price: 3.0 },\n];\n\nexport default defineEventHandler(() => {\n  return {\n    products,\n    runtime: Bun.version,\n    platform: Bun.environment.platform,\n  };\n});\n","server\u002Fapi\u002Fbun-features.get.ts",[40,6046,6047,6052,6061,6072,6084,6095,6099,6103,6119,6135,6151,6155,6159,6173,6179,6184,6189,6194,6198],{"__ignoreMap":56},[449,6048,6049],{"class":451,"line":452},[449,6050,6051],{"class":705},"\u002F\u002F This runs directly in Bun—no transpilation!\n",[449,6053,6054,6056,6059],{"class":451,"line":114},[449,6055,4960],{"class":680},[449,6057,6058],{"class":721}," Product",[449,6060,1501],{"class":684},[449,6062,6063,6066,6068,6070],{"class":451,"line":111},[449,6064,6065],{"class":1491},"  id",[449,6067,3070],{"class":680},[449,6069,4975],{"class":714},[449,6071,695],{"class":684},[449,6073,6074,6077,6079,6082],{"class":451,"line":468},[449,6075,6076],{"class":1491},"  name",[449,6078,3070],{"class":680},[449,6080,6081],{"class":714}," string",[449,6083,695],{"class":684},[449,6085,6086,6089,6091,6093],{"class":451,"line":474},[449,6087,6088],{"class":1491},"  price",[449,6090,3070],{"class":680},[449,6092,4975],{"class":714},[449,6094,695],{"class":684},[449,6096,6097],{"class":451,"line":480},[449,6098,4604],{"class":684},[449,6100,6101],{"class":451,"line":486},[449,6102,700],{"emptyLinePlaceholder":130},[449,6104,6105,6107,6109,6111,6113,6115,6117],{"class":451,"line":492},[449,6106,711],{"class":680},[449,6108,4785],{"class":714},[449,6110,3070],{"class":680},[449,6112,6058],{"class":721},[449,6114,5011],{"class":684},[449,6116,5014],{"class":680},[449,6118,4790],{"class":684},[449,6120,6121,6123,6125,6127,6129,6131,6133],{"class":451,"line":498},[449,6122,4795],{"class":684},[449,6124,4798],{"class":714},[449,6126,4801],{"class":684},[449,6128,4804],{"class":691},[449,6130,4807],{"class":684},[449,6132,4810],{"class":714},[449,6134,4819],{"class":684},[449,6136,6137,6139,6141,6143,6145,6147,6149],{"class":451,"line":133},[449,6138,4795],{"class":684},[449,6140,4826],{"class":714},[449,6142,4801],{"class":684},[449,6144,4831],{"class":691},[449,6146,4807],{"class":684},[449,6148,4836],{"class":714},[449,6150,4819],{"class":684},[449,6152,6153],{"class":451,"line":509},[449,6154,4917],{"class":684},[449,6156,6157],{"class":451,"line":318},[449,6158,700],{"emptyLinePlaceholder":130},[449,6160,6161,6163,6165,6167,6169,6171],{"class":451,"line":520},[449,6162,4629],{"class":680},[449,6164,4632],{"class":680},[449,6166,4714],{"class":721},[449,6168,4717],{"class":684},[449,6170,1498],{"class":680},[449,6172,1501],{"class":684},[449,6174,6175,6177],{"class":451,"line":526},[449,6176,4726],{"class":680},[449,6178,1501],{"class":684},[449,6180,6181],{"class":451,"line":532},[449,6182,6183],{"class":684},"    products,\n",[449,6185,6186],{"class":451,"line":2790},[449,6187,6188],{"class":684},"    runtime: Bun.version,\n",[449,6190,6191],{"class":451,"line":3511},[449,6192,6193],{"class":684},"    platform: Bun.environment.platform,\n",[449,6195,6196],{"class":451,"line":3526},[449,6197,4763],{"class":684},[449,6199,6200],{"class":451,"line":3531},[449,6201,784],{"class":684},[2808,6203,6205],{"id":6204},"using-bunfile-for-static-files","Using Bun.file for Static Files",[21,6207,6208],{},"Bun has built-in support for file operations:",[48,6210,6213],{"className":670,"code":6211,"filename":6212,"language":673,"meta":56,"style":56},"export default defineEventHandler(async (event) => {\n  const file = Bun.file(\".\u002Fserver\u002Fdata\u002Fproducts.json\");\n  const contents = await file.json();\n\n  return contents;\n});\n","server\u002Fapi\u002Fread-file.get.ts",[40,6214,6215,6237,6259,6277,6281,6288],{"__ignoreMap":56},[449,6216,6217,6219,6221,6223,6225,6227,6229,6231,6233,6235],{"class":451,"line":452},[449,6218,4629],{"class":680},[449,6220,4632],{"class":680},[449,6222,4714],{"class":721},[449,6224,725],{"class":684},[449,6226,1485],{"class":680},[449,6228,1913],{"class":684},[449,6230,2991],{"class":1491},[449,6232,1758],{"class":684},[449,6234,1498],{"class":680},[449,6236,1501],{"class":684},[449,6238,6239,6241,6244,6246,6249,6252,6254,6257],{"class":451,"line":114},[449,6240,5048],{"class":680},[449,6242,6243],{"class":714}," file",[449,6245,718],{"class":680},[449,6247,6248],{"class":684}," Bun.",[449,6250,6251],{"class":721},"file",[449,6253,725],{"class":684},[449,6255,6256],{"class":691},"\".\u002Fserver\u002Fdata\u002Fproducts.json\"",[449,6258,740],{"class":684},[449,6260,6261,6263,6266,6268,6270,6273,6275],{"class":451,"line":111},[449,6262,5048],{"class":680},[449,6264,6265],{"class":714}," contents",[449,6267,718],{"class":680},[449,6269,1654],{"class":680},[449,6271,6272],{"class":684}," file.",[449,6274,4521],{"class":721},[449,6276,1322],{"class":684},[449,6278,6279],{"class":451,"line":468},[449,6280,700],{"emptyLinePlaceholder":130},[449,6282,6283,6285],{"class":451,"line":474},[449,6284,4726],{"class":680},[449,6286,6287],{"class":684}," contents;\n",[449,6289,6290],{"class":451,"line":480},[449,6291,784],{"class":684},[2808,6293,6295],{"id":6294},"parallel-data-fetching","Parallel Data Fetching",[21,6297,6298],{},"Bun's concurrent fetching is blazingly fast:",[48,6300,6303],{"className":670,"code":6301,"filename":6302,"language":673,"meta":56,"style":56},"export default defineEventHandler(async () => {\n  const urls = [\n    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Fokinea\",\n    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Ffacebook\",\n    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Fnuxt\",\n  ];\n\n  \u002F\u002F Fetch all URLs in parallel - Bun optimizes this natively\n  const responses = await Promise.all(urls.map((url) => fetch(url).then((r) => r.json())));\n\n  return {\n    users: responses.map((r) => r.login),\n    fetchedAt: new Date().toISOString(),\n  };\n});\n","server\u002Fapi\u002Fexternal.get.ts",[40,6304,6305,6323,6334,6341,6348,6355,6360,6364,6369,6426,6430,6436,6454,6469,6473],{"__ignoreMap":56},[449,6306,6307,6309,6311,6313,6315,6317,6319,6321],{"class":451,"line":452},[449,6308,4629],{"class":680},[449,6310,4632],{"class":680},[449,6312,4714],{"class":721},[449,6314,725],{"class":684},[449,6316,1485],{"class":680},[449,6318,2090],{"class":684},[449,6320,1498],{"class":680},[449,6322,1501],{"class":684},[449,6324,6325,6327,6330,6332],{"class":451,"line":114},[449,6326,5048],{"class":680},[449,6328,6329],{"class":714}," urls",[449,6331,718],{"class":680},[449,6333,4790],{"class":684},[449,6335,6336,6339],{"class":451,"line":111},[449,6337,6338],{"class":691},"    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Fokinea\"",[449,6340,779],{"class":684},[449,6342,6343,6346],{"class":451,"line":468},[449,6344,6345],{"class":691},"    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Ffacebook\"",[449,6347,779],{"class":684},[449,6349,6350,6353],{"class":451,"line":474},[449,6351,6352],{"class":691},"    \"https:\u002F\u002Fapi.github.com\u002Fusers\u002Fnuxt\"",[449,6354,779],{"class":684},[449,6356,6357],{"class":451,"line":480},[449,6358,6359],{"class":684},"  ];\n",[449,6361,6362],{"class":451,"line":486},[449,6363,700],{"emptyLinePlaceholder":130},[449,6365,6366],{"class":451,"line":492},[449,6367,6368],{"class":705},"  \u002F\u002F Fetch all URLs in parallel - Bun optimizes this natively\n",[449,6370,6371,6373,6376,6378,6380,6382,6384,6386,6389,6392,6394,6397,6399,6401,6403,6406,6409,6411,6414,6416,6418,6421,6423],{"class":451,"line":498},[449,6372,5048],{"class":680},[449,6374,6375],{"class":714}," responses",[449,6377,718],{"class":680},[449,6379,1654],{"class":680},[449,6381,5161],{"class":714},[449,6383,165],{"class":684},[449,6385,5813],{"class":721},[449,6387,6388],{"class":684},"(urls.",[449,6390,6391],{"class":721},"map",[449,6393,5164],{"class":684},[449,6395,6396],{"class":1491},"url",[449,6398,1758],{"class":684},[449,6400,1498],{"class":680},[449,6402,5660],{"class":721},[449,6404,6405],{"class":684},"(url).",[449,6407,6408],{"class":721},"then",[449,6410,5164],{"class":684},[449,6412,6413],{"class":1491},"r",[449,6415,1758],{"class":684},[449,6417,1498],{"class":680},[449,6419,6420],{"class":684}," r.",[449,6422,4521],{"class":721},[449,6424,6425],{"class":684},"())));\n",[449,6427,6428],{"class":451,"line":133},[449,6429,700],{"emptyLinePlaceholder":130},[449,6431,6432,6434],{"class":451,"line":509},[449,6433,4726],{"class":680},[449,6435,1501],{"class":684},[449,6437,6438,6441,6443,6445,6447,6449,6451],{"class":451,"line":318},[449,6439,6440],{"class":684},"    users: responses.",[449,6442,6391],{"class":721},[449,6444,5164],{"class":684},[449,6446,6413],{"class":1491},[449,6448,1758],{"class":684},[449,6450,1498],{"class":680},[449,6452,6453],{"class":684}," r.login),\n",[449,6455,6456,6459,6461,6463,6465,6467],{"class":451,"line":520},[449,6457,6458],{"class":684},"    fetchedAt: ",[449,6460,5231],{"class":680},[449,6462,5234],{"class":721},[449,6464,5237],{"class":684},[449,6466,5240],{"class":721},[449,6468,1624],{"class":684},[449,6470,6471],{"class":451,"line":526},[449,6472,4763],{"class":684},[449,6474,6475],{"class":451,"line":532},[449,6476,784],{"class":684},[73,6478],{},[32,6480,6482],{"id":6481},"step-8-migration-guide","Step 8: Migration Guide",[2808,6484,6486],{"id":6485},"from-nodejs-to-bun","From Node.js to Bun",[816,6488,6489,6513,6569],{},[386,6490,6491,6494,6509,6512],{},[151,6492,6493],{},"Test your dependencies",[48,6495,6497],{"className":839,"code":6496,"language":841,"meta":56,"style":56},"bun pm trust\n",[40,6498,6499],{"__ignoreMap":56},[449,6500,6501,6503,6506],{"class":451,"line":452},[449,6502,4440],{"class":721},[449,6504,6505],{"class":691}," pm",[449,6507,6508],{"class":691}," trust\n",[6510,6511],"br",{},"This ensures all packages work with Bun's module resolution.",[386,6514,6515,6518],{},[151,6516,6517],{},"Update scripts",[48,6519,6521],{"className":4518,"code":6520,"language":4521,"meta":56,"style":56},"{\n  \"scripts\": {\n    \"dev\": \"bunx nuxi dev\",\n    \"build\": \"bunx nuxi build\",\n    \"start\": \"bunx nuxi start\"\n  }\n}\n",[40,6522,6523,6527,6533,6543,6553,6561,6565],{"__ignoreMap":56},[449,6524,6525],{"class":451,"line":452},[449,6526,4528],{"class":684},[449,6528,6529,6531],{"class":451,"line":114},[449,6530,4545],{"class":714},[449,6532,4548],{"class":684},[449,6534,6535,6537,6539,6541],{"class":451,"line":111},[449,6536,4553],{"class":714},[449,6538,1482],{"class":684},[449,6540,4558],{"class":691},[449,6542,779],{"class":684},[449,6544,6545,6547,6549,6551],{"class":451,"line":468},[449,6546,4565],{"class":714},[449,6548,1482],{"class":684},[449,6550,4570],{"class":691},[449,6552,779],{"class":684},[449,6554,6555,6557,6559],{"class":451,"line":474},[449,6556,4589],{"class":714},[449,6558,1482],{"class":684},[449,6560,4594],{"class":691},[449,6562,6563],{"class":451,"line":480},[449,6564,4599],{"class":684},[449,6566,6567],{"class":451,"line":486},[449,6568,4604],{"class":684},[386,6570,6571,6574],{},[151,6572,6573],{},"Check for Node.js-specific code",[48,6575,6577],{"className":839,"code":6576,"language":841,"meta":56,"style":56},"# Bun supports most Node.js APIs, but verify:\nbun --compat node_modules\n",[40,6578,6579,6584],{"__ignoreMap":56},[449,6580,6581],{"class":451,"line":452},[449,6582,6583],{"class":705},"# Bun supports most Node.js APIs, but verify:\n",[449,6585,6586,6588,6591],{"class":451,"line":114},[449,6587,4440],{"class":721},[449,6589,6590],{"class":714}," --compat",[449,6592,6593],{"class":691}," node_modules\n",[2808,6595,6597],{"id":6596},"known-compatibility-issues","Known Compatibility Issues",[25,6599,6600,6614],{"type":27},[383,6601,6602,6608,6611],{},[386,6603,6604,6605],{},"Some native modules may require rebuilding: ",[40,6606,6607],{},"bun pm rebuild",[386,6609,6610],{},"Very old packages with C++ addons might not work",[386,6612,6613],{},"Edge cases in crypto API differ slightly",[21,6615,6616,6617,6621],{},"Most modern packages work perfectly—check ",[3861,6618,6619],{"href":6619,"rel":6620},"https:\u002F\u002Fbun.sh\u002Fcompatibility",[3865]," for updates.",[73,6623],{},[32,6625,6627],{"id":6626},"step-9-deployment","Step 9: Deployment",[2808,6629,6631],{"id":6630},"deploy-to-various-platforms","Deploy to Various Platforms",[6633,6634,6636],"h4",{"id":6635},"vercel","Vercel",[48,6638,6640],{"className":839,"code":6639,"filename":4384,"language":841,"meta":56,"style":56},"# Vercel automatically detects Bun\nvercel deploy\n",[40,6641,6642,6647],{"__ignoreMap":56},[449,6643,6644],{"class":451,"line":452},[449,6645,6646],{"class":705},"# Vercel automatically detects Bun\n",[449,6648,6649,6651],{"class":451,"line":114},[449,6650,6635],{"class":721},[449,6652,6653],{"class":691}," deploy\n",[6633,6655,6657],{"id":6656},"railway","Railway",[48,6659,6662],{"className":4518,"code":6660,"filename":6661,"language":4521,"meta":56,"style":56},"{\n  \"build\": {\n    \"builder\": \"NIXPACKS_BUN\"\n  },\n  \"run\": {\n    \"command\": \"bun run start\"\n  }\n}\n","railway.json",[40,6663,6664,6668,6675,6685,6689,6696,6706,6710],{"__ignoreMap":56},[449,6665,6666],{"class":451,"line":452},[449,6667,4528],{"class":684},[449,6669,6670,6673],{"class":451,"line":114},[449,6671,6672],{"class":714},"  \"build\"",[449,6674,4548],{"class":684},[449,6676,6677,6680,6682],{"class":451,"line":111},[449,6678,6679],{"class":714},"    \"builder\"",[449,6681,1482],{"class":684},[449,6683,6684],{"class":691},"\"NIXPACKS_BUN\"\n",[449,6686,6687],{"class":451,"line":468},[449,6688,1474],{"class":684},[449,6690,6691,6694],{"class":451,"line":474},[449,6692,6693],{"class":714},"  \"run\"",[449,6695,4548],{"class":684},[449,6697,6698,6701,6703],{"class":451,"line":480},[449,6699,6700],{"class":714},"    \"command\"",[449,6702,1482],{"class":684},[449,6704,6705],{"class":691},"\"bun run start\"\n",[449,6707,6708],{"class":451,"line":486},[449,6709,4599],{"class":684},[449,6711,6712],{"class":451,"line":492},[449,6713,4604],{"class":684},[6633,6715,6717],{"id":6716},"docker","Docker",[48,6719,6724],{"className":6720,"code":6721,"filename":6722,"language":6723,"meta":56,"style":56},"language-dockerfile shiki shiki-themes github-light github-dark","FROM oven\u002Fbun:1.2 AS base\nWORKDIR \u002Fapp\n\nCOPY package.json bun.lockb* .\u002F\nRUN bun install --frozen-lockfile\n\nCOPY . .\nRUN bun run build\n\nEXPOSE 3000\nCMD [\"bun\", \"run\", \"start\"]\n","Dockerfile","dockerfile",[40,6725,6726,6731,6736,6740,6745,6750,6754,6759,6764,6768,6773],{"__ignoreMap":56},[449,6727,6728],{"class":451,"line":452},[449,6729,6730],{},"FROM oven\u002Fbun:1.2 AS base\n",[449,6732,6733],{"class":451,"line":114},[449,6734,6735],{},"WORKDIR \u002Fapp\n",[449,6737,6738],{"class":451,"line":111},[449,6739,700],{"emptyLinePlaceholder":130},[449,6741,6742],{"class":451,"line":468},[449,6743,6744],{},"COPY package.json bun.lockb* .\u002F\n",[449,6746,6747],{"class":451,"line":474},[449,6748,6749],{},"RUN bun install --frozen-lockfile\n",[449,6751,6752],{"class":451,"line":480},[449,6753,700],{"emptyLinePlaceholder":130},[449,6755,6756],{"class":451,"line":486},[449,6757,6758],{},"COPY . .\n",[449,6760,6761],{"class":451,"line":492},[449,6762,6763],{},"RUN bun run build\n",[449,6765,6766],{"class":451,"line":498},[449,6767,700],{"emptyLinePlaceholder":130},[449,6769,6770],{"class":451,"line":133},[449,6771,6772],{},"EXPOSE 3000\n",[449,6774,6775],{"class":451,"line":509},[449,6776,6777],{},"CMD [\"bun\", \"run\", \"start\"]\n",[6633,6779,6781],{"id":6780},"buns-native-server","Bun's Native Server",[21,6783,6784],{},"Bun can serve directly:",[48,6786,6788],{"className":839,"code":6787,"filename":4384,"language":841,"meta":56,"style":56},"bunx nuxi build\nbun run .output\u002Fserver\u002Findex.mjs\n",[40,6789,6790,6800],{"__ignoreMap":56},[449,6791,6792,6794,6797],{"class":451,"line":452},[449,6793,4472],{"class":721},[449,6795,6796],{"class":691}," nuxi",[449,6798,6799],{"class":691}," build\n",[449,6801,6802,6804,6806],{"class":451,"line":114},[449,6803,4440],{"class":721},[449,6805,5297],{"class":691},[449,6807,6808],{"class":691}," .output\u002Fserver\u002Findex.mjs\n",[427,6810,6812],{"icon":429,"title":6811},"Production Ready",[21,6813,6814],{},"Bun is production-ready as of v1.2. Major companies are using it in production today. However, always test your specific dependency stack before deploying.",[73,6816],{},[32,6818,6820],{"id":6819},"what-weve-built","What We've Built",[21,6822,6823],{},"By the end of this guide, you have:",[383,6825,6826,6829,6832,6835,6838],{},[386,6827,6828],{},"A fully configured Bun + Nitro development environment",[386,6830,6831],{},"Fast API endpoints running on Bun",[386,6833,6834],{},"Performance benchmarks comparing to Node.js",[386,6836,6837],{},"Migration guidance from Node.js",[386,6839,6840],{},"Deployment configurations for multiple platforms",[2808,6842,6844],{"id":6843},"api-endpoints-summary","API Endpoints Summary",[547,6846,6847,6856],{},[550,6848,6849],{},[553,6850,6851,6854],{},[556,6852,6853],{},"Endpoint",[556,6855,923],{},[569,6857,6858,6869,6879,6889,6899],{},[553,6859,6860,6866],{},[574,6861,6862,6863],{},"GET ",[40,6864,6865],{},"\u002Fapi\u002Fping",[574,6867,6868],{},"Health check with Bun info",[553,6870,6871,6876],{},[574,6872,6862,6873],{},[40,6874,6875],{},"\u002Fapi\u002Fproducts",[574,6877,6878],{},"Product list",[553,6880,6881,6886],{},[574,6882,6862,6883],{},[40,6884,6885],{},"\u002Fapi\u002Fbun-features",[574,6887,6888],{},"Bun-specific features demo",[553,6890,6891,6896],{},[574,6892,6862,6893],{},[40,6894,6895],{},"\u002Fapi\u002Fexternal",[574,6897,6898],{},"Parallel external API calls",[553,6900,6901,6907],{},[574,6902,6903,6904],{},"POST ",[40,6905,6906],{},"\u002Fapi\u002Forders",[574,6908,6909],{},"Order creation",[73,6911],{},[16,6913,3681],{"id":3680},[21,6915,6916,6919],{},[151,6917,6918],{},"Bun + Nitro"," represents the future of JavaScript server development. The combination of Bun's incredible performance and Nitro's deployment flexibility creates a stack that's hard to beat:",[383,6921,6922,6928,6933,6939,6945],{},[386,6923,6924,6927],{},[151,6925,6926],{},"Blazing fast startup"," — 5-6x faster than Node.js",[386,6929,6930,6932],{},[151,6931,4235],{}," — No compilation step",[386,6934,6935,6938],{},[151,6936,6937],{},"Native Bun APIs"," — file, fetch, WebSocket built-in",[386,6940,6941,6944],{},[151,6942,6943],{},"Universal deployment"," — Node, serverless, edge",[386,6946,6947,6950],{},[151,6948,6949],{},"Same developer experience"," — Nuxt just works",[21,6952,6953],{},"The learning curve is minimal—if you know Nuxt and Node.js, you're already 95% of the way there. The remaining 5% is enjoying the speed.",[2808,6955,6957],{"id":6956},"when-to-use-bun","When to Use Bun",[383,6959,6960,6963,6966,6969,6972],{},[386,6961,6962],{},"✅ New projects where performance matters",[386,6964,6965],{},"✅ Serverless functions (cold start is critical)",[386,6967,6968],{},"✅ Rapid prototyping",[386,6970,6971],{},"✅ TypeScript-first projects",[386,6973,6974],{},"⚠️ Projects with many native C++ modules (test first)",[2808,6976,6978],{"id":6977},"when-to-stick-with-nodejs","When to Stick with Node.js",[383,6980,6981,6984,6987],{},[386,6982,6983],{},"✅ Enterprise projects with strict stability requirements",[386,6985,6986],{},"✅ Heavy reliance on legacy packages",[386,6988,6989],{},"✅ Teams less familiar with Bun's nuances",[21,6991,6992],{},"Start small—try Bun on your next side project or a single microservice. Once you experience the speed, you'll never want to go back. ☕⚡",[21,6994,6995],{},"Ready to build faster? Install Bun and try it today!",[3728,6997,6998],{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}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 .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":7000},[7001,7002,7003,7004,7005,7006,7007,7008,7009,7014,7018,7026],{"id":4227,"depth":114,"text":4228},{"id":4270,"depth":114,"text":4271},{"id":4376,"depth":114,"text":4377},{"id":4453,"depth":114,"text":4454},{"id":4609,"depth":114,"text":4610},{"id":4690,"depth":114,"text":4691},{"id":5281,"depth":114,"text":5282},{"id":5334,"depth":114,"text":5335},{"id":6032,"depth":114,"text":6033,"children":7010},[7011,7012,7013],{"id":6036,"depth":111,"text":6037},{"id":6204,"depth":111,"text":6205},{"id":6294,"depth":111,"text":6295},{"id":6481,"depth":114,"text":6482,"children":7015},[7016,7017],{"id":6485,"depth":111,"text":6486},{"id":6596,"depth":111,"text":6597},{"id":6626,"depth":114,"text":6627,"children":7019},[7020],{"id":6630,"depth":111,"text":6631,"children":7021},[7022,7023,7024,7025],{"id":6635,"depth":468,"text":6636},{"id":6656,"depth":468,"text":6657},{"id":6716,"depth":468,"text":6717},{"id":6780,"depth":468,"text":6781},{"id":6819,"depth":114,"text":6820,"children":7027},[7028,7029,7030],{"id":6843,"depth":111,"text":6844},{"id":6956,"depth":111,"text":6957},{"id":6977,"depth":111,"text":6978},"2026-03-03","Discover why Bun is the runtime to watch in 2026 and learn how to build blazing-fast APIs with Bun and Nitro. From setup to deployment, this guide covers everything.",{"type":13,"value":7034},[7035,7037,7041,7045,7047,7059],[16,7036,333],{"id":332},[21,7038,4179,7039,4183],{},[151,7040,4182],{},[21,7042,4186,7043,4190],{},[151,7044,4189],{},[21,7046,4193],{},[383,7048,7049,7051,7053,7055,7057],{},[386,7050,4198],{},[386,7052,4201],{},[386,7054,4204],{},[386,7056,4207],{},[386,7058,4210],{},[21,7060,4213,7061,4217],{},[151,7062,4216],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1555949963-aa79dcee981c",[4440,7065,7066,3612,7067,7068,7069],"nitro","runtime","server","api","javascript",{},"\u002Fblog\u002Fbun-nitro-stack",{"title":4171,"description":7032},"blog\u002Fbun-nitro-stack","xEOpb2ZXn0epGBg9-tYvBrMMk-yPbloSFiN9c6TOobo",{"id":7076,"title":7077,"author":7078,"body":7079,"canonical":116,"categories":116,"date":8289,"description":8290,"excerpt":116,"extension":119,"featuredImg":116,"img":8291,"keywords":8292,"language":3788,"meta":8301,"navigation":130,"ogImage":116,"path":8302,"rating":116,"readTime":486,"seo":8303,"stem":8304,"tag":8305,"__hash__":8306},"blog\u002Fblog\u002Fdeploying-react-native-expo-to-app-store.md","Deploying React Native\u002FExpo Apps to the Apple App Store",{"name":9,"img":11,"website":327},{"type":13,"value":7080,"toc":8251},[7081,7084,7086,7089,7092,7096,7145,7148,7151,7165,7168,7172,7175,7207,7211,7234,7237,7240,7244,7247,7287,7290,7320,7324,7328,7331,7348,7352,7358,7553,7556,7559,7563,7591,7595,7602,7619,7623,7628,7677,7680,7683,7687,7690,7746,7750,7753,7816,7820,7823,7864,7867,7870,7874,7965,7969,8000,8003,8006,8010,8054,8058,8061,8102,8105,8109,8162,8166,8169,8201,8203,8206,8209,8212,8238,8241,8243,8248],[16,7082,7077],{"id":7083},"deploying-react-nativeexpo-apps-to-the-apple-app-store",[32,7085,333],{"id":332},[21,7087,7088],{},"Deploying a React Native or Expo app to the Apple App Store can feel like a daunting task, especially when you're coming from a web development background. The process involves understanding Apple's ecosystem, setting up development accounts, configuring build configurations, and navigating the App Store Review process.",[21,7090,7091],{},"In this comprehensive guide, I'll walk you through the entire deployment journey, from setting up your development environment to submitting your app for review. Whether you're a seasoned developer or just starting with React Native\u002FExpo, you'll learn everything you need to know to get your app on the App Store.",[32,7093,7095],{"id":7094},"table-of-contents","Table of Contents",[816,7097,7098,7104,7110,7116,7122,7128,7134,7140],{},[386,7099,7100],{},[3861,7101,7103],{"href":7102},"#setting-up-your-apple-developer-account","Setting Up Your Apple Developer Account",[386,7105,7106],{},[3861,7107,7109],{"href":7108},"#configuring-your-project-for-ios","Configuring Your Project for iOS",[386,7111,7112],{},[3861,7113,7115],{"href":7114},"#setting-up-code-signing","Setting Up Code Signing",[386,7117,7118],{},[3861,7119,7121],{"href":7120},"#preparing-for-app-store-submission","Preparing for App Store Submission",[386,7123,7124],{},[3861,7125,7127],{"href":7126},"#submitting-to-the-app-store","Submitting to the App Store",[386,7129,7130],{},[3861,7131,7133],{"href":7132},"#post-submission-and-maintenance","Post-Submission and Maintenance",[386,7135,7136],{},[3861,7137,7139],{"href":7138},"#troubleshooting-common-issues","Troubleshooting Common Issues",[386,7141,7142],{},[3861,7143,3681],{"href":7144},"#conclusion",[32,7146,7103],{"id":7147},"setting-up-your-apple-developer-account",[21,7149,7150],{},"Before you can deploy to the App Store, you need an Apple Developer account. There are two types:",[383,7152,7153,7159],{},[386,7154,7155,7158],{},[151,7156,7157],{},"Free Account"," (limited to testing on up to 100 devices)",[386,7160,7161,7164],{},[151,7162,7163],{},"Paid Account"," ($99\u002Fyear, full App Store access)",[21,7166,7167],{},"For production deployment, you'll need the paid account.",[2808,7169,7171],{"id":7170},"required-assets","Required Assets",[21,7173,7174],{},"When you purchase your Apple Developer account, you'll need to set up:",[816,7176,7177,7183,7189,7195,7201],{},[386,7178,7179,7182],{},[151,7180,7181],{},"Apple ID"," (your primary account)",[386,7184,7185,7188],{},[151,7186,7187],{},"Team ID"," (automatically generated)",[386,7190,7191,7194],{},[151,7192,7193],{},"App IDs"," (for your specific applications)",[386,7196,7197,7200],{},[151,7198,7199],{},"Certificates"," (for code signing)",[386,7202,7203,7206],{},[151,7204,7205],{},"Devices"," (for testing)",[2808,7208,7210],{"id":7209},"getting-started-with-the-developer-portal","Getting Started with the Developer Portal",[816,7212,7213,7221,7224,7231],{},[386,7214,7215,7216],{},"Visit ",[3861,7217,7220],{"href":7218,"rel":7219},"https:\u002F\u002Fdeveloper.apple.com",[3865],"developer.apple.com",[386,7222,7223],{},"Sign in with your Apple ID",[386,7225,7226,7227,7230],{},"Navigate to the ",[151,7228,7229],{},"Certificates, Identifiers & Profiles"," section",[386,7232,7233],{},"Create your team if you haven't already",[32,7235,7109],{"id":7236},"configuring-your-project-for-ios",[21,7238,7239],{},"Once you have your Apple Developer account set up, you need to configure your React Native or Expo project for iOS deployment.",[2808,7241,7243],{"id":7242},"project-structure","Project Structure",[21,7245,7246],{},"For React Native projects using the default configuration:",[48,7248,7250],{"className":839,"code":7249,"language":841,"meta":56,"style":56},"my-app\u002F\n├── android\u002F\n├── ios\u002F\n├── package.json\n└── App.js\n",[40,7251,7252,7257,7265,7272,7279],{"__ignoreMap":56},[449,7253,7254],{"class":451,"line":452},[449,7255,7256],{"class":721},"my-app\u002F\n",[449,7258,7259,7262],{"class":451,"line":114},[449,7260,7261],{"class":721},"├──",[449,7263,7264],{"class":691}," android\u002F\n",[449,7266,7267,7269],{"class":451,"line":111},[449,7268,7261],{"class":721},[449,7270,7271],{"class":691}," ios\u002F\n",[449,7273,7274,7276],{"class":451,"line":468},[449,7275,7261],{"class":721},[449,7277,7278],{"class":691}," package.json\n",[449,7280,7281,7284],{"class":451,"line":474},[449,7282,7283],{"class":721},"└──",[449,7285,7286],{"class":691}," App.js\n",[21,7288,7289],{},"For Expo projects using managed workflow:",[48,7291,7293],{"className":839,"code":7292,"language":841,"meta":56,"style":56},"my-expo-app\u002F\n├── app.json\n├── package.json\n└── .gitignore\n",[40,7294,7295,7300,7307,7313],{"__ignoreMap":56},[449,7296,7297],{"class":451,"line":452},[449,7298,7299],{"class":721},"my-expo-app\u002F\n",[449,7301,7302,7304],{"class":451,"line":114},[449,7303,7261],{"class":721},[449,7305,7306],{"class":691}," app.json\n",[449,7308,7309,7311],{"class":451,"line":111},[449,7310,7261],{"class":721},[449,7312,7278],{"class":691},[449,7314,7315,7317],{"class":451,"line":468},[449,7316,7283],{"class":721},[449,7318,7319],{"class":691}," .gitignore\n",[2808,7321,7323],{"id":7322},"ios-specific-configuration","iOS-Specific Configuration",[6633,7325,7327],{"id":7326},"react-native-bare-workflow","React Native (Bare Workflow)",[21,7329,7330],{},"If you're using React Native's bare workflow, you'll need to manually configure the iOS project:",[816,7332,7333,7338,7343],{},[386,7334,7335],{},[151,7336,7337],{},"Update Info.plist",[386,7339,7340],{},[151,7341,7342],{},"Configure entitlements",[386,7344,7345],{},[151,7346,7347],{},"Set up capabilities",[6633,7349,7351],{"id":7350},"expo-managed-workflow","Expo (Managed Workflow)",[21,7353,7354,7355,3070],{},"Expo makes iOS configuration much simpler. Most settings are handled through ",[40,7356,7357],{},"app.json",[48,7359,7361],{"className":4518,"code":7360,"language":4521,"meta":56,"style":56},"{\n  \"expo\": {\n    \"name\": \"My App\",\n    \"slug\": \"my-app\",\n    \"version\": \"1.0.0\",\n    \"orientation\": \"portrait\",\n    \"icon\": \".\u002Fassets\u002Ficon.png\",\n    \"userInterfaceStyle\": \"light\",\n    \"splash\": {\n      \"image\": \".\u002Fassets\u002Fsplash.png\",\n      \"resizeMode\": \"contain\",\n      \"backgroundColor\": \"#ffffff\"\n    },\n    \"ios\": {\n      \"bundleIdentifier\": \"com.yourcompany.yourapp\",\n      \"buildNumber\": \"1\"\n    },\n    \"android\": {\n      \"package\": \"com.yourcompany.yourapp\"\n    }\n  }\n}\n",[40,7362,7363,7367,7374,7386,7398,7409,7421,7433,7445,7452,7464,7476,7486,7490,7497,7509,7519,7523,7530,7540,7545,7549],{"__ignoreMap":56},[449,7364,7365],{"class":451,"line":452},[449,7366,4528],{"class":684},[449,7368,7369,7372],{"class":451,"line":114},[449,7370,7371],{"class":714},"  \"expo\"",[449,7373,4548],{"class":684},[449,7375,7376,7379,7381,7384],{"class":451,"line":111},[449,7377,7378],{"class":714},"    \"name\"",[449,7380,1482],{"class":684},[449,7382,7383],{"class":691},"\"My App\"",[449,7385,779],{"class":684},[449,7387,7388,7391,7393,7396],{"class":451,"line":468},[449,7389,7390],{"class":714},"    \"slug\"",[449,7392,1482],{"class":684},[449,7394,7395],{"class":691},"\"my-app\"",[449,7397,779],{"class":684},[449,7399,7400,7403,7405,7407],{"class":451,"line":474},[449,7401,7402],{"class":714},"    \"version\"",[449,7404,1482],{"class":684},[449,7406,3403],{"class":691},[449,7408,779],{"class":684},[449,7410,7411,7414,7416,7419],{"class":451,"line":480},[449,7412,7413],{"class":714},"    \"orientation\"",[449,7415,1482],{"class":684},[449,7417,7418],{"class":691},"\"portrait\"",[449,7420,779],{"class":684},[449,7422,7423,7426,7428,7431],{"class":451,"line":486},[449,7424,7425],{"class":714},"    \"icon\"",[449,7427,1482],{"class":684},[449,7429,7430],{"class":691},"\".\u002Fassets\u002Ficon.png\"",[449,7432,779],{"class":684},[449,7434,7435,7438,7440,7443],{"class":451,"line":492},[449,7436,7437],{"class":714},"    \"userInterfaceStyle\"",[449,7439,1482],{"class":684},[449,7441,7442],{"class":691},"\"light\"",[449,7444,779],{"class":684},[449,7446,7447,7450],{"class":451,"line":498},[449,7448,7449],{"class":714},"    \"splash\"",[449,7451,4548],{"class":684},[449,7453,7454,7457,7459,7462],{"class":451,"line":133},[449,7455,7456],{"class":714},"      \"image\"",[449,7458,1482],{"class":684},[449,7460,7461],{"class":691},"\".\u002Fassets\u002Fsplash.png\"",[449,7463,779],{"class":684},[449,7465,7466,7469,7471,7474],{"class":451,"line":509},[449,7467,7468],{"class":714},"      \"resizeMode\"",[449,7470,1482],{"class":684},[449,7472,7473],{"class":691},"\"contain\"",[449,7475,779],{"class":684},[449,7477,7478,7481,7483],{"class":451,"line":318},[449,7479,7480],{"class":714},"      \"backgroundColor\"",[449,7482,1482],{"class":684},[449,7484,7485],{"class":691},"\"#ffffff\"\n",[449,7487,7488],{"class":451,"line":520},[449,7489,1458],{"class":684},[449,7491,7492,7495],{"class":451,"line":526},[449,7493,7494],{"class":714},"    \"ios\"",[449,7496,4548],{"class":684},[449,7498,7499,7502,7504,7507],{"class":451,"line":532},[449,7500,7501],{"class":714},"      \"bundleIdentifier\"",[449,7503,1482],{"class":684},[449,7505,7506],{"class":691},"\"com.yourcompany.yourapp\"",[449,7508,779],{"class":684},[449,7510,7511,7514,7516],{"class":451,"line":2790},[449,7512,7513],{"class":714},"      \"buildNumber\"",[449,7515,1482],{"class":684},[449,7517,7518],{"class":691},"\"1\"\n",[449,7520,7521],{"class":451,"line":3511},[449,7522,1458],{"class":684},[449,7524,7525,7528],{"class":451,"line":3526},[449,7526,7527],{"class":714},"    \"android\"",[449,7529,4548],{"class":684},[449,7531,7532,7535,7537],{"class":451,"line":3531},[449,7533,7534],{"class":714},"      \"package\"",[449,7536,1482],{"class":684},[449,7538,7539],{"class":691},"\"com.yourcompany.yourapp\"\n",[449,7541,7542],{"class":451,"line":3536},[449,7543,7544],{"class":684},"    }\n",[449,7546,7547],{"class":451,"line":4009},[449,7548,4599],{"class":684},[449,7550,7551],{"class":451,"line":4015},[449,7552,4604],{"class":684},[32,7554,7115],{"id":7555},"setting-up-code-signing",[21,7557,7558],{},"Code signing is Apple's way of ensuring your app hasn't been tampered with. This is a critical step in the App Store submission process.",[2808,7560,7562],{"id":7561},"generating-certificates","Generating Certificates",[816,7564,7565,7578],{},[386,7566,7567,7570],{},[151,7568,7569],{},"App Signing Certificate",[383,7571,7572,7575],{},[386,7573,7574],{},"Generate a certificate in the Developer Portal",[386,7576,7577],{},"Download and install it in your Keychain",[386,7579,7580,7583],{},[151,7581,7582],{},"Provisioning Profiles",[383,7584,7585,7588],{},[386,7586,7587],{},"Create app-specific provisioning profiles for development and distribution",[386,7589,7590],{},"These profiles associate your certificates with your app and devices",[2808,7592,7594],{"id":7593},"code-signing-in-react-native","Code Signing in React Native",[21,7596,7597,7598,7601],{},"For React Native projects, you'll need to configure code signing in the ",[40,7599,7600],{},"ios\u002F"," directory:",[816,7603,7604,7609,7614],{},[386,7605,7606],{},[151,7607,7608],{},"Locate your project.pbxproj file",[386,7610,7611],{},[151,7612,7613],{},"Update the development team",[386,7615,7616],{},[151,7617,7618],{},"Configure code signing identity",[2808,7620,7622],{"id":7621},"code-signing-in-expo","Code Signing in Expo",[21,7624,7625,7626,3070],{},"Expo handles code signing automatically for you. The main configuration is in ",[40,7627,7357],{},[48,7629,7631],{"className":4518,"code":7630,"language":4521,"meta":56,"style":56},"\"ios\": {\n  \"codeSigningCertificate\": \"YourCertificate.pem\",\n  \"codeSigningMetadata\": {\n    \"publicKeyHash\": \"your-public-key-hash\"\n  }\n}\n",[40,7632,7633,7640,7652,7659,7669,7673],{"__ignoreMap":56},[449,7634,7635,7638],{"class":451,"line":452},[449,7636,7637],{"class":691},"\"ios\"",[449,7639,4548],{"class":684},[449,7641,7642,7645,7647,7650],{"class":451,"line":114},[449,7643,7644],{"class":714},"  \"codeSigningCertificate\"",[449,7646,1482],{"class":684},[449,7648,7649],{"class":691},"\"YourCertificate.pem\"",[449,7651,779],{"class":684},[449,7653,7654,7657],{"class":451,"line":111},[449,7655,7656],{"class":714},"  \"codeSigningMetadata\"",[449,7658,4548],{"class":684},[449,7660,7661,7664,7666],{"class":451,"line":468},[449,7662,7663],{"class":714},"    \"publicKeyHash\"",[449,7665,1482],{"class":684},[449,7667,7668],{"class":691},"\"your-public-key-hash\"\n",[449,7670,7671],{"class":451,"line":474},[449,7672,4599],{"class":684},[449,7674,7675],{"class":451,"line":480},[449,7676,4604],{"class":684},[32,7678,7121],{"id":7679},"preparing-for-app-store-submission",[21,7681,7682],{},"Before you can submit your app to the App Store, you need to ensure it's ready for review.",[2808,7684,7686],{"id":7685},"app-store-connect-requirements","App Store Connect Requirements",[21,7688,7689],{},"Your app must meet several requirements:",[816,7691,7692,7708,7721,7733],{},[386,7693,7694,7697],{},[151,7695,7696],{},"Bundle Identifier",[383,7698,7699,7702],{},[386,7700,7701],{},"Must match the one registered in the Developer Portal",[386,7703,7704,7705],{},"Format: ",[40,7706,7707],{},"com.companyname.appname",[386,7709,7710,7713],{},[151,7711,7712],{},"Version Number",[383,7714,7715,7718],{},[386,7716,7717],{},"Must be a positive integer",[386,7719,7720],{},"Increment with each update",[386,7722,7723,7726],{},[151,7724,7725],{},"Build Number",[383,7727,7728,7730],{},[386,7729,7717],{},[386,7731,7732],{},"Should increment with each build",[386,7734,7735,7738],{},[151,7736,7737],{},"App Name",[383,7739,7740,7743],{},[386,7741,7742],{},"Must be between 1 and 50 characters",[386,7744,7745],{},"Cannot contain prohibited words",[2808,7747,7749],{"id":7748},"app-metadata","App Metadata",[21,7751,7752],{},"Prepare the following metadata for your app:",[816,7754,7755,7771,7787,7803],{},[386,7756,7757,7760],{},[151,7758,7759],{},"App Icon",[383,7761,7762,7765,7768],{},[386,7763,7764],{},"1024×1024 pixels (PNG)",[386,7766,7767],{},"Must be square",[386,7769,7770],{},"Should be clear and readable",[386,7772,7773,7776],{},[151,7774,7775],{},"App Screenshots",[383,7777,7778,7781,7784],{},[386,7779,7780],{},"iPhone: 2732×2048 pixels (5.5-inch display)",[386,7782,7783],{},"iPad: 2732×2048 pixels (12.9-inch display)",[386,7785,7786],{},"Include at least 2 screenshots",[386,7788,7789,7792],{},[151,7790,7791],{},"App Description",[383,7793,7794,7797,7800],{},[386,7795,7796],{},"Must be between 30 and 255 characters",[386,7798,7799],{},"Include relevant keywords",[386,7801,7802],{},"Highlight key features",[386,7804,7805,7808],{},[151,7806,7807],{},"Privacy Policy",[383,7809,7810,7813],{},[386,7811,7812],{},"Required for all apps",[386,7814,7815],{},"Must be accessible from the App Store listing",[2808,7817,7819],{"id":7818},"testing-your-app","Testing Your App",[21,7821,7822],{},"Before submitting, thoroughly test your app:",[816,7824,7825,7838,7851],{},[386,7826,7827,7830],{},[151,7828,7829],{},"Unit Tests",[383,7831,7832,7835],{},[386,7833,7834],{},"Ensure core functionality works",[386,7836,7837],{},"Test edge cases",[386,7839,7840,7843],{},[151,7841,7842],{},"Integration Tests",[383,7844,7845,7848],{},[386,7846,7847],{},"Test with real devices",[386,7849,7850],{},"Test with different iOS versions",[386,7852,7853,7856],{},[151,7854,7855],{},"App Store Connect TestFlight",[383,7857,7858,7861],{},[386,7859,7860],{},"Use TestFlight for beta testing",[386,7862,7863],{},"Collect feedback from testers",[32,7865,7127],{"id":7866},"submitting-to-the-app-store",[21,7868,7869],{},"Once your app is ready, you can submit it to the App Store.",[2808,7871,7873],{"id":7872},"step-by-step-submission-process","Step-by-Step Submission Process",[816,7875,7876,7897,7910,7926,7939,7952],{},[386,7877,7878,7881],{},[151,7879,7880],{},"Create App in App Store Connect",[383,7882,7883,7891,7894],{},[386,7884,7885,7886],{},"Log in to ",[3861,7887,7890],{"href":7888,"rel":7889},"https:\u002F\u002Fappstoreconnect.apple.com",[3865],"App Store Connect",[386,7892,7893],{},"Click \"Add New App\"",[386,7895,7896],{},"Enter your app's bundle identifier",[386,7898,7899,7902],{},[151,7900,7901],{},"Upload App Binary",[383,7903,7904,7907],{},[386,7905,7906],{},"Build your app for distribution",[386,7908,7909],{},"Upload the .ipa file to App Store Connect",[386,7911,7912,7915],{},[151,7913,7914],{},"Fill Out App Metadata",[383,7916,7917,7920,7923],{},[386,7918,7919],{},"App name, description, keywords",[386,7921,7922],{},"Category and sub-category",[386,7924,7925],{},"Privacy policy URL",[386,7927,7928,7931],{},[151,7929,7930],{},"Set Pricing and Availability",[383,7932,7933,7936],{},[386,7934,7935],{},"Choose your pricing model",[386,7937,7938],{},"Select countries where you want to distribute",[386,7940,7941,7944],{},[151,7942,7943],{},"Submit for Review",[383,7945,7946,7949],{},[386,7947,7948],{},"Review all requirements",[386,7950,7951],{},"Submit for App Store Review",[386,7953,7954,7957],{},[151,7955,7956],{},"Wait for Review",[383,7958,7959,7962],{},[386,7960,7961],{},"Apple typically reviews apps within 24-72 hours",[386,7963,7964],{},"You can track the review status in App Store Connect",[2808,7966,7968],{"id":7967},"common-submission-issues","Common Submission Issues",[383,7970,7971,7987],{},[386,7972,7973,7976],{},[151,7974,7975],{},"App Store Rejection Reasons",[383,7977,7978,7981,7984],{},[386,7979,7980],{},"Read the rejection email carefully",[386,7982,7983],{},"Address all issues before resubmitting",[386,7985,7986],{},"Common reasons include crashes, privacy policy issues, and missing metadata",[386,7988,7989,7992],{},[151,7990,7991],{},"Review Delays",[383,7993,7994,7997],{},[386,7995,7996],{},"Be patient during the review process",[386,7998,7999],{},"Contact Apple Support if there are delays",[32,8001,7133],{"id":8002},"post-submission-and-maintenance",[21,8004,8005],{},"After your app is approved, you need to manage its presence on the App Store.",[2808,8007,8009],{"id":8008},"publishing-your-app","Publishing Your App",[816,8011,8012,8025,8038],{},[386,8013,8014,8017],{},[151,8015,8016],{},"Release to Production",[383,8018,8019,8022],{},[386,8020,8021],{},"Set your app to \"Ready for Sale\"",[386,8023,8024],{},"Choose your release date",[386,8026,8027,8030],{},[151,8028,8029],{},"Monitor Performance",[383,8031,8032,8035],{},[386,8033,8034],{},"Track downloads and ratings",[386,8036,8037],{},"Monitor user feedback",[386,8039,8040,8043],{},[151,8041,8042],{},"Update Regularly",[383,8044,8045,8048,8051],{},[386,8046,8047],{},"Fix bugs promptly",[386,8049,8050],{},"Add requested features",[386,8052,8053],{},"Update app metadata",[2808,8055,8057],{"id":8056},"app-store-optimization-aso","App Store Optimization (ASO)",[21,8059,8060],{},"Optimize your app listing for better visibility:",[816,8062,8063,8076,8089],{},[386,8064,8065,8068],{},[151,8066,8067],{},"Keywords",[383,8069,8070,8073],{},[386,8071,8072],{},"Research relevant keywords",[386,8074,8075],{},"Include them in your app description",[386,8077,8078,8081],{},[151,8079,8080],{},"Metadata",[383,8082,8083,8086],{},[386,8084,8085],{},"Use compelling app name",[386,8087,8088],{},"Write engaging description",[386,8090,8091,8094],{},[151,8092,8093],{},"Screenshots",[383,8095,8096,8099],{},[386,8097,8098],{},"Update screenshots regularly",[386,8100,8101],{},"Show new features",[32,8103,7139],{"id":8104},"troubleshooting-common-issues",[2808,8106,8108],{"id":8107},"common-problems-and-solutions","Common Problems and Solutions",[816,8110,8111,8124,8137,8149],{},[386,8112,8113,8116],{},[151,8114,8115],{},"Code Signing Errors",[383,8117,8118,8121],{},[386,8119,8120],{},"Regenerate certificates if needed",[386,8122,8123],{},"Update provisioning profiles",[386,8125,8126,8129],{},[151,8127,8128],{},"Build Failures",[383,8130,8131,8134],{},[386,8132,8133],{},"Check for missing dependencies",[386,8135,8136],{},"Update to the latest React Native\u002FExpo version",[386,8138,8139,8142],{},[151,8140,8141],{},"App Store Rejection",[383,8143,8144,8146],{},[386,8145,7980],{},[386,8147,8148],{},"Fix all issues before resubmitting",[386,8150,8151,8154],{},[151,8152,8153],{},"Performance Issues",[383,8155,8156,8159],{},[386,8157,8158],{},"Optimize app startup time",[386,8160,8161],{},"Reduce memory usage",[2808,8163,8165],{"id":8164},"getting-help","Getting Help",[21,8167,8168],{},"If you encounter issues:",[816,8170,8171,8181,8191],{},[386,8172,8173,8176],{},[151,8174,8175],{},"Apple Developer Forums",[383,8177,8178],{},[386,8179,8180],{},"Ask questions and get help from other developers",[386,8182,8183,8186],{},[151,8184,8185],{},"Stack Overflow",[383,8187,8188],{},[386,8189,8190],{},"Search for existing solutions",[386,8192,8193,8196],{},[151,8194,8195],{},"React Native\u002FExpo Community",[383,8197,8198],{},[386,8199,8200],{},"Join Discord or other communities",[32,8202,3681],{"id":3680},[21,8204,8205],{},"Deploying a React Native or Expo app to the Apple App Store is a multi-step process that requires careful planning and execution. By following the steps outlined in this guide, you can successfully navigate the entire deployment journey.",[21,8207,8208],{},"Remember that the App Store submission process is rigorous, but with proper preparation and attention to detail, you can get your app approved and available to users worldwide.",[21,8210,8211],{},"The key to success is:",[816,8213,8214,8220,8226,8232],{},[386,8215,8216,8219],{},[151,8217,8218],{},"Proper Planning"," - Understand all requirements before starting",[386,8221,8222,8225],{},[151,8223,8224],{},"Thorough Testing"," - Test your app thoroughly before submission",[386,8227,8228,8231],{},[151,8229,8230],{},"Attention to Detail"," - Pay attention to metadata and requirements",[386,8233,8234,8237],{},[151,8235,8236],{},"Patience"," - The review process takes time",[21,8239,8240],{},"Good luck with your App Store deployment!",[73,8242],{},[21,8244,8245],{},[156,8246,8247],{},"This guide covers the deployment process for both React Native (bare workflow) and Expo (managed workflow). For specific issues with your particular setup, consult the official documentation for your framework.",[3728,8249,8250],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":56,"searchDepth":111,"depth":111,"links":8252},[8253,8254,8255,8259,8266,8271,8276,8280,8284,8288],{"id":332,"depth":114,"text":333},{"id":7094,"depth":114,"text":7095},{"id":7147,"depth":114,"text":7103,"children":8256},[8257,8258],{"id":7170,"depth":111,"text":7171},{"id":7209,"depth":111,"text":7210},{"id":7236,"depth":114,"text":7109,"children":8260},[8261,8262],{"id":7242,"depth":111,"text":7243},{"id":7322,"depth":111,"text":7323,"children":8263},[8264,8265],{"id":7326,"depth":468,"text":7327},{"id":7350,"depth":468,"text":7351},{"id":7555,"depth":114,"text":7115,"children":8267},[8268,8269,8270],{"id":7561,"depth":111,"text":7562},{"id":7593,"depth":111,"text":7594},{"id":7621,"depth":111,"text":7622},{"id":7679,"depth":114,"text":7121,"children":8272},[8273,8274,8275],{"id":7685,"depth":111,"text":7686},{"id":7748,"depth":111,"text":7749},{"id":7818,"depth":111,"text":7819},{"id":7866,"depth":114,"text":7127,"children":8277},[8278,8279],{"id":7872,"depth":111,"text":7873},{"id":7967,"depth":111,"text":7968},{"id":8002,"depth":114,"text":7133,"children":8281},[8282,8283],{"id":8008,"depth":111,"text":8009},{"id":8056,"depth":111,"text":8057},{"id":8104,"depth":114,"text":7139,"children":8285},[8286,8287],{"id":8107,"depth":111,"text":8108},{"id":8164,"depth":111,"text":8165},{"id":3680,"depth":114,"text":3681},"2026-06-17","A comprehensive walkthrough of shipping a React Native or Expo app to Apple's App Store — from developer account setup and code signing, through App Store Connect metadata, submission, and post-launch maintenance.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1512941937669-90a1b58e7e9c",[8293,8294,8295,8296,8297,8298,8299,8300],"react-native","expo","ios","app-store","deployment","mobile","code-signing","testflight",{},"\u002Fblog\u002Fdeploying-react-native-expo-to-app-store",{"title":7077,"description":8290},"blog\u002Fdeploying-react-native-expo-to-app-store","Application Development","b2YWBuQmPOkvQVbplcgWDTQrANhrUNRHhsKbABq80BQ",{"id":8308,"title":8309,"author":8310,"body":8311,"canonical":116,"categories":116,"date":8289,"description":9863,"excerpt":116,"extension":119,"featuredImg":116,"img":9864,"keywords":9865,"language":3788,"meta":9869,"navigation":130,"ogImage":116,"path":9870,"rating":116,"readTime":498,"seo":9871,"stem":9872,"tag":8305,"__hash__":9873},"blog\u002Fblog\u002Fdeploying-react-native-expo-to-play-store.md","Deploying React Native\u002FExpo Apps to the Google Play Store",{"name":9,"img":11,"website":327},{"type":13,"value":8312,"toc":9816},[8313,8316,8318,8321,8324,8326,8376,8379,8382,8396,8399,8401,8404,8428,8432,8452,8455,8458,8460,8463,8495,8498,8532,8536,8538,8544,8567,8569,8574,8799,8802,8813,8817,8820,8840,8844,8847,8866,8870,8873,8970,8973,9044,9047,9050,9054,9073,9077,9096,9098,9104,9242,9244,9250,9330,9333,9336,9340,9342,9389,9391,9393,9450,9452,9454,9489,9492,9495,9497,9585,9587,9613,9615,9618,9620,9655,9659,9661,9694,9696,9698,9744,9746,9748,9776,9778,9781,9784,9786,9804,9807,9809,9813],[16,8314,8309],{"id":8315},"deploying-react-nativeexpo-apps-to-the-google-play-store",[32,8317,333],{"id":332},[21,8319,8320],{},"Deploying a React Native or Expo app to the Google Play Store opens up your application to billions of Android users worldwide. While the Android ecosystem is generally more permissive than Apple's, the Play Store submission process still requires careful preparation and adherence to Google's policies.",[21,8322,8323],{},"In this comprehensive guide, I'll walk you through the entire Android deployment journey, from setting up your Google account to publishing your app on the Play Store. Whether you're a seasoned developer or just starting with React Native\u002FExpo, you'll learn everything you need to know to get your app on the Play Store.",[32,8325,7095],{"id":7094},[816,8327,8328,8334,8340,8346,8352,8358,8364,8368,8372],{},[386,8329,8330],{},[3861,8331,8333],{"href":8332},"#setting-up-your-google-play-console-account","Setting Up Your Google Play Console Account",[386,8335,8336],{},[3861,8337,8339],{"href":8338},"#configuring-your-project-for-android","Configuring Your Project for Android",[386,8341,8342],{},[3861,8343,8345],{"href":8344},"#preparing-app-bundles-and-apks","Preparing App Bundles and APKs",[386,8347,8348],{},[3861,8349,8351],{"href":8350},"#setting-up-google-play-app-signing","Setting Up Google Play App Signing",[386,8353,8354],{},[3861,8355,8357],{"href":8356},"#preparing-for-play-store-submission","Preparing for Play Store Submission",[386,8359,8360],{},[3861,8361,8363],{"href":8362},"#submitting-to-the-play-store","Submitting to the Play Store",[386,8365,8366],{},[3861,8367,7133],{"href":7132},[386,8369,8370],{},[3861,8371,7139],{"href":7138},[386,8373,8374],{},[3861,8375,3681],{"href":7144},[32,8377,8333],{"id":8378},"setting-up-your-google-play-console-account",[21,8380,8381],{},"Before you can deploy to the Play Store, you need a Google Play Console account. There are two types:",[383,8383,8384,8390],{},[386,8385,8386,8389],{},[151,8387,8388],{},"Free Developer Console"," ($25 one-time registration fee)",[386,8391,8392,8395],{},[151,8393,8394],{},"Google Play for Teams"," (additional features for organizations)",[21,8397,8398],{},"For most individual developers, the free developer console is sufficient.",[2808,8400,7171],{"id":7170},[21,8402,8403],{},"When you register, you'll need to set up:",[816,8405,8406,8411,8417,8423],{},[386,8407,8408,7182],{},[151,8409,8410],{},"Google Account",[386,8412,8413,8416],{},[151,8414,8415],{},"Developer Account"," (with payment information)",[386,8418,8419,8422],{},[151,8420,8421],{},"Project Name"," (your company's\u002Fproject name)",[386,8424,8425,8427],{},[151,8426,7807],{}," (required for all apps)",[2808,8429,8431],{"id":8430},"getting-started-with-the-play-console","Getting Started with the Play Console",[816,8433,8434,8441,8444,8447],{},[386,8435,7215,8436],{},[3861,8437,8440],{"href":8438,"rel":8439},"https:\u002F\u002Fplay.google.com\u002Fconsole",[3865],"play.google.com\u002Fconsole",[386,8442,8443],{},"Sign in with your Google Account",[386,8445,8446],{},"Complete the developer registration process",[386,8448,7226,8449,7230],{},[151,8450,8451],{},"My apps",[32,8453,8339],{"id":8454},"configuring-your-project-for-android",[21,8456,8457],{},"Once you have your Google Play Console account set up, you need to configure your React Native or Expo project for Android deployment.",[2808,8459,7243],{"id":7242},[21,8461,8462],{},"For React Native projects:",[48,8464,8465],{"className":839,"code":7249,"language":841,"meta":56,"style":56},[40,8466,8467,8471,8477,8483,8489],{"__ignoreMap":56},[449,8468,8469],{"class":451,"line":452},[449,8470,7256],{"class":721},[449,8472,8473,8475],{"class":451,"line":114},[449,8474,7261],{"class":721},[449,8476,7264],{"class":691},[449,8478,8479,8481],{"class":451,"line":111},[449,8480,7261],{"class":721},[449,8482,7271],{"class":691},[449,8484,8485,8487],{"class":451,"line":468},[449,8486,7261],{"class":721},[449,8488,7278],{"class":691},[449,8490,8491,8493],{"class":451,"line":474},[449,8492,7283],{"class":721},[449,8494,7286],{"class":691},[21,8496,8497],{},"For Expo projects:",[48,8499,8501],{"className":839,"code":8500,"language":841,"meta":56,"style":56},"my-expo-app\u002F\n├── app.json\n├── package.json\n├── .gitignore\n└── expo-modules.config.json\n",[40,8502,8503,8507,8513,8519,8525],{"__ignoreMap":56},[449,8504,8505],{"class":451,"line":452},[449,8506,7299],{"class":721},[449,8508,8509,8511],{"class":451,"line":114},[449,8510,7261],{"class":721},[449,8512,7306],{"class":691},[449,8514,8515,8517],{"class":451,"line":111},[449,8516,7261],{"class":721},[449,8518,7278],{"class":691},[449,8520,8521,8523],{"class":451,"line":468},[449,8522,7261],{"class":721},[449,8524,7319],{"class":691},[449,8526,8527,8529],{"class":451,"line":474},[449,8528,7283],{"class":721},[449,8530,8531],{"class":691}," expo-modules.config.json\n",[2808,8533,8535],{"id":8534},"android-specific-configuration","Android-Specific Configuration",[6633,8537,7327],{"id":7326},[21,8539,8540,8541,7601],{},"For React Native projects, you'll need to configure the Android project in the ",[40,8542,8543],{},"android\u002F",[816,8545,8546,8553,8562],{},[386,8547,8548],{},[151,8549,4616,8550],{},[40,8551,8552],{},"AndroidManifest.xml",[386,8554,8555],{},[151,8556,8557,8558,8561],{},"Configure ",[40,8559,8560],{},"build.gradle"," files",[386,8563,8564],{},[151,8565,8566],{},"Set up app signing",[6633,8568,7351],{"id":7350},[21,8570,8571,8572,3070],{},"Expo makes Android configuration much simpler. Most settings are handled through ",[40,8573,7357],{},[48,8575,8577],{"className":4518,"code":8576,"language":4521,"meta":56,"style":56},"{\n  \"expo\": {\n    \"name\": \"My App\",\n    \"slug\": \"my-app\",\n    \"version\": \"1.0.0\",\n    \"orientation\": \"portrait\",\n    \"icon\": \".\u002Fassets\u002Ficon.png\",\n    \"userInterfaceStyle\": \"light\",\n    \"splash\": {\n      \"image\": \".\u002Fassets\u002Fsplash.png\",\n      \"resizeMode\": \"contain\",\n      \"backgroundColor\": \"#ffffff\"\n    },\n    \"ios\": {\n      \"bundleIdentifier\": \"com.yourcompany.yourapp\",\n      \"buildNumber\": \"1\"\n    },\n    \"android\": {\n      \"package\": \"com.yourcompany.yourapp\",\n      \"versionCode\": 1,\n      \"googleServicesFile\": \".\u002Fgoogle-services.json\",\n      \"adaptiveIcon\": {\n        \"foregroundImage\": \".\u002Fassets\u002Fadaptive-icon.png\",\n        \"backgroundColor\": \"#ffffff\"\n      }\n    }\n  }\n}\n",[40,8578,8579,8583,8589,8599,8609,8619,8629,8639,8649,8655,8665,8675,8683,8687,8693,8703,8711,8715,8721,8731,8742,8754,8761,8773,8782,8787,8791,8795],{"__ignoreMap":56},[449,8580,8581],{"class":451,"line":452},[449,8582,4528],{"class":684},[449,8584,8585,8587],{"class":451,"line":114},[449,8586,7371],{"class":714},[449,8588,4548],{"class":684},[449,8590,8591,8593,8595,8597],{"class":451,"line":111},[449,8592,7378],{"class":714},[449,8594,1482],{"class":684},[449,8596,7383],{"class":691},[449,8598,779],{"class":684},[449,8600,8601,8603,8605,8607],{"class":451,"line":468},[449,8602,7390],{"class":714},[449,8604,1482],{"class":684},[449,8606,7395],{"class":691},[449,8608,779],{"class":684},[449,8610,8611,8613,8615,8617],{"class":451,"line":474},[449,8612,7402],{"class":714},[449,8614,1482],{"class":684},[449,8616,3403],{"class":691},[449,8618,779],{"class":684},[449,8620,8621,8623,8625,8627],{"class":451,"line":480},[449,8622,7413],{"class":714},[449,8624,1482],{"class":684},[449,8626,7418],{"class":691},[449,8628,779],{"class":684},[449,8630,8631,8633,8635,8637],{"class":451,"line":486},[449,8632,7425],{"class":714},[449,8634,1482],{"class":684},[449,8636,7430],{"class":691},[449,8638,779],{"class":684},[449,8640,8641,8643,8645,8647],{"class":451,"line":492},[449,8642,7437],{"class":714},[449,8644,1482],{"class":684},[449,8646,7442],{"class":691},[449,8648,779],{"class":684},[449,8650,8651,8653],{"class":451,"line":498},[449,8652,7449],{"class":714},[449,8654,4548],{"class":684},[449,8656,8657,8659,8661,8663],{"class":451,"line":133},[449,8658,7456],{"class":714},[449,8660,1482],{"class":684},[449,8662,7461],{"class":691},[449,8664,779],{"class":684},[449,8666,8667,8669,8671,8673],{"class":451,"line":509},[449,8668,7468],{"class":714},[449,8670,1482],{"class":684},[449,8672,7473],{"class":691},[449,8674,779],{"class":684},[449,8676,8677,8679,8681],{"class":451,"line":318},[449,8678,7480],{"class":714},[449,8680,1482],{"class":684},[449,8682,7485],{"class":691},[449,8684,8685],{"class":451,"line":520},[449,8686,1458],{"class":684},[449,8688,8689,8691],{"class":451,"line":526},[449,8690,7494],{"class":714},[449,8692,4548],{"class":684},[449,8694,8695,8697,8699,8701],{"class":451,"line":532},[449,8696,7501],{"class":714},[449,8698,1482],{"class":684},[449,8700,7506],{"class":691},[449,8702,779],{"class":684},[449,8704,8705,8707,8709],{"class":451,"line":2790},[449,8706,7513],{"class":714},[449,8708,1482],{"class":684},[449,8710,7518],{"class":691},[449,8712,8713],{"class":451,"line":3511},[449,8714,1458],{"class":684},[449,8716,8717,8719],{"class":451,"line":3526},[449,8718,7527],{"class":714},[449,8720,4548],{"class":684},[449,8722,8723,8725,8727,8729],{"class":451,"line":3531},[449,8724,7534],{"class":714},[449,8726,1482],{"class":684},[449,8728,7506],{"class":691},[449,8730,779],{"class":684},[449,8732,8733,8736,8738,8740],{"class":451,"line":3536},[449,8734,8735],{"class":714},"      \"versionCode\"",[449,8737,1482],{"class":684},[449,8739,4798],{"class":714},[449,8741,779],{"class":684},[449,8743,8744,8747,8749,8752],{"class":451,"line":4009},[449,8745,8746],{"class":714},"      \"googleServicesFile\"",[449,8748,1482],{"class":684},[449,8750,8751],{"class":691},"\".\u002Fgoogle-services.json\"",[449,8753,779],{"class":684},[449,8755,8756,8759],{"class":451,"line":4015},[449,8757,8758],{"class":714},"      \"adaptiveIcon\"",[449,8760,4548],{"class":684},[449,8762,8763,8766,8768,8771],{"class":451,"line":4021},[449,8764,8765],{"class":714},"        \"foregroundImage\"",[449,8767,1482],{"class":684},[449,8769,8770],{"class":691},"\".\u002Fassets\u002Fadaptive-icon.png\"",[449,8772,779],{"class":684},[449,8774,8775,8778,8780],{"class":451,"line":4027},[449,8776,8777],{"class":714},"        \"backgroundColor\"",[449,8779,1482],{"class":684},[449,8781,7485],{"class":691},[449,8783,8784],{"class":451,"line":4032},[449,8785,8786],{"class":684},"      }\n",[449,8788,8789],{"class":451,"line":4038},[449,8790,7544],{"class":684},[449,8792,8793],{"class":451,"line":4044},[449,8794,4599],{"class":684},[449,8796,8797],{"class":451,"line":4049},[449,8798,4604],{"class":684},[32,8800,8345],{"id":8801},"preparing-app-bundles-and-apks",[21,8803,8804,8805,8808,8809,8812],{},"Google Play requires you to upload app bundles (",[40,8806,8807],{},".aab",") for internal testing and production, while APKs (",[40,8810,8811],{},".apk",") are still needed for some older devices and testing.",[2808,8814,8816],{"id":8815},"app-bundles-aab","App Bundles (.aab)",[21,8818,8819],{},"App bundles are the preferred format for Play Store distribution because:",[816,8821,8822,8828,8834],{},[386,8823,8824,8827],{},[151,8825,8826],{},"Smaller download sizes"," - Google strips out only the resources your device needs",[386,8829,8830,8833],{},[151,8831,8832],{},"Faster installs"," - Optimized for different device configurations",[386,8835,8836,8839],{},[151,8837,8838],{},"Better user experience"," - Reduced app size and faster updates",[2808,8841,8843],{"id":8842},"apks-apk","APKs (.apk)",[21,8845,8846],{},"APKs are still needed for:",[816,8848,8849,8855,8861],{},[386,8850,8851,8854],{},[151,8852,8853],{},"Older devices"," that don't support app bundles",[386,8856,8857,8860],{},[151,8858,8859],{},"Enterprise distribution"," in some cases",[386,8862,8863],{},[151,8864,8865],{},"Sideload testing",[2808,8867,8869],{"id":8868},"building-your-app","Building Your App",[6633,8871,8872],{"id":8293},"React Native",[48,8874,8876],{"className":839,"code":8875,"language":841,"meta":56,"style":56},"# Build app bundle for production\nnpx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android\u002Fapp\u002Fsrc\u002Fmain\u002Fassets\u002Findex.android.bundle --sourcemap-output android\u002Fapp\u002Fsrc\u002Fmain\u002Fassets\u002Findex.android.bundle.map\n\n# Build APK\ncd android && .\u002Fgradlew assembleRelease\n\n# Build App Bundle\ncd android && .\u002Fgradlew bundleRelease\n",[40,8877,8878,8883,8924,8928,8933,8948,8952,8957],{"__ignoreMap":56},[449,8879,8880],{"class":451,"line":452},[449,8881,8882],{"class":705},"# Build app bundle for production\n",[449,8884,8885,8888,8891,8894,8897,8900,8903,8906,8909,8912,8915,8918,8921],{"class":451,"line":114},[449,8886,8887],{"class":721},"npx",[449,8889,8890],{"class":691}," react-native",[449,8892,8893],{"class":691}," bundle",[449,8895,8896],{"class":714}," --platform",[449,8898,8899],{"class":691}," android",[449,8901,8902],{"class":714}," --dev",[449,8904,8905],{"class":714}," false",[449,8907,8908],{"class":714}," --entry-file",[449,8910,8911],{"class":691}," index.js",[449,8913,8914],{"class":714}," --bundle-output",[449,8916,8917],{"class":691}," android\u002Fapp\u002Fsrc\u002Fmain\u002Fassets\u002Findex.android.bundle",[449,8919,8920],{"class":714}," --sourcemap-output",[449,8922,8923],{"class":691}," android\u002Fapp\u002Fsrc\u002Fmain\u002Fassets\u002Findex.android.bundle.map\n",[449,8925,8926],{"class":451,"line":111},[449,8927,700],{"emptyLinePlaceholder":130},[449,8929,8930],{"class":451,"line":468},[449,8931,8932],{"class":705},"# Build APK\n",[449,8934,8935,8937,8939,8942,8945],{"class":451,"line":474},[449,8936,4490],{"class":714},[449,8938,8899],{"class":691},[449,8940,8941],{"class":684}," && ",[449,8943,8944],{"class":721},".\u002Fgradlew",[449,8946,8947],{"class":691}," assembleRelease\n",[449,8949,8950],{"class":451,"line":480},[449,8951,700],{"emptyLinePlaceholder":130},[449,8953,8954],{"class":451,"line":486},[449,8955,8956],{"class":705},"# Build App Bundle\n",[449,8958,8959,8961,8963,8965,8967],{"class":451,"line":492},[449,8960,4490],{"class":714},[449,8962,8899],{"class":691},[449,8964,8941],{"class":684},[449,8966,8944],{"class":721},[449,8968,8969],{"class":691}," bundleRelease\n",[6633,8971,8972],{"id":8294},"Expo",[48,8974,8976],{"className":839,"code":8975,"language":841,"meta":56,"style":56},"# Build for production\nnpx expo export --platform android --dev false\n\n# Build APK\nnpx expo build:android --release\n\n# Build App Bundle\nnpx expo build:android --type app-bundle\n",[40,8977,8978,8983,9002,9006,9010,9022,9026,9030],{"__ignoreMap":56},[449,8979,8980],{"class":451,"line":452},[449,8981,8982],{"class":705},"# Build for production\n",[449,8984,8985,8987,8990,8993,8995,8997,8999],{"class":451,"line":114},[449,8986,8887],{"class":721},[449,8988,8989],{"class":691}," expo",[449,8991,8992],{"class":691}," export",[449,8994,8896],{"class":714},[449,8996,8899],{"class":691},[449,8998,8902],{"class":714},[449,9000,9001],{"class":714}," false\n",[449,9003,9004],{"class":451,"line":111},[449,9005,700],{"emptyLinePlaceholder":130},[449,9007,9008],{"class":451,"line":468},[449,9009,8932],{"class":705},[449,9011,9012,9014,9016,9019],{"class":451,"line":474},[449,9013,8887],{"class":721},[449,9015,8989],{"class":691},[449,9017,9018],{"class":691}," build:android",[449,9020,9021],{"class":714}," --release\n",[449,9023,9024],{"class":451,"line":480},[449,9025,700],{"emptyLinePlaceholder":130},[449,9027,9028],{"class":451,"line":486},[449,9029,8956],{"class":705},[449,9031,9032,9034,9036,9038,9041],{"class":451,"line":492},[449,9033,8887],{"class":721},[449,9035,8989],{"class":691},[449,9037,9018],{"class":691},[449,9039,9040],{"class":714}," --type",[449,9042,9043],{"class":691}," app-bundle\n",[32,9045,8351],{"id":9046},"setting-up-google-play-app-signing",[21,9048,9049],{},"Google Play App Signing automatically re-signs your app with Google's certificate when you upload to the Play Store, ensuring your app remains secure and up-to-date.",[2808,9051,9053],{"id":9052},"benefits","Benefits",[816,9055,9056,9062,9068],{},[386,9057,9058,9061],{},[151,9059,9060],{},"Automatic security updates"," - Google handles certificate rotation",[386,9063,9064,9067],{},[151,9065,9066],{},"Reduced maintenance"," - No need to manage your own signing keys",[386,9069,9070,9072],{},[151,9071,8838],{}," - Seamless updates without reinstallation",[2808,9074,9076],{"id":9075},"setup-process","Setup Process",[816,9078,9079,9085,9091],{},[386,9080,9081,9084],{},[151,9082,9083],{},"Enable Google Play App Signing"," in the Play Console",[386,9086,9087,9090],{},[151,9088,9089],{},"Upload your app's signing certificate"," (or let Google generate one)",[386,9092,9093],{},[151,9094,9095],{},"Configure your build to use Google's signing",[2808,9097,7594],{"id":7593},[21,9099,9100,9101,3070],{},"For React Native projects, update your ",[40,9102,9103],{},"android\u002Fapp\u002Fbuild.gradle",[48,9105,9109],{"className":9106,"code":9107,"language":9108,"meta":56,"style":56},"language-gradle shiki shiki-themes github-light github-dark","android {\n    defaultConfig {\n        applicationId \"com.yourcompany.yourapp\"\n        versionCode 1\n        versionName \"1.0.0\"\n    }\n\n    signingConfigs {\n        release {\n            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {\n                storeFile file(MYAPP_RELEASE_STORE_FILE)\n                storePassword MYAPP_RELEASE_STORE_PASSWORD\n                keyAlias MYAPP_RELEASE_KEY_ALIAS\n                keyPassword MYAPP_RELEASE_KEY_PASSWORD\n            } else {\n                \u002F\u002F Use Google's signing configuration\n                v1Enabled true\n                v2Enabled true\n            }\n        }\n    }\n\n    buildTypes {\n        release {\n            signingConfig release.signingConfigs.debug\n        }\n    }\n}\n","gradle",[40,9110,9111,9116,9121,9126,9131,9136,9140,9144,9149,9154,9159,9164,9169,9174,9179,9184,9189,9194,9199,9203,9208,9212,9216,9221,9225,9230,9234,9238],{"__ignoreMap":56},[449,9112,9113],{"class":451,"line":452},[449,9114,9115],{},"android {\n",[449,9117,9118],{"class":451,"line":114},[449,9119,9120],{},"    defaultConfig {\n",[449,9122,9123],{"class":451,"line":111},[449,9124,9125],{},"        applicationId \"com.yourcompany.yourapp\"\n",[449,9127,9128],{"class":451,"line":468},[449,9129,9130],{},"        versionCode 1\n",[449,9132,9133],{"class":451,"line":474},[449,9134,9135],{},"        versionName \"1.0.0\"\n",[449,9137,9138],{"class":451,"line":480},[449,9139,7544],{},[449,9141,9142],{"class":451,"line":486},[449,9143,700],{"emptyLinePlaceholder":130},[449,9145,9146],{"class":451,"line":492},[449,9147,9148],{},"    signingConfigs {\n",[449,9150,9151],{"class":451,"line":498},[449,9152,9153],{},"        release {\n",[449,9155,9156],{"class":451,"line":133},[449,9157,9158],{},"            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {\n",[449,9160,9161],{"class":451,"line":509},[449,9162,9163],{},"                storeFile file(MYAPP_RELEASE_STORE_FILE)\n",[449,9165,9166],{"class":451,"line":318},[449,9167,9168],{},"                storePassword MYAPP_RELEASE_STORE_PASSWORD\n",[449,9170,9171],{"class":451,"line":520},[449,9172,9173],{},"                keyAlias MYAPP_RELEASE_KEY_ALIAS\n",[449,9175,9176],{"class":451,"line":526},[449,9177,9178],{},"                keyPassword MYAPP_RELEASE_KEY_PASSWORD\n",[449,9180,9181],{"class":451,"line":532},[449,9182,9183],{},"            } else {\n",[449,9185,9186],{"class":451,"line":2790},[449,9187,9188],{},"                \u002F\u002F Use Google's signing configuration\n",[449,9190,9191],{"class":451,"line":3511},[449,9192,9193],{},"                v1Enabled true\n",[449,9195,9196],{"class":451,"line":3526},[449,9197,9198],{},"                v2Enabled true\n",[449,9200,9201],{"class":451,"line":3531},[449,9202,5738],{},[449,9204,9205],{"class":451,"line":3536},[449,9206,9207],{},"        }\n",[449,9209,9210],{"class":451,"line":4009},[449,9211,7544],{},[449,9213,9214],{"class":451,"line":4015},[449,9215,700],{"emptyLinePlaceholder":130},[449,9217,9218],{"class":451,"line":4021},[449,9219,9220],{},"    buildTypes {\n",[449,9222,9223],{"class":451,"line":4027},[449,9224,9153],{},[449,9226,9227],{"class":451,"line":4032},[449,9228,9229],{},"            signingConfig release.signingConfigs.debug\n",[449,9231,9232],{"class":451,"line":4038},[449,9233,9207],{},[449,9235,9236],{"class":451,"line":4044},[449,9237,7544],{},[449,9239,9240],{"class":451,"line":4049},[449,9241,4604],{},[2808,9243,7622],{"id":7621},[21,9245,9246,9247,9249],{},"Expo handles Google Play App Signing automatically. Just ensure your ",[40,9248,7357],{}," includes the necessary configuration:",[48,9251,9253],{"className":4518,"code":9252,"language":4521,"meta":56,"style":56},"\"android\": {\n  \"package\": \"com.yourcompany.yourapp\",\n  \"versionCode\": 1,\n  \"googleServicesFile\": \".\u002Fgoogle-services.json\",\n  \"adaptiveIcon\": {\n    \"foregroundImage\": \".\u002Fassets\u002Fadaptive-icon.png\",\n    \"backgroundColor\": \"#ffffff\"\n  }\n}\n",[40,9254,9255,9262,9273,9284,9295,9302,9313,9322,9326],{"__ignoreMap":56},[449,9256,9257,9260],{"class":451,"line":452},[449,9258,9259],{"class":691},"\"android\"",[449,9261,4548],{"class":684},[449,9263,9264,9267,9269,9271],{"class":451,"line":114},[449,9265,9266],{"class":714},"  \"package\"",[449,9268,1482],{"class":684},[449,9270,7506],{"class":691},[449,9272,779],{"class":684},[449,9274,9275,9278,9280,9282],{"class":451,"line":111},[449,9276,9277],{"class":714},"  \"versionCode\"",[449,9279,1482],{"class":684},[449,9281,4798],{"class":714},[449,9283,779],{"class":684},[449,9285,9286,9289,9291,9293],{"class":451,"line":468},[449,9287,9288],{"class":714},"  \"googleServicesFile\"",[449,9290,1482],{"class":684},[449,9292,8751],{"class":691},[449,9294,779],{"class":684},[449,9296,9297,9300],{"class":451,"line":474},[449,9298,9299],{"class":714},"  \"adaptiveIcon\"",[449,9301,4548],{"class":684},[449,9303,9304,9307,9309,9311],{"class":451,"line":480},[449,9305,9306],{"class":714},"    \"foregroundImage\"",[449,9308,1482],{"class":684},[449,9310,8770],{"class":691},[449,9312,779],{"class":684},[449,9314,9315,9318,9320],{"class":451,"line":486},[449,9316,9317],{"class":714},"    \"backgroundColor\"",[449,9319,1482],{"class":684},[449,9321,7485],{"class":691},[449,9323,9324],{"class":451,"line":492},[449,9325,4599],{"class":684},[449,9327,9328],{"class":451,"line":498},[449,9329,4604],{"class":684},[32,9331,8357],{"id":9332},"preparing-for-play-store-submission",[21,9334,9335],{},"Before you can submit your app to the Play Store, you need to ensure it's ready for review.",[2808,9337,9339],{"id":9338},"play-store-connect-requirements","Play Store Connect Requirements",[21,9341,7689],{},[816,9343,9344,9358,9367,9379],{},[386,9345,9346,9349],{},[151,9347,9348],{},"Package Name",[383,9350,9351,9354],{},[386,9352,9353],{},"Must match the one registered in the Play Console",[386,9355,7704,9356],{},[40,9357,7707],{},[386,9359,9360,9362],{},[151,9361,7712],{},[383,9363,9364],{},[386,9365,9366],{},"Must follow semantic versioning (major.minor.patch)",[386,9368,9369,9372],{},[151,9370,9371],{},"Version Code",[383,9373,9374,9376],{},[386,9375,7717],{},[386,9377,9378],{},"Should increment with each update",[386,9380,9381,9383],{},[151,9382,7737],{},[383,9384,9385,9387],{},[386,9386,7742],{},[386,9388,7745],{},[2808,9390,7749],{"id":7748},[21,9392,7752],{},[816,9394,9395,9408,9423,9439],{},[386,9396,9397,9399],{},[151,9398,7759],{},[383,9400,9401,9404,9406],{},[386,9402,9403],{},"512×512 pixels (PNG)",[386,9405,7767],{},[386,9407,7770],{},[386,9409,9410,9412],{},[151,9411,7775],{},[383,9413,9414,9417,9420],{},[386,9415,9416],{},"Various screen sizes and orientations",[386,9418,9419],{},"Include at least 2-3 screenshots",[386,9421,9422],{},"Show key features and user interface",[386,9424,9425,9427],{},[151,9426,7791],{},[383,9428,9429,9432,9435,9437],{},[386,9430,9431],{},"Brief description: 20-30 characters",[386,9433,9434],{},"Full description: 100-500 characters",[386,9436,7799],{},[386,9438,7802],{},[386,9440,9441,9443],{},[151,9442,7807],{},[383,9444,9445,9447],{},[386,9446,7812],{},[386,9448,9449],{},"Must be accessible from the Play Store listing",[2808,9451,7819],{"id":7818},[21,9453,7822],{},[816,9455,9456,9466,9477],{},[386,9457,9458,9460],{},[151,9459,7829],{},[383,9461,9462,9464],{},[386,9463,7834],{},[386,9465,7837],{},[386,9467,9468,9470],{},[151,9469,7842],{},[383,9471,9472,9474],{},[386,9473,7847],{},[386,9475,9476],{},"Test with different Android versions",[386,9478,9479,9482],{},[151,9480,9481],{},"Google Play App Testing",[383,9483,9484,9487],{},[386,9485,9486],{},"Use Google Play's internal testing groups",[386,9488,7863],{},[32,9490,8363],{"id":9491},"submitting-to-the-play-store",[21,9493,9494],{},"Once your app is ready, you can submit it to the Play Store.",[2808,9496,7873],{"id":7872},[816,9498,9499,9518,9529,9546,9561,9573],{},[386,9500,9501,9504],{},[151,9502,9503],{},"Create App in Play Console",[383,9505,9506,9512,9515],{},[386,9507,7885,9508],{},[3861,9509,9511],{"href":8438,"rel":9510},[3865],"Google Play Console",[386,9513,9514],{},"Click \"Add new app\"",[386,9516,9517],{},"Enter your app's package name",[386,9519,9520,9522],{},[151,9521,7901],{},[383,9523,9524,9526],{},[386,9525,7906],{},[386,9527,9528],{},"Upload the .aab file (preferred) or .apk",[386,9530,9531,9533],{},[151,9532,7914],{},[383,9534,9535,9538,9541,9543],{},[386,9536,9537],{},"App title, short description, full description",[386,9539,9540],{},"Category and tags",[386,9542,7925],{},[386,9544,9545],{},"App icon and screenshots",[386,9547,9548,9551],{},[151,9549,9550],{},"Set Pricing and Distribution",[383,9552,9553,9556,9558],{},[386,9554,9555],{},"Choose your pricing model (free or paid)",[386,9557,7938],{},[386,9559,9560],{},"Configure device compatibility",[386,9562,9563,9566],{},[151,9564,9565],{},"Review and Submit",[383,9567,9568,9570],{},[386,9569,7948],{},[386,9571,9572],{},"Submit for review",[386,9574,9575,9577],{},[151,9576,7956],{},[383,9578,9579,9582],{},[386,9580,9581],{},"Google typically reviews apps within 24-72 hours",[386,9583,9584],{},"You can track the review status in Play Console",[2808,9586,7968],{"id":7967},[383,9588,9589,9602],{},[386,9590,9591,9594],{},[151,9592,9593],{},"Play Store Rejection Reasons",[383,9595,9596,9598,9600],{},[386,9597,7980],{},[386,9599,7983],{},[386,9601,7986],{},[386,9603,9604,9606],{},[151,9605,7991],{},[383,9607,9608,9610],{},[386,9609,7996],{},[386,9611,9612],{},"Contact Google support if there are delays",[32,9614,7133],{"id":8002},[21,9616,9617],{},"After your app is approved, you need to manage its presence on the Play Store.",[2808,9619,8009],{"id":8008},[816,9621,9622,9633,9643],{},[386,9623,9624,9626],{},[151,9625,8016],{},[383,9627,9628,9631],{},[386,9629,9630],{},"Set your app to \"Published\"",[386,9632,8024],{},[386,9634,9635,9637],{},[151,9636,8029],{},[383,9638,9639,9641],{},[386,9640,8034],{},[386,9642,8037],{},[386,9644,9645,9647],{},[151,9646,8042],{},[383,9648,9649,9651,9653],{},[386,9650,8047],{},[386,9652,8050],{},[386,9654,8053],{},[2808,9656,9658],{"id":9657},"play-store-optimization-aso","Play Store Optimization (ASO)",[21,9660,8060],{},[816,9662,9663,9673,9684],{},[386,9664,9665,9667],{},[151,9666,8067],{},[383,9668,9669,9671],{},[386,9670,8072],{},[386,9672,8075],{},[386,9674,9675,9677],{},[151,9676,8080],{},[383,9678,9679,9682],{},[386,9680,9681],{},"Use compelling app title",[386,9683,8088],{},[386,9685,9686,9688],{},[151,9687,8093],{},[383,9689,9690,9692],{},[386,9691,8098],{},[386,9693,8101],{},[32,9695,7139],{"id":8104},[2808,9697,8108],{"id":8107},[816,9699,9700,9713,9723,9734],{},[386,9701,9702,9705],{},[151,9703,9704],{},"App Signing Issues",[383,9706,9707,9710],{},[386,9708,9709],{},"Use Google Play App Signing",[386,9711,9712],{},"Ensure proper certificate management",[386,9714,9715,9717],{},[151,9716,8128],{},[383,9718,9719,9721],{},[386,9720,8133],{},[386,9722,8136],{},[386,9724,9725,9728],{},[151,9726,9727],{},"Play Store Rejection",[383,9729,9730,9732],{},[386,9731,7980],{},[386,9733,8148],{},[386,9735,9736,9738],{},[151,9737,8153],{},[383,9739,9740,9742],{},[386,9741,8158],{},[386,9743,8161],{},[2808,9745,8165],{"id":8164},[21,9747,8168],{},[816,9749,9750,9760,9768],{},[386,9751,9752,9755],{},[151,9753,9754],{},"Google Play Developer Support",[383,9756,9757],{},[386,9758,9759],{},"Submit a support request through Play Console",[386,9761,9762,9764],{},[151,9763,8185],{},[383,9765,9766],{},[386,9767,8190],{},[386,9769,9770,9772],{},[151,9771,8195],{},[383,9773,9774],{},[386,9775,8200],{},[32,9777,3681],{"id":3680},[21,9779,9780],{},"Deploying a React Native or Expo app to the Google Play Store opens up your application to billions of Android users. While the process has some differences from iOS deployment, it follows a similar pattern of preparation, testing, and submission.",[21,9782,9783],{},"Remember that the Play Store submission process is thorough, but with proper preparation and attention to detail, you can get your app approved and available to users worldwide.",[21,9785,8211],{},[816,9787,9788,9792,9796,9800],{},[386,9789,9790,8219],{},[151,9791,8218],{},[386,9793,9794,8225],{},[151,9795,8224],{},[386,9797,9798,8231],{},[151,9799,8230],{},[386,9801,9802,8237],{},[151,9803,8236],{},[21,9805,9806],{},"Good luck with your Play Store deployment!",[73,9808],{},[21,9810,9811],{},[156,9812,8247],{},[3728,9814,9815],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":9817},[9818,9819,9820,9824,9831,9839,9845,9850,9854,9858,9862],{"id":332,"depth":114,"text":333},{"id":7094,"depth":114,"text":7095},{"id":8378,"depth":114,"text":8333,"children":9821},[9822,9823],{"id":7170,"depth":111,"text":7171},{"id":8430,"depth":111,"text":8431},{"id":8454,"depth":114,"text":8339,"children":9825},[9826,9827],{"id":7242,"depth":111,"text":7243},{"id":8534,"depth":111,"text":8535,"children":9828},[9829,9830],{"id":7326,"depth":468,"text":7327},{"id":7350,"depth":468,"text":7351},{"id":8801,"depth":114,"text":8345,"children":9832},[9833,9834,9835],{"id":8815,"depth":111,"text":8816},{"id":8842,"depth":111,"text":8843},{"id":8868,"depth":111,"text":8869,"children":9836},[9837,9838],{"id":8293,"depth":468,"text":8872},{"id":8294,"depth":468,"text":8972},{"id":9046,"depth":114,"text":8351,"children":9840},[9841,9842,9843,9844],{"id":9052,"depth":111,"text":9053},{"id":9075,"depth":111,"text":9076},{"id":7593,"depth":111,"text":7594},{"id":7621,"depth":111,"text":7622},{"id":9332,"depth":114,"text":8357,"children":9846},[9847,9848,9849],{"id":9338,"depth":111,"text":9339},{"id":7748,"depth":111,"text":7749},{"id":7818,"depth":111,"text":7819},{"id":9491,"depth":114,"text":8363,"children":9851},[9852,9853],{"id":7872,"depth":111,"text":7873},{"id":7967,"depth":111,"text":7968},{"id":8002,"depth":114,"text":7133,"children":9855},[9856,9857],{"id":8008,"depth":111,"text":8009},{"id":9657,"depth":111,"text":9658},{"id":8104,"depth":114,"text":7139,"children":9859},[9860,9861],{"id":8107,"depth":111,"text":8108},{"id":8164,"depth":111,"text":8165},{"id":3680,"depth":114,"text":3681},"A step-by-step guide to publishing a React Native or Expo app on the Google Play Store — Play Console setup, AAB vs APK, Google Play App Signing, store listing metadata, and ongoing release management.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1607252650355-f7fd0460ccdb",[8293,8294,9866,9867,8297,8298,9868,8299],"android","play-store","app-bundle",{},"\u002Fblog\u002Fdeploying-react-native-expo-to-play-store",{"title":8309,"description":9863},"blog\u002Fdeploying-react-native-expo-to-play-store","Is48O9o0LIJ927mE27QhZ5iiQj_vmUNGWqGEZwLL__s",{"id":9875,"title":9876,"author":9877,"body":9878,"canonical":116,"categories":116,"date":10403,"description":10404,"excerpt":10405,"extension":119,"featuredImg":116,"img":10421,"keywords":10422,"language":3788,"meta":10427,"navigation":130,"ogImage":116,"path":10428,"rating":474,"readTime":133,"seo":10429,"stem":10430,"tag":3793,"__hash__":10431},"blog\u002Fblog\u002Fdioxus.md","Getting Started with Dioxus 0.7: A Cross-Platform Rust UI Framework",{"name":9,"img":11,"website":327},{"type":13,"value":9879,"toc":10382},[9880,9882,9901,9904,9906,9910,9927,9939,9946,9948,9952,9955,9986,9994,9996,10000,10009,10013,10043,10053,10059,10061,10065,10076,10085,10088,10090,10094,10101,10105,10131,10134,10136,10140,10155,10159,10237,10247,10249,10253,10264,10268,10297,10303,10305,10309,10320,10324,10335,10342,10344,10348,10359,10366,10368,10370,10373,10380],[16,9881,333],{"id":332},[21,9883,9884,9887,9888,9891,9892,9895,9896],{},[151,9885,9886],{},"Dioxus 0.7"," is the latest stable version of a powerful cross-platform UI framework built in ",[151,9889,9890],{},"Rust",". With Dioxus, developers can use a single Rust codebase to build applications that run on the ",[151,9893,9894],{},"web, desktop, and mobile platforms"," — all while leveraging Rust’s performance, strong type safety, and modern tooling. ",[9897,9898,9900],"content-reference",{"index":9899},"0","oaicite:0",[21,9902,9903],{},"In this post, we’ll explore what Dioxus is, how it works, and how you can start building your first app using its declarative UI syntax and cross-platform capabilities.",[16,9905,4373],{"id":4372},[32,9907,9909],{"id":9908},"what-is-dioxus","What Is Dioxus?",[21,9911,9912,9913,9916,9917,9920,9921,9923,9924],{},"At its core, ",[151,9914,9915],{},"Dioxus"," is a developer-focused UI framework designed to simplify building interactive applications while offering the performance and safety benefits of Rust. It’s similar in spirit to frameworks like ",[151,9918,9919],{},"Flutter"," or ",[151,9922,8872],{},", but deeply rooted in the Rust ecosystem. ",[9897,9925,9926],{"index":4798},"oaicite:1",[25,9928,9929],{"type":363},[21,9930,9931,9932,9935,9936],{},"Dioxus lets you build UI with familiar ",[151,9933,9934],{},"HTML and CSS"," semantics using Rust, and compile to web (WASM), desktop, and mobile targets from a single codebase. ",[9897,9937,9938],{"index":4826},"oaicite:2",[21,9940,9941,9942,9945],{},"The framework’s syntax is inspired by modern declarative UI paradigms, meaning you describe ",[156,9943,9944],{},"what your UI should look like"," instead of how to construct elements imperatively.",[73,9947],{},[32,9949,9951],{"id":9950},"why-use-dioxus","Why Use Dioxus?",[21,9953,9954],{},"Developers gravitate toward Dioxus because it offers:",[383,9956,9957,9963,9968,9974,9980],{},[386,9958,9959,9962],{},[151,9960,9961],{},"Cross-platform support"," (web, desktop, mobile)",[386,9964,9965],{},[151,9966,9967],{},"Rust’s performance and safety guarantees",[386,9969,9970,9973],{},[151,9971,9972],{},"RSX",", a macro-based declarative UI syntax",[386,9975,9976,9979],{},[151,9977,9978],{},"Hot-reloading"," for faster developer feedback",[386,9981,9982,9983],{},"Integrated tools for building, bundling, and deploying apps ",[9897,9984,9985],{"index":4849},"oaicite:3",[25,9987,9988],{"type":27},[21,9989,9990,9991],{},"Learning Rust’s syntax and its borrow checker can have a steeper learning curve if you’re coming from JavaScript or TypeScript — but the payoff is safer, faster applications. ",[9897,9992,9993],{"index":4873},"oaicite:4",[73,9995],{},[32,9997,9999],{"id":9998},"core-concepts-rsx-and-components","Core Concepts: RSX and Components",[21,10001,10002,10003,10005,10006],{},"Dioxus uses ",[151,10004,9972],{}," — a Rust macro that resembles JSX (from React) — to describe UI in a declarative way. Instead of manually creating and updating DOM elements, you declare what your components should render. ",[9897,10007,10008],{"index":4897},"oaicite:5",[2808,10010,10012],{"id":10011},"rsx-example","RSX Example",[48,10014,10018],{"className":10015,"code":10016,"language":10017,"meta":56,"style":56},"language-rust shiki shiki-themes github-light github-dark","fn App() -> Element {\n    rsx! {\n        div { \"Hello, world!\" }\n    }\n}\n","rust",[40,10019,10020,10025,10030,10035,10039],{"__ignoreMap":56},[449,10021,10022],{"class":451,"line":452},[449,10023,10024],{},"fn App() -> Element {\n",[449,10026,10027],{"class":451,"line":114},[449,10028,10029],{},"    rsx! {\n",[449,10031,10032],{"class":451,"line":111},[449,10033,10034],{},"        div { \"Hello, world!\" }\n",[449,10036,10037],{"class":451,"line":468},[449,10038,7544],{},[449,10040,10041],{"class":451,"line":474},[449,10042,4604],{},[21,10044,10045,10046,10052],{},"RSX syntax feels familiar to developers experienced with JSX or other declarative UI languages, but with the robustness of Rust’s compiler and type system powering it. (",[3861,10047,10051],{"href":10048,"rel":10049,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Ftutorial\u002Frsx\u002F?utm_source=chatgpt.com",[3865],"Dioxus | Fullstack crossplatform app framework for Rust","Dioxus Labs",")\n::",[21,10054,10055,10056,827],{},"Hot-reloading is built in — when you save changes, your app updates instantly without a full rebuild. (",[3861,10057,10051],{"href":10048,"rel":10058,"title":10050},[3865],[73,10060],{},[32,10062,10064],{"id":10063},"state-management","State Management",[21,10066,10067,10068,10071,10072,827],{},"Dioxus has a built-in reactivity model using ",[151,10069,10070],{},"signals",", allowing your UI to update when underlying data changes. Signals wrap ordinary Rust values and trigger component re-renders whenever they’re updated. (",[3861,10073,10051],{"href":10074,"rel":10075,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Ftutorial\u002Fstate\u002F?utm_source=chatgpt.com",[3865],[48,10077,10079],{"className":10015,"code":10078,"language":10017,"meta":56,"style":56},"let mut count = use_signal(|| 0);\n",[40,10080,10081],{"__ignoreMap":56},[449,10082,10083],{"class":451,"line":452},[449,10084,10078],{},[21,10086,10087],{},"This simple reactive primitive brings interactivity to your applications with minimal boilerplate.",[73,10089],{},[32,10091,10093],{"id":10092},"building-a-complete-app-the-hotdog-tutorial","Building a Complete App: The HotDog Tutorial",[21,10095,10096,10097,827],{},"To help developers get started, Dioxus provides a comprehensive tutorial where you’ll build a small cross-platform app called “HotDog” — a playful dog photo app that lets users swipe and save images. (",[3861,10098,10051],{"href":10099,"rel":10100,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Ftutorial\u002F?utm_source=chatgpt.com",[3865],[2808,10102,10104],{"id":10103},"what-youll-learn","What You’ll Learn",[383,10106,10107,10110,10113,10116,10119,10122,10125],{},[386,10108,10109],{},"Tooling setup",[386,10111,10112],{},"Creating your first app project",[386,10114,10115],{},"Working with components",[386,10117,10118],{},"Adding state and interactivity",[386,10120,10121],{},"Fetching remote data",[386,10123,10124],{},"Routing and multi-page UI",[386,10126,10127,10128,827],{},"Bundling and deployment (",[3861,10129,10051],{"href":10099,"rel":10130,"title":10050},[3865],[21,10132,10133],{},"This guided experience walks you from zero to a full app that runs across platforms, showing how Dioxus handles fullstack needs efficiently.",[73,10135],{},[32,10137,10139],{"id":10138},"fetching-data-and-resources","Fetching Data and Resources",[21,10141,10142,10143,10146,10147,10150,10151,827],{},"Dioxus doesn’t have built-in data fetching utilities, so you’ll often leverage existing Rust crates like ",[40,10144,10145],{},"reqwest"," for HTTP client functionality and ",[40,10148,10149],{},"serde"," for JSON deserialization. (",[3861,10152,10051],{"href":10153,"rel":10154,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Ftutorial\u002Fdata_fetching?utm_source=chatgpt.com",[3865],[2808,10156,10158],{"id":10157},"example-fetching-and-displaying-a-random-dog-image","Example: Fetching and Displaying a Random Dog Image",[48,10160,10162],{"className":10015,"code":10161,"language":10017,"meta":56,"style":56},"#[component]\nfn DogView() -> Element {\n    let mut img_src = use_resource(|| async move {\n        reqwest::get(\"https:\u002F\u002Fdog.ceo\u002Fapi\u002Fbreeds\u002Fimage\u002Frandom\")\n            .await.unwrap()\n            .json::\u003CDogApi>()\n            .await.unwrap()\n            .message\n    });\n\n    rsx! {\n        div {\n            img { src: img_src.cloned().unwrap_or_default() }\n        }\n    }\n}\n",[40,10163,10164,10169,10174,10179,10184,10189,10194,10198,10203,10207,10211,10215,10220,10225,10229,10233],{"__ignoreMap":56},[449,10165,10166],{"class":451,"line":452},[449,10167,10168],{},"#[component]\n",[449,10170,10171],{"class":451,"line":114},[449,10172,10173],{},"fn DogView() -> Element {\n",[449,10175,10176],{"class":451,"line":111},[449,10177,10178],{},"    let mut img_src = use_resource(|| async move {\n",[449,10180,10181],{"class":451,"line":468},[449,10182,10183],{},"        reqwest::get(\"https:\u002F\u002Fdog.ceo\u002Fapi\u002Fbreeds\u002Fimage\u002Frandom\")\n",[449,10185,10186],{"class":451,"line":474},[449,10187,10188],{},"            .await.unwrap()\n",[449,10190,10191],{"class":451,"line":480},[449,10192,10193],{},"            .json::\u003CDogApi>()\n",[449,10195,10196],{"class":451,"line":486},[449,10197,10188],{},[449,10199,10200],{"class":451,"line":492},[449,10201,10202],{},"            .message\n",[449,10204,10205],{"class":451,"line":498},[449,10206,3484],{},[449,10208,10209],{"class":451,"line":133},[449,10210,700],{"emptyLinePlaceholder":130},[449,10212,10213],{"class":451,"line":509},[449,10214,10029],{},[449,10216,10217],{"class":451,"line":318},[449,10218,10219],{},"        div {\n",[449,10221,10222],{"class":451,"line":520},[449,10223,10224],{},"            img { src: img_src.cloned().unwrap_or_default() }\n",[449,10226,10227],{"class":451,"line":526},[449,10228,9207],{},[449,10230,10231],{"class":451,"line":532},[449,10232,7544],{},[449,10234,10235],{"class":451,"line":2790},[449,10236,4604],{},[21,10238,10239,10240,10243,10244,827],{},"This pattern shows how Dioxus integrates asynchronous logic with its reactive system via ",[40,10241,10242],{},"use_resource",". (",[3861,10245,10051],{"href":10153,"rel":10246,"title":10050},[3865],[73,10248],{},[32,10250,10252],{"id":10251},"routing-and-navigation","Routing and Navigation",[21,10254,10255,10256,10259,10260,827],{},"Most real applications need multiple screens. Dioxus includes a ",[151,10257,10258],{},"type-safe router"," that maps enum variants to paths. (",[3861,10261,10051],{"href":10262,"rel":10263,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Ftutorial\u002Frouting\u002F?utm_source=chatgpt.com",[3865],[2808,10265,10267],{"id":10266},"routing-example","Routing Example",[48,10269,10271],{"className":10015,"code":10270,"language":10017,"meta":56,"style":56},"#[derive(Routable, Clone, PartialEq)]\nenum Route {\n    #[route(\"\u002F\")]\n    DogView,\n}\n",[40,10272,10273,10278,10283,10288,10293],{"__ignoreMap":56},[449,10274,10275],{"class":451,"line":452},[449,10276,10277],{},"#[derive(Routable, Clone, PartialEq)]\n",[449,10279,10280],{"class":451,"line":114},[449,10281,10282],{},"enum Route {\n",[449,10284,10285],{"class":451,"line":111},[449,10286,10287],{},"    #[route(\"\u002F\")]\n",[449,10289,10290],{"class":451,"line":468},[449,10291,10292],{},"    DogView,\n",[449,10294,10295],{"class":451,"line":474},[449,10296,4604],{},[21,10298,10299,10300,827],{},"Once configured, navigating between pages is seamless and safe at compile time, reducing runtime bugs. (",[3861,10301,10051],{"href":10262,"rel":10302,"title":10050},[3865],[73,10304],{},[32,10306,10308],{"id":10307},"fullstack-capabilities","Fullstack Capabilities",[21,10310,10311,10312,10315,10316,827],{},"Dioxus doesn’t just handle the frontend—",[151,10313,10314],{},"it also integrates backend logic directly in Rust",". You can combine frontend UI code with backend server functions, state management, and SSR capabilities via the fullstack features. (",[3861,10317,10051],{"href":10318,"rel":10319,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002Fessentials\u002Ffullstack\u002F?utm_source=chatgpt.com",[3865],[2808,10321,10323],{"id":10322},"fullstack-features","Fullstack Features",[383,10325,10326,10329,10332],{},[386,10327,10328],{},"Server functions callable from the UI",[386,10330,10331],{},"Integration with backend frameworks",[386,10333,10334],{},"Static and dynamic content rendering\n::",[21,10336,10337,10338,10341],{},"This makes Dioxus ideal for ",[151,10339,10340],{},"end-to-end Rust applications"," where both client and server share a language and ecosystem.",[73,10343],{},[32,10345,10347],{"id":10346},"why-dioxus-matters","Why Dioxus Matters",[21,10349,10350,10351,10354,10355,827],{},"With Dioxus 0.7, Rust developers finally have a ",[151,10352,10353],{},"mature, ergonomic framework"," for building cross-platform UI applications that don’t compromise performance or safety. The combination of Rust’s compile-time guarantees, declarative UI, and comprehensive tooling makes it a compelling choice for modern application development. (",[3861,10356,10051],{"href":10357,"rel":10358,"title":10050},"https:\u002F\u002Fdioxuslabs.com\u002Flearn\u002F0.7\u002F?utm_source=chatgpt.com",[3865],[21,10360,10361,10362,10365],{},"Whether you’re building a ",[151,10363,10364],{},"mobile app, desktop client, or WASM-based web UI",", Dioxus helps you maintain a single codebase across all platforms without sacrificing developer productivity.",[73,10367],{},[16,10369,3681],{"id":3680},[21,10371,10372],{},"Dioxus 0.7 is more than just a UI framework — it’s a unified platform for building fullstack, cross-platform applications entirely in Rust. With intuitive UI syntax, powerful state management, routing, backend integration, and solid tooling, it’s positioned as a strong contender for modern app development in Rust.",[21,10374,10375,10376,10379],{},"If you’re ready to build ",[151,10377,10378],{},"fast, safe, and beautiful applications",", Dioxus is a framework worth exploring. 🚀",[3728,10381,4140],{},{"title":56,"searchDepth":111,"depth":111,"links":10383},[10384,10385,10386,10389,10390,10393,10396,10399,10402],{"id":9908,"depth":114,"text":9909},{"id":9950,"depth":114,"text":9951},{"id":9998,"depth":114,"text":9999,"children":10387},[10388],{"id":10011,"depth":111,"text":10012},{"id":10063,"depth":114,"text":10064},{"id":10092,"depth":114,"text":10093,"children":10391},[10392],{"id":10103,"depth":111,"text":10104},{"id":10138,"depth":114,"text":10139,"children":10394},[10395],{"id":10157,"depth":111,"text":10158},{"id":10251,"depth":114,"text":10252,"children":10397},[10398],{"id":10266,"depth":111,"text":10267},{"id":10307,"depth":114,"text":10308,"children":10400},[10401],{"id":10322,"depth":111,"text":10323},{"id":10346,"depth":114,"text":10347},"2026-01-10","Explore Dioxus 0.7 — what it is, how it works across platforms using Rust, and why it’s an exciting choice for building modern UI applications.",{"type":13,"value":10406},[10407,10409,10419],[16,10408,333],{"id":332},[21,10410,10411,9887,10413,9891,10415,9895,10417],{},[151,10412,9886],{},[151,10414,9890],{},[151,10416,9894],{},[9897,10418,9900],{"index":9899},[21,10420,9903],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1590608897129-79d5d1839d6b",[10423,10017,10424,10425,10426],"dioxus","cross-platform","ui","fullstack",{},"\u002Fblog\u002Fdioxus",{"title":9876,"description":10404},"blog\u002Fdioxus","EIreHXt8R037GvR3hw-HS2SgXa26R9VBCt6DFvUnTsY",{"id":10433,"title":10434,"author":10435,"body":10436,"canonical":116,"categories":116,"date":7031,"description":14669,"excerpt":14670,"extension":119,"featuredImg":116,"img":7063,"keywords":14688,"language":3788,"meta":14694,"navigation":130,"ogImage":116,"path":14695,"rating":474,"readTime":318,"seo":14696,"stem":14697,"tag":3793,"__hash__":14698},"blog\u002Fblog\u002Fdrizzle-nitro-api.md","Building a Production API with Drizzle ORM + Nitro: A Complete Guide",{"name":9,"img":11,"website":327},{"type":13,"value":10437,"toc":14644},[10438,10440,10447,10454,10457,10464,10468,10471,10503,10508,10510,10512,10516,10519,10530,10532,10536,10539,10601,10606,10608,10612,10615,10620,10707,10709,10713,10716,10736,10741,11368,11375,11377,11381,11384,11389,11678,11680,11684,11687,11692,12371,12373,12377,12381,12386,12476,12480,12485,12711,12715,12718,12722,13573,13577,13582,14051,14055,14060,14258,14260,14264,14267,14304,14319,14321,14325,14328,14340,14344,14362,14366,14378,14382,14449,14453,14487,14489,14491,14493,14510,14512,14600,14602,14604,14611,14614,14634,14641],[16,10439,333],{"id":332},[21,10441,10442,10443,10446],{},"In our ",[151,10444,10445],{},"BrewStop food truck series",", we used Unstorage for data persistence—an excellent choice for prototypes and simple applications. But when you're building for production, you need something more robust: a proper database with type-safe queries, migrations, and scalable architecture.",[21,10448,10449,10450,10453],{},"That's where ",[151,10451,10452],{},"Drizzle ORM"," comes in.",[21,10455,10456],{},"Drizzle is a lightweight, TypeScript-first ORM that gives you the control of raw SQL with the ergonomics of an ORM. It pairs beautifully with Nitro, offering a production-ready data layer that won't slow you down.",[21,10458,10459,10460,10463],{},"In this post, we'll build a complete database-backed API using ",[151,10461,10462],{},"Drizzle ORM + Nitro","—covering setup, schema design, queries, and deployment.",[16,10465,10467],{"id":10466},"why-drizzle-orm","Why Drizzle ORM?",[21,10469,10470],{},"Before we dive in, let's talk about why Drizzle is worth your attention:",[383,10472,10473,10479,10485,10491,10497],{},[386,10474,10475,10478],{},[151,10476,10477],{},"Type-safe queries"," — TypeScript understands your schema end-to-end",[386,10480,10481,10484],{},[151,10482,10483],{},"Lightweight"," — No heavy runtime, compiles to efficient SQL",[386,10486,10487,10490],{},[151,10488,10489],{},"Portable"," — Works with PostgreSQL, MySQL, SQLite, and more",[386,10492,10493,10496],{},[151,10494,10495],{},"Migration support"," — First-class migration tooling",[386,10498,10499,10502],{},[151,10500,10501],{},"Zero dependencies"," — Doesn't pull in unnecessary bloat",[25,10504,10505],{"type":363},[21,10506,10507],{},"Drizzle is designed to feel like you're writing SQL—but with full type safety and IDE autocomplete.",[73,10509],{},[16,10511,4373],{"id":4372},[32,10513,10515],{"id":10514},"prerequisites","Prerequisites",[21,10517,10518],{},"This guide assumes you have:",[383,10520,10521,10524,10527],{},[386,10522,10523],{},"Node.js 18+ installed",[386,10525,10526],{},"Basic knowledge of TypeScript",[386,10528,10529],{},"A PostgreSQL or SQLite database (we'll use SQLite for simplicity, but the code is mostly identical)",[73,10531],{},[32,10533,10535],{"id":10534},"step-1-project-setup","Step 1: Project Setup",[21,10537,10538],{},"Let's start by creating a new Nitro project and installing Drizzle.",[48,10540,10542],{"className":839,"code":10541,"filename":4384,"language":841,"meta":56,"style":56},"# Create a new Nitro project\nnpx create-nitro-app brewstop-api-v2\ncd brewstop-api-v2\n\n# Install Drizzle ORM and SQLite driver\nnpm install drizzle-orm better-sqlite3\nnpm install -D drizzle-kit @types\u002Fbetter-sqlite3\n",[40,10543,10544,10549,10559,10565,10569,10574,10586],{"__ignoreMap":56},[449,10545,10546],{"class":451,"line":452},[449,10547,10548],{"class":705},"# Create a new Nitro project\n",[449,10550,10551,10553,10556],{"class":451,"line":114},[449,10552,8887],{"class":721},[449,10554,10555],{"class":691}," create-nitro-app",[449,10557,10558],{"class":691}," brewstop-api-v2\n",[449,10560,10561,10563],{"class":451,"line":111},[449,10562,4490],{"class":714},[449,10564,10558],{"class":691},[449,10566,10567],{"class":451,"line":468},[449,10568,700],{"emptyLinePlaceholder":130},[449,10570,10571],{"class":451,"line":474},[449,10572,10573],{"class":705},"# Install Drizzle ORM and SQLite driver\n",[449,10575,10576,10578,10580,10583],{"class":451,"line":480},[449,10577,3703],{"class":721},[449,10579,3706],{"class":691},[449,10581,10582],{"class":691}," drizzle-orm",[449,10584,10585],{"class":691}," better-sqlite3\n",[449,10587,10588,10590,10592,10595,10598],{"class":451,"line":486},[449,10589,3703],{"class":721},[449,10591,3706],{"class":691},[449,10593,10594],{"class":714}," -D",[449,10596,10597],{"class":691}," drizzle-kit",[449,10599,10600],{"class":691}," @types\u002Fbetter-sqlite3\n",[25,10602,10603],{"type":27},[21,10604,10605],{},"Make sure to use the appropriate driver for your database (pg for PostgreSQL, mysql2 for MySQL, etc.). We'll use better-sqlite3 for this example.",[73,10607],{},[32,10609,10611],{"id":10610},"step-2-configure-drizzle","Step 2: Configure Drizzle",[21,10613,10614],{},"Create a configuration file for Drizzle. This tells Drizzle where your database is and how to handle migrations.",[21,10616,4697,10617,3070],{},[40,10618,10619],{},"drizzle.config.ts",[48,10621,10623],{"className":670,"code":10622,"filename":10619,"language":673,"meta":56,"style":56},"import { defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  schema: \".\u002Fserver\u002Fdb\u002Fschema.ts\",\n  out: \".\u002Fdrizzle\",\n  dialect: \"sqlite\",\n  dbCredentials: {\n    url: \".\u002Fbrewstop.db\",\n  },\n});\n",[40,10624,10625,10639,10643,10654,10664,10674,10684,10689,10699,10703],{"__ignoreMap":56},[449,10626,10627,10629,10632,10634,10637],{"class":451,"line":452},[449,10628,681],{"class":680},[449,10630,10631],{"class":684}," { defineConfig } ",[449,10633,688],{"class":680},[449,10635,10636],{"class":691}," \"drizzle-kit\"",[449,10638,695],{"class":684},[449,10640,10641],{"class":451,"line":114},[449,10642,700],{"emptyLinePlaceholder":130},[449,10644,10645,10647,10649,10652],{"class":451,"line":111},[449,10646,4629],{"class":680},[449,10648,4632],{"class":680},[449,10650,10651],{"class":721}," defineConfig",[449,10653,1391],{"class":684},[449,10655,10656,10659,10662],{"class":451,"line":468},[449,10657,10658],{"class":684},"  schema: ",[449,10660,10661],{"class":691},"\".\u002Fserver\u002Fdb\u002Fschema.ts\"",[449,10663,779],{"class":684},[449,10665,10666,10669,10672],{"class":451,"line":474},[449,10667,10668],{"class":684},"  out: ",[449,10670,10671],{"class":691},"\".\u002Fdrizzle\"",[449,10673,779],{"class":684},[449,10675,10676,10679,10682],{"class":451,"line":480},[449,10677,10678],{"class":684},"  dialect: ",[449,10680,10681],{"class":691},"\"sqlite\"",[449,10683,779],{"class":684},[449,10685,10686],{"class":451,"line":486},[449,10687,10688],{"class":684},"  dbCredentials: {\n",[449,10690,10691,10694,10697],{"class":451,"line":492},[449,10692,10693],{"class":684},"    url: ",[449,10695,10696],{"class":691},"\".\u002Fbrewstop.db\"",[449,10698,779],{"class":684},[449,10700,10701],{"class":451,"line":498},[449,10702,1474],{"class":684},[449,10704,10705],{"class":451,"line":133},[449,10706,784],{"class":684},[73,10708],{},[32,10710,10712],{"id":10711},"step-3-define-your-schema","Step 3: Define Your Schema",[21,10714,10715],{},"Now let's design our database schema. For BrewStop, we need:",[383,10717,10718,10724,10730],{},[386,10719,10720,10723],{},[151,10721,10722],{},"Menu items"," — products the food truck sells",[386,10725,10726,10729],{},[151,10727,10728],{},"Orders"," — customer orders",[386,10731,10732,10735],{},[151,10733,10734],{},"Order items"," — individual items within an order",[21,10737,4697,10738,3070],{},[40,10739,10740],{},"server\u002Fdb\u002Fschema.ts",[48,10742,10744],{"className":670,"code":10743,"filename":10740,"language":673,"meta":56,"style":56},"import { sqliteTable, text, integer, real } from \"drizzle-orm\u002Fsqlite-core\";\nimport { sql } from \"drizzle-orm\";\n\n\u002F\u002F Menu Items Table\nexport const menuItems = sqliteTable(\"menu_items\", {\n  id: text(\"id\").primaryKey(),\n  name: text(\"name\").notNull(),\n  description: text(\"description\"),\n  price: real(\"price\").notNull(),\n  category: text(\"category\").notNull(), \u002F\u002F coffee, tea, food\n  available: integer(\"available\", { mode: \"boolean\" }).default(true),\n  createdAt: integer(\"created_at\", { mode: \"timestamp\" }).default(sql`CURRENT_TIMESTAMP`),\n});\n\n\u002F\u002F Orders Table\nexport const orders = sqliteTable(\"orders\", {\n  id: text(\"id\").primaryKey(),\n  status: text(\"status\").notNull().default(\"pending\"), \u002F\u002F pending, preparing, ready, completed\n  customerName: text(\"customer_name\"),\n  total: real(\"total\").notNull(),\n  createdAt: integer(\"created_at\", { mode: \"timestamp\" }).default(sql`CURRENT_TIMESTAMP`),\n  updatedAt: integer(\"updated_at\", { mode: \"timestamp\" }).default(sql`CURRENT_TIMESTAMP`),\n});\n\n\u002F\u002F Order Items Table (junction table)\nexport const orderItems = sqliteTable(\"order_items\", {\n  id: text(\"id\").primaryKey(),\n  orderId: text(\"order_id\")\n    .notNull()\n    .references(() => orders.id),\n  menuItemId: text(\"menu_item_id\")\n    .notNull()\n    .references(() => menuItems.id),\n  quantity: integer(\"quantity\").notNull().default(1),\n  unitPrice: real(\"unit_price\").notNull(),\n});\n\n\u002F\u002F Type exports for TypeScript\nexport type MenuItem = typeof menuItems.$inferSelect;\nexport type NewMenuItem = typeof menuItems.$inferInsert;\nexport type Order = typeof orders.$inferSelect;\nexport type NewOrder = typeof orders.$inferInsert;\n",[40,10745,10746,10760,10774,10778,10783,10805,10824,10842,10855,10874,10896,10927,10958,10962,10966,10971,10990,11006,11036,11050,11068,11094,11122,11126,11130,11135,11155,11171,11186,11196,11210,11224,11232,11245,11271,11289,11293,11297,11302,11320,11336,11352],{"__ignoreMap":56},[449,10747,10748,10750,10753,10755,10758],{"class":451,"line":452},[449,10749,681],{"class":680},[449,10751,10752],{"class":684}," { sqliteTable, text, integer, real } ",[449,10754,688],{"class":680},[449,10756,10757],{"class":691}," \"drizzle-orm\u002Fsqlite-core\"",[449,10759,695],{"class":684},[449,10761,10762,10764,10767,10769,10772],{"class":451,"line":114},[449,10763,681],{"class":680},[449,10765,10766],{"class":684}," { sql } ",[449,10768,688],{"class":680},[449,10770,10771],{"class":691}," \"drizzle-orm\"",[449,10773,695],{"class":684},[449,10775,10776],{"class":451,"line":111},[449,10777,700],{"emptyLinePlaceholder":130},[449,10779,10780],{"class":451,"line":468},[449,10781,10782],{"class":705},"\u002F\u002F Menu Items Table\n",[449,10784,10785,10787,10790,10793,10795,10798,10800,10803],{"class":451,"line":474},[449,10786,4629],{"class":680},[449,10788,10789],{"class":680}," const",[449,10791,10792],{"class":714}," menuItems",[449,10794,718],{"class":680},[449,10796,10797],{"class":721}," sqliteTable",[449,10799,725],{"class":684},[449,10801,10802],{"class":691},"\"menu_items\"",[449,10804,768],{"class":684},[449,10806,10807,10810,10812,10814,10817,10819,10822],{"class":451,"line":480},[449,10808,10809],{"class":684},"  id: ",[449,10811,53],{"class":721},[449,10813,725],{"class":684},[449,10815,10816],{"class":691},"\"id\"",[449,10818,374],{"class":684},[449,10820,10821],{"class":721},"primaryKey",[449,10823,1624],{"class":684},[449,10825,10826,10828,10830,10832,10835,10837,10840],{"class":451,"line":486},[449,10827,1396],{"class":684},[449,10829,53],{"class":721},[449,10831,725],{"class":684},[449,10833,10834],{"class":691},"\"name\"",[449,10836,374],{"class":684},[449,10838,10839],{"class":721},"notNull",[449,10841,1624],{"class":684},[449,10843,10844,10846,10848,10850,10853],{"class":451,"line":492},[449,10845,1406],{"class":684},[449,10847,53],{"class":721},[449,10849,725],{"class":684},[449,10851,10852],{"class":691},"\"description\"",[449,10854,1613],{"class":684},[449,10856,10857,10860,10863,10865,10868,10870,10872],{"class":451,"line":498},[449,10858,10859],{"class":684},"  price: ",[449,10861,10862],{"class":721},"real",[449,10864,725],{"class":684},[449,10866,10867],{"class":691},"\"price\"",[449,10869,374],{"class":684},[449,10871,10839],{"class":721},[449,10873,1624],{"class":684},[449,10875,10876,10879,10881,10883,10886,10888,10890,10893],{"class":451,"line":133},[449,10877,10878],{"class":684},"  category: ",[449,10880,53],{"class":721},[449,10882,725],{"class":684},[449,10884,10885],{"class":691},"\"category\"",[449,10887,374],{"class":684},[449,10889,10839],{"class":721},[449,10891,10892],{"class":684},"(), ",[449,10894,10895],{"class":705},"\u002F\u002F coffee, tea, food\n",[449,10897,10898,10901,10904,10906,10909,10912,10915,10918,10921,10923,10925],{"class":451,"line":509},[449,10899,10900],{"class":684},"  available: ",[449,10902,10903],{"class":721},"integer",[449,10905,725],{"class":684},[449,10907,10908],{"class":691},"\"available\"",[449,10910,10911],{"class":684},", { mode: ",[449,10913,10914],{"class":691},"\"boolean\"",[449,10916,10917],{"class":684}," }).",[449,10919,10920],{"class":721},"default",[449,10922,725],{"class":684},[449,10924,2169],{"class":714},[449,10926,1613],{"class":684},[449,10928,10929,10932,10934,10936,10939,10941,10944,10946,10948,10950,10953,10956],{"class":451,"line":318},[449,10930,10931],{"class":684},"  createdAt: ",[449,10933,10903],{"class":721},[449,10935,725],{"class":684},[449,10937,10938],{"class":691},"\"created_at\"",[449,10940,10911],{"class":684},[449,10942,10943],{"class":691},"\"timestamp\"",[449,10945,10917],{"class":684},[449,10947,10920],{"class":721},[449,10949,725],{"class":684},[449,10951,10952],{"class":721},"sql",[449,10954,10955],{"class":691},"`CURRENT_TIMESTAMP`",[449,10957,1613],{"class":684},[449,10959,10960],{"class":451,"line":520},[449,10961,784],{"class":684},[449,10963,10964],{"class":451,"line":526},[449,10965,700],{"emptyLinePlaceholder":130},[449,10967,10968],{"class":451,"line":532},[449,10969,10970],{"class":705},"\u002F\u002F Orders Table\n",[449,10972,10973,10975,10977,10979,10981,10983,10985,10988],{"class":451,"line":2790},[449,10974,4629],{"class":680},[449,10976,10789],{"class":680},[449,10978,5003],{"class":714},[449,10980,718],{"class":680},[449,10982,10797],{"class":721},[449,10984,725],{"class":684},[449,10986,10987],{"class":691},"\"orders\"",[449,10989,768],{"class":684},[449,10991,10992,10994,10996,10998,11000,11002,11004],{"class":451,"line":3511},[449,10993,10809],{"class":684},[449,10995,53],{"class":721},[449,10997,725],{"class":684},[449,10999,10816],{"class":691},[449,11001,374],{"class":684},[449,11003,10821],{"class":721},[449,11005,1624],{"class":684},[449,11007,11008,11011,11013,11015,11018,11020,11022,11024,11026,11028,11030,11033],{"class":451,"line":3526},[449,11009,11010],{"class":684},"  status: ",[449,11012,53],{"class":721},[449,11014,725],{"class":684},[449,11016,11017],{"class":691},"\"status\"",[449,11019,374],{"class":684},[449,11021,10839],{"class":721},[449,11023,5237],{"class":684},[449,11025,10920],{"class":721},[449,11027,725],{"class":684},[449,11029,5221],{"class":691},[449,11031,11032],{"class":684},"), ",[449,11034,11035],{"class":705},"\u002F\u002F pending, preparing, ready, completed\n",[449,11037,11038,11041,11043,11045,11048],{"class":451,"line":3531},[449,11039,11040],{"class":684},"  customerName: ",[449,11042,53],{"class":721},[449,11044,725],{"class":684},[449,11046,11047],{"class":691},"\"customer_name\"",[449,11049,1613],{"class":684},[449,11051,11052,11055,11057,11059,11062,11064,11066],{"class":451,"line":3536},[449,11053,11054],{"class":684},"  total: ",[449,11056,10862],{"class":721},[449,11058,725],{"class":684},[449,11060,11061],{"class":691},"\"total\"",[449,11063,374],{"class":684},[449,11065,10839],{"class":721},[449,11067,1624],{"class":684},[449,11069,11070,11072,11074,11076,11078,11080,11082,11084,11086,11088,11090,11092],{"class":451,"line":4009},[449,11071,10931],{"class":684},[449,11073,10903],{"class":721},[449,11075,725],{"class":684},[449,11077,10938],{"class":691},[449,11079,10911],{"class":684},[449,11081,10943],{"class":691},[449,11083,10917],{"class":684},[449,11085,10920],{"class":721},[449,11087,725],{"class":684},[449,11089,10952],{"class":721},[449,11091,10955],{"class":691},[449,11093,1613],{"class":684},[449,11095,11096,11099,11101,11103,11106,11108,11110,11112,11114,11116,11118,11120],{"class":451,"line":4015},[449,11097,11098],{"class":684},"  updatedAt: ",[449,11100,10903],{"class":721},[449,11102,725],{"class":684},[449,11104,11105],{"class":691},"\"updated_at\"",[449,11107,10911],{"class":684},[449,11109,10943],{"class":691},[449,11111,10917],{"class":684},[449,11113,10920],{"class":721},[449,11115,725],{"class":684},[449,11117,10952],{"class":721},[449,11119,10955],{"class":691},[449,11121,1613],{"class":684},[449,11123,11124],{"class":451,"line":4021},[449,11125,784],{"class":684},[449,11127,11128],{"class":451,"line":4027},[449,11129,700],{"emptyLinePlaceholder":130},[449,11131,11132],{"class":451,"line":4032},[449,11133,11134],{"class":705},"\u002F\u002F Order Items Table (junction table)\n",[449,11136,11137,11139,11141,11144,11146,11148,11150,11153],{"class":451,"line":4038},[449,11138,4629],{"class":680},[449,11140,10789],{"class":680},[449,11142,11143],{"class":714}," orderItems",[449,11145,718],{"class":680},[449,11147,10797],{"class":721},[449,11149,725],{"class":684},[449,11151,11152],{"class":691},"\"order_items\"",[449,11154,768],{"class":684},[449,11156,11157,11159,11161,11163,11165,11167,11169],{"class":451,"line":4044},[449,11158,10809],{"class":684},[449,11160,53],{"class":721},[449,11162,725],{"class":684},[449,11164,10816],{"class":691},[449,11166,374],{"class":684},[449,11168,10821],{"class":721},[449,11170,1624],{"class":684},[449,11172,11173,11176,11178,11180,11183],{"class":451,"line":4049},[449,11174,11175],{"class":684},"  orderId: ",[449,11177,53],{"class":721},[449,11179,725],{"class":684},[449,11181,11182],{"class":691},"\"order_id\"",[449,11184,11185],{"class":684},")\n",[449,11187,11188,11191,11193],{"class":451,"line":4054},[449,11189,11190],{"class":684},"    .",[449,11192,10839],{"class":721},[449,11194,11195],{"class":684},"()\n",[449,11197,11198,11200,11203,11205,11207],{"class":451,"line":4059},[449,11199,11190],{"class":684},[449,11201,11202],{"class":721},"references",[449,11204,4717],{"class":684},[449,11206,1498],{"class":680},[449,11208,11209],{"class":684}," orders.id),\n",[449,11211,11212,11215,11217,11219,11222],{"class":451,"line":4065},[449,11213,11214],{"class":684},"  menuItemId: ",[449,11216,53],{"class":721},[449,11218,725],{"class":684},[449,11220,11221],{"class":691},"\"menu_item_id\"",[449,11223,11185],{"class":684},[449,11225,11226,11228,11230],{"class":451,"line":4070},[449,11227,11190],{"class":684},[449,11229,10839],{"class":721},[449,11231,11195],{"class":684},[449,11233,11234,11236,11238,11240,11242],{"class":451,"line":4075},[449,11235,11190],{"class":684},[449,11237,11202],{"class":721},[449,11239,4717],{"class":684},[449,11241,1498],{"class":680},[449,11243,11244],{"class":684}," menuItems.id),\n",[449,11246,11247,11250,11252,11254,11257,11259,11261,11263,11265,11267,11269],{"class":451,"line":4081},[449,11248,11249],{"class":684},"  quantity: ",[449,11251,10903],{"class":721},[449,11253,725],{"class":684},[449,11255,11256],{"class":691},"\"quantity\"",[449,11258,374],{"class":684},[449,11260,10839],{"class":721},[449,11262,5237],{"class":684},[449,11264,10920],{"class":721},[449,11266,725],{"class":684},[449,11268,4798],{"class":714},[449,11270,1613],{"class":684},[449,11272,11273,11276,11278,11280,11283,11285,11287],{"class":451,"line":4086},[449,11274,11275],{"class":684},"  unitPrice: ",[449,11277,10862],{"class":721},[449,11279,725],{"class":684},[449,11281,11282],{"class":691},"\"unit_price\"",[449,11284,374],{"class":684},[449,11286,10839],{"class":721},[449,11288,1624],{"class":684},[449,11290,11291],{"class":451,"line":4092},[449,11292,784],{"class":684},[449,11294,11295],{"class":451,"line":4098},[449,11296,700],{"emptyLinePlaceholder":130},[449,11298,11299],{"class":451,"line":4104},[449,11300,11301],{"class":705},"\u002F\u002F Type exports for TypeScript\n",[449,11303,11304,11306,11309,11312,11314,11317],{"class":451,"line":4110},[449,11305,4629],{"class":680},[449,11307,11308],{"class":680}," type",[449,11310,11311],{"class":721}," MenuItem",[449,11313,718],{"class":680},[449,11315,11316],{"class":680}," typeof",[449,11318,11319],{"class":684}," menuItems.$inferSelect;\n",[449,11321,11322,11324,11326,11329,11331,11333],{"class":451,"line":5782},[449,11323,4629],{"class":680},[449,11325,11308],{"class":680},[449,11327,11328],{"class":721}," NewMenuItem",[449,11330,718],{"class":680},[449,11332,11316],{"class":680},[449,11334,11335],{"class":684}," menuItems.$inferInsert;\n",[449,11337,11338,11340,11342,11345,11347,11349],{"class":451,"line":5788},[449,11339,4629],{"class":680},[449,11341,11308],{"class":680},[449,11343,11344],{"class":721}," Order",[449,11346,718],{"class":680},[449,11348,11316],{"class":680},[449,11350,11351],{"class":684}," orders.$inferSelect;\n",[449,11353,11354,11356,11358,11361,11363,11365],{"class":451,"line":5794},[449,11355,4629],{"class":680},[449,11357,11308],{"class":680},[449,11359,11360],{"class":721}," NewOrder",[449,11362,718],{"class":680},[449,11364,11316],{"class":680},[449,11366,11367],{"class":684}," orders.$inferInsert;\n",[427,11369,11372],{"icon":11370,"title":11371},"🔑","Schema Best Practices",[21,11373,11374],{},"Always define your schema in TypeScript. Drizzle's type inference means your queries will be fully typed—no more guessing what fields exist on your models.",[73,11376],{},[32,11378,11380],{"id":11379},"step-4-initialize-the-database-connection","Step 4: Initialize the Database Connection",[21,11382,11383],{},"Create a database connection utility that Nitro can use.",[21,11385,4697,11386,3070],{},[40,11387,11388],{},"server\u002Fdb\u002Findex.ts",[48,11390,11392],{"className":670,"code":11391,"filename":11388,"language":673,"meta":56,"style":56},"import Database from \"better-sqlite3\";\nimport { drizzle } from \"drizzle-orm\u002Fbetter-sqlite3\";\nimport * as schema from \".\u002Fschema\";\n\nconst sqlite = new Database(\"brewstop.db\");\nexport const db = drizzle(sqlite, { schema });\n\n\u002F\u002F Initialize tables on startup\nexport function initializeDatabase() {\n  sqlite.exec(`\n    CREATE TABLE IF NOT EXISTS menu_items (\n      id TEXT PRIMARY KEY,\n      name TEXT NOT NULL,\n      description TEXT,\n      price REAL NOT NULL,\n      category TEXT NOT NULL,\n      available INTEGER DEFAULT 1,\n      created_at INTEGER DEFAULT (strftime('%s', 'now'))\n    );\n\n    CREATE TABLE IF NOT EXISTS orders (\n      id TEXT PRIMARY KEY,\n      status TEXT NOT NULL DEFAULT 'pending',\n      customer_name TEXT,\n      total REAL NOT NULL,\n      created_at INTEGER DEFAULT (strftime('%s', 'now')),\n      updated_at INTEGER DEFAULT (strftime('%s', 'now'))\n    );\n\n    CREATE TABLE IF NOT EXISTS order_items (\n      id TEXT PRIMARY KEY,\n      order_id TEXT NOT NULL,\n      menu_item_id TEXT NOT NULL,\n      quantity INTEGER DEFAULT 1,\n      unit_price REAL NOT NULL,\n      FOREIGN KEY (order_id) REFERENCES orders(id),\n      FOREIGN KEY (menu_item_id) REFERENCES menu_items(id)\n    );\n  `);\n\n  console.log(\"✅ Database initialized\");\n}\n",[40,11393,11394,11408,11422,11442,11446,11467,11484,11488,11493,11504,11517,11522,11527,11532,11537,11542,11547,11552,11557,11561,11565,11570,11574,11579,11584,11589,11594,11599,11603,11607,11612,11616,11621,11626,11631,11636,11641,11646,11650,11657,11661,11674],{"__ignoreMap":56},[449,11395,11396,11398,11401,11403,11406],{"class":451,"line":452},[449,11397,681],{"class":680},[449,11399,11400],{"class":684}," Database ",[449,11402,688],{"class":680},[449,11404,11405],{"class":691}," \"better-sqlite3\"",[449,11407,695],{"class":684},[449,11409,11410,11412,11415,11417,11420],{"class":451,"line":114},[449,11411,681],{"class":680},[449,11413,11414],{"class":684}," { drizzle } ",[449,11416,688],{"class":680},[449,11418,11419],{"class":691}," \"drizzle-orm\u002Fbetter-sqlite3\"",[449,11421,695],{"class":684},[449,11423,11424,11426,11429,11432,11435,11437,11440],{"class":451,"line":111},[449,11425,681],{"class":680},[449,11427,11428],{"class":714}," *",[449,11430,11431],{"class":680}," as",[449,11433,11434],{"class":684}," schema ",[449,11436,688],{"class":680},[449,11438,11439],{"class":691}," \".\u002Fschema\"",[449,11441,695],{"class":684},[449,11443,11444],{"class":451,"line":468},[449,11445,700],{"emptyLinePlaceholder":130},[449,11447,11448,11450,11453,11455,11457,11460,11462,11465],{"class":451,"line":474},[449,11449,711],{"class":680},[449,11451,11452],{"class":714}," sqlite",[449,11454,718],{"class":680},[449,11456,1343],{"class":680},[449,11458,11459],{"class":721}," Database",[449,11461,725],{"class":684},[449,11463,11464],{"class":691},"\"brewstop.db\"",[449,11466,740],{"class":684},[449,11468,11469,11471,11473,11476,11478,11481],{"class":451,"line":480},[449,11470,4629],{"class":680},[449,11472,10789],{"class":680},[449,11474,11475],{"class":714}," db",[449,11477,718],{"class":680},[449,11479,11480],{"class":721}," drizzle",[449,11482,11483],{"class":684},"(sqlite, { schema });\n",[449,11485,11486],{"class":451,"line":486},[449,11487,700],{"emptyLinePlaceholder":130},[449,11489,11490],{"class":451,"line":492},[449,11491,11492],{"class":705},"\u002F\u002F Initialize tables on startup\n",[449,11494,11495,11497,11499,11502],{"class":451,"line":498},[449,11496,4629],{"class":680},[449,11498,5433],{"class":680},[449,11500,11501],{"class":721}," initializeDatabase",[449,11503,5439],{"class":684},[449,11505,11506,11509,11512,11514],{"class":451,"line":133},[449,11507,11508],{"class":684},"  sqlite.",[449,11510,11511],{"class":721},"exec",[449,11513,725],{"class":684},[449,11515,11516],{"class":691},"`\n",[449,11518,11519],{"class":451,"line":509},[449,11520,11521],{"class":691},"    CREATE TABLE IF NOT EXISTS menu_items (\n",[449,11523,11524],{"class":451,"line":318},[449,11525,11526],{"class":691},"      id TEXT PRIMARY KEY,\n",[449,11528,11529],{"class":451,"line":520},[449,11530,11531],{"class":691},"      name TEXT NOT NULL,\n",[449,11533,11534],{"class":451,"line":526},[449,11535,11536],{"class":691},"      description TEXT,\n",[449,11538,11539],{"class":451,"line":532},[449,11540,11541],{"class":691},"      price REAL NOT NULL,\n",[449,11543,11544],{"class":451,"line":2790},[449,11545,11546],{"class":691},"      category TEXT NOT NULL,\n",[449,11548,11549],{"class":451,"line":3511},[449,11550,11551],{"class":691},"      available INTEGER DEFAULT 1,\n",[449,11553,11554],{"class":451,"line":3526},[449,11555,11556],{"class":691},"      created_at INTEGER DEFAULT (strftime('%s', 'now'))\n",[449,11558,11559],{"class":451,"line":3531},[449,11560,5791],{"class":691},[449,11562,11563],{"class":451,"line":3536},[449,11564,700],{"emptyLinePlaceholder":130},[449,11566,11567],{"class":451,"line":4009},[449,11568,11569],{"class":691},"    CREATE TABLE IF NOT EXISTS orders (\n",[449,11571,11572],{"class":451,"line":4015},[449,11573,11526],{"class":691},[449,11575,11576],{"class":451,"line":4021},[449,11577,11578],{"class":691},"      status TEXT NOT NULL DEFAULT 'pending',\n",[449,11580,11581],{"class":451,"line":4027},[449,11582,11583],{"class":691},"      customer_name TEXT,\n",[449,11585,11586],{"class":451,"line":4032},[449,11587,11588],{"class":691},"      total REAL NOT NULL,\n",[449,11590,11591],{"class":451,"line":4038},[449,11592,11593],{"class":691},"      created_at INTEGER DEFAULT (strftime('%s', 'now')),\n",[449,11595,11596],{"class":451,"line":4044},[449,11597,11598],{"class":691},"      updated_at INTEGER DEFAULT (strftime('%s', 'now'))\n",[449,11600,11601],{"class":451,"line":4049},[449,11602,5791],{"class":691},[449,11604,11605],{"class":451,"line":4054},[449,11606,700],{"emptyLinePlaceholder":130},[449,11608,11609],{"class":451,"line":4059},[449,11610,11611],{"class":691},"    CREATE TABLE IF NOT EXISTS order_items (\n",[449,11613,11614],{"class":451,"line":4065},[449,11615,11526],{"class":691},[449,11617,11618],{"class":451,"line":4070},[449,11619,11620],{"class":691},"      order_id TEXT NOT NULL,\n",[449,11622,11623],{"class":451,"line":4075},[449,11624,11625],{"class":691},"      menu_item_id TEXT NOT NULL,\n",[449,11627,11628],{"class":451,"line":4081},[449,11629,11630],{"class":691},"      quantity INTEGER DEFAULT 1,\n",[449,11632,11633],{"class":451,"line":4086},[449,11634,11635],{"class":691},"      unit_price REAL NOT NULL,\n",[449,11637,11638],{"class":451,"line":4092},[449,11639,11640],{"class":691},"      FOREIGN KEY (order_id) REFERENCES orders(id),\n",[449,11642,11643],{"class":451,"line":4098},[449,11644,11645],{"class":691},"      FOREIGN KEY (menu_item_id) REFERENCES menu_items(id)\n",[449,11647,11648],{"class":451,"line":4104},[449,11649,5791],{"class":691},[449,11651,11652,11655],{"class":451,"line":4110},[449,11653,11654],{"class":691},"  `",[449,11656,740],{"class":684},[449,11658,11659],{"class":451,"line":5782},[449,11660,700],{"emptyLinePlaceholder":130},[449,11662,11663,11665,11667,11669,11672],{"class":451,"line":5788},[449,11664,5444],{"class":684},[449,11666,1675],{"class":721},[449,11668,725],{"class":684},[449,11670,11671],{"class":691},"\"✅ Database initialized\"",[449,11673,740],{"class":684},[449,11675,11676],{"class":451,"line":5794},[449,11677,4604],{"class":684},[73,11679],{},[32,11681,11683],{"id":11682},"step-5-seed-some-data","Step 5: Seed Some Data",[21,11685,11686],{},"Let's add an endpoint to populate our menu with sample data.",[21,11688,4697,11689,3070],{},[40,11690,11691],{},"server\u002Fapi\u002Fseed.post.ts",[48,11693,11695],{"className":670,"code":11694,"filename":11691,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { menuItems } from \"..\u002Fdb\u002Fschema\";\n\nconst defaultMenuItems = [\n  {\n    id: \"latte\",\n    name: \"Latte\",\n    description: \"Smooth espresso with steamed milk\",\n    price: 4.5,\n    category: \"coffee\",\n  },\n  {\n    id: \"espresso\",\n    name: \"Espresso\",\n    description: \"Rich, bold espresso shot\",\n    price: 3.0,\n    category: \"coffee\",\n  },\n  {\n    id: \"americano\",\n    name: \"Americano\",\n    description: \"Espresso with hot water\",\n    price: 3.5,\n    category: \"coffee\",\n  },\n  {\n    id: \"cappuccino\",\n    name: \"Cappuccino\",\n    description: \"Espresso with equal parts milk foam\",\n    price: 4.5,\n    category: \"coffee\",\n  },\n  {\n    id: \"chai\",\n    name: \"Chai Tea\",\n    description: \"Spiced black tea with milk\",\n    price: 4.0,\n    category: \"tea\",\n  },\n  {\n    id: \"green-tea\",\n    name: \"Green Tea\",\n    description: \"Organic Japanese green tea\",\n    price: 3.5,\n    category: \"tea\",\n  },\n  {\n    id: \"croissant\",\n    name: \"Croissant\",\n    description: \"Buttery French pastry\",\n    price: 3.5,\n    category: \"food\",\n  },\n  {\n    id: \"muffin\",\n    name: \"Blueberry Muffin\",\n    description: \"Freshly baked muffin\",\n    price: 3.0,\n    category: \"food\",\n  },\n  {\n    id: \"bagel\",\n    name: \"Bagel with Cream Cheese\",\n    description: \"Toasted bagel with cream cheese\",\n    price: 4.0,\n    category: \"food\",\n  },\n];\n\nexport default defineEventHandler(async () => {\n  \u002F\u002F Clear existing menu items\n  await db.delete(menuItems).run();\n\n  \u002F\u002F Insert default items\n  for (const item of defaultMenuItems) {\n    await db.insert(menuItems).values({\n      ...item,\n      available: true,\n    });\n  }\n\n  return { message: \"Menu seeded successfully\", count: defaultMenuItems.length };\n});\n",[40,11696,11697,11711,11725,11729,11740,11745,11755,11764,11774,11783,11792,11796,11800,11809,11817,11826,11834,11842,11846,11850,11859,11868,11877,11885,11893,11897,11901,11910,11919,11928,11936,11944,11948,11952,11961,11969,11978,11986,11994,11998,12002,12011,12020,12029,12037,12045,12049,12053,12062,12070,12079,12087,12095,12099,12103,12112,12122,12132,12141,12150,12155,12160,12170,12180,12190,12199,12208,12213,12218,12223,12242,12248,12267,12272,12278,12296,12314,12323,12333,12338,12343,12348,12366],{"__ignoreMap":56},[449,11698,11699,11701,11704,11706,11709],{"class":451,"line":452},[449,11700,681],{"class":680},[449,11702,11703],{"class":684}," { db } ",[449,11705,688],{"class":680},[449,11707,11708],{"class":691}," \"..\u002Fdb\"",[449,11710,695],{"class":684},[449,11712,11713,11715,11718,11720,11723],{"class":451,"line":114},[449,11714,681],{"class":680},[449,11716,11717],{"class":684}," { menuItems } ",[449,11719,688],{"class":680},[449,11721,11722],{"class":691}," \"..\u002Fdb\u002Fschema\"",[449,11724,695],{"class":684},[449,11726,11727],{"class":451,"line":111},[449,11728,700],{"emptyLinePlaceholder":130},[449,11730,11731,11733,11736,11738],{"class":451,"line":468},[449,11732,711],{"class":680},[449,11734,11735],{"class":714}," defaultMenuItems",[449,11737,718],{"class":680},[449,11739,4790],{"class":684},[449,11741,11742],{"class":451,"line":474},[449,11743,11744],{"class":684},"  {\n",[449,11746,11747,11750,11753],{"class":451,"line":480},[449,11748,11749],{"class":684},"    id: ",[449,11751,11752],{"class":691},"\"latte\"",[449,11754,779],{"class":684},[449,11756,11757,11760,11762],{"class":451,"line":486},[449,11758,11759],{"class":684},"    name: ",[449,11761,4804],{"class":691},[449,11763,779],{"class":684},[449,11765,11766,11769,11772],{"class":451,"line":492},[449,11767,11768],{"class":684},"    description: ",[449,11770,11771],{"class":691},"\"Smooth espresso with steamed milk\"",[449,11773,779],{"class":684},[449,11775,11776,11779,11781],{"class":451,"line":498},[449,11777,11778],{"class":684},"    price: ",[449,11780,4810],{"class":714},[449,11782,779],{"class":684},[449,11784,11785,11788,11790],{"class":451,"line":133},[449,11786,11787],{"class":684},"    category: ",[449,11789,4816],{"class":691},[449,11791,779],{"class":684},[449,11793,11794],{"class":451,"line":509},[449,11795,1474],{"class":684},[449,11797,11798],{"class":451,"line":318},[449,11799,11744],{"class":684},[449,11801,11802,11804,11807],{"class":451,"line":520},[449,11803,11749],{"class":684},[449,11805,11806],{"class":691},"\"espresso\"",[449,11808,779],{"class":684},[449,11810,11811,11813,11815],{"class":451,"line":526},[449,11812,11759],{"class":684},[449,11814,4831],{"class":691},[449,11816,779],{"class":684},[449,11818,11819,11821,11824],{"class":451,"line":532},[449,11820,11768],{"class":684},[449,11822,11823],{"class":691},"\"Rich, bold espresso shot\"",[449,11825,779],{"class":684},[449,11827,11828,11830,11832],{"class":451,"line":2790},[449,11829,11778],{"class":684},[449,11831,4836],{"class":714},[449,11833,779],{"class":684},[449,11835,11836,11838,11840],{"class":451,"line":3511},[449,11837,11787],{"class":684},[449,11839,4816],{"class":691},[449,11841,779],{"class":684},[449,11843,11844],{"class":451,"line":3526},[449,11845,1474],{"class":684},[449,11847,11848],{"class":451,"line":3531},[449,11849,11744],{"class":684},[449,11851,11852,11854,11857],{"class":451,"line":3536},[449,11853,11749],{"class":684},[449,11855,11856],{"class":691},"\"americano\"",[449,11858,779],{"class":684},[449,11860,11861,11863,11866],{"class":451,"line":4009},[449,11862,11759],{"class":684},[449,11864,11865],{"class":691},"\"Americano\"",[449,11867,779],{"class":684},[449,11869,11870,11872,11875],{"class":451,"line":4015},[449,11871,11768],{"class":684},[449,11873,11874],{"class":691},"\"Espresso with hot water\"",[449,11876,779],{"class":684},[449,11878,11879,11881,11883],{"class":451,"line":4021},[449,11880,11778],{"class":684},[449,11882,4859],{"class":714},[449,11884,779],{"class":684},[449,11886,11887,11889,11891],{"class":451,"line":4027},[449,11888,11787],{"class":684},[449,11890,4816],{"class":691},[449,11892,779],{"class":684},[449,11894,11895],{"class":451,"line":4032},[449,11896,1474],{"class":684},[449,11898,11899],{"class":451,"line":4038},[449,11900,11744],{"class":684},[449,11902,11903,11905,11908],{"class":451,"line":4044},[449,11904,11749],{"class":684},[449,11906,11907],{"class":691},"\"cappuccino\"",[449,11909,779],{"class":684},[449,11911,11912,11914,11917],{"class":451,"line":4049},[449,11913,11759],{"class":684},[449,11915,11916],{"class":691},"\"Cappuccino\"",[449,11918,779],{"class":684},[449,11920,11921,11923,11926],{"class":451,"line":4054},[449,11922,11768],{"class":684},[449,11924,11925],{"class":691},"\"Espresso with equal parts milk foam\"",[449,11927,779],{"class":684},[449,11929,11930,11932,11934],{"class":451,"line":4059},[449,11931,11778],{"class":684},[449,11933,4810],{"class":714},[449,11935,779],{"class":684},[449,11937,11938,11940,11942],{"class":451,"line":4065},[449,11939,11787],{"class":684},[449,11941,4816],{"class":691},[449,11943,779],{"class":684},[449,11945,11946],{"class":451,"line":4070},[449,11947,1474],{"class":684},[449,11949,11950],{"class":451,"line":4075},[449,11951,11744],{"class":684},[449,11953,11954,11956,11959],{"class":451,"line":4081},[449,11955,11749],{"class":684},[449,11957,11958],{"class":691},"\"chai\"",[449,11960,779],{"class":684},[449,11962,11963,11965,11967],{"class":451,"line":4086},[449,11964,11759],{"class":684},[449,11966,4878],{"class":691},[449,11968,779],{"class":684},[449,11970,11971,11973,11976],{"class":451,"line":4092},[449,11972,11768],{"class":684},[449,11974,11975],{"class":691},"\"Spiced black tea with milk\"",[449,11977,779],{"class":684},[449,11979,11980,11982,11984],{"class":451,"line":4098},[449,11981,11778],{"class":684},[449,11983,4883],{"class":714},[449,11985,779],{"class":684},[449,11987,11988,11990,11992],{"class":451,"line":4104},[449,11989,11787],{"class":684},[449,11991,4888],{"class":691},[449,11993,779],{"class":684},[449,11995,11996],{"class":451,"line":4110},[449,11997,1474],{"class":684},[449,11999,12000],{"class":451,"line":5782},[449,12001,11744],{"class":684},[449,12003,12004,12006,12009],{"class":451,"line":5788},[449,12005,11749],{"class":684},[449,12007,12008],{"class":691},"\"green-tea\"",[449,12010,779],{"class":684},[449,12012,12013,12015,12018],{"class":451,"line":5794},[449,12014,11759],{"class":684},[449,12016,12017],{"class":691},"\"Green Tea\"",[449,12019,779],{"class":684},[449,12021,12022,12024,12027],{"class":451,"line":5799},[449,12023,11768],{"class":684},[449,12025,12026],{"class":691},"\"Organic Japanese green tea\"",[449,12028,779],{"class":684},[449,12030,12031,12033,12035],{"class":451,"line":5804},[449,12032,11778],{"class":684},[449,12034,4859],{"class":714},[449,12036,779],{"class":684},[449,12038,12039,12041,12043],{"class":451,"line":5819},[449,12040,11787],{"class":684},[449,12042,4888],{"class":691},[449,12044,779],{"class":684},[449,12046,12047],{"class":451,"line":5824},[449,12048,1474],{"class":684},[449,12050,12051],{"class":451,"line":5846},[449,12052,11744],{"class":684},[449,12054,12055,12057,12060],{"class":451,"line":5880},[449,12056,11749],{"class":684},[449,12058,12059],{"class":691},"\"croissant\"",[449,12061,779],{"class":684},[449,12063,12064,12066,12068],{"class":451,"line":5885},[449,12065,11759],{"class":684},[449,12067,4854],{"class":691},[449,12069,779],{"class":684},[449,12071,12072,12074,12077],{"class":451,"line":5899},[449,12073,11768],{"class":684},[449,12075,12076],{"class":691},"\"Buttery French pastry\"",[449,12078,779],{"class":684},[449,12080,12081,12083,12085],{"class":451,"line":5919},[449,12082,11778],{"class":684},[449,12084,4859],{"class":714},[449,12086,779],{"class":684},[449,12088,12089,12091,12093],{"class":451,"line":5938},[449,12090,11787],{"class":684},[449,12092,4864],{"class":691},[449,12094,779],{"class":684},[449,12096,12097],{"class":451,"line":5973},[449,12098,1474],{"class":684},[449,12100,12101],{"class":451,"line":5978},[449,12102,11744],{"class":684},[449,12104,12105,12107,12110],{"class":451,"line":5983},[449,12106,11749],{"class":684},[449,12108,12109],{"class":691},"\"muffin\"",[449,12111,779],{"class":684},[449,12113,12115,12117,12120],{"class":451,"line":12114},56,[449,12116,11759],{"class":684},[449,12118,12119],{"class":691},"\"Blueberry Muffin\"",[449,12121,779],{"class":684},[449,12123,12125,12127,12130],{"class":451,"line":12124},57,[449,12126,11768],{"class":684},[449,12128,12129],{"class":691},"\"Freshly baked muffin\"",[449,12131,779],{"class":684},[449,12133,12135,12137,12139],{"class":451,"line":12134},58,[449,12136,11778],{"class":684},[449,12138,4836],{"class":714},[449,12140,779],{"class":684},[449,12142,12144,12146,12148],{"class":451,"line":12143},59,[449,12145,11787],{"class":684},[449,12147,4864],{"class":691},[449,12149,779],{"class":684},[449,12151,12153],{"class":451,"line":12152},60,[449,12154,1474],{"class":684},[449,12156,12158],{"class":451,"line":12157},61,[449,12159,11744],{"class":684},[449,12161,12163,12165,12168],{"class":451,"line":12162},62,[449,12164,11749],{"class":684},[449,12166,12167],{"class":691},"\"bagel\"",[449,12169,779],{"class":684},[449,12171,12173,12175,12178],{"class":451,"line":12172},63,[449,12174,11759],{"class":684},[449,12176,12177],{"class":691},"\"Bagel with Cream Cheese\"",[449,12179,779],{"class":684},[449,12181,12183,12185,12188],{"class":451,"line":12182},64,[449,12184,11768],{"class":684},[449,12186,12187],{"class":691},"\"Toasted bagel with cream cheese\"",[449,12189,779],{"class":684},[449,12191,12193,12195,12197],{"class":451,"line":12192},65,[449,12194,11778],{"class":684},[449,12196,4883],{"class":714},[449,12198,779],{"class":684},[449,12200,12202,12204,12206],{"class":451,"line":12201},66,[449,12203,11787],{"class":684},[449,12205,4864],{"class":691},[449,12207,779],{"class":684},[449,12209,12211],{"class":451,"line":12210},67,[449,12212,1474],{"class":684},[449,12214,12216],{"class":451,"line":12215},68,[449,12217,4917],{"class":684},[449,12219,12221],{"class":451,"line":12220},69,[449,12222,700],{"emptyLinePlaceholder":130},[449,12224,12226,12228,12230,12232,12234,12236,12238,12240],{"class":451,"line":12225},70,[449,12227,4629],{"class":680},[449,12229,4632],{"class":680},[449,12231,4714],{"class":721},[449,12233,725],{"class":684},[449,12235,1485],{"class":680},[449,12237,2090],{"class":684},[449,12239,1498],{"class":680},[449,12241,1501],{"class":684},[449,12243,12245],{"class":451,"line":12244},71,[449,12246,12247],{"class":705},"  \u002F\u002F Clear existing menu items\n",[449,12249,12251,12253,12256,12259,12262,12265],{"class":451,"line":12250},72,[449,12252,2099],{"class":680},[449,12254,12255],{"class":684}," db.",[449,12257,12258],{"class":721},"delete",[449,12260,12261],{"class":684},"(menuItems).",[449,12263,12264],{"class":721},"run",[449,12266,1322],{"class":684},[449,12268,12270],{"class":451,"line":12269},73,[449,12271,700],{"emptyLinePlaceholder":130},[449,12273,12275],{"class":451,"line":12274},74,[449,12276,12277],{"class":705},"  \u002F\u002F Insert default items\n",[449,12279,12281,12283,12285,12287,12290,12293],{"class":451,"line":12280},75,[449,12282,5529],{"class":680},[449,12284,1913],{"class":684},[449,12286,711],{"class":680},[449,12288,12289],{"class":714}," item",[449,12291,12292],{"class":680}," of",[449,12294,12295],{"class":684}," defaultMenuItems) {\n",[449,12297,12299,12302,12304,12307,12309,12312],{"class":451,"line":12298},76,[449,12300,12301],{"class":680},"    await",[449,12303,12255],{"class":684},[449,12305,12306],{"class":721},"insert",[449,12308,12261],{"class":684},[449,12310,12311],{"class":721},"values",[449,12313,1391],{"class":684},[449,12315,12317,12320],{"class":451,"line":12316},77,[449,12318,12319],{"class":680},"      ...",[449,12321,12322],{"class":684},"item,\n",[449,12324,12326,12329,12331],{"class":451,"line":12325},78,[449,12327,12328],{"class":684},"      available: ",[449,12330,2169],{"class":714},[449,12332,779],{"class":684},[449,12334,12336],{"class":451,"line":12335},79,[449,12337,3484],{"class":684},[449,12339,12341],{"class":451,"line":12340},80,[449,12342,4599],{"class":684},[449,12344,12346],{"class":451,"line":12345},81,[449,12347,700],{"emptyLinePlaceholder":130},[449,12349,12351,12353,12356,12359,12362,12364],{"class":451,"line":12350},82,[449,12352,4726],{"class":680},[449,12354,12355],{"class":684}," { message: ",[449,12357,12358],{"class":691},"\"Menu seeded successfully\"",[449,12360,12361],{"class":684},", count: defaultMenuItems.",[449,12363,5097],{"class":714},[449,12365,1520],{"class":684},[449,12367,12369],{"class":451,"line":12368},83,[449,12370,784],{"class":684},[73,12372],{},[32,12374,12376],{"id":12375},"step-6-create-api-endpoints","Step 6: Create API Endpoints",[2808,12378,12380],{"id":12379},"get-menu","Get Menu",[21,12382,4697,12383,3070],{},[40,12384,12385],{},"server\u002Fapi\u002Fmenu.get.ts",[48,12387,12389],{"className":670,"code":12388,"filename":12385,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { menuItems } from \"..\u002Fdb\u002Fschema\";\n\nexport default defineEventHandler(async () => {\n  const items = await db.select().from(menuItems).where(menuItems.available);\n  return { items };\n});\n",[40,12390,12391,12403,12415,12419,12437,12465,12472],{"__ignoreMap":56},[449,12392,12393,12395,12397,12399,12401],{"class":451,"line":452},[449,12394,681],{"class":680},[449,12396,11703],{"class":684},[449,12398,688],{"class":680},[449,12400,11708],{"class":691},[449,12402,695],{"class":684},[449,12404,12405,12407,12409,12411,12413],{"class":451,"line":114},[449,12406,681],{"class":680},[449,12408,11717],{"class":684},[449,12410,688],{"class":680},[449,12412,11722],{"class":691},[449,12414,695],{"class":684},[449,12416,12417],{"class":451,"line":111},[449,12418,700],{"emptyLinePlaceholder":130},[449,12420,12421,12423,12425,12427,12429,12431,12433,12435],{"class":451,"line":468},[449,12422,4629],{"class":680},[449,12424,4632],{"class":680},[449,12426,4714],{"class":721},[449,12428,725],{"class":684},[449,12430,1485],{"class":680},[449,12432,2090],{"class":684},[449,12434,1498],{"class":680},[449,12436,1501],{"class":684},[449,12438,12439,12441,12444,12446,12448,12450,12453,12455,12457,12459,12462],{"class":451,"line":474},[449,12440,5048],{"class":680},[449,12442,12443],{"class":714}," items",[449,12445,718],{"class":680},[449,12447,1654],{"class":680},[449,12449,12255],{"class":684},[449,12451,12452],{"class":721},"select",[449,12454,5237],{"class":684},[449,12456,688],{"class":721},[449,12458,12261],{"class":684},[449,12460,12461],{"class":721},"where",[449,12463,12464],{"class":684},"(menuItems.available);\n",[449,12466,12467,12469],{"class":451,"line":480},[449,12468,4726],{"class":680},[449,12470,12471],{"class":684}," { items };\n",[449,12473,12474],{"class":451,"line":486},[449,12475,784],{"class":684},[2808,12477,12479],{"id":12478},"get-single-menu-item","Get Single Menu Item",[21,12481,4697,12482,3070],{},[40,12483,12484],{},"server\u002Fapi\u002Fmenu\u002F[id].get.ts",[48,12486,12488],{"className":670,"code":12487,"filename":12484,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { menuItems } from \"..\u002Fdb\u002Fschema\";\n\nexport default defineEventHandler(async (event) => {\n  const id = getRouterParam(event, \"id\");\n\n  if (!id) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Menu item ID is required\",\n    });\n  }\n\n  const item = await db.select().from(menuItems).where(menuItems.id.equals(id)).get();\n\n  if (!item) {\n    throw createError({\n      statusCode: 404,\n      statusMessage: \"Menu item not found\",\n    });\n  }\n\n  return item;\n});\n",[40,12489,12490,12502,12514,12518,12540,12559,12563,12574,12582,12590,12599,12603,12607,12611,12647,12651,12662,12670,12679,12688,12692,12696,12700,12707],{"__ignoreMap":56},[449,12491,12492,12494,12496,12498,12500],{"class":451,"line":452},[449,12493,681],{"class":680},[449,12495,11703],{"class":684},[449,12497,688],{"class":680},[449,12499,11708],{"class":691},[449,12501,695],{"class":684},[449,12503,12504,12506,12508,12510,12512],{"class":451,"line":114},[449,12505,681],{"class":680},[449,12507,11717],{"class":684},[449,12509,688],{"class":680},[449,12511,11722],{"class":691},[449,12513,695],{"class":684},[449,12515,12516],{"class":451,"line":111},[449,12517,700],{"emptyLinePlaceholder":130},[449,12519,12520,12522,12524,12526,12528,12530,12532,12534,12536,12538],{"class":451,"line":468},[449,12521,4629],{"class":680},[449,12523,4632],{"class":680},[449,12525,4714],{"class":721},[449,12527,725],{"class":684},[449,12529,1485],{"class":680},[449,12531,1913],{"class":684},[449,12533,2991],{"class":1491},[449,12535,1758],{"class":684},[449,12537,1498],{"class":680},[449,12539,1501],{"class":684},[449,12541,12542,12544,12547,12549,12552,12555,12557],{"class":451,"line":474},[449,12543,5048],{"class":680},[449,12545,12546],{"class":714}," id",[449,12548,718],{"class":680},[449,12550,12551],{"class":721}," getRouterParam",[449,12553,12554],{"class":684},"(event, ",[449,12556,10816],{"class":691},[449,12558,740],{"class":684},[449,12560,12561],{"class":451,"line":480},[449,12562,700],{"emptyLinePlaceholder":130},[449,12564,12565,12567,12569,12571],{"class":451,"line":486},[449,12566,5080],{"class":680},[449,12568,1913],{"class":684},[449,12570,5085],{"class":680},[449,12572,12573],{"class":684},"id) {\n",[449,12575,12576,12578,12580],{"class":451,"line":492},[449,12577,5110],{"class":680},[449,12579,5113],{"class":721},[449,12581,1391],{"class":684},[449,12583,12584,12586,12588],{"class":451,"line":498},[449,12585,5120],{"class":684},[449,12587,5123],{"class":714},[449,12589,779],{"class":684},[449,12591,12592,12594,12597],{"class":451,"line":133},[449,12593,5130],{"class":684},[449,12595,12596],{"class":691},"\"Menu item ID is required\"",[449,12598,779],{"class":684},[449,12600,12601],{"class":451,"line":509},[449,12602,3484],{"class":684},[449,12604,12605],{"class":451,"line":318},[449,12606,4599],{"class":684},[449,12608,12609],{"class":451,"line":520},[449,12610,700],{"emptyLinePlaceholder":130},[449,12612,12613,12615,12617,12619,12621,12623,12625,12627,12629,12631,12633,12636,12639,12642,12645],{"class":451,"line":526},[449,12614,5048],{"class":680},[449,12616,12289],{"class":714},[449,12618,718],{"class":680},[449,12620,1654],{"class":680},[449,12622,12255],{"class":684},[449,12624,12452],{"class":721},[449,12626,5237],{"class":684},[449,12628,688],{"class":721},[449,12630,12261],{"class":684},[449,12632,12461],{"class":721},[449,12634,12635],{"class":684},"(menuItems.id.",[449,12637,12638],{"class":721},"equals",[449,12640,12641],{"class":684},"(id)).",[449,12643,12644],{"class":721},"get",[449,12646,1322],{"class":684},[449,12648,12649],{"class":451,"line":532},[449,12650,700],{"emptyLinePlaceholder":130},[449,12652,12653,12655,12657,12659],{"class":451,"line":2790},[449,12654,5080],{"class":680},[449,12656,1913],{"class":684},[449,12658,5085],{"class":680},[449,12660,12661],{"class":684},"item) {\n",[449,12663,12664,12666,12668],{"class":451,"line":3511},[449,12665,5110],{"class":680},[449,12667,5113],{"class":721},[449,12669,1391],{"class":684},[449,12671,12672,12674,12677],{"class":451,"line":3526},[449,12673,5120],{"class":684},[449,12675,12676],{"class":714},"404",[449,12678,779],{"class":684},[449,12680,12681,12683,12686],{"class":451,"line":3531},[449,12682,5130],{"class":684},[449,12684,12685],{"class":691},"\"Menu item not found\"",[449,12687,779],{"class":684},[449,12689,12690],{"class":451,"line":3536},[449,12691,3484],{"class":684},[449,12693,12694],{"class":451,"line":4009},[449,12695,4599],{"class":684},[449,12697,12698],{"class":451,"line":4015},[449,12699,700],{"emptyLinePlaceholder":130},[449,12701,12702,12704],{"class":451,"line":4021},[449,12703,4726],{"class":680},[449,12705,12706],{"class":684}," item;\n",[449,12708,12709],{"class":451,"line":4027},[449,12710,784],{"class":684},[2808,12712,12714],{"id":12713},"create-order","Create Order",[21,12716,12717],{},"This is where Drizzle really shines—let's create a proper order with related items.",[21,12719,4697,12720,3070],{},[40,12721,4953],{},[48,12723,12725],{"className":670,"code":12724,"filename":4953,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { orders, orderItems, menuItems } from \"..\u002Fdb\u002Fschema\";\nimport { eq } from \"drizzle-orm\";\n\ninterface OrderItemInput {\n  menuItemId: string;\n  quantity: number;\n}\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n\n  \u002F\u002F Validate input\n  if (!body.items || !Array.isArray(body.items) || body.items.length === 0) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Order must contain at least one item\",\n    });\n  }\n\n  \u002F\u002F Calculate total and fetch menu item prices\n  let total = 0;\n  const orderItemInputs: OrderItemInput[] = [];\n\n  for (const item of body.items) {\n    const menuItem = await db\n      .select()\n      .from(menuItems)\n      .where(eq(menuItems.id, item.menuItemId))\n      .get();\n\n    if (!menuItem) {\n      throw createError({\n        statusCode: 400,\n        statusMessage: `Menu item ${item.menuItemId} not found`,\n      });\n    }\n\n    if (!menuItem.available) {\n      throw createError({\n        statusCode: 400,\n        statusMessage: `Menu item ${menuItem.name} is not available`,\n      });\n    }\n\n    total += menuItem.price * item.quantity;\n    orderItemInputs.push({\n      menuItemId: item.menuItemId,\n      quantity: item.quantity,\n    });\n  }\n\n  \u002F\u002F Create the order\n  const orderId = crypto.randomUUID();\n  const now = Date.now();\n\n  await db.insert(orders).values({\n    id: orderId,\n    customerName: body.customerName || \"Guest\",\n    status: \"pending\",\n    total,\n    createdAt: new Date(now),\n    updatedAt: new Date(now),\n  });\n\n  \u002F\u002F Create order items\n  for (const input of orderItemInputs) {\n    const menuItem = await db\n      .select()\n      .from(menuItems)\n      .where(eq(menuItems.id, input.menuItemId))\n      .get();\n\n    await db.insert(orderItems).values({\n      id: crypto.randomUUID(),\n      orderId,\n      menuItemId: input.menuItemId,\n      quantity: input.quantity,\n      unitPrice: menuItem!.price,\n    });\n  }\n\n  \u002F\u002F Fetch the complete order\n  const createdOrder = await db.select().from(orders).where(eq(orders.id, orderId)).get();\n\n  const items = await db.select().from(orderItems).where(eq(orderItems.orderId, orderId));\n\n  return {\n    ...createdOrder,\n    items,\n  };\n});\n",[40,12726,12727,12739,12752,12765,12769,12778,12789,12799,12803,12807,12829,12844,12848,12853,12891,12899,12907,12915,12919,12923,12927,12932,12945,12962,12966,12981,12996,13005,13014,13028,13036,13040,13052,13061,13070,13091,13096,13100,13104,13115,13123,13131,13150,13154,13158,13162,13179,13188,13193,13198,13202,13206,13210,13215,13231,13246,13250,13265,13270,13282,13290,13295,13306,13317,13322,13326,13331,13347,13359,13367,13375,13388,13396,13400,13415,13424,13429,13434,13439,13449,13453,13457,13461,13466,13501,13506,13536,13541,13548,13557,13563,13568],{"__ignoreMap":56},[449,12728,12729,12731,12733,12735,12737],{"class":451,"line":452},[449,12730,681],{"class":680},[449,12732,11703],{"class":684},[449,12734,688],{"class":680},[449,12736,11708],{"class":691},[449,12738,695],{"class":684},[449,12740,12741,12743,12746,12748,12750],{"class":451,"line":114},[449,12742,681],{"class":680},[449,12744,12745],{"class":684}," { orders, orderItems, menuItems } ",[449,12747,688],{"class":680},[449,12749,11722],{"class":691},[449,12751,695],{"class":684},[449,12753,12754,12756,12759,12761,12763],{"class":451,"line":111},[449,12755,681],{"class":680},[449,12757,12758],{"class":684}," { eq } ",[449,12760,688],{"class":680},[449,12762,10771],{"class":691},[449,12764,695],{"class":684},[449,12766,12767],{"class":451,"line":468},[449,12768,700],{"emptyLinePlaceholder":130},[449,12770,12771,12773,12776],{"class":451,"line":474},[449,12772,4960],{"class":680},[449,12774,12775],{"class":721}," OrderItemInput",[449,12777,1501],{"class":684},[449,12779,12780,12783,12785,12787],{"class":451,"line":480},[449,12781,12782],{"class":1491},"  menuItemId",[449,12784,3070],{"class":680},[449,12786,6081],{"class":714},[449,12788,695],{"class":684},[449,12790,12791,12793,12795,12797],{"class":451,"line":486},[449,12792,4982],{"class":1491},[449,12794,3070],{"class":680},[449,12796,4975],{"class":714},[449,12798,695],{"class":684},[449,12800,12801],{"class":451,"line":492},[449,12802,4604],{"class":684},[449,12804,12805],{"class":451,"line":498},[449,12806,700],{"emptyLinePlaceholder":130},[449,12808,12809,12811,12813,12815,12817,12819,12821,12823,12825,12827],{"class":451,"line":133},[449,12810,4629],{"class":680},[449,12812,4632],{"class":680},[449,12814,4714],{"class":721},[449,12816,725],{"class":684},[449,12818,1485],{"class":680},[449,12820,1913],{"class":684},[449,12822,2991],{"class":1491},[449,12824,1758],{"class":684},[449,12826,1498],{"class":680},[449,12828,1501],{"class":684},[449,12830,12831,12833,12835,12837,12839,12841],{"class":451,"line":509},[449,12832,5048],{"class":680},[449,12834,5051],{"class":714},[449,12836,718],{"class":680},[449,12838,1654],{"class":680},[449,12840,5060],{"class":721},[449,12842,12843],{"class":684},"(event);\n",[449,12845,12846],{"class":451,"line":318},[449,12847,700],{"emptyLinePlaceholder":130},[449,12849,12850],{"class":451,"line":520},[449,12851,12852],{"class":705},"  \u002F\u002F Validate input\n",[449,12854,12855,12857,12859,12861,12864,12866,12869,12872,12875,12878,12880,12883,12885,12887,12889],{"class":451,"line":526},[449,12856,5080],{"class":680},[449,12858,1913],{"class":684},[449,12860,5085],{"class":680},[449,12862,12863],{"class":684},"body.items ",[449,12865,5091],{"class":680},[449,12867,12868],{"class":680}," !",[449,12870,12871],{"class":684},"Array.",[449,12873,12874],{"class":721},"isArray",[449,12876,12877],{"class":684},"(body.items) ",[449,12879,5091],{"class":680},[449,12881,12882],{"class":684}," body.items.",[449,12884,5097],{"class":714},[449,12886,5100],{"class":680},[449,12888,5103],{"class":714},[449,12890,3417],{"class":684},[449,12892,12893,12895,12897],{"class":451,"line":532},[449,12894,5110],{"class":680},[449,12896,5113],{"class":721},[449,12898,1391],{"class":684},[449,12900,12901,12903,12905],{"class":451,"line":2790},[449,12902,5120],{"class":684},[449,12904,5123],{"class":714},[449,12906,779],{"class":684},[449,12908,12909,12911,12913],{"class":451,"line":3511},[449,12910,5130],{"class":684},[449,12912,5133],{"class":691},[449,12914,779],{"class":684},[449,12916,12917],{"class":451,"line":3526},[449,12918,3484],{"class":684},[449,12920,12921],{"class":451,"line":3531},[449,12922,4599],{"class":684},[449,12924,12925],{"class":451,"line":3536},[449,12926,700],{"emptyLinePlaceholder":130},[449,12928,12929],{"class":451,"line":4009},[449,12930,12931],{"class":705},"  \u002F\u002F Calculate total and fetch menu item prices\n",[449,12933,12934,12936,12939,12941,12943],{"class":451,"line":4015},[449,12935,5496],{"class":680},[449,12937,12938],{"class":684}," total ",[449,12940,5014],{"class":680},[449,12942,5103],{"class":714},[449,12944,695],{"class":684},[449,12946,12947,12949,12952,12954,12956,12958,12960],{"class":451,"line":4021},[449,12948,5048],{"class":680},[449,12950,12951],{"class":714}," orderItemInputs",[449,12953,3070],{"class":680},[449,12955,12775],{"class":721},[449,12957,5011],{"class":684},[449,12959,5014],{"class":680},[449,12961,5017],{"class":684},[449,12963,12964],{"class":451,"line":4027},[449,12965,700],{"emptyLinePlaceholder":130},[449,12967,12968,12970,12972,12974,12976,12978],{"class":451,"line":4032},[449,12969,5529],{"class":680},[449,12971,1913],{"class":684},[449,12973,711],{"class":680},[449,12975,12289],{"class":714},[449,12977,12292],{"class":680},[449,12979,12980],{"class":684}," body.items) {\n",[449,12982,12983,12986,12989,12991,12993],{"class":451,"line":4038},[449,12984,12985],{"class":680},"    const",[449,12987,12988],{"class":714}," menuItem",[449,12990,718],{"class":680},[449,12992,1654],{"class":680},[449,12994,12995],{"class":684}," db\n",[449,12997,12998,13001,13003],{"class":451,"line":4044},[449,12999,13000],{"class":684},"      .",[449,13002,12452],{"class":721},[449,13004,11195],{"class":684},[449,13006,13007,13009,13011],{"class":451,"line":4049},[449,13008,13000],{"class":684},[449,13010,688],{"class":721},[449,13012,13013],{"class":684},"(menuItems)\n",[449,13015,13016,13018,13020,13022,13025],{"class":451,"line":4054},[449,13017,13000],{"class":684},[449,13019,12461],{"class":721},[449,13021,725],{"class":684},[449,13023,13024],{"class":721},"eq",[449,13026,13027],{"class":684},"(menuItems.id, item.menuItemId))\n",[449,13029,13030,13032,13034],{"class":451,"line":4059},[449,13031,13000],{"class":684},[449,13033,12644],{"class":721},[449,13035,1322],{"class":684},[449,13037,13038],{"class":451,"line":4065},[449,13039,700],{"emptyLinePlaceholder":130},[449,13041,13042,13045,13047,13049],{"class":451,"line":4070},[449,13043,13044],{"class":680},"    if",[449,13046,1913],{"class":684},[449,13048,5085],{"class":680},[449,13050,13051],{"class":684},"menuItem) {\n",[449,13053,13054,13057,13059],{"class":451,"line":4075},[449,13055,13056],{"class":680},"      throw",[449,13058,5113],{"class":721},[449,13060,1391],{"class":684},[449,13062,13063,13066,13068],{"class":451,"line":4081},[449,13064,13065],{"class":684},"        statusCode: ",[449,13067,5123],{"class":714},[449,13069,779],{"class":684},[449,13071,13072,13075,13078,13081,13083,13086,13089],{"class":451,"line":4086},[449,13073,13074],{"class":684},"        statusMessage: ",[449,13076,13077],{"class":691},"`Menu item ${",[449,13079,13080],{"class":684},"item",[449,13082,165],{"class":691},[449,13084,13085],{"class":684},"menuItemId",[449,13087,13088],{"class":691},"} not found`",[449,13090,779],{"class":684},[449,13092,13093],{"class":451,"line":4092},[449,13094,13095],{"class":684},"      });\n",[449,13097,13098],{"class":451,"line":4098},[449,13099,7544],{"class":684},[449,13101,13102],{"class":451,"line":4104},[449,13103,700],{"emptyLinePlaceholder":130},[449,13105,13106,13108,13110,13112],{"class":451,"line":4110},[449,13107,13044],{"class":680},[449,13109,1913],{"class":684},[449,13111,5085],{"class":680},[449,13113,13114],{"class":684},"menuItem.available) {\n",[449,13116,13117,13119,13121],{"class":451,"line":5782},[449,13118,13056],{"class":680},[449,13120,5113],{"class":721},[449,13122,1391],{"class":684},[449,13124,13125,13127,13129],{"class":451,"line":5788},[449,13126,13065],{"class":684},[449,13128,5123],{"class":714},[449,13130,779],{"class":684},[449,13132,13133,13135,13137,13140,13142,13145,13148],{"class":451,"line":5794},[449,13134,13074],{"class":684},[449,13136,13077],{"class":691},[449,13138,13139],{"class":684},"menuItem",[449,13141,165],{"class":691},[449,13143,13144],{"class":684},"name",[449,13146,13147],{"class":691},"} is not available`",[449,13149,779],{"class":684},[449,13151,13152],{"class":451,"line":5799},[449,13153,13095],{"class":684},[449,13155,13156],{"class":451,"line":5804},[449,13157,7544],{"class":684},[449,13159,13160],{"class":451,"line":5819},[449,13161,700],{"emptyLinePlaceholder":130},[449,13163,13164,13167,13170,13173,13176],{"class":451,"line":5824},[449,13165,13166],{"class":684},"    total ",[449,13168,13169],{"class":680},"+=",[449,13171,13172],{"class":684}," menuItem.price ",[449,13174,13175],{"class":680},"*",[449,13177,13178],{"class":684}," item.quantity;\n",[449,13180,13181,13184,13186],{"class":451,"line":5846},[449,13182,13183],{"class":684},"    orderItemInputs.",[449,13185,5258],{"class":721},[449,13187,1391],{"class":684},[449,13189,13190],{"class":451,"line":5880},[449,13191,13192],{"class":684},"      menuItemId: item.menuItemId,\n",[449,13194,13195],{"class":451,"line":5885},[449,13196,13197],{"class":684},"      quantity: item.quantity,\n",[449,13199,13200],{"class":451,"line":5899},[449,13201,3484],{"class":684},[449,13203,13204],{"class":451,"line":5919},[449,13205,4599],{"class":684},[449,13207,13208],{"class":451,"line":5938},[449,13209,700],{"emptyLinePlaceholder":130},[449,13211,13212],{"class":451,"line":5973},[449,13213,13214],{"class":705},"  \u002F\u002F Create the order\n",[449,13216,13217,13219,13222,13224,13227,13229],{"class":451,"line":5978},[449,13218,5048],{"class":680},[449,13220,13221],{"class":714}," orderId",[449,13223,718],{"class":680},[449,13225,13226],{"class":684}," crypto.",[449,13228,5206],{"class":721},[449,13230,1322],{"class":684},[449,13232,13233,13235,13238,13240,13242,13244],{"class":451,"line":5983},[449,13234,5048],{"class":680},[449,13236,13237],{"class":714}," now",[449,13239,718],{"class":680},[449,13241,5487],{"class":684},[449,13243,4756],{"class":721},[449,13245,1322],{"class":684},[449,13247,13248],{"class":451,"line":12114},[449,13249,700],{"emptyLinePlaceholder":130},[449,13251,13252,13254,13256,13258,13261,13263],{"class":451,"line":12124},[449,13253,2099],{"class":680},[449,13255,12255],{"class":684},[449,13257,12306],{"class":721},[449,13259,13260],{"class":684},"(orders).",[449,13262,12311],{"class":721},[449,13264,1391],{"class":684},[449,13266,13267],{"class":451,"line":12134},[449,13268,13269],{"class":684},"    id: orderId,\n",[449,13271,13272,13275,13277,13280],{"class":451,"line":12143},[449,13273,13274],{"class":684},"    customerName: body.customerName ",[449,13276,5091],{"class":680},[449,13278,13279],{"class":691}," \"Guest\"",[449,13281,779],{"class":684},[449,13283,13284,13286,13288],{"class":451,"line":12152},[449,13285,5218],{"class":684},[449,13287,5221],{"class":691},[449,13289,779],{"class":684},[449,13291,13292],{"class":451,"line":12157},[449,13293,13294],{"class":684},"    total,\n",[449,13296,13297,13299,13301,13303],{"class":451,"line":12162},[449,13298,5228],{"class":684},[449,13300,5231],{"class":680},[449,13302,5234],{"class":721},[449,13304,13305],{"class":684},"(now),\n",[449,13307,13308,13311,13313,13315],{"class":451,"line":12172},[449,13309,13310],{"class":684},"    updatedAt: ",[449,13312,5231],{"class":680},[449,13314,5234],{"class":721},[449,13316,13305],{"class":684},[449,13318,13319],{"class":451,"line":12182},[449,13320,13321],{"class":684},"  });\n",[449,13323,13324],{"class":451,"line":12192},[449,13325,700],{"emptyLinePlaceholder":130},[449,13327,13328],{"class":451,"line":12201},[449,13329,13330],{"class":705},"  \u002F\u002F Create order items\n",[449,13332,13333,13335,13337,13339,13342,13344],{"class":451,"line":12210},[449,13334,5529],{"class":680},[449,13336,1913],{"class":684},[449,13338,711],{"class":680},[449,13340,13341],{"class":714}," input",[449,13343,12292],{"class":680},[449,13345,13346],{"class":684}," orderItemInputs) {\n",[449,13348,13349,13351,13353,13355,13357],{"class":451,"line":12215},[449,13350,12985],{"class":680},[449,13352,12988],{"class":714},[449,13354,718],{"class":680},[449,13356,1654],{"class":680},[449,13358,12995],{"class":684},[449,13360,13361,13363,13365],{"class":451,"line":12220},[449,13362,13000],{"class":684},[449,13364,12452],{"class":721},[449,13366,11195],{"class":684},[449,13368,13369,13371,13373],{"class":451,"line":12225},[449,13370,13000],{"class":684},[449,13372,688],{"class":721},[449,13374,13013],{"class":684},[449,13376,13377,13379,13381,13383,13385],{"class":451,"line":12244},[449,13378,13000],{"class":684},[449,13380,12461],{"class":721},[449,13382,725],{"class":684},[449,13384,13024],{"class":721},[449,13386,13387],{"class":684},"(menuItems.id, input.menuItemId))\n",[449,13389,13390,13392,13394],{"class":451,"line":12250},[449,13391,13000],{"class":684},[449,13393,12644],{"class":721},[449,13395,1322],{"class":684},[449,13397,13398],{"class":451,"line":12269},[449,13399,700],{"emptyLinePlaceholder":130},[449,13401,13402,13404,13406,13408,13411,13413],{"class":451,"line":12274},[449,13403,12301],{"class":680},[449,13405,12255],{"class":684},[449,13407,12306],{"class":721},[449,13409,13410],{"class":684},"(orderItems).",[449,13412,12311],{"class":721},[449,13414,1391],{"class":684},[449,13416,13417,13420,13422],{"class":451,"line":12280},[449,13418,13419],{"class":684},"      id: crypto.",[449,13421,5206],{"class":721},[449,13423,1624],{"class":684},[449,13425,13426],{"class":451,"line":12298},[449,13427,13428],{"class":684},"      orderId,\n",[449,13430,13431],{"class":451,"line":12316},[449,13432,13433],{"class":684},"      menuItemId: input.menuItemId,\n",[449,13435,13436],{"class":451,"line":12325},[449,13437,13438],{"class":684},"      quantity: input.quantity,\n",[449,13440,13441,13444,13446],{"class":451,"line":12335},[449,13442,13443],{"class":684},"      unitPrice: menuItem",[449,13445,5085],{"class":680},[449,13447,13448],{"class":684},".price,\n",[449,13450,13451],{"class":451,"line":12340},[449,13452,3484],{"class":684},[449,13454,13455],{"class":451,"line":12345},[449,13456,4599],{"class":684},[449,13458,13459],{"class":451,"line":12350},[449,13460,700],{"emptyLinePlaceholder":130},[449,13462,13463],{"class":451,"line":12368},[449,13464,13465],{"class":705},"  \u002F\u002F Fetch the complete order\n",[449,13467,13469,13471,13474,13476,13478,13480,13482,13484,13486,13488,13490,13492,13494,13497,13499],{"class":451,"line":13468},84,[449,13470,5048],{"class":680},[449,13472,13473],{"class":714}," createdOrder",[449,13475,718],{"class":680},[449,13477,1654],{"class":680},[449,13479,12255],{"class":684},[449,13481,12452],{"class":721},[449,13483,5237],{"class":684},[449,13485,688],{"class":721},[449,13487,13260],{"class":684},[449,13489,12461],{"class":721},[449,13491,725],{"class":684},[449,13493,13024],{"class":721},[449,13495,13496],{"class":684},"(orders.id, orderId)).",[449,13498,12644],{"class":721},[449,13500,1322],{"class":684},[449,13502,13504],{"class":451,"line":13503},85,[449,13505,700],{"emptyLinePlaceholder":130},[449,13507,13509,13511,13513,13515,13517,13519,13521,13523,13525,13527,13529,13531,13533],{"class":451,"line":13508},86,[449,13510,5048],{"class":680},[449,13512,12443],{"class":714},[449,13514,718],{"class":680},[449,13516,1654],{"class":680},[449,13518,12255],{"class":684},[449,13520,12452],{"class":721},[449,13522,5237],{"class":684},[449,13524,688],{"class":721},[449,13526,13410],{"class":684},[449,13528,12461],{"class":721},[449,13530,725],{"class":684},[449,13532,13024],{"class":721},[449,13534,13535],{"class":684},"(orderItems.orderId, orderId));\n",[449,13537,13539],{"class":451,"line":13538},87,[449,13540,700],{"emptyLinePlaceholder":130},[449,13542,13544,13546],{"class":451,"line":13543},88,[449,13545,4726],{"class":680},[449,13547,1501],{"class":684},[449,13549,13551,13554],{"class":451,"line":13550},89,[449,13552,13553],{"class":680},"    ...",[449,13555,13556],{"class":684},"createdOrder,\n",[449,13558,13560],{"class":451,"line":13559},90,[449,13561,13562],{"class":684},"    items,\n",[449,13564,13566],{"class":451,"line":13565},91,[449,13567,4763],{"class":684},[449,13569,13571],{"class":451,"line":13570},92,[449,13572,784],{"class":684},[2808,13574,13576],{"id":13575},"update-order-status","Update Order Status",[21,13578,4697,13579,3070],{},[40,13580,13581],{},"server\u002Fapi\u002Forders\u002F[id].patch.ts",[48,13583,13585],{"className":670,"code":13584,"filename":13581,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { orders } from \"..\u002Fdb\u002Fschema\";\nimport { eq } from \"drizzle-orm\";\n\nconst validStatuses = [\"pending\", \"preparing\", \"ready\", \"completed\", \"cancelled\"];\n\nexport default defineEventHandler(async (event) => {\n  const id = getRouterParam(event, \"id\");\n  const body = await readBody(event);\n\n  if (!id) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Order ID is required\",\n    });\n  }\n\n  if (!body.status || !validStatuses.includes(body.status)) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: `Invalid status. Must be one of: ${validStatuses.join(\", \")}`,\n    });\n  }\n\n  const existingOrder = await db.select().from(orders).where(eq(orders.id, id)).get();\n\n  if (!existingOrder) {\n    throw createError({\n      statusCode: 404,\n      statusMessage: \"Order not found\",\n    });\n  }\n\n  \u002F\u002F Update the order\n  await db\n    .update(orders)\n    .set({\n      status: body.status,\n      updatedAt: new Date(),\n    })\n    .where(eq(orders.id, id));\n\n  const updatedOrder = await db.select().from(orders).where(eq(orders.id, id)).get();\n\n  return updatedOrder;\n});\n",[40,13586,13587,13599,13612,13624,13628,13664,13668,13690,13706,13720,13724,13734,13742,13750,13759,13763,13767,13771,13795,13803,13811,13837,13841,13845,13849,13883,13887,13898,13906,13914,13923,13927,13931,13935,13940,13946,13956,13965,13970,13981,13986,13999,14003,14036,14040,14047],{"__ignoreMap":56},[449,13588,13589,13591,13593,13595,13597],{"class":451,"line":452},[449,13590,681],{"class":680},[449,13592,11703],{"class":684},[449,13594,688],{"class":680},[449,13596,11708],{"class":691},[449,13598,695],{"class":684},[449,13600,13601,13603,13606,13608,13610],{"class":451,"line":114},[449,13602,681],{"class":680},[449,13604,13605],{"class":684}," { orders } ",[449,13607,688],{"class":680},[449,13609,11722],{"class":691},[449,13611,695],{"class":684},[449,13613,13614,13616,13618,13620,13622],{"class":451,"line":111},[449,13615,681],{"class":680},[449,13617,12758],{"class":684},[449,13619,688],{"class":680},[449,13621,10771],{"class":691},[449,13623,695],{"class":684},[449,13625,13626],{"class":451,"line":468},[449,13627,700],{"emptyLinePlaceholder":130},[449,13629,13630,13632,13635,13637,13640,13642,13644,13647,13649,13652,13654,13657,13659,13662],{"class":451,"line":474},[449,13631,711],{"class":680},[449,13633,13634],{"class":714}," validStatuses",[449,13636,718],{"class":680},[449,13638,13639],{"class":684}," [",[449,13641,5221],{"class":691},[449,13643,349],{"class":684},[449,13645,13646],{"class":691},"\"preparing\"",[449,13648,349],{"class":684},[449,13650,13651],{"class":691},"\"ready\"",[449,13653,349],{"class":684},[449,13655,13656],{"class":691},"\"completed\"",[449,13658,349],{"class":684},[449,13660,13661],{"class":691},"\"cancelled\"",[449,13663,4917],{"class":684},[449,13665,13666],{"class":451,"line":480},[449,13667,700],{"emptyLinePlaceholder":130},[449,13669,13670,13672,13674,13676,13678,13680,13682,13684,13686,13688],{"class":451,"line":486},[449,13671,4629],{"class":680},[449,13673,4632],{"class":680},[449,13675,4714],{"class":721},[449,13677,725],{"class":684},[449,13679,1485],{"class":680},[449,13681,1913],{"class":684},[449,13683,2991],{"class":1491},[449,13685,1758],{"class":684},[449,13687,1498],{"class":680},[449,13689,1501],{"class":684},[449,13691,13692,13694,13696,13698,13700,13702,13704],{"class":451,"line":492},[449,13693,5048],{"class":680},[449,13695,12546],{"class":714},[449,13697,718],{"class":680},[449,13699,12551],{"class":721},[449,13701,12554],{"class":684},[449,13703,10816],{"class":691},[449,13705,740],{"class":684},[449,13707,13708,13710,13712,13714,13716,13718],{"class":451,"line":498},[449,13709,5048],{"class":680},[449,13711,5051],{"class":714},[449,13713,718],{"class":680},[449,13715,1654],{"class":680},[449,13717,5060],{"class":721},[449,13719,12843],{"class":684},[449,13721,13722],{"class":451,"line":133},[449,13723,700],{"emptyLinePlaceholder":130},[449,13725,13726,13728,13730,13732],{"class":451,"line":509},[449,13727,5080],{"class":680},[449,13729,1913],{"class":684},[449,13731,5085],{"class":680},[449,13733,12573],{"class":684},[449,13735,13736,13738,13740],{"class":451,"line":318},[449,13737,5110],{"class":680},[449,13739,5113],{"class":721},[449,13741,1391],{"class":684},[449,13743,13744,13746,13748],{"class":451,"line":520},[449,13745,5120],{"class":684},[449,13747,5123],{"class":714},[449,13749,779],{"class":684},[449,13751,13752,13754,13757],{"class":451,"line":526},[449,13753,5130],{"class":684},[449,13755,13756],{"class":691},"\"Order ID is required\"",[449,13758,779],{"class":684},[449,13760,13761],{"class":451,"line":532},[449,13762,3484],{"class":684},[449,13764,13765],{"class":451,"line":2790},[449,13766,4599],{"class":684},[449,13768,13769],{"class":451,"line":3511},[449,13770,700],{"emptyLinePlaceholder":130},[449,13772,13773,13775,13777,13779,13782,13784,13786,13789,13792],{"class":451,"line":3526},[449,13774,5080],{"class":680},[449,13776,1913],{"class":684},[449,13778,5085],{"class":680},[449,13780,13781],{"class":684},"body.status ",[449,13783,5091],{"class":680},[449,13785,12868],{"class":680},[449,13787,13788],{"class":684},"validStatuses.",[449,13790,13791],{"class":721},"includes",[449,13793,13794],{"class":684},"(body.status)) {\n",[449,13796,13797,13799,13801],{"class":451,"line":3531},[449,13798,5110],{"class":680},[449,13800,5113],{"class":721},[449,13802,1391],{"class":684},[449,13804,13805,13807,13809],{"class":451,"line":3536},[449,13806,5120],{"class":684},[449,13808,5123],{"class":714},[449,13810,779],{"class":684},[449,13812,13813,13815,13818,13821,13823,13826,13828,13831,13833,13835],{"class":451,"line":4009},[449,13814,5130],{"class":684},[449,13816,13817],{"class":691},"`Invalid status. Must be one of: ${",[449,13819,13820],{"class":684},"validStatuses",[449,13822,165],{"class":691},[449,13824,13825],{"class":721},"join",[449,13827,725],{"class":691},[449,13829,13830],{"class":691},"\", \"",[449,13832,827],{"class":691},[449,13834,1517],{"class":691},[449,13836,779],{"class":684},[449,13838,13839],{"class":451,"line":4015},[449,13840,3484],{"class":684},[449,13842,13843],{"class":451,"line":4021},[449,13844,4599],{"class":684},[449,13846,13847],{"class":451,"line":4027},[449,13848,700],{"emptyLinePlaceholder":130},[449,13850,13851,13853,13856,13858,13860,13862,13864,13866,13868,13870,13872,13874,13876,13879,13881],{"class":451,"line":4032},[449,13852,5048],{"class":680},[449,13854,13855],{"class":714}," existingOrder",[449,13857,718],{"class":680},[449,13859,1654],{"class":680},[449,13861,12255],{"class":684},[449,13863,12452],{"class":721},[449,13865,5237],{"class":684},[449,13867,688],{"class":721},[449,13869,13260],{"class":684},[449,13871,12461],{"class":721},[449,13873,725],{"class":684},[449,13875,13024],{"class":721},[449,13877,13878],{"class":684},"(orders.id, id)).",[449,13880,12644],{"class":721},[449,13882,1322],{"class":684},[449,13884,13885],{"class":451,"line":4038},[449,13886,700],{"emptyLinePlaceholder":130},[449,13888,13889,13891,13893,13895],{"class":451,"line":4044},[449,13890,5080],{"class":680},[449,13892,1913],{"class":684},[449,13894,5085],{"class":680},[449,13896,13897],{"class":684},"existingOrder) {\n",[449,13899,13900,13902,13904],{"class":451,"line":4049},[449,13901,5110],{"class":680},[449,13903,5113],{"class":721},[449,13905,1391],{"class":684},[449,13907,13908,13910,13912],{"class":451,"line":4054},[449,13909,5120],{"class":684},[449,13911,12676],{"class":714},[449,13913,779],{"class":684},[449,13915,13916,13918,13921],{"class":451,"line":4059},[449,13917,5130],{"class":684},[449,13919,13920],{"class":691},"\"Order not found\"",[449,13922,779],{"class":684},[449,13924,13925],{"class":451,"line":4065},[449,13926,3484],{"class":684},[449,13928,13929],{"class":451,"line":4070},[449,13930,4599],{"class":684},[449,13932,13933],{"class":451,"line":4075},[449,13934,700],{"emptyLinePlaceholder":130},[449,13936,13937],{"class":451,"line":4081},[449,13938,13939],{"class":705},"  \u002F\u002F Update the order\n",[449,13941,13942,13944],{"class":451,"line":4086},[449,13943,2099],{"class":680},[449,13945,12995],{"class":684},[449,13947,13948,13950,13953],{"class":451,"line":4092},[449,13949,11190],{"class":684},[449,13951,13952],{"class":721},"update",[449,13954,13955],{"class":684},"(orders)\n",[449,13957,13958,13960,13963],{"class":451,"line":4098},[449,13959,11190],{"class":684},[449,13961,13962],{"class":721},"set",[449,13964,1391],{"class":684},[449,13966,13967],{"class":451,"line":4104},[449,13968,13969],{"class":684},"      status: body.status,\n",[449,13971,13972,13975,13977,13979],{"class":451,"line":4110},[449,13973,13974],{"class":684},"      updatedAt: ",[449,13976,5231],{"class":680},[449,13978,5234],{"class":721},[449,13980,1624],{"class":684},[449,13982,13983],{"class":451,"line":5782},[449,13984,13985],{"class":684},"    })\n",[449,13987,13988,13990,13992,13994,13996],{"class":451,"line":5788},[449,13989,11190],{"class":684},[449,13991,12461],{"class":721},[449,13993,725],{"class":684},[449,13995,13024],{"class":721},[449,13997,13998],{"class":684},"(orders.id, id));\n",[449,14000,14001],{"class":451,"line":5794},[449,14002,700],{"emptyLinePlaceholder":130},[449,14004,14005,14007,14010,14012,14014,14016,14018,14020,14022,14024,14026,14028,14030,14032,14034],{"class":451,"line":5799},[449,14006,5048],{"class":680},[449,14008,14009],{"class":714}," updatedOrder",[449,14011,718],{"class":680},[449,14013,1654],{"class":680},[449,14015,12255],{"class":684},[449,14017,12452],{"class":721},[449,14019,5237],{"class":684},[449,14021,688],{"class":721},[449,14023,13260],{"class":684},[449,14025,12461],{"class":721},[449,14027,725],{"class":684},[449,14029,13024],{"class":721},[449,14031,13878],{"class":684},[449,14033,12644],{"class":721},[449,14035,1322],{"class":684},[449,14037,14038],{"class":451,"line":5804},[449,14039,700],{"emptyLinePlaceholder":130},[449,14041,14042,14044],{"class":451,"line":5819},[449,14043,4726],{"class":680},[449,14045,14046],{"class":684}," updatedOrder;\n",[449,14048,14049],{"class":451,"line":5824},[449,14050,784],{"class":684},[2808,14052,14054],{"id":14053},"get-all-orders","Get All Orders",[21,14056,4697,14057,3070],{},[40,14058,14059],{},"server\u002Fapi\u002Forders.get.ts",[48,14061,14063],{"className":670,"code":14062,"filename":14059,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { orders, orderItems } from \"..\u002Fdb\u002Fschema\";\n\nexport default defineEventHandler(async () => {\n  const allOrders = await db.select().from(orders).orderBy(orders.createdAt);\n\n  \u002F\u002F Fetch items for each order\n  const ordersWithItems = await Promise.all(\n    allOrders.map(async (order) => {\n      const items = await db.select().from(orderItems).where(orderItems.orderId.equals(order.id));\n      return { ...order, items };\n    }),\n  );\n\n  return { orders: ordersWithItems };\n});\n",[40,14064,14065,14077,14090,14094,14112,14139,14143,14148,14167,14189,14220,14234,14238,14243,14247,14254],{"__ignoreMap":56},[449,14066,14067,14069,14071,14073,14075],{"class":451,"line":452},[449,14068,681],{"class":680},[449,14070,11703],{"class":684},[449,14072,688],{"class":680},[449,14074,11708],{"class":691},[449,14076,695],{"class":684},[449,14078,14079,14081,14084,14086,14088],{"class":451,"line":114},[449,14080,681],{"class":680},[449,14082,14083],{"class":684}," { orders, orderItems } ",[449,14085,688],{"class":680},[449,14087,11722],{"class":691},[449,14089,695],{"class":684},[449,14091,14092],{"class":451,"line":111},[449,14093,700],{"emptyLinePlaceholder":130},[449,14095,14096,14098,14100,14102,14104,14106,14108,14110],{"class":451,"line":468},[449,14097,4629],{"class":680},[449,14099,4632],{"class":680},[449,14101,4714],{"class":721},[449,14103,725],{"class":684},[449,14105,1485],{"class":680},[449,14107,2090],{"class":684},[449,14109,1498],{"class":680},[449,14111,1501],{"class":684},[449,14113,14114,14116,14119,14121,14123,14125,14127,14129,14131,14133,14136],{"class":451,"line":474},[449,14115,5048],{"class":680},[449,14117,14118],{"class":714}," allOrders",[449,14120,718],{"class":680},[449,14122,1654],{"class":680},[449,14124,12255],{"class":684},[449,14126,12452],{"class":721},[449,14128,5237],{"class":684},[449,14130,688],{"class":721},[449,14132,13260],{"class":684},[449,14134,14135],{"class":721},"orderBy",[449,14137,14138],{"class":684},"(orders.createdAt);\n",[449,14140,14141],{"class":451,"line":480},[449,14142,700],{"emptyLinePlaceholder":130},[449,14144,14145],{"class":451,"line":486},[449,14146,14147],{"class":705},"  \u002F\u002F Fetch items for each order\n",[449,14149,14150,14152,14155,14157,14159,14161,14163,14165],{"class":451,"line":492},[449,14151,5048],{"class":680},[449,14153,14154],{"class":714}," ordersWithItems",[449,14156,718],{"class":680},[449,14158,1654],{"class":680},[449,14160,5161],{"class":714},[449,14162,165],{"class":684},[449,14164,5813],{"class":721},[449,14166,5567],{"class":684},[449,14168,14169,14172,14174,14176,14178,14180,14183,14185,14187],{"class":451,"line":498},[449,14170,14171],{"class":684},"    allOrders.",[449,14173,6391],{"class":721},[449,14175,725],{"class":684},[449,14177,1485],{"class":680},[449,14179,1913],{"class":684},[449,14181,14182],{"class":1491},"order",[449,14184,1758],{"class":684},[449,14186,1498],{"class":680},[449,14188,1501],{"class":684},[449,14190,14191,14194,14196,14198,14200,14202,14204,14206,14208,14210,14212,14215,14217],{"class":451,"line":133},[449,14192,14193],{"class":680},"      const",[449,14195,12443],{"class":714},[449,14197,718],{"class":680},[449,14199,1654],{"class":680},[449,14201,12255],{"class":684},[449,14203,12452],{"class":721},[449,14205,5237],{"class":684},[449,14207,688],{"class":721},[449,14209,13410],{"class":684},[449,14211,12461],{"class":721},[449,14213,14214],{"class":684},"(orderItems.orderId.",[449,14216,12638],{"class":721},[449,14218,14219],{"class":684},"(order.id));\n",[449,14221,14222,14225,14228,14231],{"class":451,"line":509},[449,14223,14224],{"class":680},"      return",[449,14226,14227],{"class":684}," { ",[449,14229,14230],{"class":680},"...",[449,14232,14233],{"class":684},"order, items };\n",[449,14235,14236],{"class":451,"line":318},[449,14237,4101],{"class":684},[449,14239,14240],{"class":451,"line":520},[449,14241,14242],{"class":684},"  );\n",[449,14244,14245],{"class":451,"line":526},[449,14246,700],{"emptyLinePlaceholder":130},[449,14248,14249,14251],{"class":451,"line":532},[449,14250,4726],{"class":680},[449,14252,14253],{"class":684}," { orders: ordersWithItems };\n",[449,14255,14256],{"class":451,"line":2790},[449,14257,784],{"class":684},[73,14259],{},[32,14261,14263],{"id":14262},"step-7-run-migrations","Step 7: Run Migrations",[21,14265,14266],{},"Now that our schema is defined, let's generate and push the migrations.",[48,14268,14270],{"className":839,"code":14269,"filename":4384,"language":841,"meta":56,"style":56},"# Generate migration files\nnpx drizzle-kit generate:sqlite\n\n# Push schema to database\nnpx drizzle-kit push:sqlite\n",[40,14271,14272,14277,14286,14290,14295],{"__ignoreMap":56},[449,14273,14274],{"class":451,"line":452},[449,14275,14276],{"class":705},"# Generate migration files\n",[449,14278,14279,14281,14283],{"class":451,"line":114},[449,14280,8887],{"class":721},[449,14282,10597],{"class":691},[449,14284,14285],{"class":691}," generate:sqlite\n",[449,14287,14288],{"class":451,"line":111},[449,14289,700],{"emptyLinePlaceholder":130},[449,14291,14292],{"class":451,"line":468},[449,14293,14294],{"class":705},"# Push schema to database\n",[449,14296,14297,14299,14301],{"class":451,"line":474},[449,14298,8887],{"class":721},[449,14300,10597],{"class":691},[449,14302,14303],{"class":691}," push:sqlite\n",[427,14305,14308],{"icon":14306,"title":14307},"🛠️","Migration Workflow",[21,14309,14310,14311,14314,14315,14318],{},"In development, you can use ",[40,14312,14313],{},"push:sqlite"," to sync changes quickly. For production, use ",[40,14316,14317],{},"generate"," to create migration files and run them separately.",[73,14320],{},[32,14322,14324],{"id":14323},"step-8-test-the-api","Step 8: Test the API",[21,14326,14327],{},"Start your server and test the endpoints:",[48,14329,14330],{"className":839,"code":3854,"filename":4384,"language":841,"meta":56,"style":56},[40,14331,14332],{"__ignoreMap":56},[449,14333,14334,14336,14338],{"class":451,"line":452},[449,14335,3703],{"class":721},[449,14337,5297],{"class":691},[449,14339,5300],{"class":691},[2808,14341,14343],{"id":14342},"seed-the-menu","Seed the menu:",[48,14345,14347],{"className":839,"code":14346,"language":841,"meta":56,"style":56},"curl -X POST http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fseed\n",[40,14348,14349],{"__ignoreMap":56},[449,14350,14351,14353,14356,14359],{"class":451,"line":452},[449,14352,4396],{"class":721},[449,14354,14355],{"class":714}," -X",[449,14357,14358],{"class":691}," POST",[449,14360,14361],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fseed\n",[2808,14363,14365],{"id":14364},"get-the-menu","Get the menu:",[48,14367,14369],{"className":839,"code":14368,"language":841,"meta":56,"style":56},"curl http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmenu\n",[40,14370,14371],{"__ignoreMap":56},[449,14372,14373,14375],{"class":451,"line":452},[449,14374,4396],{"class":721},[449,14376,14377],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmenu\n",[2808,14379,14381],{"id":14380},"create-an-order","Create an order:",[48,14383,14385],{"className":839,"code":14384,"language":841,"meta":56,"style":56},"curl -X POST http:\u002F\u002Flocalhost:3000\u002Fapi\u002Forders \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"customerName\": \"John\",\n    \"items\": [\n      { \"menuItemId\": \"latte\", \"quantity\": 2 },\n      { \"menuItemId\": \"croissant\", \"quantity\": 1 }\n    ]\n  }'\n",[40,14386,14387,14401,14411,14419,14424,14429,14434,14439,14444],{"__ignoreMap":56},[449,14388,14389,14391,14393,14395,14398],{"class":451,"line":452},[449,14390,4396],{"class":721},[449,14392,14355],{"class":714},[449,14394,14358],{"class":691},[449,14396,14397],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Forders",[449,14399,14400],{"class":714}," \\\n",[449,14402,14403,14406,14409],{"class":451,"line":114},[449,14404,14405],{"class":714},"  -H",[449,14407,14408],{"class":691}," \"Content-Type: application\u002Fjson\"",[449,14410,14400],{"class":714},[449,14412,14413,14416],{"class":451,"line":111},[449,14414,14415],{"class":714},"  -d",[449,14417,14418],{"class":691}," '{\n",[449,14420,14421],{"class":451,"line":468},[449,14422,14423],{"class":691},"    \"customerName\": \"John\",\n",[449,14425,14426],{"class":451,"line":474},[449,14427,14428],{"class":691},"    \"items\": [\n",[449,14430,14431],{"class":451,"line":480},[449,14432,14433],{"class":691},"      { \"menuItemId\": \"latte\", \"quantity\": 2 },\n",[449,14435,14436],{"class":451,"line":486},[449,14437,14438],{"class":691},"      { \"menuItemId\": \"croissant\", \"quantity\": 1 }\n",[449,14440,14441],{"class":451,"line":492},[449,14442,14443],{"class":691},"    ]\n",[449,14445,14446],{"class":451,"line":498},[449,14447,14448],{"class":691},"  }'\n",[2808,14450,14452],{"id":14451},"update-order-status-1","Update order status:",[48,14454,14456],{"className":839,"code":14455,"language":841,"meta":56,"style":56},"curl -X PATCH http:\u002F\u002Flocalhost:3000\u002Fapi\u002Forders\u002FORDER_ID \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"status\": \"preparing\"}'\n",[40,14457,14458,14472,14480],{"__ignoreMap":56},[449,14459,14460,14462,14464,14467,14470],{"class":451,"line":452},[449,14461,4396],{"class":721},[449,14463,14355],{"class":714},[449,14465,14466],{"class":691}," PATCH",[449,14468,14469],{"class":691}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002Forders\u002FORDER_ID",[449,14471,14400],{"class":714},[449,14473,14474,14476,14478],{"class":451,"line":114},[449,14475,14405],{"class":714},[449,14477,14408],{"class":691},[449,14479,14400],{"class":714},[449,14481,14482,14484],{"class":451,"line":111},[449,14483,14415],{"class":714},[449,14485,14486],{"class":691}," '{\"status\": \"preparing\"}'\n",[73,14488],{},[32,14490,6820],{"id":6819},[21,14492,6823],{},[383,14494,14495,14498,14501,14504,14507],{},[386,14496,14497],{},"A fully typed database schema using Drizzle ORM",[386,14499,14500],{},"Type-safe queries throughout your API",[386,14502,14503],{},"Proper data validation and error handling",[386,14505,14506],{},"Order creation with transaction-like behavior",[386,14508,14509],{},"Status update workflow",[2808,14511,6844],{"id":6843},[547,14513,14514,14525],{},[550,14515,14516],{},[553,14517,14518,14521,14523],{},[556,14519,14520],{},"Method",[556,14522,6853],{},[556,14524,923],{},[569,14526,14527,14540,14552,14564,14575,14588],{},[553,14528,14529,14532,14537],{},[574,14530,14531],{},"GET",[574,14533,14534],{},[40,14535,14536],{},"\u002Fapi\u002Fmenu",[574,14538,14539],{},"Get available menu items",[553,14541,14542,14544,14549],{},[574,14543,14531],{},[574,14545,14546],{},[40,14547,14548],{},"\u002Fapi\u002Fmenu\u002F:id",[574,14550,14551],{},"Get single menu item",[553,14553,14554,14557,14561],{},[574,14555,14556],{},"POST",[574,14558,14559],{},[40,14560,6906],{},[574,14562,14563],{},"Create new order",[553,14565,14566,14568,14572],{},[574,14567,14531],{},[574,14569,14570],{},[40,14571,6906],{},[574,14573,14574],{},"Get all orders",[553,14576,14577,14580,14585],{},[574,14578,14579],{},"PATCH",[574,14581,14582],{},[40,14583,14584],{},"\u002Fapi\u002Forders\u002F:id",[574,14586,14587],{},"Update order status",[553,14589,14590,14592,14597],{},[574,14591,14556],{},[574,14593,14594],{},[40,14595,14596],{},"\u002Fapi\u002Fseed",[574,14598,14599],{},"Seed menu data",[73,14601],{},[16,14603,3681],{"id":3680},[21,14605,14606,14607,14610],{},"Drizzle ORM transforms your database layer from an afterthought into a ",[151,14608,14609],{},"first-class citizen"," of your application. The type safety alone justifies the switch—no more runtime errors from typos in column names, no more guessing what a query returns.",[21,14612,14613],{},"Combined with Nitro's filesystem routing and deployment flexibility, you have a production-ready stack that scales:",[383,14615,14616,14622,14628],{},[386,14617,14618,14621],{},[151,14619,14620],{},"Start with SQLite"," for development and small projects",[386,14623,14624,14627],{},[151,14625,14626],{},"Switch to PostgreSQL"," for production without changing your code",[386,14629,14630,14633],{},[151,14631,14632],{},"Deploy anywhere"," — Node.js, serverless, edge",[21,14635,14636,14637,14640],{},"In the next post, we'll add ",[151,14638,14639],{},"authentication"," to protect our order management endpoints. Until then, enjoy your type-safe API! ☕🚀",[3728,14642,14643],{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":14645},[14646,14647,14648,14649,14650,14651,14652,14659,14660,14666],{"id":10514,"depth":114,"text":10515},{"id":10534,"depth":114,"text":10535},{"id":10610,"depth":114,"text":10611},{"id":10711,"depth":114,"text":10712},{"id":11379,"depth":114,"text":11380},{"id":11682,"depth":114,"text":11683},{"id":12375,"depth":114,"text":12376,"children":14653},[14654,14655,14656,14657,14658],{"id":12379,"depth":111,"text":12380},{"id":12478,"depth":111,"text":12479},{"id":12713,"depth":111,"text":12714},{"id":13575,"depth":111,"text":13576},{"id":14053,"depth":111,"text":14054},{"id":14262,"depth":114,"text":14263},{"id":14323,"depth":114,"text":14324,"children":14661},[14662,14663,14664,14665],{"id":14342,"depth":111,"text":14343},{"id":14364,"depth":111,"text":14365},{"id":14380,"depth":111,"text":14381},{"id":14451,"depth":111,"text":14452},{"id":6819,"depth":114,"text":6820,"children":14667},[14668],{"id":6843,"depth":111,"text":6844},"Learn how to build a production-ready API using Drizzle ORM with Nitro. From setup to deployment, this guide covers everything you need for type-safe database operations.",{"type":13,"value":14671},[14672,14674,14678,14682,14684],[16,14673,333],{"id":332},[21,14675,10442,14676,10446],{},[151,14677,10445],{},[21,14679,10449,14680,10453],{},[151,14681,10452],{},[21,14683,10456],{},[21,14685,10459,14686,10463],{},[151,14687,10462],{},[14689,14690,7065,14691,14692,14693,3784],"drizzle","orm","database","postgres","sqlite",{},"\u002Fblog\u002Fdrizzle-nitro-api",{"title":10434,"description":14669},"blog\u002Fdrizzle-nitro-api","Y5V4K_Fm_OS1Uzb5lCPlrwo1X-Pfim5DE3To4xuXTu8",{"id":14700,"title":14701,"author":14702,"body":14703,"canonical":116,"categories":116,"date":14744,"description":14745,"excerpt":14746,"extension":119,"featuredImg":116,"img":14752,"keywords":14753,"language":14754,"meta":14755,"navigation":130,"ogImage":116,"path":14756,"rating":132,"readTime":474,"seo":14757,"stem":14758,"tag":14759,"__hash__":14760},"blog\u002Fblog\u002Ffirst-post.md","First Post - Who Am I?",{"name":9,"website":10,"img":11},{"type":13,"value":14704,"toc":14739},[14705,14709,14712,14715,14718,14722,14725,14729,14732,14736],[16,14706,14708],{"id":14707},"just-starting","Just Starting",[21,14710,14711],{},"Hey, I am Vantol, I am a Jamaican - FullStack Developer - and Educator in the Jamaican school system. (I teach Math to kids! Help Me! Please!) LOL!",[21,14713,14714],{},"I have been coding for about 10 years, and I have experimented with most programming languages but I have come to love Javascript - Node.js, Vue.js, Nuxt.js, React, MongoDB\u002FPostgres in my stack. I have been playing with Django Rest Framework of recently and might make something with one day.",[21,14716,14717],{},"In 2021, my focused shifted to making me a concept of grow along with skills and ideas that can change the world.",[32,14719,14721],{"id":14720},"starting-a-new-path","Starting a new path",[21,14723,14724],{},"Basically moving forward in 2022 will be more about Open Source, Content Creation (from Youtube and Twitch Stream) and Npm packages.",[32,14726,14728],{"id":14727},"focus","Focus",[21,14730,14731],{},"'Evolve with Innovation' has always been a slogan for me, and what better way to evolve but to make myself better as a person, father and friend. Outreach and giving back is something I have always wanted to do, so i created Zhyjenae. Zhyjenae is about helping young persons (whether in Jamaica or worldwide) appreciate coding and the doors in which it can open.",[32,14733,14735],{"id":14734},"continued-faith","Continued Faith",[21,14737,14738],{},"It's important that I state I am a Christian and increasing my faith in the Father is important and I want to show that in my coding going forward. In times like these its important to my trust in Him so I can be better in every, shape or form.",{"title":56,"searchDepth":111,"depth":111,"links":14740},[14741,14742,14743],{"id":14720,"depth":114,"text":14721},{"id":14727,"depth":114,"text":14728},{"id":14734,"depth":114,"text":14735},"2021-11-14","Hey, I am Vantol, I am a Jamaican. Get to know me!",{"type":13,"value":14747},[14748,14750],[16,14749,14708],{"id":14707},[21,14751,14711],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1636919448\u002FDSC_0991_snlozn.jpg",[122,123],"Buy a coffee Meme",{},"\u002Fblog\u002Ffirst-post",{"title":14701,"description":14745},"blog\u002Ffirst-post","Me","yZ_OvC-ZFhdxYXd68EoqYLS-Kt1S-xkpfxDLxo1sntE",{"id":14762,"title":14763,"author":14764,"body":14765,"canonical":116,"categories":116,"date":15786,"description":15787,"excerpt":15788,"extension":119,"featuredImg":116,"img":15836,"keywords":15837,"language":3788,"meta":15840,"navigation":130,"ogImage":116,"path":15841,"rating":498,"readTime":133,"seo":15842,"stem":15843,"tag":8305,"__hash__":15844},"blog\u002Fblog\u002Ffood-truck-p1.md","Building a Real App with Nitro (Part 1): Foundations of a Food Truck API",{"name":9,"img":11,"website":327},{"type":13,"value":14766,"toc":15770},[14767,14769,14787,14794,14811,14817,14831,14837,14839,14843,14850,14854,14868,14871,14882,14884,14888,14891,14905,14910,14912,14916,14950,14953,14959,14962,14964,14968,14975,14980,15159,15162,15164,15168,15172,15228,15231,15237,15240,15247,15249,15253,15258,15341,15344,15346,15350,15353,15358,15424,15427,15471,15474,15476,15480,15484,15615,15622,15625,15627,15631,15637,15669,15672,15674,15678,15681,15697,15701,15717,15719,15723,15728,15745,15747,15749,15756,15764,15767],[16,14768,333],{"id":332},[21,14770,14771,14772,14775,14776,14779,14780,14782,14783,14786],{},"Most backend tutorials stop at ",[156,14773,14774],{},"“Hello World”",". In this ",[151,14777,14778],{},"two-part series",", we’ll go further by using ",[151,14781,4189],{}," to build an ",[151,14784,14785],{},"actual backend application"," — a food truck \u002F coffee shop API that could realistically power a real product.",[21,14788,14789,14790,14793],{},"In ",[151,14791,14792],{},"Part 1",", we’ll focus on:",[383,14795,14796,14799,14802,14805,14808],{},[386,14797,14798],{},"Project setup",[386,14800,14801],{},"Application structure",[386,14803,14804],{},"Core API routes (menu, orders, hours)",[386,14806,14807],{},"Runtime configuration",[386,14809,14810],{},"Local development",[21,14812,14789,14813,14816],{},[151,14814,14815],{},"Part 2",", we’ll expand this into:",[383,14818,14819,14822,14825,14828],{},[386,14820,14821],{},"Order creation and validation",[386,14823,14824],{},"Persistence (in-memory → storage)",[386,14826,14827],{},"Middleware and plugins",[386,14829,14830],{},"Deployment-ready architecture",[21,14832,14833,14834,165],{},"This series assumes basic JavaScript\u002FTypeScript knowledge but ",[151,14835,14836],{},"no prior Nitro experience",[16,14838,4373],{"id":4372},[32,14840,14842],{"id":14841},"the-app-were-building","The App We’re Building",[21,14844,14845,14846,14849],{},"Our fictional app: ",[151,14847,14848],{},"BrewStop"," ☕🚚 — a mobile coffee truck.",[2808,14851,14853],{"id":14852},"core-features-backend","Core Features (Backend)",[383,14855,14856,14859,14862,14865],{},[386,14857,14858],{},"Fetch menu items",[386,14860,14861],{},"View opening hours",[386,14863,14864],{},"Place orders",[386,14866,14867],{},"Track order status",[21,14869,14870],{},"Nitro will serve as:",[383,14872,14873,14876,14879],{},[386,14874,14875],{},"The API server",[386,14877,14878],{},"The runtime abstraction layer",[386,14880,14881],{},"The deployment target (Node, serverless, edge)",[73,14883],{},[32,14885,14887],{"id":14886},"why-nitro-for-this-app","Why Nitro for This App?",[21,14889,14890],{},"Nitro is perfect for this use case because:",[383,14892,14893,14896,14899,14902],{},[386,14894,14895],{},"It’s lightweight and fast",[386,14897,14898],{},"It supports filesystem routing",[386,14900,14901],{},"It deploys anywhere",[386,14903,14904],{},"It works great with frontend frameworks later",[25,14906,14907],{"type":363},[21,14908,14909],{},"Nitro is the same server engine powering Nuxt — meaning anything we build here can later scale into a fullstack Nuxt app.",[73,14911],{},[32,14913,14915],{"id":14914},"step-1-create-the-nitro-project","Step 1: Create the Nitro Project",[48,14917,14919],{"className":839,"code":14918,"language":841,"meta":56,"style":56},"npx create-nitro-app brewstop-api\ncd brewstop-api\nnpm install\nnpm run dev\n",[40,14920,14921,14930,14936,14942],{"__ignoreMap":56},[449,14922,14923,14925,14927],{"class":451,"line":452},[449,14924,8887],{"class":721},[449,14926,10555],{"class":691},[449,14928,14929],{"class":691}," brewstop-api\n",[449,14931,14932,14934],{"class":451,"line":114},[449,14933,4490],{"class":714},[449,14935,14929],{"class":691},[449,14937,14938,14940],{"class":451,"line":111},[449,14939,3703],{"class":721},[449,14941,4512],{"class":691},[449,14943,14944,14946,14948],{"class":451,"line":468},[449,14945,3703],{"class":721},[449,14947,5297],{"class":691},[449,14949,5300],{"class":691},[21,14951,14952],{},"Your project structure will look like this:",[48,14954,14957],{"className":14955,"code":14956,"language":53},[51],"server\u002F\n  api\u002F\n  routes\u002F\n  plugins\u002F\nnitro.config.ts\n",[40,14958,14956],{"__ignoreMap":56},[21,14960,14961],{},"Nitro automatically wires everything together.",[73,14963],{},[32,14965,14967],{"id":14966},"step-2-define-the-menu-data","Step 2: Define the Menu Data",[21,14969,14970,14971,14974],{},"For now, we’ll start with ",[151,14972,14973],{},"in-memory data"," (we’ll improve this in Part 2).",[21,14976,4697,14977,3070],{},[40,14978,14979],{},"server\u002Fdata\u002Fmenu.ts",[48,14981,14983],{"className":670,"code":14982,"language":673,"meta":56,"style":56},"export interface MenuItem {\n  id: string;\n  name: string;\n  price: number;\n  category: \"coffee\" | \"tea\" | \"food\";\n}\n\nexport const menu: MenuItem[] = [\n  { id: \"latte\", name: \"Latte\", price: 4.5, category: \"coffee\" },\n  { id: \"espresso\", name: \"Espresso\", price: 3, category: \"coffee\" },\n  { id: \"chai\", name: \"Chai Tea\", price: 4, category: \"tea\" },\n  { id: \"croissant\", name: \"Croissant\", price: 3.5, category: \"food\" },\n];\n",[40,14984,14985,14996,15006,15016,15026,15048,15052,15056,15075,15095,15115,15135,15155],{"__ignoreMap":56},[449,14986,14987,14989,14992,14994],{"class":451,"line":452},[449,14988,4629],{"class":680},[449,14990,14991],{"class":680}," interface",[449,14993,11311],{"class":721},[449,14995,1501],{"class":684},[449,14997,14998,15000,15002,15004],{"class":451,"line":114},[449,14999,6065],{"class":1491},[449,15001,3070],{"class":680},[449,15003,6081],{"class":714},[449,15005,695],{"class":684},[449,15007,15008,15010,15012,15014],{"class":451,"line":111},[449,15009,6076],{"class":1491},[449,15011,3070],{"class":680},[449,15013,6081],{"class":714},[449,15015,695],{"class":684},[449,15017,15018,15020,15022,15024],{"class":451,"line":468},[449,15019,6088],{"class":1491},[449,15021,3070],{"class":680},[449,15023,4975],{"class":714},[449,15025,695],{"class":684},[449,15027,15028,15031,15033,15036,15038,15041,15043,15046],{"class":451,"line":474},[449,15029,15030],{"class":1491},"  category",[449,15032,3070],{"class":680},[449,15034,15035],{"class":691}," \"coffee\"",[449,15037,4405],{"class":680},[449,15039,15040],{"class":691}," \"tea\"",[449,15042,4405],{"class":680},[449,15044,15045],{"class":691}," \"food\"",[449,15047,695],{"class":684},[449,15049,15050],{"class":451,"line":480},[449,15051,4604],{"class":684},[449,15053,15054],{"class":451,"line":486},[449,15055,700],{"emptyLinePlaceholder":130},[449,15057,15058,15060,15062,15065,15067,15069,15071,15073],{"class":451,"line":492},[449,15059,4629],{"class":680},[449,15061,10789],{"class":680},[449,15063,15064],{"class":714}," menu",[449,15066,3070],{"class":680},[449,15068,11311],{"class":721},[449,15070,5011],{"class":684},[449,15072,5014],{"class":680},[449,15074,4790],{"class":684},[449,15076,15077,15079,15081,15083,15085,15087,15089,15091,15093],{"class":451,"line":498},[449,15078,4795],{"class":684},[449,15080,11752],{"class":691},[449,15082,4801],{"class":684},[449,15084,4804],{"class":691},[449,15086,4807],{"class":684},[449,15088,4810],{"class":714},[449,15090,4813],{"class":684},[449,15092,4816],{"class":691},[449,15094,4819],{"class":684},[449,15096,15097,15099,15101,15103,15105,15107,15109,15111,15113],{"class":451,"line":133},[449,15098,4795],{"class":684},[449,15100,11806],{"class":691},[449,15102,4801],{"class":684},[449,15104,4831],{"class":691},[449,15106,4807],{"class":684},[449,15108,4849],{"class":714},[449,15110,4813],{"class":684},[449,15112,4816],{"class":691},[449,15114,4819],{"class":684},[449,15116,15117,15119,15121,15123,15125,15127,15129,15131,15133],{"class":451,"line":509},[449,15118,4795],{"class":684},[449,15120,11958],{"class":691},[449,15122,4801],{"class":684},[449,15124,4878],{"class":691},[449,15126,4807],{"class":684},[449,15128,4873],{"class":714},[449,15130,4813],{"class":684},[449,15132,4888],{"class":691},[449,15134,4819],{"class":684},[449,15136,15137,15139,15141,15143,15145,15147,15149,15151,15153],{"class":451,"line":318},[449,15138,4795],{"class":684},[449,15140,12059],{"class":691},[449,15142,4801],{"class":684},[449,15144,4854],{"class":691},[449,15146,4807],{"class":684},[449,15148,4859],{"class":714},[449,15150,4813],{"class":684},[449,15152,4864],{"class":691},[449,15154,4819],{"class":684},[449,15156,15157],{"class":451,"line":520},[449,15158,4917],{"class":684},[21,15160,15161],{},"This shared file keeps our types and data clean.",[73,15163],{},[32,15165,15167],{"id":15166},"step-3-create-the-menu-api-route","Step 3: Create the Menu API Route",[21,15169,4697,15170,3070],{},[40,15171,12385],{},[48,15173,15175],{"className":670,"code":15174,"language":673,"meta":56,"style":56},"import { menu } from \"..\u002Fdata\u002Fmenu\";\n\nexport default defineEventHandler(() => {\n  return {\n    items: menu,\n  };\n});\n",[40,15176,15177,15191,15195,15209,15215,15220,15224],{"__ignoreMap":56},[449,15178,15179,15181,15184,15186,15189],{"class":451,"line":452},[449,15180,681],{"class":680},[449,15182,15183],{"class":684}," { menu } ",[449,15185,688],{"class":680},[449,15187,15188],{"class":691}," \"..\u002Fdata\u002Fmenu\"",[449,15190,695],{"class":684},[449,15192,15193],{"class":451,"line":114},[449,15194,700],{"emptyLinePlaceholder":130},[449,15196,15197,15199,15201,15203,15205,15207],{"class":451,"line":111},[449,15198,4629],{"class":680},[449,15200,4632],{"class":680},[449,15202,4714],{"class":721},[449,15204,4717],{"class":684},[449,15206,1498],{"class":680},[449,15208,1501],{"class":684},[449,15210,15211,15213],{"class":451,"line":468},[449,15212,4726],{"class":680},[449,15214,1501],{"class":684},[449,15216,15217],{"class":451,"line":474},[449,15218,15219],{"class":684},"    items: menu,\n",[449,15221,15222],{"class":451,"line":480},[449,15223,4763],{"class":684},[449,15225,15226],{"class":451,"line":486},[449,15227,784],{"class":684},[21,15229,15230],{},"Now visit:",[48,15232,15235],{"className":15233,"code":15234,"language":53},[51],"http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmenu\n",[40,15236,15234],{"__ignoreMap":56},[21,15238,15239],{},"You’ll receive structured JSON instantly.",[21,15241,15242,15243,15246],{},"Filesystem routing means no router config, no boilerplate — your file structure ",[156,15244,15245],{},"is"," your API.\n::",[73,15248],{},[32,15250,15252],{"id":15251},"step-4-add-business-hours","Step 4: Add Business Hours",[21,15254,4697,15255,3070],{},[40,15256,15257],{},"server\u002Fapi\u002Fhours.get.ts",[48,15259,15261],{"className":670,"code":15260,"language":673,"meta":56,"style":56},"export default defineEventHandler(() => {\n  return {\n    open: \"08:00\",\n    close: \"16:00\",\n    days: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n  };\n});\n",[40,15262,15263,15277,15283,15293,15303,15333,15337],{"__ignoreMap":56},[449,15264,15265,15267,15269,15271,15273,15275],{"class":451,"line":452},[449,15266,4629],{"class":680},[449,15268,4632],{"class":680},[449,15270,4714],{"class":721},[449,15272,4717],{"class":684},[449,15274,1498],{"class":680},[449,15276,1501],{"class":684},[449,15278,15279,15281],{"class":451,"line":114},[449,15280,4726],{"class":680},[449,15282,1501],{"class":684},[449,15284,15285,15288,15291],{"class":451,"line":111},[449,15286,15287],{"class":684},"    open: ",[449,15289,15290],{"class":691},"\"08:00\"",[449,15292,779],{"class":684},[449,15294,15295,15298,15301],{"class":451,"line":468},[449,15296,15297],{"class":684},"    close: ",[449,15299,15300],{"class":691},"\"16:00\"",[449,15302,779],{"class":684},[449,15304,15305,15308,15311,15313,15316,15318,15321,15323,15326,15328,15331],{"class":451,"line":474},[449,15306,15307],{"class":684},"    days: [",[449,15309,15310],{"class":691},"\"Monday\"",[449,15312,349],{"class":684},[449,15314,15315],{"class":691},"\"Tuesday\"",[449,15317,349],{"class":684},[449,15319,15320],{"class":691},"\"Wednesday\"",[449,15322,349],{"class":684},[449,15324,15325],{"class":691},"\"Thursday\"",[449,15327,349],{"class":684},[449,15329,15330],{"class":691},"\"Friday\"",[449,15332,1469],{"class":684},[449,15334,15335],{"class":451,"line":480},[449,15336,4763],{"class":684},[449,15338,15339],{"class":451,"line":486},[449,15340,784],{"class":684},[21,15342,15343],{},"This allows the frontend to determine if orders are allowed.",[73,15345],{},[32,15347,15349],{"id":15348},"step-5-runtime-configuration","Step 5: Runtime Configuration",[21,15351,15352],{},"Let’s make the truck name configurable.",[21,15354,4616,15355,3070],{},[40,15356,15357],{},"nitro.config.ts",[48,15359,15361],{"className":670,"code":15360,"language":673,"meta":56,"style":56},"import { defineNitroConfig } from \"nitro\u002Fconfig\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    public: {\n      truckName: \"BrewStop Coffee\",\n    },\n  },\n});\n",[40,15362,15363,15377,15381,15392,15397,15402,15412,15416,15420],{"__ignoreMap":56},[449,15364,15365,15367,15370,15372,15375],{"class":451,"line":452},[449,15366,681],{"class":680},[449,15368,15369],{"class":684}," { defineNitroConfig } ",[449,15371,688],{"class":680},[449,15373,15374],{"class":691}," \"nitro\u002Fconfig\"",[449,15376,695],{"class":684},[449,15378,15379],{"class":451,"line":114},[449,15380,700],{"emptyLinePlaceholder":130},[449,15382,15383,15385,15387,15390],{"class":451,"line":111},[449,15384,4629],{"class":680},[449,15386,4632],{"class":680},[449,15388,15389],{"class":721}," defineNitroConfig",[449,15391,1391],{"class":684},[449,15393,15394],{"class":451,"line":468},[449,15395,15396],{"class":684},"  runtimeConfig: {\n",[449,15398,15399],{"class":451,"line":474},[449,15400,15401],{"class":684},"    public: {\n",[449,15403,15404,15407,15410],{"class":451,"line":480},[449,15405,15406],{"class":684},"      truckName: ",[449,15408,15409],{"class":691},"\"BrewStop Coffee\"",[449,15411,779],{"class":684},[449,15413,15414],{"class":451,"line":486},[449,15415,1458],{"class":684},[449,15417,15418],{"class":451,"line":492},[449,15419,1474],{"class":684},[449,15421,15422],{"class":451,"line":498},[449,15423,784],{"class":684},[21,15425,15426],{},"Use it in an endpoint:",[48,15428,15430],{"className":670,"code":15429,"language":673,"meta":56,"style":56},"export default defineEventHandler(() => {\n  const config = useRuntimeConfig();\n  return { name: config.public.truckName };\n});\n",[40,15431,15432,15446,15460,15467],{"__ignoreMap":56},[449,15433,15434,15436,15438,15440,15442,15444],{"class":451,"line":452},[449,15435,4629],{"class":680},[449,15437,4632],{"class":680},[449,15439,4714],{"class":721},[449,15441,4717],{"class":684},[449,15443,1498],{"class":680},[449,15445,1501],{"class":684},[449,15447,15448,15450,15453,15455,15458],{"class":451,"line":114},[449,15449,5048],{"class":680},[449,15451,15452],{"class":714}," config",[449,15454,718],{"class":680},[449,15456,15457],{"class":721}," useRuntimeConfig",[449,15459,1322],{"class":684},[449,15461,15462,15464],{"class":451,"line":111},[449,15463,4726],{"class":680},[449,15465,15466],{"class":684}," { name: config.public.truckName };\n",[449,15468,15469],{"class":451,"line":468},[449,15470,784],{"class":684},[21,15472,15473],{},"Environment overrides can be added later without code changes.",[73,15475],{},[32,15477,15479],{"id":15478},"step-6-create-orders-initial-version","Step 6: Create Orders (Initial Version)",[21,15481,4697,15482,3070],{},[40,15483,4953],{},[48,15485,15487],{"className":670,"code":15486,"language":673,"meta":56,"style":56},"let orders: any[] = [];\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n\n  const order = {\n    id: crypto.randomUUID(),\n    items: body.items,\n    status: \"pending\",\n    createdAt: Date.now(),\n  };\n\n  orders.push(order);\n  return order;\n});\n",[40,15488,15489,15505,15509,15531,15545,15549,15559,15567,15572,15580,15589,15593,15597,15605,15611],{"__ignoreMap":56},[449,15490,15491,15493,15495,15497,15499,15501,15503],{"class":451,"line":452},[449,15492,5534],{"class":680},[449,15494,5003],{"class":684},[449,15496,3070],{"class":680},[449,15498,5008],{"class":714},[449,15500,5011],{"class":684},[449,15502,5014],{"class":680},[449,15504,5017],{"class":684},[449,15506,15507],{"class":451,"line":114},[449,15508,700],{"emptyLinePlaceholder":130},[449,15510,15511,15513,15515,15517,15519,15521,15523,15525,15527,15529],{"class":451,"line":111},[449,15512,4629],{"class":680},[449,15514,4632],{"class":680},[449,15516,4714],{"class":721},[449,15518,725],{"class":684},[449,15520,1485],{"class":680},[449,15522,1913],{"class":684},[449,15524,2991],{"class":1491},[449,15526,1758],{"class":684},[449,15528,1498],{"class":680},[449,15530,1501],{"class":684},[449,15532,15533,15535,15537,15539,15541,15543],{"class":451,"line":468},[449,15534,5048],{"class":680},[449,15536,5051],{"class":714},[449,15538,718],{"class":680},[449,15540,1654],{"class":680},[449,15542,5060],{"class":721},[449,15544,12843],{"class":684},[449,15546,15547],{"class":451,"line":474},[449,15548,700],{"emptyLinePlaceholder":130},[449,15550,15551,15553,15555,15557],{"class":451,"line":480},[449,15552,5048],{"class":680},[449,15554,5194],{"class":714},[449,15556,718],{"class":680},[449,15558,1501],{"class":684},[449,15560,15561,15563,15565],{"class":451,"line":486},[449,15562,5203],{"class":684},[449,15564,5206],{"class":721},[449,15566,1624],{"class":684},[449,15568,15569],{"class":451,"line":492},[449,15570,15571],{"class":684},"    items: body.items,\n",[449,15573,15574,15576,15578],{"class":451,"line":498},[449,15575,5218],{"class":684},[449,15577,5221],{"class":691},[449,15579,779],{"class":684},[449,15581,15582,15585,15587],{"class":451,"line":133},[449,15583,15584],{"class":684},"    createdAt: Date.",[449,15586,4756],{"class":721},[449,15588,1624],{"class":684},[449,15590,15591],{"class":451,"line":509},[449,15592,4763],{"class":684},[449,15594,15595],{"class":451,"line":318},[449,15596,700],{"emptyLinePlaceholder":130},[449,15598,15599,15601,15603],{"class":451,"line":520},[449,15600,5255],{"class":684},[449,15602,5258],{"class":721},[449,15604,5261],{"class":684},[449,15606,15607,15609],{"class":451,"line":526},[449,15608,4726],{"class":680},[449,15610,5272],{"class":684},[449,15612,15613],{"class":451,"line":532},[449,15614,784],{"class":684},[21,15616,15617,15618,15621],{},"This gives us a basic order flow we’ll ",[151,15619,15620],{},"refactor and harden"," in Part 2.",[21,15623,15624],{},"This approach is fine for development — but not production. We’ll address persistence and validation next.\n::",[73,15626],{},[32,15628,15630],{"id":15629},"step-7-testing-the-api","Step 7: Testing the API",[21,15632,15633,15634,15636],{},"You can test with ",[40,15635,4396],{},", Postman, or any frontend:",[48,15638,15640],{"className":839,"code":15639,"language":841,"meta":56,"style":56},"curl -X POST http:\u002F\u002Flocalhost:3000\u002Fapi\u002Forders \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"items\":[\"latte\",\"croissant\"]}'\n",[40,15641,15642,15654,15662],{"__ignoreMap":56},[449,15643,15644,15646,15648,15650,15652],{"class":451,"line":452},[449,15645,4396],{"class":721},[449,15647,14355],{"class":714},[449,15649,14358],{"class":691},[449,15651,14397],{"class":691},[449,15653,14400],{"class":714},[449,15655,15656,15658,15660],{"class":451,"line":114},[449,15657,14405],{"class":714},[449,15659,14408],{"class":691},[449,15661,14400],{"class":714},[449,15663,15664,15666],{"class":451,"line":111},[449,15665,14415],{"class":714},[449,15667,15668],{"class":691}," '{\"items\":[\"latte\",\"croissant\"]}'\n",[21,15670,15671],{},"You’ll receive a created order response immediately.",[73,15673],{},[32,15675,15677],{"id":15676},"what-weve-built-so-far","What We’ve Built So Far",[21,15679,15680],{},"By the end of Part 1, we have:",[383,15682,15683,15686,15689,15691,15694],{},[386,15684,15685],{},"A working Nitro backend",[386,15687,15688],{},"Menu and hours endpoints",[386,15690,6909],{},[386,15692,15693],{},"Runtime config",[386,15695,15696],{},"Clean file structure",[2808,15698,15700],{"id":15699},"current-api-endpoints","Current API Endpoints",[383,15702,15703,15707,15712],{},[386,15704,6862,15705],{},[40,15706,14536],{},[386,15708,6862,15709],{},[40,15710,15711],{},"\u002Fapi\u002Fhours",[386,15713,6903,15714,15716],{},[40,15715,6906],{},"\n::",[73,15718],{},[16,15720,15722],{"id":15721},"whats-coming-in-part-2","What’s Coming in Part 2",[21,15724,14789,15725,15727],{},[151,15726,14815],{},", we’ll level this up:",[383,15729,15730,15733,15736,15739,15742],{},[386,15731,15732],{},"Input validation",[386,15734,15735],{},"Order status updates",[386,15737,15738],{},"Storage using UnJS tools",[386,15740,15741],{},"Middleware (logging & auth)",[386,15743,15744],{},"Deployment-ready output",[73,15746],{},[16,15748,3681],{"id":3680},[21,15750,15751,15752,15755],{},"Nitro makes it incredibly easy to go from ",[151,15753,15754],{},"idea → working backend"," with almost zero friction. In just a few files, we’ve built the foundation of a real food truck application — something that could power a production system with the right enhancements.",[21,15757,14789,15758,15760,15761,165],{},[151,15759,14815],{},", we’ll turn this prototype into a ",[151,15762,15763],{},"robust, scalable backend",[21,15765,15766],{},"👉 Stay tuned — BrewStop is just getting started ☕🚀",[3728,15768,15769],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":15771},[15772,15775,15776,15777,15778,15779,15780,15781,15782,15783],{"id":14841,"depth":114,"text":14842,"children":15773},[15774],{"id":14852,"depth":111,"text":14853},{"id":14886,"depth":114,"text":14887},{"id":14914,"depth":114,"text":14915},{"id":14966,"depth":114,"text":14967},{"id":15166,"depth":114,"text":15167},{"id":15251,"depth":114,"text":15252},{"id":15348,"depth":114,"text":15349},{"id":15478,"depth":114,"text":15479},{"id":15629,"depth":114,"text":15630},{"id":15676,"depth":114,"text":15677,"children":15784},[15785],{"id":15699,"depth":111,"text":15700},"2026-01-21","Part 1 of a hands-on series where we use Nitro to build a real backend for a food truck \u002F coffee shop application — from project setup to core API routes.",{"type":13,"value":15789},[15790,15792,15802,15806,15818,15822,15832],[16,15791,333],{"id":332},[21,15793,14771,15794,14775,15796,14779,15798,14782,15800,14786],{},[156,15795,14774],{},[151,15797,14778],{},[151,15799,4189],{},[151,15801,14785],{},[21,15803,14789,15804,14793],{},[151,15805,14792],{},[383,15807,15808,15810,15812,15814,15816],{},[386,15809,14798],{},[386,15811,14801],{},[386,15813,14804],{},[386,15815,14807],{},[386,15817,14810],{},[21,15819,14789,15820,14816],{},[151,15821,14815],{},[383,15823,15824,15826,15828,15830],{},[386,15825,14821],{},[386,15827,14824],{},[386,15829,14827],{},[386,15831,14830],{},[21,15833,14833,15834,165],{},[151,15835,14836],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1620589125156-fd5028c5e05b?q=80&w=3287&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",[7065,15838,7068,15839,7069,3784],"backend","food truck",{},"\u002Fblog\u002Ffood-truck-p1",{"title":14763,"description":15787},"blog\u002Ffood-truck-p1","T3Xx0-IUKrEEgCNwb-O0AQHIX2Y2-zowJ2oGhKqi3p8",{"id":15846,"title":15847,"author":15848,"body":15849,"canonical":116,"categories":116,"date":15786,"description":17210,"excerpt":17211,"extension":119,"featuredImg":116,"img":15836,"keywords":17243,"language":3788,"meta":17246,"navigation":130,"ogImage":116,"path":17247,"rating":133,"readTime":133,"seo":17248,"stem":17249,"tag":17250,"__hash__":17251},"blog\u002Fblog\u002Ffood-truck-p2.md","Building a Real App with Nitro (Part 2): Persistence, Validation, and Production Readiness",{"name":9,"img":11,"website":327},{"type":13,"value":15850,"toc":17191},[15851,15853,15864,15873,15888,15891,15893,15897,15900,15920,15927,15929,15933,15940,15944,15958,15962,15967,16040,16043,16054,16057,16059,16063,16067,16213,16216,16218,16222,16225,16230,16314,16317,16393,16396,16398,16402,16404,16408,16519,16521,16525,16709,16712,16717,16719,16723,16728,16830,16833,16835,16839,16842,16846,16883,16888,17024,17027,17029,17033,17036,17049,17056,17067,17079,17082,17084,17088,17092,17115,17118,17132,17134,17136,17145,17161,17168,17171,17185,17188],[16,15852,333],{"id":332},[21,15854,14789,15855,15857,15858,15860,15861,15863],{},[151,15856,14792],{},", we built the foundation of ",[151,15859,14848],{},", a food truck \u002F coffee shop backend powered by ",[151,15862,4189],{},". We created menu endpoints, business hours, and a basic order flow.",[21,15865,14789,15866,15868,15869,15872],{},[151,15867,14815],{},", we’ll turn that prototype into something ",[151,15870,15871],{},"production-ready"," by adding:",[383,15874,15875,15877,15880,15882,15885],{},[386,15876,15732],{},[386,15878,15879],{},"Persistent storage (using UnJS tools)",[386,15881,15735],{},[386,15883,15884],{},"Middleware & plugins",[386,15886,15887],{},"Better structure for deployment",[21,15889,15890],{},"This is where Nitro really shines — small additions, big capability.",[16,15892,4373],{"id":4372},[32,15894,15896],{"id":15895},"recap-where-we-left-off","Recap: Where We Left Off",[21,15898,15899],{},"At the end of Part 1, we had:",[383,15901,15902,15907,15912,15917],{},[386,15903,15904],{},[40,15905,15906],{},"GET \u002Fapi\u002Fmenu",[386,15908,15909],{},[40,15910,15911],{},"GET \u002Fapi\u002Fhours",[386,15913,15914],{},[40,15915,15916],{},"POST \u002Fapi\u002Forders",[386,15918,15919],{},"In-memory order storage",[21,15921,15922,15923,15926],{},"The biggest limitation? ",[151,15924,15925],{},"Orders disappear on restart"," and inputs are not validated. Let’s fix that.",[73,15928],{},[32,15930,15932],{"id":15931},"step-1-add-persistent-storage-with-unstorage","Step 1: Add Persistent Storage with Unstorage",[21,15934,15935,15936,15939],{},"Nitro integrates beautifully with ",[151,15937,15938],{},"Unstorage",", a key-value storage system from the UnJS ecosystem.",[2808,15941,15943],{"id":15942},"install-unstorage","Install Unstorage",[48,15945,15947],{"className":839,"code":15946,"language":841,"meta":56,"style":56},"npm install unstorage\n",[40,15948,15949],{"__ignoreMap":56},[449,15950,15951,15953,15955],{"class":451,"line":452},[449,15952,3703],{"class":721},[449,15954,3706],{"class":691},[449,15956,15957],{"class":691}," unstorage\n",[2808,15959,15961],{"id":15960},"create-a-storage-utility","Create a Storage Utility",[21,15963,4697,15964,3070],{},[40,15965,15966],{},"server\u002Futils\u002Fstorage.ts",[48,15968,15970],{"className":670,"code":15969,"language":673,"meta":56,"style":56},"import { createStorage } from \"unstorage\";\nimport fsDriver from \"unstorage\u002Fdrivers\u002Ffs\";\n\nexport const storage = createStorage({\n  driver: fsDriver({ base: \".\u002F.data\" }),\n});\n",[40,15971,15972,15986,16000,16004,16020,16036],{"__ignoreMap":56},[449,15973,15974,15976,15979,15981,15984],{"class":451,"line":452},[449,15975,681],{"class":680},[449,15977,15978],{"class":684}," { createStorage } ",[449,15980,688],{"class":680},[449,15982,15983],{"class":691}," \"unstorage\"",[449,15985,695],{"class":684},[449,15987,15988,15990,15993,15995,15998],{"class":451,"line":114},[449,15989,681],{"class":680},[449,15991,15992],{"class":684}," fsDriver ",[449,15994,688],{"class":680},[449,15996,15997],{"class":691}," \"unstorage\u002Fdrivers\u002Ffs\"",[449,15999,695],{"class":684},[449,16001,16002],{"class":451,"line":111},[449,16003,700],{"emptyLinePlaceholder":130},[449,16005,16006,16008,16010,16013,16015,16018],{"class":451,"line":468},[449,16007,4629],{"class":680},[449,16009,10789],{"class":680},[449,16011,16012],{"class":714}," storage",[449,16014,718],{"class":680},[449,16016,16017],{"class":721}," createStorage",[449,16019,1391],{"class":684},[449,16021,16022,16025,16028,16031,16034],{"class":451,"line":474},[449,16023,16024],{"class":684},"  driver: ",[449,16026,16027],{"class":721},"fsDriver",[449,16029,16030],{"class":684},"({ base: ",[449,16032,16033],{"class":691},"\".\u002F.data\"",[449,16035,3479],{"class":684},[449,16037,16038],{"class":451,"line":480},[449,16039,784],{"class":684},[21,16041,16042],{},"This gives us:",[383,16044,16045,16048,16051],{},[386,16046,16047],{},"Persistent storage",[386,16049,16050],{},"Zero database setup",[386,16052,16053],{},"Easy swap to Redis, Cloudflare KV, etc.",[21,16055,16056],{},"You can switch storage drivers without rewriting your application logic.\n::",[73,16058],{},[32,16060,16062],{"id":16061},"step-2-refactor-orders-to-use-storage","Step 2: Refactor Orders to Use Storage",[21,16064,4616,16065,3070],{},[40,16066,4953],{},[48,16068,16070],{"className":670,"code":16069,"language":673,"meta":56,"style":56},"import { storage } from \"..\u002Futils\u002Fstorage\";\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n\n  const order = {\n    id: crypto.randomUUID(),\n    items: body.items,\n    status: \"pending\",\n    createdAt: Date.now(),\n  };\n\n  await storage.setItem(`orders:${order.id}`, order);\n  return order;\n});\n",[40,16071,16072,16086,16090,16112,16126,16130,16140,16148,16152,16160,16168,16172,16176,16203,16209],{"__ignoreMap":56},[449,16073,16074,16076,16079,16081,16084],{"class":451,"line":452},[449,16075,681],{"class":680},[449,16077,16078],{"class":684}," { storage } ",[449,16080,688],{"class":680},[449,16082,16083],{"class":691}," \"..\u002Futils\u002Fstorage\"",[449,16085,695],{"class":684},[449,16087,16088],{"class":451,"line":114},[449,16089,700],{"emptyLinePlaceholder":130},[449,16091,16092,16094,16096,16098,16100,16102,16104,16106,16108,16110],{"class":451,"line":111},[449,16093,4629],{"class":680},[449,16095,4632],{"class":680},[449,16097,4714],{"class":721},[449,16099,725],{"class":684},[449,16101,1485],{"class":680},[449,16103,1913],{"class":684},[449,16105,2991],{"class":1491},[449,16107,1758],{"class":684},[449,16109,1498],{"class":680},[449,16111,1501],{"class":684},[449,16113,16114,16116,16118,16120,16122,16124],{"class":451,"line":468},[449,16115,5048],{"class":680},[449,16117,5051],{"class":714},[449,16119,718],{"class":680},[449,16121,1654],{"class":680},[449,16123,5060],{"class":721},[449,16125,12843],{"class":684},[449,16127,16128],{"class":451,"line":474},[449,16129,700],{"emptyLinePlaceholder":130},[449,16131,16132,16134,16136,16138],{"class":451,"line":480},[449,16133,5048],{"class":680},[449,16135,5194],{"class":714},[449,16137,718],{"class":680},[449,16139,1501],{"class":684},[449,16141,16142,16144,16146],{"class":451,"line":486},[449,16143,5203],{"class":684},[449,16145,5206],{"class":721},[449,16147,1624],{"class":684},[449,16149,16150],{"class":451,"line":492},[449,16151,15571],{"class":684},[449,16153,16154,16156,16158],{"class":451,"line":498},[449,16155,5218],{"class":684},[449,16157,5221],{"class":691},[449,16159,779],{"class":684},[449,16161,16162,16164,16166],{"class":451,"line":133},[449,16163,15584],{"class":684},[449,16165,4756],{"class":721},[449,16167,1624],{"class":684},[449,16169,16170],{"class":451,"line":509},[449,16171,4763],{"class":684},[449,16173,16174],{"class":451,"line":318},[449,16175,700],{"emptyLinePlaceholder":130},[449,16177,16178,16180,16183,16186,16188,16191,16193,16195,16198,16200],{"class":451,"line":520},[449,16179,2099],{"class":680},[449,16181,16182],{"class":684}," storage.",[449,16184,16185],{"class":721},"setItem",[449,16187,725],{"class":684},[449,16189,16190],{"class":691},"`orders:${",[449,16192,14182],{"class":684},[449,16194,165],{"class":691},[449,16196,16197],{"class":684},"id",[449,16199,1517],{"class":691},[449,16201,16202],{"class":684},", order);\n",[449,16204,16205,16207],{"class":451,"line":526},[449,16206,4726],{"class":680},[449,16208,5272],{"class":684},[449,16210,16211],{"class":451,"line":532},[449,16212,784],{"class":684},[21,16214,16215],{},"Now orders persist across restarts.",[73,16217],{},[32,16219,16221],{"id":16220},"step-3-input-validation","Step 3: Input Validation",[21,16223,16224],{},"Never trust user input — even for coffee ☕.",[21,16226,4697,16227,3070],{},[40,16228,16229],{},"server\u002Futils\u002Fvalidation.ts",[48,16231,16233],{"className":670,"code":16232,"language":673,"meta":56,"style":56},"export function validateOrder(body: any) {\n  if (!body?.items || !Array.isArray(body.items)) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Invalid order format\",\n    });\n  }\n}\n",[40,16234,16235,16255,16277,16285,16293,16302,16306,16310],{"__ignoreMap":56},[449,16236,16237,16239,16241,16244,16246,16249,16251,16253],{"class":451,"line":452},[449,16238,4629],{"class":680},[449,16240,5433],{"class":680},[449,16242,16243],{"class":721}," validateOrder",[449,16245,725],{"class":684},[449,16247,16248],{"class":1491},"body",[449,16250,3070],{"class":680},[449,16252,5008],{"class":714},[449,16254,3417],{"class":684},[449,16256,16257,16259,16261,16263,16266,16268,16270,16272,16274],{"class":451,"line":114},[449,16258,5080],{"class":680},[449,16260,1913],{"class":684},[449,16262,5085],{"class":680},[449,16264,16265],{"class":684},"body?.items ",[449,16267,5091],{"class":680},[449,16269,12868],{"class":680},[449,16271,12871],{"class":684},[449,16273,12874],{"class":721},[449,16275,16276],{"class":684},"(body.items)) {\n",[449,16278,16279,16281,16283],{"class":451,"line":111},[449,16280,5110],{"class":680},[449,16282,5113],{"class":721},[449,16284,1391],{"class":684},[449,16286,16287,16289,16291],{"class":451,"line":468},[449,16288,5120],{"class":684},[449,16290,5123],{"class":714},[449,16292,779],{"class":684},[449,16294,16295,16297,16300],{"class":451,"line":474},[449,16296,5130],{"class":684},[449,16298,16299],{"class":691},"\"Invalid order format\"",[449,16301,779],{"class":684},[449,16303,16304],{"class":451,"line":480},[449,16305,3484],{"class":684},[449,16307,16308],{"class":451,"line":486},[449,16309,4599],{"class":684},[449,16311,16312],{"class":451,"line":492},[449,16313,4604],{"class":684},[21,16315,16316],{},"Use it in your endpoint:",[48,16318,16320],{"className":670,"code":16319,"language":673,"meta":56,"style":56},"import { validateOrder } from \"..\u002Futils\u002Fvalidation\";\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n  validateOrder(body);\n  \u002F\u002F continue logic\n});\n",[40,16321,16322,16336,16340,16362,16376,16384,16389],{"__ignoreMap":56},[449,16323,16324,16326,16329,16331,16334],{"class":451,"line":452},[449,16325,681],{"class":680},[449,16327,16328],{"class":684}," { validateOrder } ",[449,16330,688],{"class":680},[449,16332,16333],{"class":691}," \"..\u002Futils\u002Fvalidation\"",[449,16335,695],{"class":684},[449,16337,16338],{"class":451,"line":114},[449,16339,700],{"emptyLinePlaceholder":130},[449,16341,16342,16344,16346,16348,16350,16352,16354,16356,16358,16360],{"class":451,"line":111},[449,16343,4629],{"class":680},[449,16345,4632],{"class":680},[449,16347,4714],{"class":721},[449,16349,725],{"class":684},[449,16351,1485],{"class":680},[449,16353,1913],{"class":684},[449,16355,2991],{"class":1491},[449,16357,1758],{"class":684},[449,16359,1498],{"class":680},[449,16361,1501],{"class":684},[449,16363,16364,16366,16368,16370,16372,16374],{"class":451,"line":468},[449,16365,5048],{"class":680},[449,16367,5051],{"class":714},[449,16369,718],{"class":680},[449,16371,1654],{"class":680},[449,16373,5060],{"class":721},[449,16375,12843],{"class":684},[449,16377,16378,16381],{"class":451,"line":474},[449,16379,16380],{"class":721},"  validateOrder",[449,16382,16383],{"class":684},"(body);\n",[449,16385,16386],{"class":451,"line":480},[449,16387,16388],{"class":705},"  \u002F\u002F continue logic\n",[449,16390,16391],{"class":451,"line":486},[449,16392,784],{"class":684},[21,16394,16395],{},"Validation protects your API from malformed requests and accidental misuse.\n::",[73,16397],{},[32,16399,16401],{"id":16400},"step-4-fetch-orders-update-status","Step 4: Fetch Orders & Update Status",[2808,16403,14054],{"id":14053},[21,16405,4697,16406,3070],{},[40,16407,14059],{},[48,16409,16411],{"className":670,"code":16410,"language":673,"meta":56,"style":56},"import { storage } from \"..\u002Futils\u002Fstorage\";\n\nexport default defineEventHandler(async () => {\n  const keys = await storage.getKeys(\"orders:\");\n  const orders = await Promise.all(keys.map((key) => storage.getItem(key)));\n  return orders;\n});\n",[40,16412,16413,16425,16429,16447,16470,16508,16515],{"__ignoreMap":56},[449,16414,16415,16417,16419,16421,16423],{"class":451,"line":452},[449,16416,681],{"class":680},[449,16418,16078],{"class":684},[449,16420,688],{"class":680},[449,16422,16083],{"class":691},[449,16424,695],{"class":684},[449,16426,16427],{"class":451,"line":114},[449,16428,700],{"emptyLinePlaceholder":130},[449,16430,16431,16433,16435,16437,16439,16441,16443,16445],{"class":451,"line":111},[449,16432,4629],{"class":680},[449,16434,4632],{"class":680},[449,16436,4714],{"class":721},[449,16438,725],{"class":684},[449,16440,1485],{"class":680},[449,16442,2090],{"class":684},[449,16444,1498],{"class":680},[449,16446,1501],{"class":684},[449,16448,16449,16451,16454,16456,16458,16460,16463,16465,16468],{"class":451,"line":468},[449,16450,5048],{"class":680},[449,16452,16453],{"class":714}," keys",[449,16455,718],{"class":680},[449,16457,1654],{"class":680},[449,16459,16182],{"class":684},[449,16461,16462],{"class":721},"getKeys",[449,16464,725],{"class":684},[449,16466,16467],{"class":691},"\"orders:\"",[449,16469,740],{"class":684},[449,16471,16472,16474,16476,16478,16480,16482,16484,16486,16489,16491,16493,16496,16498,16500,16502,16505],{"class":451,"line":474},[449,16473,5048],{"class":680},[449,16475,5003],{"class":714},[449,16477,718],{"class":680},[449,16479,1654],{"class":680},[449,16481,5161],{"class":714},[449,16483,165],{"class":684},[449,16485,5813],{"class":721},[449,16487,16488],{"class":684},"(keys.",[449,16490,6391],{"class":721},[449,16492,5164],{"class":684},[449,16494,16495],{"class":1491},"key",[449,16497,1758],{"class":684},[449,16499,1498],{"class":680},[449,16501,16182],{"class":684},[449,16503,16504],{"class":721},"getItem",[449,16506,16507],{"class":684},"(key)));\n",[449,16509,16510,16512],{"class":451,"line":480},[449,16511,4726],{"class":680},[449,16513,16514],{"class":684}," orders;\n",[449,16516,16517],{"class":451,"line":486},[449,16518,784],{"class":684},[2808,16520,13576],{"id":13575},[21,16522,4697,16523,3070],{},[40,16524,13581],{},[48,16526,16528],{"className":670,"code":16527,"language":673,"meta":56,"style":56},"import { storage } from \"..\u002F..\u002Futils\u002Fstorage\";\n\nexport default defineEventHandler(async (event) => {\n  const id = event.context.params?.id;\n  const body = await readBody(event);\n\n  const order = await storage.getItem(`orders:${id}`);\n  if (!order) {\n    throw createError({ statusCode: 404, statusMessage: \"Order not found\" });\n  }\n\n  const updated = { ...order, status: body.status };\n  await storage.setItem(`orders:${id}`, updated);\n\n  return updated;\n});\n",[40,16529,16530,16543,16547,16569,16580,16594,16598,16622,16633,16651,16655,16659,16675,16694,16698,16705],{"__ignoreMap":56},[449,16531,16532,16534,16536,16538,16541],{"class":451,"line":452},[449,16533,681],{"class":680},[449,16535,16078],{"class":684},[449,16537,688],{"class":680},[449,16539,16540],{"class":691}," \"..\u002F..\u002Futils\u002Fstorage\"",[449,16542,695],{"class":684},[449,16544,16545],{"class":451,"line":114},[449,16546,700],{"emptyLinePlaceholder":130},[449,16548,16549,16551,16553,16555,16557,16559,16561,16563,16565,16567],{"class":451,"line":111},[449,16550,4629],{"class":680},[449,16552,4632],{"class":680},[449,16554,4714],{"class":721},[449,16556,725],{"class":684},[449,16558,1485],{"class":680},[449,16560,1913],{"class":684},[449,16562,2991],{"class":1491},[449,16564,1758],{"class":684},[449,16566,1498],{"class":680},[449,16568,1501],{"class":684},[449,16570,16571,16573,16575,16577],{"class":451,"line":468},[449,16572,5048],{"class":680},[449,16574,12546],{"class":714},[449,16576,718],{"class":680},[449,16578,16579],{"class":684}," event.context.params?.id;\n",[449,16581,16582,16584,16586,16588,16590,16592],{"class":451,"line":474},[449,16583,5048],{"class":680},[449,16585,5051],{"class":714},[449,16587,718],{"class":680},[449,16589,1654],{"class":680},[449,16591,5060],{"class":721},[449,16593,12843],{"class":684},[449,16595,16596],{"class":451,"line":480},[449,16597,700],{"emptyLinePlaceholder":130},[449,16599,16600,16602,16604,16606,16608,16610,16612,16614,16616,16618,16620],{"class":451,"line":486},[449,16601,5048],{"class":680},[449,16603,5194],{"class":714},[449,16605,718],{"class":680},[449,16607,1654],{"class":680},[449,16609,16182],{"class":684},[449,16611,16504],{"class":721},[449,16613,725],{"class":684},[449,16615,16190],{"class":691},[449,16617,16197],{"class":684},[449,16619,1517],{"class":691},[449,16621,740],{"class":684},[449,16623,16624,16626,16628,16630],{"class":451,"line":492},[449,16625,5080],{"class":680},[449,16627,1913],{"class":684},[449,16629,5085],{"class":680},[449,16631,16632],{"class":684},"order) {\n",[449,16634,16635,16637,16639,16642,16644,16647,16649],{"class":451,"line":498},[449,16636,5110],{"class":680},[449,16638,5113],{"class":721},[449,16640,16641],{"class":684},"({ statusCode: ",[449,16643,12676],{"class":714},[449,16645,16646],{"class":684},", statusMessage: ",[449,16648,13920],{"class":691},[449,16650,2051],{"class":684},[449,16652,16653],{"class":451,"line":133},[449,16654,4599],{"class":684},[449,16656,16657],{"class":451,"line":509},[449,16658,700],{"emptyLinePlaceholder":130},[449,16660,16661,16663,16666,16668,16670,16672],{"class":451,"line":318},[449,16662,5048],{"class":680},[449,16664,16665],{"class":714}," updated",[449,16667,718],{"class":680},[449,16669,14227],{"class":684},[449,16671,14230],{"class":680},[449,16673,16674],{"class":684},"order, status: body.status };\n",[449,16676,16677,16679,16681,16683,16685,16687,16689,16691],{"class":451,"line":520},[449,16678,2099],{"class":680},[449,16680,16182],{"class":684},[449,16682,16185],{"class":721},[449,16684,725],{"class":684},[449,16686,16190],{"class":691},[449,16688,16197],{"class":684},[449,16690,1517],{"class":691},[449,16692,16693],{"class":684},", updated);\n",[449,16695,16696],{"class":451,"line":526},[449,16697,700],{"emptyLinePlaceholder":130},[449,16699,16700,16702],{"class":451,"line":532},[449,16701,4726],{"class":680},[449,16703,16704],{"class":684}," updated;\n",[449,16706,16707],{"class":451,"line":2790},[449,16708,784],{"class":684},[21,16710,16711],{},"Now BrewStop supports a real workflow:",[383,16713,16714],{},[386,16715,16716],{},"pending → preparing → ready → completed",[73,16718],{},[32,16720,16722],{"id":16721},"step-5-add-middleware-logging","Step 5: Add Middleware (Logging)",[21,16724,4697,16725,3070],{},[40,16726,16727],{},"server\u002Fplugins\u002Flogger.ts",[48,16729,16731],{"className":670,"code":16730,"language":673,"meta":56,"style":56},"export default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook(\"request\", (event) => {\n    console.log(`[${new Date().toISOString()}] ${event.method} ${event.path}`);\n  });\n});\n",[40,16732,16733,16753,16776,16822,16826],{"__ignoreMap":56},[449,16734,16735,16737,16739,16742,16744,16747,16749,16751],{"class":451,"line":452},[449,16736,4629],{"class":680},[449,16738,4632],{"class":680},[449,16740,16741],{"class":721}," defineNitroPlugin",[449,16743,5164],{"class":684},[449,16745,16746],{"class":1491},"nitroApp",[449,16748,1758],{"class":684},[449,16750,1498],{"class":680},[449,16752,1501],{"class":684},[449,16754,16755,16758,16761,16763,16766,16768,16770,16772,16774],{"class":451,"line":114},[449,16756,16757],{"class":684},"  nitroApp.hooks.",[449,16759,16760],{"class":721},"hook",[449,16762,725],{"class":684},[449,16764,16765],{"class":691},"\"request\"",[449,16767,3500],{"class":684},[449,16769,2991],{"class":1491},[449,16771,1758],{"class":684},[449,16773,1498],{"class":680},[449,16775,1501],{"class":684},[449,16777,16778,16780,16782,16784,16787,16789,16791,16793,16795,16798,16801,16803,16805,16808,16811,16813,16815,16818,16820],{"class":451,"line":111},[449,16779,3002],{"class":684},[449,16781,1675],{"class":721},[449,16783,725],{"class":684},[449,16785,16786],{"class":691},"`[${",[449,16788,5231],{"class":680},[449,16790,5234],{"class":721},[449,16792,5237],{"class":691},[449,16794,5240],{"class":721},[449,16796,16797],{"class":691},"()",[449,16799,16800],{"class":691},"}] ${",[449,16802,2991],{"class":684},[449,16804,165],{"class":691},[449,16806,16807],{"class":684},"method",[449,16809,16810],{"class":691},"} ${",[449,16812,2991],{"class":684},[449,16814,165],{"class":691},[449,16816,16817],{"class":684},"path",[449,16819,1517],{"class":691},[449,16821,740],{"class":684},[449,16823,16824],{"class":451,"line":468},[449,16825,13321],{"class":684},[449,16827,16828],{"class":451,"line":474},[449,16829,784],{"class":684},[21,16831,16832],{},"This gives you centralized request logging without cluttering endpoints.",[73,16834],{},[32,16836,16838],{"id":16837},"step-6-simple-api-key-protection","Step 6: Simple API Key Protection",[21,16840,16841],{},"Let’s protect order updates.",[21,16843,4616,16844,3070],{},[40,16845,15357],{},[48,16847,16849],{"className":670,"code":16848,"language":673,"meta":56,"style":56},"export default defineNitroConfig({\n  runtimeConfig: {\n    apiKey: \"super-secret-key\",\n  },\n});\n",[40,16850,16851,16861,16865,16875,16879],{"__ignoreMap":56},[449,16852,16853,16855,16857,16859],{"class":451,"line":452},[449,16854,4629],{"class":680},[449,16856,4632],{"class":680},[449,16858,15389],{"class":721},[449,16860,1391],{"class":684},[449,16862,16863],{"class":451,"line":114},[449,16864,15396],{"class":684},[449,16866,16867,16870,16873],{"class":451,"line":111},[449,16868,16869],{"class":684},"    apiKey: ",[449,16871,16872],{"class":691},"\"super-secret-key\"",[449,16874,779],{"class":684},[449,16876,16877],{"class":451,"line":468},[449,16878,1474],{"class":684},[449,16880,16881],{"class":451,"line":474},[449,16882,784],{"class":684},[21,16884,4697,16885,3070],{},[40,16886,16887],{},"server\u002Fplugins\u002Fauth.ts",[48,16889,16891],{"className":670,"code":16890,"language":673,"meta":56,"style":56},"export default defineNitroPlugin(() => {\n  addEventHandler((event) => {\n    if (event.path.startsWith(\"\u002Fapi\u002Forders\") && event.method !== \"GET\") {\n      const key = event.headers.get(\"x-api-key\");\n      if (key !== useRuntimeConfig().apiKey) {\n        throw createError({ statusCode: 401, statusMessage: \"Unauthorized\" });\n      }\n    }\n  });\n});\n",[40,16892,16893,16907,16922,16953,16974,16989,17008,17012,17016,17020],{"__ignoreMap":56},[449,16894,16895,16897,16899,16901,16903,16905],{"class":451,"line":452},[449,16896,4629],{"class":680},[449,16898,4632],{"class":680},[449,16900,16741],{"class":721},[449,16902,4717],{"class":684},[449,16904,1498],{"class":680},[449,16906,1501],{"class":684},[449,16908,16909,16912,16914,16916,16918,16920],{"class":451,"line":114},[449,16910,16911],{"class":721},"  addEventHandler",[449,16913,5164],{"class":684},[449,16915,2991],{"class":1491},[449,16917,1758],{"class":684},[449,16919,1498],{"class":680},[449,16921,1501],{"class":684},[449,16923,16924,16926,16929,16932,16934,16937,16939,16942,16945,16948,16951],{"class":451,"line":111},[449,16925,13044],{"class":680},[449,16927,16928],{"class":684}," (event.path.",[449,16930,16931],{"class":721},"startsWith",[449,16933,725],{"class":684},[449,16935,16936],{"class":691},"\"\u002Fapi\u002Forders\"",[449,16938,1758],{"class":684},[449,16940,16941],{"class":680},"&&",[449,16943,16944],{"class":684}," event.method ",[449,16946,16947],{"class":680},"!==",[449,16949,16950],{"class":691}," \"GET\"",[449,16952,3417],{"class":684},[449,16954,16955,16957,16960,16962,16965,16967,16969,16972],{"class":451,"line":468},[449,16956,14193],{"class":680},[449,16958,16959],{"class":714}," key",[449,16961,718],{"class":680},[449,16963,16964],{"class":684}," event.headers.",[449,16966,12644],{"class":721},[449,16968,725],{"class":684},[449,16970,16971],{"class":691},"\"x-api-key\"",[449,16973,740],{"class":684},[449,16975,16976,16979,16982,16984,16986],{"class":451,"line":474},[449,16977,16978],{"class":680},"      if",[449,16980,16981],{"class":684}," (key ",[449,16983,16947],{"class":680},[449,16985,15457],{"class":721},[449,16987,16988],{"class":684},"().apiKey) {\n",[449,16990,16991,16994,16996,16998,17001,17003,17006],{"class":451,"line":480},[449,16992,16993],{"class":680},"        throw",[449,16995,5113],{"class":721},[449,16997,16641],{"class":684},[449,16999,17000],{"class":714},"401",[449,17002,16646],{"class":684},[449,17004,17005],{"class":691},"\"Unauthorized\"",[449,17007,2051],{"class":684},[449,17009,17010],{"class":451,"line":486},[449,17011,8786],{"class":684},[449,17013,17014],{"class":451,"line":492},[449,17015,7544],{"class":684},[449,17017,17018],{"class":451,"line":498},[449,17019,13321],{"class":684},[449,17021,17022],{"class":451,"line":133},[449,17023,784],{"class":684},[21,17025,17026],{},"This is intentionally simple — Nitro plugins scale well to JWT, OAuth, or third-party auth later.\n::",[73,17028],{},[32,17030,17032],{"id":17031},"step-7-deployment-readiness","Step 7: Deployment Readiness",[21,17034,17035],{},"Build your app:",[48,17037,17039],{"className":839,"code":17038,"language":841,"meta":56,"style":56},"npm run build\n",[40,17040,17041],{"__ignoreMap":56},[449,17042,17043,17045,17047],{"class":451,"line":452},[449,17044,3703],{"class":721},[449,17046,5297],{"class":691},[449,17048,6799],{"class":691},[21,17050,17051,17052,17055],{},"Nitro outputs a ",[40,17053,17054],{},".output"," directory that can run on:",[383,17057,17058,17061,17064],{},[386,17059,17060],{},"Node.js servers",[386,17062,17063],{},"Serverless platforms",[386,17065,17066],{},"Edge runtimes",[48,17068,17070],{"className":839,"code":17069,"language":841,"meta":56,"style":56},"node .output\u002Fserver\u002Findex.mjs\n",[40,17071,17072],{"__ignoreMap":56},[449,17073,17074,17077],{"class":451,"line":452},[449,17075,17076],{"class":721},"node",[449,17078,6808],{"class":691},[21,17080,17081],{},"No changes needed.",[73,17083],{},[32,17085,17087],{"id":17086},"final-api-overview","Final API Overview",[2808,17089,17091],{"id":17090},"brewstop-api-final","BrewStop API (Final)",[383,17093,17094,17098,17102,17106,17110],{},[386,17095,6862,17096],{},[40,17097,14536],{},[386,17099,6862,17100],{},[40,17101,15711],{},[386,17103,6862,17104],{},[40,17105,6906],{},[386,17107,6903,17108],{},[40,17109,6906],{},[386,17111,17112,17113,15716],{},"PATCH ",[40,17114,14584],{},[21,17116,17117],{},"This backend can now realistically power:",[383,17119,17120,17123,17126,17129],{},[386,17121,17122],{},"A POS system",[386,17124,17125],{},"A mobile app",[386,17127,17128],{},"A Nuxt frontend",[386,17130,17131],{},"An admin dashboard",[73,17133],{},[16,17135,3681],{"id":3680},[21,17137,17138,17139,17142,17143,3070],{},"In just ",[151,17140,17141],{},"two parts",", we’ve built a real backend using ",[151,17144,4189],{},[383,17146,17147,17149,17152,17155,17158],{},[386,17148,16047],{},[386,17150,17151],{},"Validation",[386,17153,17154],{},"Middleware",[386,17156,17157],{},"Secure endpoints",[386,17159,17160],{},"Multi-runtime deployment",[21,17162,17163,17164,17167],{},"Nitro proves that you don’t need heavy frameworks or complex infrastructure to build ",[151,17165,17166],{},"serious applications",". With composable UnJS tools and clean architecture, you can ship fast — and scale later.",[21,17169,17170],{},"Next steps?",[383,17172,17173,17176,17179,17182],{},[386,17174,17175],{},"Add a frontend (Nuxt or Vite)",[386,17177,17178],{},"Add payments",[386,17180,17181],{},"Deploy to edge",[386,17183,17184],{},"Replace storage with a database",[21,17186,17187],{},"BrewStop is production-ready — and this is only the beginning. ☕🚀",[3728,17189,17190],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":17192},[17193,17194,17198,17199,17200,17204,17205,17206,17207],{"id":15895,"depth":114,"text":15896},{"id":15931,"depth":114,"text":15932,"children":17195},[17196,17197],{"id":15942,"depth":111,"text":15943},{"id":15960,"depth":111,"text":15961},{"id":16061,"depth":114,"text":16062},{"id":16220,"depth":114,"text":16221},{"id":16400,"depth":114,"text":16401,"children":17201},[17202,17203],{"id":14053,"depth":111,"text":14054},{"id":13575,"depth":111,"text":13576},{"id":16721,"depth":114,"text":16722},{"id":16837,"depth":114,"text":16838},{"id":17031,"depth":114,"text":17032},{"id":17086,"depth":114,"text":17087,"children":17208},[17209],{"id":17090,"depth":111,"text":17091},"Part 2 of our Nitro series where we level up the BrewStop food truck backend with validation, storage, middleware, and deployment-ready architecture.",{"type":13,"value":17212},[17213,17215,17223,17229,17241],[16,17214,333],{"id":332},[21,17216,14789,17217,15857,17219,15860,17221,15863],{},[151,17218,14792],{},[151,17220,14848],{},[151,17222,4189],{},[21,17224,14789,17225,15868,17227,15872],{},[151,17226,14815],{},[151,17228,15871],{},[383,17230,17231,17233,17235,17237,17239],{},[386,17232,15732],{},[386,17234,15879],{},[386,17236,15735],{},[386,17238,15884],{},[386,17240,15887],{},[21,17242,15890],{},[7065,15838,7068,17244,17245,15839],"unjs","serverless",{},"\u002Fblog\u002Ffood-truck-p2",{"title":15847,"description":17210},"blog\u002Ffood-truck-p2","“Application Development”","yGl_Nw8xQl-nJwoyLI-p6UtlqiurPk2QUl8upg43R6U",{"id":17253,"title":17254,"author":17255,"body":17257,"canonical":116,"categories":116,"date":18223,"description":18224,"excerpt":18225,"extension":119,"featuredImg":116,"img":18239,"keywords":18240,"language":18248,"meta":18249,"navigation":130,"ogImage":116,"path":18250,"rating":474,"readTime":318,"seo":18251,"stem":18252,"tag":18253,"__hash__":18254},"blog\u002Fblog\u002Fgithub-actions-deployment-difficulties.md","The Hard Truth About GitHub Actions and Continuous Deployment",{"name":9,"img":17256,"website":327},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1767533048\u002FPXL_20251010_202726442_2_hhudfr.jpg",{"type":13,"value":17258,"toc":18209},[17259,17261,17271,17274,17277,17282,17284,17288,17295,17298,17302,17305,17345,17352,17356,17359,17448,17451,17453,17457,17460,17464,17467,17493,17509,17513,17516,17542,17545,17547,17551,17554,17558,17621,17625,17628,17665,17668,17670,17674,17677,17681,17684,17687,17705,17712,17714,17718,17721,17725,17728,17749,17753,17756,17770,17774,17777,17792,17796,17799,17813,17817,17820,17834,17836,17840,17843,18168,18171,18179,18181,18183,18186,18189,18203,18206],[16,17260,333],{"id":332},[21,17262,17263,17264,17267,17268],{},"Every tutorial makes it look effortless. A few lines of YAML, a ",[40,17265,17266],{},"git push",", and your application magically deploys to production. ",[151,17269,17270],{},"If only it were that simple.",[21,17272,17273],{},"The reality of GitHub Actions and continuous deployment is far messier. After years of building, breaking, and rebuilding deployment pipelines, I can tell you this: CI\u002FCD is not a solved problem. It is a continuous negotiation between your code, your infrastructure, your tooling, and the infinite ways they can fail silently until 2 AM.",[21,17275,17276],{},"This post is not a tutorial. It is a field report from the trenches — an honest look at what actually goes wrong, why it goes wrong, and what you need to understand before you treat deployment as an afterthought.",[25,17278,17279],{"type":27},[21,17280,17281],{},"If you are new to CI\u002FCD, do not let this discourage you. Let it prepare you. The difficulties are real, but they are surmountable with the right mental model.",[73,17283],{},[16,17285,17287],{"id":17286},"the-illusion-of-simplicity","The Illusion of Simplicity",[21,17289,17290,17291,17294],{},"GitHub Actions sells you a dream: ",[156,17292,17293],{},"\"Automate your workflow from idea to production.\""," The marketplace is full of reusable actions. The syntax looks declarative and friendly. You copy a starter workflow, tweak a few values, and it works — once.",[21,17296,17297],{},"Then reality sets in.",[32,17299,17301],{"id":17300},"yaml-is-a-bad-programming-language","YAML Is a Bad Programming Language",[21,17303,17304],{},"YAML was designed for configuration, not logic. Yet GitHub Actions forces you to express conditional behavior, matrix builds, job dependencies, and environment-specific logic in a format that:",[383,17306,17307,17310,17322,17339],{},[386,17308,17309],{},"Fails silently on indentation errors",[386,17311,17312,17313,349,17316,1542,17318,17321],{},"Has no type system — ",[40,17314,17315],{},"\"true\"",[40,17317,2169],{},[40,17319,17320],{},"True"," are different things",[386,17323,17324,17325,17328,17329,349,17332,349,17335,17338],{},"Uses ",[40,17326,17327],{},"${{ }}"," expression syntax that behaves differently in ",[40,17330,17331],{},"env",[40,17333,17334],{},"with",[40,17336,17337],{},"if",", and shell contexts",[386,17340,17341,17342,17344],{},"Provides no local testing — every iteration requires a ",[40,17343,17266],{}," and a wait",[427,17346,17349],{"icon":17347,"title":17348},"🐛","The Debugging Cycle",[21,17350,17351],{},"A single missing quote in a workflow file can cost you twenty minutes: push, wait for runner allocation, watch it fail, read the logs, fix, repeat. There is no debugger. There is no REPL. There is only patience.",[32,17353,17355],{"id":17354},"the-matrix-multiplication-problem","The Matrix Multiplication Problem",[21,17357,17358],{},"Matrix builds are powerful until they multiply your problems:",[48,17360,17364],{"className":17361,"code":17362,"language":17363,"meta":56,"style":56},"language-yaml shiki shiki-themes github-light github-dark","strategy:\n  matrix:\n    node: [18, 20, 22]\n    os: [ubuntu-latest, windows-latest, macos-latest]\n    database: [postgres, mysql, sqlite]\n","yaml",[40,17365,17366,17375,17382,17406,17428],{"__ignoreMap":56},[449,17367,17368,17372],{"class":451,"line":452},[449,17369,17371],{"class":17370},"s9eBZ","strategy",[449,17373,17374],{"class":684},":\n",[449,17376,17377,17380],{"class":451,"line":114},[449,17378,17379],{"class":17370},"  matrix",[449,17381,17374],{"class":684},[449,17383,17384,17387,17390,17393,17395,17398,17400,17403],{"class":451,"line":111},[449,17385,17386],{"class":17370},"    node",[449,17388,17389],{"class":684},": [",[449,17391,17392],{"class":714},"18",[449,17394,349],{"class":684},[449,17396,17397],{"class":714},"20",[449,17399,349],{"class":684},[449,17401,17402],{"class":714},"22",[449,17404,17405],{"class":684},"]\n",[449,17407,17408,17411,17413,17416,17418,17421,17423,17426],{"class":451,"line":468},[449,17409,17410],{"class":17370},"    os",[449,17412,17389],{"class":684},[449,17414,17415],{"class":691},"ubuntu-latest",[449,17417,349],{"class":684},[449,17419,17420],{"class":691},"windows-latest",[449,17422,349],{"class":684},[449,17424,17425],{"class":691},"macos-latest",[449,17427,17405],{"class":684},[449,17429,17430,17433,17435,17437,17439,17442,17444,17446],{"class":451,"line":474},[449,17431,17432],{"class":17370},"    database",[449,17434,17389],{"class":684},[449,17436,14692],{"class":691},[449,17438,349],{"class":684},[449,17440,17441],{"class":691},"mysql",[449,17443,349],{"class":684},[449,17445,14693],{"class":691},[449,17447,17405],{"class":684},[21,17449,17450],{},"Congratulations, you now have 27 jobs. One flaky test on one OS with one database version will fail randomly, blocking your entire pipeline. You will spend hours chasing Heisenbugs that only reproduce on GitHub's runners, never locally.",[73,17452],{},[16,17454,17456],{"id":17455},"secrets-and-environment-hell","Secrets and Environment Hell",[21,17458,17459],{},"Managing secrets in GitHub Actions is straightforward until it is not.",[32,17461,17463],{"id":17462},"the-secret-sprawl","The Secret Sprawl",[21,17465,17466],{},"Every repository has secrets. Every environment (staging, production, review apps) has its own set. Then you have organization secrets, repository secrets, and environment secrets — each with different precedence rules. You need:",[383,17468,17469,17475,17481,17487],{},[386,17470,17471,17474],{},[40,17472,17473],{},"DATABASE_URL"," — but different for staging and production",[386,17476,17477,17480],{},[40,17478,17479],{},"API_KEY"," — rotated quarterly, now invalidating old workflow runs",[386,17482,17483,17486],{},[40,17484,17485],{},"SSH_PRIVATE_KEY"," — for deployment, but only certain branches should deploy",[386,17488,17489,17492],{},[40,17490,17491],{},"SLACK_WEBHOOK"," — for notifications, except on fork PRs",[25,17494,17496],{"type":17495},"error",[21,17497,17498,17499,17502,17503,17505,17506,17508],{},"Secrets do not interpolate the way you expect. ",[40,17500,17501],{},"${{ secrets.MY_SECRET }}"," in an ",[40,17504,17331],{}," block behaves differently than in a ",[40,17507,17334],{}," block. Fork PRs cannot access secrets by design — which breaks workflows that need them for testing.",[32,17510,17512],{"id":17511},"the-deployment-permission-labyrinth","The Deployment Permission Labyrinth",[21,17514,17515],{},"GitHub's permission model is granular to a fault:",[383,17517,17518,17524,17530,17536],{},[386,17519,17520,17523],{},[40,17521,17522],{},"contents: write"," — for pushing tags and releases",[386,17525,17526,17529],{},[40,17527,17528],{},"id-token: write"," — for OIDC authentication with cloud providers",[386,17531,17532,17535],{},[40,17533,17534],{},"packages: write"," — for publishing container images",[386,17537,17538,17541],{},[40,17539,17540],{},"actions: write"," — for caching and artifact management",[21,17543,17544],{},"Getting these wrong means cryptic 403 errors from AWS, Vercel, or Docker Hub with no indication of which permission is missing. You will add permissions one by one, pushing and waiting, until something works — without understanding why.",[73,17546],{},[16,17548,17550],{"id":17549},"the-flakiness-tax","The Flakiness Tax",[21,17552,17553],{},"Flaky tests are the silent killer of CI\u002FCD confidence. A test that passes 90% of the time teaches your team to ignore failures. Eventually, a real failure is missed because everyone assumes \"it's just flaky.\"",[32,17555,17557],{"id":17556},"sources-of-flakiness","Sources of Flakiness",[547,17559,17560,17570],{},[550,17561,17562],{},[553,17563,17564,17567],{},[556,17565,17566],{},"Source",[556,17568,17569],{},"Why It Happens",[569,17571,17572,17580,17588,17596,17610],{},[553,17573,17574,17577],{},[574,17575,17576],{},"Timing issues",[574,17578,17579],{},"Network requests, animations, database migrations finish in different orders",[553,17581,17582,17585],{},[574,17583,17584],{},"Shared state",[574,17586,17587],{},"Tests leak data into databases, filesystems, or caches",[553,17589,17590,17593],{},[574,17591,17592],{},"External services",[574,17594,17595],{},"Third-party APIs rate-limit or return different responses",[553,17597,17598,17601],{},[574,17599,17600],{},"Runner variance",[574,17602,17603,17604,17606,17607,17609],{},"GitHub's ",[40,17605,17415],{}," today is not ",[40,17608,17415],{}," six months ago",[553,17611,17612,17615],{},[574,17613,17614],{},"Caching bugs",[574,17616,17617,17620],{},[40,17618,17619],{},"actions\u002Fcache"," restores corrupted or stale dependencies",[32,17622,17624],{"id":17623},"the-retry-trap","The Retry Trap",[21,17626,17627],{},"The easiest fix is the worst fix:",[48,17629,17631],{"className":17361,"code":17630,"language":17363,"meta":56,"style":56},"- name: Run tests\n  run: npm test\n  retries: 3\n",[40,17632,17633,17645,17655],{"__ignoreMap":56},[449,17634,17635,17638,17640,17642],{"class":451,"line":452},[449,17636,17637],{"class":684},"- ",[449,17639,13144],{"class":17370},[449,17641,1482],{"class":684},[449,17643,17644],{"class":691},"Run tests\n",[449,17646,17647,17650,17652],{"class":451,"line":114},[449,17648,17649],{"class":17370},"  run",[449,17651,1482],{"class":684},[449,17653,17654],{"class":691},"npm test\n",[449,17656,17657,17660,17662],{"class":451,"line":111},[449,17658,17659],{"class":17370},"  retries",[449,17661,1482],{"class":684},[449,17663,17664],{"class":714},"3\n",[21,17666,17667],{},"You have not fixed the flakiness. You have institutionalized it. Your tests are now slower, your feedback loop is degraded, and your team trusts the pipeline less every day.",[73,17669],{},[16,17671,17673],{"id":17672},"deployment-is-not-the-end","Deployment Is Not the End",[21,17675,17676],{},"Getting code onto a server is only half the battle. The other half is knowing whether it actually works.",[32,17678,17680],{"id":17679},"the-green-checkmark-lie","The \"Green Checkmark\" Lie",[21,17682,17683],{},"A successful workflow run means the deployment step completed — not that your application is healthy. Your health checks, smoke tests, and rollback procedures matter more than the deployment itself.",[21,17685,17686],{},"We have seen pipelines that:",[383,17688,17689,17692,17695,17702],{},[386,17690,17691],{},"Deploy successfully but serve 500 errors due to missing environment variables",[386,17693,17694],{},"Pass all tests but break in production because the test database schema differs from production",[386,17696,17697,17698,17701],{},"Deploy to the wrong region because ",[40,17699,17700],{},"AWS_REGION"," was set in the wrong scope",[386,17703,17704],{},"Roll forward instead of back because rollback procedures were never tested",[427,17706,17709],{"icon":17707,"title":17708},"🔥","The Untested Rollback",[21,17710,17711],{},"The most dangerous code in your repository is not your application. It is your rollback script — which you have never actually run under pressure.",[73,17713],{},[16,17715,17717],{"id":17716},"what-you-actually-need","What You Actually Need",[21,17719,17720],{},"After years of fighting with GitHub Actions, here is what we have learned about what a reliable CI\u002FCD setup actually requires.",[32,17722,17724],{"id":17723},"_1-treat-pipelines-as-production-code","1. Treat Pipelines as Production Code",[21,17726,17727],{},"Your workflow files deserve the same rigor as your application code:",[383,17729,17730,17740,17743,17746],{},[386,17731,17732,17733,17736,17737],{},"Version pin your actions: ",[40,17734,17735],{},"actions\u002Fcheckout@v4.1.1",", not ",[40,17738,17739],{},"@v4",[386,17741,17742],{},"Use reusable workflows to reduce duplication and centralize logic",[386,17744,17745],{},"Document why each step exists, not just what it does",[386,17747,17748],{},"Review workflow changes in pull requests with the same scrutiny as application changes",[32,17750,17752],{"id":17751},"_2-test-your-deployment-not-just-your-code","2. Test Your Deployment, Not Just Your Code",[21,17754,17755],{},"A deployment pipeline should verify the deployment, not just execute it:",[383,17757,17758,17761,17764,17767],{},[386,17759,17760],{},"Health checks after every deploy",[386,17762,17763],{},"Smoke tests against the production environment",[386,17765,17766],{},"Canary or blue-green deployments for critical services",[386,17768,17769],{},"Automated rollbacks when error rates spike",[32,17771,17773],{"id":17772},"_3-isolate-and-reproduce","3. Isolate and Reproduce",[21,17775,17776],{},"When a pipeline fails, you need to reproduce it locally:",[383,17778,17779,17786,17789],{},[386,17780,17781,17782,17785],{},"Use ",[40,17783,17784],{},"act"," to run workflows locally (with caveats — it is not perfect)",[386,17787,17788],{},"Containerize your build environment so local and CI behave identically",[386,17790,17791],{},"Log everything. The cost of storage is nothing compared to the cost of debugging a failure you cannot see.",[32,17793,17795],{"id":17794},"_4-own-your-observability","4. Own Your Observability",[21,17797,17798],{},"If you cannot answer these questions in under 60 seconds, your observability is insufficient:",[383,17800,17801,17804,17807,17810],{},[386,17802,17803],{},"When did this specific commit last deploy to production?",[386,17805,17806],{},"Which workflow run introduced this regression?",[386,17808,17809],{},"How long does the average deployment take, and is it trending up?",[386,17811,17812],{},"What is the failure rate of our pipeline by job and by step?",[32,17814,17816],{"id":17815},"_5-accept-that-failure-is-normal","5. Accept That Failure Is Normal",[21,17818,17819],{},"Build for failure, not for perfection:",[383,17821,17822,17825,17828,17831],{},[386,17823,17824],{},"Every deployment should be rollback-able in under five minutes",[386,17826,17827],{},"Every secret should be rotatable without a code change",[386,17829,17830],{},"Every environment should be rebuildable from scratch in under an hour",[386,17832,17833],{},"Every team member should know how to pause deployments and who to call",[73,17835],{},[16,17837,17839],{"id":17838},"a-realistic-starting-point","A Realistic Starting Point",[21,17841,17842],{},"If you are building a GitHub Actions pipeline today, here is a minimal, defensible structure:",[48,17844,17846],{"className":17361,"code":17845,"language":17363,"meta":56,"style":56},"name: Deploy\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version-file: \".nvmrc\"\n          cache: \"npm\"\n      - run: npm ci\n      - run: npm run test:ci\n      - run: npm run lint\n      - run: npm run typecheck\n\n  deploy:\n    needs: test\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    runs-on: ubuntu-latest\n    environment: production\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Deploy\n        run: .\u002Fscripts\u002Fdeploy.sh\n      - name: Health Check\n        run: .\u002Fscripts\u002Fhealth-check.sh\n",[40,17847,17848,17857,17861,17867,17874,17886,17893,17903,17907,17914,17924,17934,17938,17945,17952,17962,17969,17982,17993,18000,18010,18020,18031,18042,18053,18064,18068,18075,18085,18094,18102,18112,18118,18128,18138,18148,18159],{"__ignoreMap":56},[449,17849,17850,17852,17854],{"class":451,"line":452},[449,17851,13144],{"class":17370},[449,17853,1482],{"class":684},[449,17855,17856],{"class":691},"Deploy\n",[449,17858,17859],{"class":451,"line":114},[449,17860,700],{"emptyLinePlaceholder":130},[449,17862,17863,17865],{"class":451,"line":111},[449,17864,3492],{"class":714},[449,17866,17374],{"class":684},[449,17868,17869,17872],{"class":451,"line":468},[449,17870,17871],{"class":17370},"  push",[449,17873,17374],{"class":684},[449,17875,17876,17879,17881,17884],{"class":451,"line":474},[449,17877,17878],{"class":17370},"    branches",[449,17880,17389],{"class":684},[449,17882,17883],{"class":691},"main",[449,17885,17405],{"class":684},[449,17887,17888,17891],{"class":451,"line":480},[449,17889,17890],{"class":17370},"  pull_request",[449,17892,17374],{"class":684},[449,17894,17895,17897,17899,17901],{"class":451,"line":486},[449,17896,17878],{"class":17370},[449,17898,17389],{"class":684},[449,17900,17883],{"class":691},[449,17902,17405],{"class":684},[449,17904,17905],{"class":451,"line":492},[449,17906,700],{"emptyLinePlaceholder":130},[449,17908,17909,17912],{"class":451,"line":498},[449,17910,17911],{"class":17370},"concurrency",[449,17913,17374],{"class":684},[449,17915,17916,17919,17921],{"class":451,"line":133},[449,17917,17918],{"class":17370},"  group",[449,17920,1482],{"class":684},[449,17922,17923],{"class":691},"${{ github.workflow }}-${{ github.ref }}\n",[449,17925,17926,17929,17931],{"class":451,"line":509},[449,17927,17928],{"class":17370},"  cancel-in-progress",[449,17930,1482],{"class":684},[449,17932,17933],{"class":714},"true\n",[449,17935,17936],{"class":451,"line":318},[449,17937,700],{"emptyLinePlaceholder":130},[449,17939,17940,17943],{"class":451,"line":520},[449,17941,17942],{"class":17370},"jobs",[449,17944,17374],{"class":684},[449,17946,17947,17950],{"class":451,"line":526},[449,17948,17949],{"class":17370},"  test",[449,17951,17374],{"class":684},[449,17953,17954,17957,17959],{"class":451,"line":532},[449,17955,17956],{"class":17370},"    runs-on",[449,17958,1482],{"class":684},[449,17960,17961],{"class":691},"ubuntu-latest\n",[449,17963,17964,17967],{"class":451,"line":2790},[449,17965,17966],{"class":17370},"    steps",[449,17968,17374],{"class":684},[449,17970,17971,17974,17977,17979],{"class":451,"line":3511},[449,17972,17973],{"class":684},"      - ",[449,17975,17976],{"class":17370},"uses",[449,17978,1482],{"class":684},[449,17980,17981],{"class":691},"actions\u002Fcheckout@v4\n",[449,17983,17984,17986,17988,17990],{"class":451,"line":3526},[449,17985,17973],{"class":684},[449,17987,17976],{"class":17370},[449,17989,1482],{"class":684},[449,17991,17992],{"class":691},"actions\u002Fsetup-node@v4\n",[449,17994,17995,17998],{"class":451,"line":3531},[449,17996,17997],{"class":17370},"        with",[449,17999,17374],{"class":684},[449,18001,18002,18005,18007],{"class":451,"line":3536},[449,18003,18004],{"class":17370},"          node-version-file",[449,18006,1482],{"class":684},[449,18008,18009],{"class":691},"\".nvmrc\"\n",[449,18011,18012,18015,18017],{"class":451,"line":4009},[449,18013,18014],{"class":17370},"          cache",[449,18016,1482],{"class":684},[449,18018,18019],{"class":691},"\"npm\"\n",[449,18021,18022,18024,18026,18028],{"class":451,"line":4015},[449,18023,17973],{"class":684},[449,18025,12264],{"class":17370},[449,18027,1482],{"class":684},[449,18029,18030],{"class":691},"npm ci\n",[449,18032,18033,18035,18037,18039],{"class":451,"line":4021},[449,18034,17973],{"class":684},[449,18036,12264],{"class":17370},[449,18038,1482],{"class":684},[449,18040,18041],{"class":691},"npm run test:ci\n",[449,18043,18044,18046,18048,18050],{"class":451,"line":4027},[449,18045,17973],{"class":684},[449,18047,12264],{"class":17370},[449,18049,1482],{"class":684},[449,18051,18052],{"class":691},"npm run lint\n",[449,18054,18055,18057,18059,18061],{"class":451,"line":4032},[449,18056,17973],{"class":684},[449,18058,12264],{"class":17370},[449,18060,1482],{"class":684},[449,18062,18063],{"class":691},"npm run typecheck\n",[449,18065,18066],{"class":451,"line":4038},[449,18067,700],{"emptyLinePlaceholder":130},[449,18069,18070,18073],{"class":451,"line":4044},[449,18071,18072],{"class":17370},"  deploy",[449,18074,17374],{"class":684},[449,18076,18077,18080,18082],{"class":451,"line":4049},[449,18078,18079],{"class":17370},"    needs",[449,18081,1482],{"class":684},[449,18083,18084],{"class":691},"test\n",[449,18086,18087,18089,18091],{"class":451,"line":4054},[449,18088,13044],{"class":17370},[449,18090,1482],{"class":684},[449,18092,18093],{"class":691},"github.ref == 'refs\u002Fheads\u002Fmain'\n",[449,18095,18096,18098,18100],{"class":451,"line":4059},[449,18097,17956],{"class":17370},[449,18099,1482],{"class":684},[449,18101,17961],{"class":691},[449,18103,18104,18107,18109],{"class":451,"line":4065},[449,18105,18106],{"class":17370},"    environment",[449,18108,1482],{"class":684},[449,18110,18111],{"class":691},"production\n",[449,18113,18114,18116],{"class":451,"line":4070},[449,18115,17966],{"class":17370},[449,18117,17374],{"class":684},[449,18119,18120,18122,18124,18126],{"class":451,"line":4075},[449,18121,17973],{"class":684},[449,18123,17976],{"class":17370},[449,18125,1482],{"class":684},[449,18127,17981],{"class":691},[449,18129,18130,18132,18134,18136],{"class":451,"line":4081},[449,18131,17973],{"class":684},[449,18133,13144],{"class":17370},[449,18135,1482],{"class":684},[449,18137,17856],{"class":691},[449,18139,18140,18143,18145],{"class":451,"line":4086},[449,18141,18142],{"class":17370},"        run",[449,18144,1482],{"class":684},[449,18146,18147],{"class":691},".\u002Fscripts\u002Fdeploy.sh\n",[449,18149,18150,18152,18154,18156],{"class":451,"line":4092},[449,18151,17973],{"class":684},[449,18153,13144],{"class":17370},[449,18155,1482],{"class":684},[449,18157,18158],{"class":691},"Health Check\n",[449,18160,18161,18163,18165],{"class":451,"line":4098},[449,18162,18142],{"class":17370},[449,18164,1482],{"class":684},[449,18166,18167],{"class":691},".\u002Fscripts\u002Fhealth-check.sh\n",[21,18169,18170],{},"This is not fancy. It is boring. Boring is the goal.",[25,18172,18173],{"type":363},[21,18174,18175,18176,18178],{},"Notice the ",[40,18177,17911],{}," block — it prevents multiple deployments from running simultaneously, which is a common source of race conditions and partial deployments.",[73,18180],{},[16,18182,3681],{"id":3680},[21,18184,18185],{},"GitHub Actions and continuous deployment are not easy because deployment is not easy. The YAML is awkward, the failure modes are opaque, and the gap between \"it works in the tutorial\" and \"it works in production\" is wide and deep.",[21,18187,18188],{},"The developers who succeed are not the ones who copy the most sophisticated workflows. They are the ones who:",[383,18190,18191,18194,18197,18200],{},[386,18192,18193],{},"Understand every line in their pipeline",[386,18195,18196],{},"Test their deployments, not just their code",[386,18198,18199],{},"Build for failure and know how to recover",[386,18201,18202],{},"Treat CI\u002FCD as a first-class engineering concern, not an afterthought",[21,18204,18205],{},"If you are struggling with GitHub Actions, you are not doing it wrong. You are experiencing what everyone experiences. Keep going. Document what you learn. And remember: every green checkmark in production was earned by someone who survived a lot of red ones first.",[3728,18207,18208],{},"html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}",{"title":56,"searchDepth":111,"depth":111,"links":18210},[18211,18212,18213,18214,18215,18216,18217,18218,18219,18220,18221,18222],{"id":17300,"depth":114,"text":17301},{"id":17354,"depth":114,"text":17355},{"id":17462,"depth":114,"text":17463},{"id":17511,"depth":114,"text":17512},{"id":17556,"depth":114,"text":17557},{"id":17623,"depth":114,"text":17624},{"id":17679,"depth":114,"text":17680},{"id":17723,"depth":114,"text":17724},{"id":17751,"depth":114,"text":17752},{"id":17772,"depth":114,"text":17773},{"id":17794,"depth":114,"text":17795},{"id":17815,"depth":114,"text":17816},"2026-06-10","CI\u002FCD pipelines look simple in tutorials. In practice, GitHub Actions is a maze of YAML syntax, secret management, flaky tests, and deployment failures that only show up in production.",{"type":13,"value":18226},[18227,18229,18235,18237],[16,18228,333],{"id":332},[21,18230,17263,18231,17267,18233],{},[40,18232,17266],{},[151,18234,17270],{},[21,18236,17273],{},[21,18238,17276],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1775009589\u002Fgithub-actions_cd_dificulties.png",[18241,18242,18243,18244,17363,18245,18246,18247],"github actions","ci\u002Fcd","continuous deployment","devops","automation","deployment pipeline","github secrets","YAML",{},"\u002Fblog\u002Fgithub-actions-deployment-difficulties",{"title":17254,"description":18224},"blog\u002Fgithub-actions-deployment-difficulties","DevOps","0mWetmKIAGj5R2A_N-ATyUw5LLvFV9mc7q0h6xBw0Zo",{"id":18256,"title":18257,"author":18258,"body":18259,"canonical":116,"categories":116,"date":8289,"description":20795,"excerpt":116,"extension":119,"featuredImg":116,"img":20796,"keywords":20797,"language":3788,"meta":20804,"navigation":130,"ogImage":116,"path":20805,"rating":116,"readTime":318,"seo":20806,"stem":20807,"tag":3793,"__hash__":20808},"blog\u002Fblog\u002Fllms-and-ai-harness-integration.md","LLMs and Their Integration with AI Harnesses: A Comprehensive Guide",{"name":9,"img":11,"website":327},{"type":13,"value":18260,"toc":20727},[18261,18264,18266,18269,18272,18275,18277,18343,18346,18350,18353,18379,18383,18415,18419,18439,18442,18446,18449,18487,18491,18494,18526,18529,18533,18536,18562,18566,18569,18595,18599,18602,18628,18631,18635,18640,18654,18659,18670,18674,18678,18692,18696,18707,18711,18715,18729,18733,18744,18748,18752,18766,18770,18781,18785,18789,18803,18807,18818,18822,18826,18840,18844,18858,18861,18865,18871,18876,18887,18892,18903,18908,18919,18923,18928,18932,18943,18947,18958,18962,18973,18977,18982,18986,18997,19001,19012,19016,19027,19031,19036,19041,19047,19051,19056,19060,19071,19075,19081,19084,19088,19108,19112,19132,19136,19156,19160,19176,19179,19199,19202,19206,19211,19222,19227,19240,19244,19248,19259,19263,19277,19281,19285,19296,19300,19314,19318,19322,19333,19337,19351,19355,19359,19370,19374,19388,19391,19395,19401,19407,19411,19422,19426,19437,19441,19446,19451,19455,19466,19470,19481,19485,19490,19495,19499,19510,19514,19525,19529,19534,19539,19543,19554,19558,19569,19573,19578,19583,19587,19598,19602,19612,19615,19619,19624,19638,19643,19814,19818,19823,19840,19844,20038,20042,20047,20061,20065,20259,20263,20268,20282,20286,20535,20538,20542,20548,20552,20565,20569,20580,20584,20589,20594,20608,20613,20624,20628,20633,20637,20651,20655,20660,20664,20678,20682,20687,20692,20706,20708,20711,20714,20717,20719,20724],[16,18262,18257],{"id":18263},"llms-and-their-integration-with-ai-harnesses-a-comprehensive-guide",[32,18265,333],{"id":332},[21,18267,18268],{},"Large Language Models (LLMs) have revolutionized the field of artificial intelligence, enabling applications that can understand, generate, and reason with human language at unprecedented scale. However, deploying these powerful models in production environments requires more than just model weights and inference code.",[21,18270,18271],{},"Enter AI harnesses - the infrastructure and tooling layer that bridges the gap between raw LLM capabilities and practical, production-ready applications.",[21,18273,18274],{},"In this comprehensive guide, we'll explore what AI harnesses are, why they're essential for LLM integration, and how to design and implement effective harness architectures for your applications.",[32,18276,7095],{"id":7094},[816,18278,18279,18285,18291,18297,18303,18309,18315,18321,18327,18333,18339],{},[386,18280,18281],{},[3861,18282,18284],{"href":18283},"#understanding-large-language-models","Understanding Large Language Models",[386,18286,18287],{},[3861,18288,18290],{"href":18289},"#what-are-ai-harnesses","What Are AI Harnesses?",[386,18292,18293],{},[3861,18294,18296],{"href":18295},"#why-ai-harnesses-matter-for-llm-integration","Why AI Harnesses Matter for LLM Integration",[386,18298,18299],{},[3861,18300,18302],{"href":18301},"#core-components-of-an-ai-harness","Core Components of an AI Harness",[386,18304,18305],{},[3861,18306,18308],{"href":18307},"#integration-patterns-and-approaches","Integration Patterns and Approaches",[386,18310,18311],{},[3861,18312,18314],{"href":18313},"#benefits-of-ai-harness-integration","Benefits of AI Harness Integration",[386,18316,18317],{},[3861,18318,18320],{"href":18319},"#technical-considerations-and-challenges","Technical Considerations and Challenges",[386,18322,18323],{},[3861,18324,18326],{"href":18325},"#use-cases-and-real-world-examples","Use Cases and Real-World Examples",[386,18328,18329],{},[3861,18330,18332],{"href":18331},"#best-practices-for-llm-integration","Best Practices for LLM Integration",[386,18334,18335],{},[3861,18336,18338],{"href":18337},"#future-trends-in-ai-harness-design","Future Trends in AI Harness Design",[386,18340,18341],{},[3861,18342,3681],{"href":7144},[32,18344,18284],{"id":18345},"understanding-large-language-models",[2808,18347,18349],{"id":18348},"what-are-llms","What Are LLMs?",[21,18351,18352],{},"Large Language Models are deep learning models trained on vast amounts of text data to understand and generate human language. Key characteristics include:",[383,18354,18355,18361,18367,18373],{},[386,18356,18357,18360],{},[151,18358,18359],{},"Scale",": Models with billions to trillions of parameters",[386,18362,18363,18366],{},[151,18364,18365],{},"Autoregressive",": Predict next token based on context",[386,18368,18369,18372],{},[151,18370,18371],{},"Transformer Architecture",": Self-attention mechanisms for context understanding",[386,18374,18375,18378],{},[151,18376,18377],{},"Pre-training",": Learned from massive text corpora before fine-tuning",[2808,18380,18382],{"id":18381},"common-llm-families","Common LLM Families",[383,18384,18385,18391,18397,18403,18409],{},[386,18386,18387,18390],{},[151,18388,18389],{},"GPT Series",": OpenAI's ChatGPT, GPT-3, GPT-4",[386,18392,18393,18396],{},[151,18394,18395],{},"Llama Series",": Meta's open-source models",[386,18398,18399,18402],{},[151,18400,18401],{},"Claude Series",": Anthropic's conversational AI",[386,18404,18405,18408],{},[151,18406,18407],{},"Gemini Series",": Google's multimodal models",[386,18410,18411,18414],{},[151,18412,18413],{},"Mistral Series",": Efficient open-source models",[2808,18416,18418],{"id":18417},"llm-capabilities","LLM Capabilities",[383,18420,18421,18424,18427,18430,18433,18436],{},[386,18422,18423],{},"Text generation and completion",[386,18425,18426],{},"Summarization and translation",[386,18428,18429],{},"Question answering and reasoning",[386,18431,18432],{},"Code generation and debugging",[386,18434,18435],{},"Content creation and editing",[386,18437,18438],{},"Conversational AI and chatbots",[32,18440,18290],{"id":18441},"what-are-ai-harnesses",[2808,18443,18445],{"id":18444},"definition","Definition",[21,18447,18448],{},"An AI harness is a comprehensive infrastructure layer that provides:",[383,18450,18451,18457,18463,18469,18475,18481],{},[386,18452,18453,18456],{},[151,18454,18455],{},"Model Management",": Deployment, scaling, and monitoring of LLM services",[386,18458,18459,18462],{},[151,18460,18461],{},"API Layer",": Standardized interfaces for LLM interactions",[386,18464,18465,18468],{},[151,18466,18467],{},"Caching and Optimization",": Performance tuning and cost reduction",[386,18470,18471,18474],{},[151,18472,18473],{},"Security and Compliance",": Access control and data protection",[386,18476,18477,18480],{},[151,18478,18479],{},"Observability",": Logging, metrics, and debugging tools",[386,18482,18483,18486],{},[151,18484,18485],{},"Integration Layer",": Connectors to external systems and data sources",[2808,18488,18490],{"id":18489},"key-differentiators","Key Differentiators",[21,18492,18493],{},"Unlike traditional ML pipelines, AI harnesses are specifically designed for:",[383,18495,18496,18502,18508,18514,18520],{},[386,18497,18498,18501],{},[151,18499,18500],{},"Conversational Workflows",": Multi-turn interactions and context management",[386,18503,18504,18507],{},[151,18505,18506],{},"Prompt Engineering",": Systematic optimization of model inputs",[386,18509,18510,18513],{},[151,18511,18512],{},"Cost Management",": Token usage tracking and budget control",[386,18515,18516,18519],{},[151,18517,18518],{},"Latency Optimization",": Real-time response generation",[386,18521,18522,18525],{},[151,18523,18524],{},"Multi-modal Support",": Integration with vision, audio, and other modalities",[32,18527,18296],{"id":18528},"why-ai-harnesses-matter-for-llm-integration",[2808,18530,18532],{"id":18531},"_1-production-readiness","1. Production Readiness",[21,18534,18535],{},"LLMs trained in research environments face significant challenges when deployed in production:",[383,18537,18538,18544,18550,18556],{},[386,18539,18540,18543],{},[151,18541,18542],{},"Scalability",": Handling concurrent requests at scale",[386,18545,18546,18549],{},[151,18547,18548],{},"Reliability",": Ensuring consistent performance under load",[386,18551,18552,18555],{},[151,18553,18554],{},"Security",": Protecting sensitive data and model intellectual property",[386,18557,18558,18561],{},[151,18559,18560],{},"Compliance",": Meeting regulatory requirements",[2808,18563,18565],{"id":18564},"_2-cost-efficiency","2. Cost Efficiency",[21,18567,18568],{},"AI harnesses optimize LLM usage through:",[383,18570,18571,18577,18583,18589],{},[386,18572,18573,18576],{},[151,18574,18575],{},"Token Caching",": Reducing redundant API calls",[386,18578,18579,18582],{},[151,18580,18581],{},"Model Selection",": Choosing the right model for each use case",[386,18584,18585,18588],{},[151,18586,18587],{},"Load Balancing",": Distributing requests efficiently",[386,18590,18591,18594],{},[151,18592,18593],{},"Auto-scaling",": Adjusting resources based on demand",[2808,18596,18598],{"id":18597},"_3-developer-experience","3. Developer Experience",[21,18600,18601],{},"Harnesses provide developers with:",[383,18603,18604,18610,18616,18622],{},[386,18605,18606,18609],{},[151,18607,18608],{},"Consistent APIs",": Unified interfaces across different LLM providers",[386,18611,18612,18615],{},[151,18613,18614],{},"Error Handling",": Robust error recovery and retry logic",[386,18617,18618,18621],{},[151,18619,18620],{},"Debugging Tools",": Visibility into model interactions",[386,18623,18624,18627],{},[151,18625,18626],{},"Testing Frameworks",": Unit and integration testing for LLM applications",[32,18629,18302],{"id":18630},"core-components-of-an-ai-harness",[2808,18632,18634],{"id":18633},"_1-model-management-layer","1. Model Management Layer",[21,18636,18637,3070],{},[151,18638,18639],{},"Features",[383,18641,18642,18645,18648,18651],{},[386,18643,18644],{},"Model versioning and deployment",[386,18646,18647],{},"A\u002FB testing capabilities",[386,18649,18650],{},"Model performance monitoring",[386,18652,18653],{},"Automated rollbacks",[21,18655,18656,3070],{},[151,18657,18658],{},"Technologies",[383,18660,18661,18664,18667],{},[386,18662,18663],{},"Container orchestration (Kubernetes)",[386,18665,18666],{},"Model registries (Hugging Face, MLflow)",[386,18668,18669],{},"CI\u002FCD pipelines for model updates",[2808,18671,18673],{"id":18672},"_2-api-gateway-and-routing","2. API Gateway and Routing",[21,18675,18676,3070],{},[151,18677,18639],{},[383,18679,18680,18683,18686,18689],{},[386,18681,18682],{},"Request validation and authentication",[386,18684,18685],{},"Rate limiting and throttling",[386,18687,18688],{},"Load balancing across model instances",[386,18690,18691],{},"Request\u002Fresponse transformation",[21,18693,18694,3070],{},[151,18695,18658],{},[383,18697,18698,18701,18704],{},[386,18699,18700],{},"API gateways (Kong, AWS API Gateway)",[386,18702,18703],{},"Service mesh (Istio, Linkerd)",[386,18705,18706],{},"Circuit breakers and retries",[2808,18708,18710],{"id":18709},"_3-caching-and-optimization-layer","3. Caching and Optimization Layer",[21,18712,18713,3070],{},[151,18714,18639],{},[383,18716,18717,18720,18723,18726],{},[386,18718,18719],{},"Response caching for frequent queries",[386,18721,18722],{},"Prompt caching for repeated inputs",[386,18724,18725],{},"Token usage optimization",[386,18727,18728],{},"Cost tracking and budgeting",[21,18730,18731,3070],{},[151,18732,18658],{},[383,18734,18735,18738,18741],{},[386,18736,18737],{},"In-memory caches (Redis, Memcached)",[386,18739,18740],{},"Vector databases (Pinecone, Weaviate)",[386,18742,18743],{},"Tokenizers and embedding caches",[2808,18745,18747],{"id":18746},"_4-observability-and-monitoring","4. Observability and Monitoring",[21,18749,18750,3070],{},[151,18751,18639],{},[383,18753,18754,18757,18760,18763],{},[386,18755,18756],{},"Request tracing and logging",[386,18758,18759],{},"Performance metrics and alerting",[386,18761,18762],{},"Usage analytics and cost tracking",[386,18764,18765],{},"Error classification and reporting",[21,18767,18768,3070],{},[151,18769,18658],{},[383,18771,18772,18775,18778],{},[386,18773,18774],{},"Observability platforms (Datadog, New Relic)",[386,18776,18777],{},"Logging systems (ELK stack, Splunk)",[386,18779,18780],{},"Metrics collection (Prometheus, Grafana)",[2808,18782,18784],{"id":18783},"_5-security-and-compliance","5. Security and Compliance",[21,18786,18787,3070],{},[151,18788,18639],{},[383,18790,18791,18794,18797,18800],{},[386,18792,18793],{},"Authentication and authorization",[386,18795,18796],{},"Data encryption and masking",[386,18798,18799],{},"Access control policies",[386,18801,18802],{},"Audit logging and compliance reporting",[21,18804,18805,3070],{},[151,18806,18658],{},[383,18808,18809,18812,18815],{},[386,18810,18811],{},"Identity providers (Okta, Auth0)",[386,18813,18814],{},"Encryption libraries (OpenSSL, libsodium)",[386,18816,18817],{},"Compliance frameworks (SOC 2, GDPR)",[2808,18819,18821],{"id":18820},"_6-integration-layer","6. Integration Layer",[21,18823,18824,3070],{},[151,18825,18639],{},[383,18827,18828,18831,18834,18837],{},[386,18829,18830],{},"Connectors to external APIs",[386,18832,18833],{},"Database integrations",[386,18835,18836],{},"Message queue support",[386,18838,18839],{},"Webhook handling",[21,18841,18842,3070],{},[151,18843,18658],{},[383,18845,18846,18849,18852,18855],{},[386,18847,18848],{},"REST and gRPC clients",[386,18850,18851],{},"Database drivers (SQLAlchemy, Prisma)",[386,18853,18854],{},"Message brokers (RabbitMQ, Kafka)",[386,18856,18857],{},"Webhook frameworks (Express, FastAPI)",[32,18859,18308],{"id":18860},"integration-patterns-and-approaches",[2808,18862,18864],{"id":18863},"_1-direct-api-integration","1. Direct API Integration",[21,18866,18867,18870],{},[151,18868,18869],{},"Pattern",": Connect directly to LLM provider APIs",[21,18872,18873,3070],{},[151,18874,18875],{},"Use Cases",[383,18877,18878,18881,18884],{},[386,18879,18880],{},"Simple text generation",[386,18882,18883],{},"Quick prototyping",[386,18885,18886],{},"Low-volume applications",[21,18888,18889,3070],{},[151,18890,18891],{},"Pros",[383,18893,18894,18897,18900],{},[386,18895,18896],{},"Simple implementation",[386,18898,18899],{},"Direct access to latest models",[386,18901,18902],{},"No additional infrastructure",[21,18904,18905,3070],{},[151,18906,18907],{},"Cons",[383,18909,18910,18913,18916],{},[386,18911,18912],{},"Provider lock-in",[386,18914,18915],{},"Limited control over performance",[386,18917,18918],{},"Higher costs at scale",[2808,18920,18922],{"id":18921},"_2-managed-llm-services","2. Managed LLM Services",[21,18924,18925,18927],{},[151,18926,18869],{},": Use managed LLM platforms (OpenAI, Anthropic, etc.)",[21,18929,18930,3070],{},[151,18931,18875],{},[383,18933,18934,18937,18940],{},[386,18935,18936],{},"Production applications",[386,18938,18939],{},"Enterprise deployments",[386,18941,18942],{},"Multi-model support",[21,18944,18945,3070],{},[151,18946,18891],{},[383,18948,18949,18952,18955],{},[386,18950,18951],{},"Managed infrastructure",[386,18953,18954],{},"Built-in monitoring",[386,18956,18957],{},"Enterprise features",[21,18959,18960,3070],{},[151,18961,18907],{},[383,18963,18964,18967,18970],{},[386,18965,18966],{},"Vendor dependencies",[386,18968,18969],{},"Potential vendor lock-in",[386,18971,18972],{},"Limited customization",[2808,18974,18976],{"id":18975},"_3-self-hosted-llm-solutions","3. Self-Hosted LLM Solutions",[21,18978,18979,18981],{},[151,18980,18869],{},": Run LLMs on your own infrastructure",[21,18983,18984,3070],{},[151,18985,18875],{},[383,18987,18988,18991,18994],{},[386,18989,18990],{},"Privacy-sensitive applications",[386,18992,18993],{},"Offline deployments",[386,18995,18996],{},"Custom model fine-tuning",[21,18998,18999,3070],{},[151,19000,18891],{},[383,19002,19003,19006,19009],{},[386,19004,19005],{},"Full control",[386,19007,19008],{},"Cost optimization",[386,19010,19011],{},"Data privacy",[21,19013,19014,3070],{},[151,19015,18907],{},[383,19017,19018,19021,19024],{},[386,19019,19020],{},"High infrastructure costs",[386,19022,19023],{},"Complex maintenance",[386,19025,19026],{},"Requires expertise",[2808,19028,19030],{"id":19029},"_4-hybrid-integration-pattern","4. Hybrid Integration Pattern",[21,19032,19033,19035],{},[151,19034,18869],{},": Combine multiple approaches based on use case",[21,19037,19038,3070],{},[151,19039,19040],{},"Architecture",[48,19042,19045],{"className":19043,"code":19044,"language":53},[51],"┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Direct API    │    │ Managed Service │    │ Self-Hosted     │\n│   Integration   │    │   Integration   │    │   Integration   │\n└─────────┬───────┘    └─────────┬───────┘    └─────────┬───────┘\n          │                      │                      │\n          └──────────────────────┼──────────────────────┘\n                                 │\n                    ┌────────────▼────────────┐\n                    │    AI Harness Layer     │\n                    │  (Routing, Caching,     │\n                    │   Monitoring, Security) │\n                    └─────────────────────────┘\n",[40,19046,19044],{"__ignoreMap":56},[2808,19048,19050],{"id":19049},"_5-event-driven-integration","5. Event-Driven Integration",[21,19052,19053,19055],{},[151,19054,18869],{},": Use message queues for asynchronous LLM processing",[21,19057,19058,3070],{},[151,19059,18875],{},[383,19061,19062,19065,19068],{},[386,19063,19064],{},"Batch processing",[386,19066,19067],{},"Real-time analytics",[386,19069,19070],{},"Background tasks",[21,19072,19073,3070],{},[151,19074,19040],{},[48,19076,19079],{"className":19077,"code":19078,"language":53},[51],"┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Request Queue │───▶│   LLM Processor  │───▶│   Response DB   │\n│   (RabbitMQ)    │    │   (Kubernetes)   │    │   (PostgreSQL)   │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n",[40,19080,19078],{"__ignoreMap":56},[32,19082,18314],{"id":19083},"benefits-of-ai-harness-integration",[2808,19085,19087],{"id":19086},"_1-improved-performance","1. Improved Performance",[383,19089,19090,19096,19102],{},[386,19091,19092,19095],{},[151,19093,19094],{},"Faster Response Times",": Caching and optimization reduce latency",[386,19097,19098,19101],{},[151,19099,19100],{},"Higher Throughput",": Efficient load balancing handles concurrent requests",[386,19103,19104,19107],{},[151,19105,19106],{},"Better Resource Utilization",": Auto-scaling adjusts to demand",[2808,19109,19111],{"id":19110},"_2-enhanced-reliability","2. Enhanced Reliability",[383,19113,19114,19120,19126],{},[386,19115,19116,19119],{},[151,19117,19118],{},"High Availability",": Redundancy and failover mechanisms",[386,19121,19122,19125],{},[151,19123,19124],{},"Error Recovery",": Automatic retries and circuit breakers",[386,19127,19128,19131],{},[151,19129,19130],{},"Health Monitoring",": Proactive issue detection and resolution",[2808,19133,19135],{"id":19134},"_3-cost-optimization","3. Cost Optimization",[383,19137,19138,19144,19150],{},[386,19139,19140,19143],{},[151,19141,19142],{},"Reduced Token Usage",": Intelligent caching and prompt optimization",[386,19145,19146,19149],{},[151,19147,19148],{},"Efficient Resource Allocation",": Auto-scaling based on demand",[386,19151,19152,19155],{},[151,19153,19154],{},"Budget Control",": Spending limits and cost tracking",[2808,19157,19159],{"id":19158},"_4-better-developer-experience","4. Better Developer Experience",[383,19161,19162,19167,19171],{},[386,19163,19164,19166],{},[151,19165,18608],{},": Unified interfaces across providers",[386,19168,19169,18621],{},[151,19170,18620],{},[386,19172,19173,19175],{},[151,19174,18626],{},": Comprehensive testing capabilities",[2808,19177,18784],{"id":19178},"_5-security-and-compliance-1",[383,19180,19181,19187,19193],{},[386,19182,19183,19186],{},[151,19184,19185],{},"Data Protection",": Encryption and access control",[386,19188,19189,19192],{},[151,19190,19191],{},"Audit Trails",": Comprehensive logging and monitoring",[386,19194,19195,19198],{},[151,19196,19197],{},"Regulatory Compliance",": Support for industry standards",[32,19200,18320],{"id":19201},"technical-considerations-and-challenges",[2808,19203,19205],{"id":19204},"_1-latency-and-performance","1. Latency and Performance",[21,19207,19208,3070],{},[151,19209,19210],{},"Challenges",[383,19212,19213,19216,19219],{},[386,19214,19215],{},"LLM inference latency",[386,19217,19218],{},"Network overhead",[386,19220,19221],{},"Token processing costs",[21,19223,19224,3070],{},[151,19225,19226],{},"Solutions",[383,19228,19229,19232,19235,19238],{},[386,19230,19231],{},"Response caching",[386,19233,19234],{},"Model optimization",[386,19236,19237],{},"Edge computing",[386,19239,19064],{},[2808,19241,19243],{"id":19242},"_2-cost-management","2. Cost Management",[21,19245,19246,3070],{},[151,19247,19210],{},[383,19249,19250,19253,19256],{},[386,19251,19252],{},"Unpredictable token costs",[386,19254,19255],{},"Model selection complexity",[386,19257,19258],{},"Scaling expenses",[21,19260,19261,3070],{},[151,19262,19226],{},[383,19264,19265,19268,19271,19274],{},[386,19266,19267],{},"Token usage tracking",[386,19269,19270],{},"Cost-per-query monitoring",[386,19272,19273],{},"Model tiering strategies",[386,19275,19276],{},"Budget controls",[2808,19278,19280],{"id":19279},"_3-context-management","3. Context Management",[21,19282,19283,3070],{},[151,19284,19210],{},[383,19286,19287,19290,19293],{},[386,19288,19289],{},"Conversation context preservation",[386,19291,19292],{},"Token limits",[386,19294,19295],{},"Memory efficiency",[21,19297,19298,3070],{},[151,19299,19226],{},[383,19301,19302,19305,19308,19311],{},[386,19303,19304],{},"Vector databases for context storage",[386,19306,19307],{},"Context summarization",[386,19309,19310],{},"Sliding window techniques",[386,19312,19313],{},"Efficient tokenization",[2808,19315,19317],{"id":19316},"_4-security-and-privacy","4. Security and Privacy",[21,19319,19320,3070],{},[151,19321,19210],{},[383,19323,19324,19327,19330],{},[386,19325,19326],{},"Data leakage risks",[386,19328,19329],{},"Model theft",[386,19331,19332],{},"Compliance requirements",[21,19334,19335,3070],{},[151,19336,19226],{},[383,19338,19339,19342,19345,19348],{},[386,19340,19341],{},"Data encryption",[386,19343,19344],{},"Access control",[386,19346,19347],{},"Audit logging",[386,19349,19350],{},"Differential privacy",[2808,19352,19354],{"id":19353},"_5-monitoring-and-observability","5. Monitoring and Observability",[21,19356,19357,3070],{},[151,19358,19210],{},[383,19360,19361,19364,19367],{},[386,19362,19363],{},"Distributed system complexity",[386,19365,19366],{},"LLM-specific metrics",[386,19368,19369],{},"Error classification",[21,19371,19372,3070],{},[151,19373,19226],{},[383,19375,19376,19379,19382,19385],{},[386,19377,19378],{},"Custom metrics",[386,19380,19381],{},"LLM-specific logging",[386,19383,19384],{},"Anomaly detection",[386,19386,19387],{},"Alerting systems",[32,19389,18326],{"id":19390},"use-cases-and-real-world-examples",[2808,19392,19394],{"id":19393},"_1-customer-support-chatbots","1. Customer Support Chatbots",[21,19396,19397,19400],{},[151,19398,19399],{},"Application",": Automated customer service",[21,19402,19403,19406],{},[151,19404,19405],{},"Integration Pattern",": Hybrid (direct API + managed services)",[21,19408,19409,3070],{},[151,19410,18639],{},[383,19412,19413,19416,19419],{},[386,19414,19415],{},"Multi-turn conversations",[386,19417,19418],{},"Knowledge base integration",[386,19420,19421],{},"Escalation to human agents",[21,19423,19424,3070],{},[151,19425,9053],{},[383,19427,19428,19431,19434],{},[386,19429,19430],{},"24\u002F7 availability",[386,19432,19433],{},"Consistent responses",[386,19435,19436],{},"Reduced operational costs",[2808,19438,19440],{"id":19439},"_2-code-generation-and-review","2. Code Generation and Review",[21,19442,19443,19445],{},[151,19444,19399],{},": Developer productivity tools",[21,19447,19448,19450],{},[151,19449,19405],{},": Self-hosted + managed services",[21,19452,19453,3070],{},[151,19454,18639],{},[383,19456,19457,19460,19463],{},[386,19458,19459],{},"Code completion",[386,19461,19462],{},"Bug detection",[386,19464,19465],{},"Code optimization",[21,19467,19468,3070],{},[151,19469,9053],{},[383,19471,19472,19475,19478],{},[386,19473,19474],{},"Faster development",[386,19476,19477],{},"Improved code quality",[386,19479,19480],{},"Reduced debugging time",[2808,19482,19484],{"id":19483},"_3-content-generation-and-marketing","3. Content Generation and Marketing",[21,19486,19487,19489],{},[151,19488,19399],{},": Marketing automation",[21,19491,19492,19494],{},[151,19493,19405],{},": Managed services",[21,19496,19497,3070],{},[151,19498,18639],{},[383,19500,19501,19504,19507],{},[386,19502,19503],{},"Blog post generation",[386,19505,19506],{},"Social media content",[386,19508,19509],{},"Email campaigns",[21,19511,19512,3070],{},[151,19513,9053],{},[383,19515,19516,19519,19522],{},[386,19517,19518],{},"Scalable content creation",[386,19520,19521],{},"Consistent brand voice",[386,19523,19524],{},"Faster campaign deployment",[2808,19526,19528],{"id":19527},"_4-data-analysis-and-insights","4. Data Analysis and Insights",[21,19530,19531,19533],{},[151,19532,19399],{},": Business intelligence",[21,19535,19536,19538],{},[151,19537,19405],{},": Event-driven integration",[21,19540,19541,3070],{},[151,19542,18639],{},[383,19544,19545,19548,19551],{},[386,19546,19547],{},"Natural language queries",[386,19549,19550],{},"Data summarization",[386,19552,19553],{},"Pattern detection",[21,19555,19556,3070],{},[151,19557,9053],{},[383,19559,19560,19563,19566],{},[386,19561,19562],{},"Democratized data access",[386,19564,19565],{},"Faster insights",[386,19567,19568],{},"Reduced analyst workload",[2808,19570,19572],{"id":19571},"_5-educational-ai-tutors","5. Educational AI Tutors",[21,19574,19575,19577],{},[151,19576,19399],{},": Personalized learning",[21,19579,19580,19582],{},[151,19581,19405],{},": Hybrid with self-hosted models",[21,19584,19585,3070],{},[151,19586,18639],{},[383,19588,19589,19592,19595],{},[386,19590,19591],{},"Adaptive learning paths",[386,19593,19594],{},"Personalized feedback",[386,19596,19597],{},"Progress tracking",[21,19599,19600,3070],{},[151,19601,9053],{},[383,19603,19604,19607,19609],{},[386,19605,19606],{},"Customized education",[386,19608,19430],{},[386,19610,19611],{},"Scalable learning",[32,19613,18332],{"id":19614},"best-practices-for-llm-integration",[2808,19616,19618],{"id":19617},"_1-design-for-scalability","1. Design for Scalability",[21,19620,19621,3070],{},[151,19622,19623],{},"Principles",[383,19625,19626,19629,19632,19635],{},[386,19627,19628],{},"Stateless design",[386,19630,19631],{},"Horizontal scaling",[386,19633,19634],{},"Load balancing",[386,19636,19637],{},"Circuit breakers",[21,19639,19640,3070],{},[151,19641,19642],{},"Implementation",[48,19644,19648],{"className":19645,"code":19646,"language":19647,"meta":56,"style":56},"language-python shiki shiki-themes github-light github-dark","# Example: Scalable LLM integration\nclass LLMIntegration:\n    def __init__(self, config):\n        self.config = config\n        self.client_pool = []\n        self.load_balancer = LoadBalancer()\n        self.circuit_breaker = CircuitBreaker()\n\n    async def generate(self, prompt, context=None):\n        # Use circuit breaker for resilience\n        if not self.circuit_breaker.can_execute():\n            raise CircuitBreakerError(\"Service unavailable\")\n\n        # Use load balancer for distribution\n        client = self.load_balancer.get_client()\n        return await client.generate(prompt, context)\n","python",[40,19649,19650,19655,19665,19676,19689,19701,19713,19725,19729,19751,19756,19770,19783,19787,19792,19804],{"__ignoreMap":56},[449,19651,19652],{"class":451,"line":452},[449,19653,19654],{"class":705},"# Example: Scalable LLM integration\n",[449,19656,19657,19660,19663],{"class":451,"line":114},[449,19658,19659],{"class":680},"class",[449,19661,19662],{"class":721}," LLMIntegration",[449,19664,17374],{"class":684},[449,19666,19667,19670,19673],{"class":451,"line":111},[449,19668,19669],{"class":680},"    def",[449,19671,19672],{"class":714}," __init__",[449,19674,19675],{"class":684},"(self, config):\n",[449,19677,19678,19681,19684,19686],{"class":451,"line":468},[449,19679,19680],{"class":714},"        self",[449,19682,19683],{"class":684},".config ",[449,19685,5014],{"class":680},[449,19687,19688],{"class":684}," config\n",[449,19690,19691,19693,19696,19698],{"class":451,"line":474},[449,19692,19680],{"class":714},[449,19694,19695],{"class":684},".client_pool ",[449,19697,5014],{"class":680},[449,19699,19700],{"class":684}," []\n",[449,19702,19703,19705,19708,19710],{"class":451,"line":480},[449,19704,19680],{"class":714},[449,19706,19707],{"class":684},".load_balancer ",[449,19709,5014],{"class":680},[449,19711,19712],{"class":684}," LoadBalancer()\n",[449,19714,19715,19717,19720,19722],{"class":451,"line":486},[449,19716,19680],{"class":714},[449,19718,19719],{"class":684},".circuit_breaker ",[449,19721,5014],{"class":680},[449,19723,19724],{"class":684}," CircuitBreaker()\n",[449,19726,19727],{"class":451,"line":492},[449,19728,700],{"emptyLinePlaceholder":130},[449,19730,19731,19734,19737,19740,19743,19745,19748],{"class":451,"line":498},[449,19732,19733],{"class":680},"    async",[449,19735,19736],{"class":680}," def",[449,19738,19739],{"class":721}," generate",[449,19741,19742],{"class":684},"(self, prompt, context",[449,19744,5014],{"class":680},[449,19746,19747],{"class":714},"None",[449,19749,19750],{"class":684},"):\n",[449,19752,19753],{"class":451,"line":133},[449,19754,19755],{"class":705},"        # Use circuit breaker for resilience\n",[449,19757,19758,19761,19764,19767],{"class":451,"line":509},[449,19759,19760],{"class":680},"        if",[449,19762,19763],{"class":680}," not",[449,19765,19766],{"class":714}," self",[449,19768,19769],{"class":684},".circuit_breaker.can_execute():\n",[449,19771,19772,19775,19778,19781],{"class":451,"line":318},[449,19773,19774],{"class":680},"            raise",[449,19776,19777],{"class":684}," CircuitBreakerError(",[449,19779,19780],{"class":691},"\"Service unavailable\"",[449,19782,11185],{"class":684},[449,19784,19785],{"class":451,"line":520},[449,19786,700],{"emptyLinePlaceholder":130},[449,19788,19789],{"class":451,"line":526},[449,19790,19791],{"class":705},"        # Use load balancer for distribution\n",[449,19793,19794,19797,19799,19801],{"class":451,"line":532},[449,19795,19796],{"class":684},"        client ",[449,19798,5014],{"class":680},[449,19800,19766],{"class":714},[449,19802,19803],{"class":684},".load_balancer.get_client()\n",[449,19805,19806,19809,19811],{"class":451,"line":2790},[449,19807,19808],{"class":680},"        return",[449,19810,1654],{"class":680},[449,19812,19813],{"class":684}," client.generate(prompt, context)\n",[2808,19815,19817],{"id":19816},"_2-implement-comprehensive-monitoring","2. Implement Comprehensive Monitoring",[21,19819,19820,3070],{},[151,19821,19822],{},"Metrics to Track",[383,19824,19825,19828,19831,19834,19837],{},[386,19826,19827],{},"Request latency",[386,19829,19830],{},"Token usage",[386,19832,19833],{},"Error rates",[386,19835,19836],{},"Model performance",[386,19838,19839],{},"Cost tracking",[21,19841,19842,3070],{},[151,19843,19642],{},[48,19845,19847],{"className":19645,"code":19846,"language":19647,"meta":56,"style":56},"# Example: Monitoring integration\nimport prometheus_client\n\nclass LLMMonitor:\n    request_latency = prometheus_client.Histogram(\n        'llm_request_latency_seconds', 'LLM request latency'\n    )\n    token_usage = prometheus_client.Counter(\n        'llm_token_usage_total', 'Total tokens used'\n    )\n    error_rate = prometheus_client.Gauge(\n        'llm_error_rate', 'LLM error rate'\n    )\n\n    @request_latency.time()\n    async def generate_with_monitoring(self, prompt):\n        # Generate response\n        response = await self.llm_client.generate(prompt)\n\n        # Track metrics\n        self.token_usage.inc(response.token_count)\n        self.error_rate.set(0 if response.success else 1)\n\n        return response\n",[40,19848,19849,19854,19861,19865,19874,19884,19894,19899,19909,19919,19923,19933,19943,19947,19951,19958,19970,19975,19989,19993,19998,20005,20027,20031],{"__ignoreMap":56},[449,19850,19851],{"class":451,"line":452},[449,19852,19853],{"class":705},"# Example: Monitoring integration\n",[449,19855,19856,19858],{"class":451,"line":114},[449,19857,681],{"class":680},[449,19859,19860],{"class":684}," prometheus_client\n",[449,19862,19863],{"class":451,"line":111},[449,19864,700],{"emptyLinePlaceholder":130},[449,19866,19867,19869,19872],{"class":451,"line":468},[449,19868,19659],{"class":680},[449,19870,19871],{"class":721}," LLMMonitor",[449,19873,17374],{"class":684},[449,19875,19876,19879,19881],{"class":451,"line":474},[449,19877,19878],{"class":684},"    request_latency ",[449,19880,5014],{"class":680},[449,19882,19883],{"class":684}," prometheus_client.Histogram(\n",[449,19885,19886,19889,19891],{"class":451,"line":480},[449,19887,19888],{"class":691},"        'llm_request_latency_seconds'",[449,19890,349],{"class":684},[449,19892,19893],{"class":691},"'LLM request latency'\n",[449,19895,19896],{"class":451,"line":486},[449,19897,19898],{"class":684},"    )\n",[449,19900,19901,19904,19906],{"class":451,"line":492},[449,19902,19903],{"class":684},"    token_usage ",[449,19905,5014],{"class":680},[449,19907,19908],{"class":684}," prometheus_client.Counter(\n",[449,19910,19911,19914,19916],{"class":451,"line":498},[449,19912,19913],{"class":691},"        'llm_token_usage_total'",[449,19915,349],{"class":684},[449,19917,19918],{"class":691},"'Total tokens used'\n",[449,19920,19921],{"class":451,"line":133},[449,19922,19898],{"class":684},[449,19924,19925,19928,19930],{"class":451,"line":509},[449,19926,19927],{"class":684},"    error_rate ",[449,19929,5014],{"class":680},[449,19931,19932],{"class":684}," prometheus_client.Gauge(\n",[449,19934,19935,19938,19940],{"class":451,"line":318},[449,19936,19937],{"class":691},"        'llm_error_rate'",[449,19939,349],{"class":684},[449,19941,19942],{"class":691},"'LLM error rate'\n",[449,19944,19945],{"class":451,"line":520},[449,19946,19898],{"class":684},[449,19948,19949],{"class":451,"line":526},[449,19950,700],{"emptyLinePlaceholder":130},[449,19952,19953,19956],{"class":451,"line":532},[449,19954,19955],{"class":721},"    @request_latency.time",[449,19957,11195],{"class":684},[449,19959,19960,19962,19964,19967],{"class":451,"line":2790},[449,19961,19733],{"class":680},[449,19963,19736],{"class":680},[449,19965,19966],{"class":721}," generate_with_monitoring",[449,19968,19969],{"class":684},"(self, prompt):\n",[449,19971,19972],{"class":451,"line":3511},[449,19973,19974],{"class":705},"        # Generate response\n",[449,19976,19977,19980,19982,19984,19986],{"class":451,"line":3526},[449,19978,19979],{"class":684},"        response ",[449,19981,5014],{"class":680},[449,19983,1654],{"class":680},[449,19985,19766],{"class":714},[449,19987,19988],{"class":684},".llm_client.generate(prompt)\n",[449,19990,19991],{"class":451,"line":3531},[449,19992,700],{"emptyLinePlaceholder":130},[449,19994,19995],{"class":451,"line":3536},[449,19996,19997],{"class":705},"        # Track metrics\n",[449,19999,20000,20002],{"class":451,"line":4009},[449,20001,19680],{"class":714},[449,20003,20004],{"class":684},".token_usage.inc(response.token_count)\n",[449,20006,20007,20009,20012,20014,20017,20020,20022,20025],{"class":451,"line":4015},[449,20008,19680],{"class":714},[449,20010,20011],{"class":684},".error_rate.set(",[449,20013,9899],{"class":714},[449,20015,20016],{"class":680}," if",[449,20018,20019],{"class":684}," response.success ",[449,20021,5720],{"class":680},[449,20023,20024],{"class":714}," 1",[449,20026,11185],{"class":684},[449,20028,20029],{"class":451,"line":4021},[449,20030,700],{"emptyLinePlaceholder":130},[449,20032,20033,20035],{"class":451,"line":4027},[449,20034,19808],{"class":680},[449,20036,20037],{"class":684}," response\n",[2808,20039,20041],{"id":20040},"_3-optimize-costs-and-performance","3. Optimize Costs and Performance",[21,20043,20044,3070],{},[151,20045,20046],{},"Strategies",[383,20048,20049,20052,20055,20058],{},[386,20050,20051],{},"Implement caching",[386,20053,20054],{},"Use efficient prompts",[386,20056,20057],{},"Batch requests",[386,20059,20060],{},"Monitor usage",[21,20062,20063,3070],{},[151,20064,19642],{},[48,20066,20068],{"className":19645,"code":20067,"language":19647,"meta":56,"style":56},"# Example: Cost optimization\nclass CostOptimizedLLM:\n    def __init__(self, config):\n        self.config = config\n        self.cache = {}\n        self.prompt_optimizer = PromptOptimizer()\n\n    async def generate(self, prompt, context=None):\n        # Check cache first\n        cache_key = self._generate_cache_key(prompt, context)\n        if cache_key in self.cache:\n            return self.cache[cache_key]\n\n        # Optimize prompt\n        optimized_prompt = self.prompt_optimizer.optimize(prompt)\n\n        # Generate response\n        response = await self.llm_client.generate(optimized_prompt, context)\n\n        # Cache response\n        self.cache[cache_key] = response\n\n        return response\n",[40,20069,20070,20075,20084,20092,20102,20114,20126,20130,20146,20151,20163,20178,20187,20191,20196,20208,20212,20216,20229,20233,20238,20249,20253],{"__ignoreMap":56},[449,20071,20072],{"class":451,"line":452},[449,20073,20074],{"class":705},"# Example: Cost optimization\n",[449,20076,20077,20079,20082],{"class":451,"line":114},[449,20078,19659],{"class":680},[449,20080,20081],{"class":721}," CostOptimizedLLM",[449,20083,17374],{"class":684},[449,20085,20086,20088,20090],{"class":451,"line":111},[449,20087,19669],{"class":680},[449,20089,19672],{"class":714},[449,20091,19675],{"class":684},[449,20093,20094,20096,20098,20100],{"class":451,"line":468},[449,20095,19680],{"class":714},[449,20097,19683],{"class":684},[449,20099,5014],{"class":680},[449,20101,19688],{"class":684},[449,20103,20104,20106,20109,20111],{"class":451,"line":474},[449,20105,19680],{"class":714},[449,20107,20108],{"class":684},".cache ",[449,20110,5014],{"class":680},[449,20112,20113],{"class":684}," {}\n",[449,20115,20116,20118,20121,20123],{"class":451,"line":480},[449,20117,19680],{"class":714},[449,20119,20120],{"class":684},".prompt_optimizer ",[449,20122,5014],{"class":680},[449,20124,20125],{"class":684}," PromptOptimizer()\n",[449,20127,20128],{"class":451,"line":486},[449,20129,700],{"emptyLinePlaceholder":130},[449,20131,20132,20134,20136,20138,20140,20142,20144],{"class":451,"line":492},[449,20133,19733],{"class":680},[449,20135,19736],{"class":680},[449,20137,19739],{"class":721},[449,20139,19742],{"class":684},[449,20141,5014],{"class":680},[449,20143,19747],{"class":714},[449,20145,19750],{"class":684},[449,20147,20148],{"class":451,"line":498},[449,20149,20150],{"class":705},"        # Check cache first\n",[449,20152,20153,20156,20158,20160],{"class":451,"line":133},[449,20154,20155],{"class":684},"        cache_key ",[449,20157,5014],{"class":680},[449,20159,19766],{"class":714},[449,20161,20162],{"class":684},"._generate_cache_key(prompt, context)\n",[449,20164,20165,20167,20170,20173,20175],{"class":451,"line":509},[449,20166,19760],{"class":680},[449,20168,20169],{"class":684}," cache_key ",[449,20171,20172],{"class":680},"in",[449,20174,19766],{"class":714},[449,20176,20177],{"class":684},".cache:\n",[449,20179,20180,20182,20184],{"class":451,"line":318},[449,20181,5634],{"class":680},[449,20183,19766],{"class":714},[449,20185,20186],{"class":684},".cache[cache_key]\n",[449,20188,20189],{"class":451,"line":520},[449,20190,700],{"emptyLinePlaceholder":130},[449,20192,20193],{"class":451,"line":526},[449,20194,20195],{"class":705},"        # Optimize prompt\n",[449,20197,20198,20201,20203,20205],{"class":451,"line":532},[449,20199,20200],{"class":684},"        optimized_prompt ",[449,20202,5014],{"class":680},[449,20204,19766],{"class":714},[449,20206,20207],{"class":684},".prompt_optimizer.optimize(prompt)\n",[449,20209,20210],{"class":451,"line":2790},[449,20211,700],{"emptyLinePlaceholder":130},[449,20213,20214],{"class":451,"line":3511},[449,20215,19974],{"class":705},[449,20217,20218,20220,20222,20224,20226],{"class":451,"line":3526},[449,20219,19979],{"class":684},[449,20221,5014],{"class":680},[449,20223,1654],{"class":680},[449,20225,19766],{"class":714},[449,20227,20228],{"class":684},".llm_client.generate(optimized_prompt, context)\n",[449,20230,20231],{"class":451,"line":3531},[449,20232,700],{"emptyLinePlaceholder":130},[449,20234,20235],{"class":451,"line":3536},[449,20236,20237],{"class":705},"        # Cache response\n",[449,20239,20240,20242,20245,20247],{"class":451,"line":4009},[449,20241,19680],{"class":714},[449,20243,20244],{"class":684},".cache[cache_key] ",[449,20246,5014],{"class":680},[449,20248,20037],{"class":684},[449,20250,20251],{"class":451,"line":4015},[449,20252,700],{"emptyLinePlaceholder":130},[449,20254,20255,20257],{"class":451,"line":4021},[449,20256,19808],{"class":680},[449,20258,20037],{"class":684},[2808,20260,20262],{"id":20261},"_4-ensure-security-and-privacy","4. Ensure Security and Privacy",[21,20264,20265,3070],{},[151,20266,20267],{},"Best Practices",[383,20269,20270,20273,20276,20279],{},[386,20271,20272],{},"Encrypt sensitive data",[386,20274,20275],{},"Implement access control",[386,20277,20278],{},"Use secure authentication",[386,20280,20281],{},"Log access patterns",[21,20283,20284,3070],{},[151,20285,19642],{},[48,20287,20289],{"className":19645,"code":20288,"language":19647,"meta":56,"style":56},"# Example: Security implementation\nclass SecureLLMIntegration:\n    def __init__(self, config):\n        self.config = config\n        self.auth = AuthManager(config)\n        self.encryption = EncryptionManager(config)\n        self.audit = AuditLogger(config)\n\n    async def generate(self, prompt, context=None):\n        # Authenticate request\n        user = await self.auth.authenticate(request)\n\n        # Check permissions\n        if not self.auth.has_permission(user, 'generate_llm'):\n            raise PermissionError(\"Insufficient permissions\")\n\n        # Encrypt sensitive data\n        encrypted_prompt = self.encryption.encrypt(prompt)\n\n        # Generate response\n        response = await self.llm_client.generate(encrypted_prompt, context)\n\n        # Decrypt response\n        decrypted_response = self.encryption.decrypt(response)\n\n        # Log access\n        await self.audit.log_access(user, 'generate_llm', prompt, response)\n\n        return decrypted_response\n",[40,20290,20291,20296,20305,20313,20323,20335,20347,20359,20363,20379,20384,20398,20402,20407,20423,20437,20441,20446,20458,20462,20466,20479,20483,20488,20500,20504,20509,20524,20528],{"__ignoreMap":56},[449,20292,20293],{"class":451,"line":452},[449,20294,20295],{"class":705},"# Example: Security implementation\n",[449,20297,20298,20300,20303],{"class":451,"line":114},[449,20299,19659],{"class":680},[449,20301,20302],{"class":721}," SecureLLMIntegration",[449,20304,17374],{"class":684},[449,20306,20307,20309,20311],{"class":451,"line":111},[449,20308,19669],{"class":680},[449,20310,19672],{"class":714},[449,20312,19675],{"class":684},[449,20314,20315,20317,20319,20321],{"class":451,"line":468},[449,20316,19680],{"class":714},[449,20318,19683],{"class":684},[449,20320,5014],{"class":680},[449,20322,19688],{"class":684},[449,20324,20325,20327,20330,20332],{"class":451,"line":474},[449,20326,19680],{"class":714},[449,20328,20329],{"class":684},".auth ",[449,20331,5014],{"class":680},[449,20333,20334],{"class":684}," AuthManager(config)\n",[449,20336,20337,20339,20342,20344],{"class":451,"line":480},[449,20338,19680],{"class":714},[449,20340,20341],{"class":684},".encryption ",[449,20343,5014],{"class":680},[449,20345,20346],{"class":684}," EncryptionManager(config)\n",[449,20348,20349,20351,20354,20356],{"class":451,"line":486},[449,20350,19680],{"class":714},[449,20352,20353],{"class":684},".audit ",[449,20355,5014],{"class":680},[449,20357,20358],{"class":684}," AuditLogger(config)\n",[449,20360,20361],{"class":451,"line":492},[449,20362,700],{"emptyLinePlaceholder":130},[449,20364,20365,20367,20369,20371,20373,20375,20377],{"class":451,"line":498},[449,20366,19733],{"class":680},[449,20368,19736],{"class":680},[449,20370,19739],{"class":721},[449,20372,19742],{"class":684},[449,20374,5014],{"class":680},[449,20376,19747],{"class":714},[449,20378,19750],{"class":684},[449,20380,20381],{"class":451,"line":133},[449,20382,20383],{"class":705},"        # Authenticate request\n",[449,20385,20386,20389,20391,20393,20395],{"class":451,"line":509},[449,20387,20388],{"class":684},"        user ",[449,20390,5014],{"class":680},[449,20392,1654],{"class":680},[449,20394,19766],{"class":714},[449,20396,20397],{"class":684},".auth.authenticate(request)\n",[449,20399,20400],{"class":451,"line":318},[449,20401,700],{"emptyLinePlaceholder":130},[449,20403,20404],{"class":451,"line":520},[449,20405,20406],{"class":705},"        # Check permissions\n",[449,20408,20409,20411,20413,20415,20418,20421],{"class":451,"line":526},[449,20410,19760],{"class":680},[449,20412,19763],{"class":680},[449,20414,19766],{"class":714},[449,20416,20417],{"class":684},".auth.has_permission(user, ",[449,20419,20420],{"class":691},"'generate_llm'",[449,20422,19750],{"class":684},[449,20424,20425,20427,20430,20432,20435],{"class":451,"line":532},[449,20426,19774],{"class":680},[449,20428,20429],{"class":714}," PermissionError",[449,20431,725],{"class":684},[449,20433,20434],{"class":691},"\"Insufficient permissions\"",[449,20436,11185],{"class":684},[449,20438,20439],{"class":451,"line":2790},[449,20440,700],{"emptyLinePlaceholder":130},[449,20442,20443],{"class":451,"line":3511},[449,20444,20445],{"class":705},"        # Encrypt sensitive data\n",[449,20447,20448,20451,20453,20455],{"class":451,"line":3526},[449,20449,20450],{"class":684},"        encrypted_prompt ",[449,20452,5014],{"class":680},[449,20454,19766],{"class":714},[449,20456,20457],{"class":684},".encryption.encrypt(prompt)\n",[449,20459,20460],{"class":451,"line":3531},[449,20461,700],{"emptyLinePlaceholder":130},[449,20463,20464],{"class":451,"line":3536},[449,20465,19974],{"class":705},[449,20467,20468,20470,20472,20474,20476],{"class":451,"line":4009},[449,20469,19979],{"class":684},[449,20471,5014],{"class":680},[449,20473,1654],{"class":680},[449,20475,19766],{"class":714},[449,20477,20478],{"class":684},".llm_client.generate(encrypted_prompt, context)\n",[449,20480,20481],{"class":451,"line":4015},[449,20482,700],{"emptyLinePlaceholder":130},[449,20484,20485],{"class":451,"line":4021},[449,20486,20487],{"class":705},"        # Decrypt response\n",[449,20489,20490,20493,20495,20497],{"class":451,"line":4027},[449,20491,20492],{"class":684},"        decrypted_response ",[449,20494,5014],{"class":680},[449,20496,19766],{"class":714},[449,20498,20499],{"class":684},".encryption.decrypt(response)\n",[449,20501,20502],{"class":451,"line":4032},[449,20503,700],{"emptyLinePlaceholder":130},[449,20505,20506],{"class":451,"line":4038},[449,20507,20508],{"class":705},"        # Log access\n",[449,20510,20511,20514,20516,20519,20521],{"class":451,"line":4044},[449,20512,20513],{"class":680},"        await",[449,20515,19766],{"class":714},[449,20517,20518],{"class":684},".audit.log_access(user, ",[449,20520,20420],{"class":691},[449,20522,20523],{"class":684},", prompt, response)\n",[449,20525,20526],{"class":451,"line":4049},[449,20527,700],{"emptyLinePlaceholder":130},[449,20529,20530,20532],{"class":451,"line":4054},[449,20531,19808],{"class":680},[449,20533,20534],{"class":684}," decrypted_response\n",[32,20536,18338],{"id":20537},"future-trends-in-ai-harness-design",[2808,20539,20541],{"id":20540},"_1-edge-ai-harnesses","1. Edge AI Harnesses",[21,20543,20544,20547],{},[151,20545,20546],{},"Trend",": Moving LLM inference to edge devices",[21,20549,20550,3070],{},[151,20551,9053],{},[383,20553,20554,20557,20560,20563],{},[386,20555,20556],{},"Reduced latency",[386,20558,20559],{},"Offline capabilities",[386,20561,20562],{},"Improved privacy",[386,20564,19008],{},[21,20566,20567,3070],{},[151,20568,18658],{},[383,20570,20571,20574,20577],{},[386,20572,20573],{},"Edge computing platforms",[386,20575,20576],{},"Quantized models",[386,20578,20579],{},"Efficient inference engines",[2808,20581,20583],{"id":20582},"_2-multi-modal-harnesses","2. Multi-Modal Harnesses",[21,20585,20586,20588],{},[151,20587,20546],{},": Integrating vision, audio, and other modalities",[21,20590,20591,3070],{},[151,20592,20593],{},"Capabilities",[383,20595,20596,20599,20602,20605],{},[386,20597,20598],{},"Image understanding",[386,20600,20601],{},"Speech recognition",[386,20603,20604],{},"Sensor data processing",[386,20606,20607],{},"Cross-modal reasoning",[21,20609,20610,3070],{},[151,20611,20612],{},"Applications",[383,20614,20615,20618,20621],{},[386,20616,20617],{},"Computer vision",[386,20619,20620],{},"Voice assistants",[386,20622,20623],{},"IoT analytics",[2808,20625,20627],{"id":20626},"_3-federated-learning-harnesses","3. Federated Learning Harnesses",[21,20629,20630,20632],{},[151,20631,20546],{},": Training models across distributed devices",[21,20634,20635,3070],{},[151,20636,9053],{},[383,20638,20639,20642,20645,20648],{},[386,20640,20641],{},"Privacy preservation",[386,20643,20644],{},"Data diversity",[386,20646,20647],{},"Reduced data transfer",[386,20649,20650],{},"Collaborative learning",[2808,20652,20654],{"id":20653},"_4-ai-harness-orchestration","4. AI Harness Orchestration",[21,20656,20657,20659],{},[151,20658,20546],{},": Automated management of complex harness architectures",[21,20661,20662,3070],{},[151,20663,18639],{},[383,20665,20666,20669,20672,20675],{},[386,20667,20668],{},"Self-healing systems",[386,20670,20671],{},"Auto-optimization",[386,20673,20674],{},"Resource management",[386,20676,20677],{},"Performance tuning",[2808,20679,20681],{"id":20680},"_5-sustainable-ai-harnesses","5. Sustainable AI Harnesses",[21,20683,20684,20686],{},[151,20685,20546],{},": Environmentally conscious AI infrastructure",[21,20688,20689,3070],{},[151,20690,20691],{},"Focus Areas",[383,20693,20694,20697,20700,20703],{},[386,20695,20696],{},"Energy efficiency",[386,20698,20699],{},"Carbon footprint tracking",[386,20701,20702],{},"Sustainable hardware",[386,20704,20705],{},"Green computing practices",[32,20707,3681],{"id":3680},[21,20709,20710],{},"AI harnesses are essential infrastructure for integrating LLMs into production applications. They provide the foundation for scalable, reliable, and cost-effective LLM deployment while addressing critical challenges like security, privacy, and performance.",[21,20712,20713],{},"By understanding the components, integration patterns, and best practices outlined in this guide, you can design and implement effective AI harnesses that unlock the full potential of LLMs while maintaining operational excellence.",[21,20715,20716],{},"The future of AI harness design promises even more sophisticated capabilities, from edge AI to multi-modal integration and federated learning. As these trends mature, AI harnesses will continue to evolve, enabling increasingly powerful and accessible AI applications for everyone.",[73,20718],{},[21,20720,20721],{},[156,20722,20723],{},"Whether you're building a simple chatbot or a complex enterprise AI system, investing in a robust AI harness will pay dividends in terms of reliability, cost efficiency, and developer experience. The key is to start with a solid foundation and evolve your harness as your needs grow.",[3728,20725,20726],{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}",{"title":56,"searchDepth":111,"depth":111,"links":20728},[20729,20730,20731,20736,20740,20745,20753,20760,20767,20774,20781,20787,20794],{"id":332,"depth":114,"text":333},{"id":7094,"depth":114,"text":7095},{"id":18345,"depth":114,"text":18284,"children":20732},[20733,20734,20735],{"id":18348,"depth":111,"text":18349},{"id":18381,"depth":111,"text":18382},{"id":18417,"depth":111,"text":18418},{"id":18441,"depth":114,"text":18290,"children":20737},[20738,20739],{"id":18444,"depth":111,"text":18445},{"id":18489,"depth":111,"text":18490},{"id":18528,"depth":114,"text":18296,"children":20741},[20742,20743,20744],{"id":18531,"depth":111,"text":18532},{"id":18564,"depth":111,"text":18565},{"id":18597,"depth":111,"text":18598},{"id":18630,"depth":114,"text":18302,"children":20746},[20747,20748,20749,20750,20751,20752],{"id":18633,"depth":111,"text":18634},{"id":18672,"depth":111,"text":18673},{"id":18709,"depth":111,"text":18710},{"id":18746,"depth":111,"text":18747},{"id":18783,"depth":111,"text":18784},{"id":18820,"depth":111,"text":18821},{"id":18860,"depth":114,"text":18308,"children":20754},[20755,20756,20757,20758,20759],{"id":18863,"depth":111,"text":18864},{"id":18921,"depth":111,"text":18922},{"id":18975,"depth":111,"text":18976},{"id":19029,"depth":111,"text":19030},{"id":19049,"depth":111,"text":19050},{"id":19083,"depth":114,"text":18314,"children":20761},[20762,20763,20764,20765,20766],{"id":19086,"depth":111,"text":19087},{"id":19110,"depth":111,"text":19111},{"id":19134,"depth":111,"text":19135},{"id":19158,"depth":111,"text":19159},{"id":19178,"depth":111,"text":18784},{"id":19201,"depth":114,"text":18320,"children":20768},[20769,20770,20771,20772,20773],{"id":19204,"depth":111,"text":19205},{"id":19242,"depth":111,"text":19243},{"id":19279,"depth":111,"text":19280},{"id":19316,"depth":111,"text":19317},{"id":19353,"depth":111,"text":19354},{"id":19390,"depth":114,"text":18326,"children":20775},[20776,20777,20778,20779,20780],{"id":19393,"depth":111,"text":19394},{"id":19439,"depth":111,"text":19440},{"id":19483,"depth":111,"text":19484},{"id":19527,"depth":111,"text":19528},{"id":19571,"depth":111,"text":19572},{"id":19614,"depth":114,"text":18332,"children":20782},[20783,20784,20785,20786],{"id":19617,"depth":111,"text":19618},{"id":19816,"depth":111,"text":19817},{"id":20040,"depth":111,"text":20041},{"id":20261,"depth":111,"text":20262},{"id":20537,"depth":114,"text":18338,"children":20788},[20789,20790,20791,20792,20793],{"id":20540,"depth":111,"text":20541},{"id":20582,"depth":111,"text":20583},{"id":20626,"depth":111,"text":20627},{"id":20653,"depth":111,"text":20654},{"id":20680,"depth":111,"text":20681},{"id":3680,"depth":114,"text":3681},"An overview of Large Language Models and the harness infrastructure that makes them production-ready — covering model management, API routing, caching, observability, security, and integration patterns from direct API to self-hosted and event-driven approaches.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1677442136019-21780ecad995",[3781,3782,20798,20799,20800,20801,20802,20803],"harness","integration","infrastructure","observability","caching","multi-modal",{},"\u002Fblog\u002Fllms-and-ai-harness-integration",{"title":18257,"description":20795},"blog\u002Fllms-and-ai-harness-integration","oS6kd-hnVsV7f3Sn1XgQbN01xE1lYwf14H5YT_wOiWw",{"id":20810,"title":20811,"author":20812,"body":20813,"canonical":116,"categories":116,"date":20988,"description":20989,"excerpt":20990,"extension":119,"featuredImg":116,"img":21001,"keywords":21002,"language":3788,"meta":21008,"navigation":130,"ogImage":116,"path":21009,"rating":474,"readTime":480,"seo":21010,"stem":21011,"tag":21012,"__hash__":21013},"blog\u002Fblog\u002Fmps-new-begins.md","Mashed Potato Studios: Crafting Digital Experiences That Actually Work",{"name":9,"img":11,"website":327},{"type":13,"value":20814,"toc":20980},[20815,20817,20829,20831,20835,20838,20843,20847,20850,20977],[16,20816,333],{"id":332},[21,20818,20819,20820,20822,20823,20828],{},"At ",[151,20821,164],{},", we believe great digital products should be simple, effective, and memorable—just like comfort food done right. Our website, ",[3861,20824,20827],{"href":20825,"rel":20826},"https:\u002F\u002Fmashedpotatostudios.com",[3865],"mashedpotatostudios.com",", reflects who we are: a creative digital studio focused on building solutions that make sense for real people and real businesses.",[16,20830,4373],{"id":4372},[32,20832,20834],{"id":20833},"who-we-are","Who We Are",[21,20836,20837],{},"Mashed Potato Studios is a creative and technology-driven studio that helps businesses transform ideas into polished digital experiences. From concept to launch, we focus on clarity, usability, and performance—cutting out the unnecessary fluff and delivering what actually matters.",[25,20839,20840],{"type":363},[21,20841,20842],{},"Mashed Potato Studios works with startups, growing businesses, and established brands looking to level up their digital presence.",[32,20844,20846],{"id":20845},"what-we-do","What We Do",[21,20848,20849],{},"Our services are designed to meet clients where they are, whether they’re starting from scratch or refining an existing product.",[2805,20851,20852,20856,20872,20875,20879,20886,20900,20905,20909,20912],{},[2808,20853,20855],{"id":20854},"core-focus-areas","Core Focus Areas",[383,20857,20858,20861,20864,20867],{},[386,20859,20860],{},"Website design & development",[386,20862,20863],{},"Web applications & SaaS platforms",[386,20865,20866],{},"Branding & digital identity",[386,20868,20869,20870,15716],{},"Performance, scalability, and user experience",[6510,20871],{},[21,20873,20874],{},"We combine clean design with modern development practices to ensure every project is fast, accessible, and future-ready.",[32,20876,20878],{"id":20877},"why-the-website-matters","Why the Website Matters",[21,20880,20881,20882,20885],{},"Your website is often the ",[151,20883,20884],{},"first impression"," of your brand. At Mashed Potato Studios, we design websites that:",[383,20887,20888,20891,20894,20897],{},[386,20889,20890],{},"Communicate value clearly",[386,20892,20893],{},"Load fast and work across all devices",[386,20895,20896],{},"Convert visitors into customers",[386,20898,20899],{},"Grow with your business",[25,20901,20902],{"type":27},[21,20903,20904],{},"A slow, cluttered, or outdated website can cost you credibility—and customers.",[32,20906,20908],{"id":20907},"our-approach-to-development","Our Approach to Development",[21,20910,20911],{},"We build with modern tools and best practices, focusing on maintainability and long-term success.",[48,20913,20916],{"className":670,"code":20914,"filename":20915,"language":673,"meta":56,"style":56},"const studioPhilosophy = {\n  design: \"Clean and purposeful\",\n  code: \"Scalable and maintainable\",\n  clients: \"Partners, not just projects\",\n};\n\nconsole.log(studioPhilosophy);\n","philosophy.ts",[40,20917,20918,20929,20939,20949,20959,20964,20968],{"__ignoreMap":56},[449,20919,20920,20922,20925,20927],{"class":451,"line":452},[449,20921,711],{"class":680},[449,20923,20924],{"class":714}," studioPhilosophy",[449,20926,718],{"class":680},[449,20928,1501],{"class":684},[449,20930,20931,20934,20937],{"class":451,"line":114},[449,20932,20933],{"class":684},"  design: ",[449,20935,20936],{"class":691},"\"Clean and purposeful\"",[449,20938,779],{"class":684},[449,20940,20941,20944,20947],{"class":451,"line":111},[449,20942,20943],{"class":684},"  code: ",[449,20945,20946],{"class":691},"\"Scalable and maintainable\"",[449,20948,779],{"class":684},[449,20950,20951,20954,20957],{"class":451,"line":468},[449,20952,20953],{"class":684},"  clients: ",[449,20955,20956],{"class":691},"\"Partners, not just projects\"",[449,20958,779],{"class":684},[449,20960,20961],{"class":451,"line":474},[449,20962,20963],{"class":684},"};\n",[449,20965,20966],{"class":451,"line":480},[449,20967,700],{"emptyLinePlaceholder":130},[449,20969,20970,20972,20974],{"class":451,"line":486},[449,20971,1672],{"class":684},[449,20973,1675],{"class":721},[449,20975,20976],{"class":684},"(studioPhilosophy);\n",[3728,20978,20979],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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);}",{"title":56,"searchDepth":111,"depth":111,"links":20981},[20982,20983,20986,20987],{"id":20833,"depth":114,"text":20834},{"id":20845,"depth":114,"text":20846,"children":20984},[20985],{"id":20854,"depth":111,"text":20855},{"id":20877,"depth":114,"text":20878},{"id":20907,"depth":114,"text":20908},"2026-01-04","An inside look at Mashed Potato Studios—our mission, services, and how we help brands turn ideas into powerful digital products.",{"type":13,"value":20991},[20992,20994],[16,20993,333],{"id":332},[21,20995,20819,20996,20822,20998,20828],{},[151,20997,164],{},[3861,20999,20827],{"href":20825,"rel":21000},[3865],"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1553877522-43269d4ea984",[21003,21004,21005,21006,21007],"web development","branding","digital studio","startups","saas",{},"\u002Fblog\u002Fmps-new-begins",{"title":20811,"description":20989},"blog\u002Fmps-new-begins","Business","lNJKpy1Th4lqKSyvpeUGhIuRyUjWFebY8VrMTWFoQRA",{"id":21015,"title":21016,"author":21017,"body":21018,"canonical":116,"categories":116,"date":21063,"description":21064,"excerpt":21065,"extension":119,"featuredImg":116,"img":4159,"keywords":21071,"language":4162,"meta":21072,"navigation":130,"ogImage":116,"path":21073,"rating":21074,"readTime":111,"seo":21075,"stem":21076,"tag":21077,"__hash__":21078},"blog\u002Fblog\u002Fnew-vue-default.md","The New Vue Default",{"name":9,"website":10,"img":11},{"type":13,"value":21019,"toc":21061},[21020,21023,21026,21032,21035,21055,21058],[16,21021,21016],{"id":21022},"the-new-vue-default",[21,21024,21025],{},"Important notice: Vue will become default version on February 7, 2022.",[21027,21028,21029],"note",{},[21,21030,21031],{},"This was a major milestone for the Vue ecosystem, shifting from a library-first to a framework-first mindset.",[21,21033,21034],{},"I am actually excited about the current direction and vision that Vue is headed. Being a progressive framework means that implementation of how code is written is paramount for developer experience (DX). Look at how the new vue is implemented.",[427,21036,21039],{"icon":21037,"title":21038},"⚡️","Quick Install",[48,21040,21042],{"className":839,"code":21041,"language":841,"meta":56,"style":56},"npm install init vue@latest\n",[40,21043,21044],{"__ignoreMap":56},[449,21045,21046,21048,21050,21052],{"class":451,"line":452},[449,21047,3703],{"class":721},[449,21049,3706],{"class":691},[449,21051,4478],{"class":691},[449,21053,21054],{"class":691}," vue@latest\n",[21,21056,21057],{},"This provides a refreshing CLI experience that runs on Vite tooling under the hood. Integrating all the relevant tools from the community make the experience worth while..... just wish there was an turn off the bloatware (for more experienced persons who wanna get up and running quickly).",[3728,21059,21060],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}",{"title":56,"searchDepth":111,"depth":111,"links":21062},[],"2022-02-01","From a library to a Framework",{"type":13,"value":21066},[21067,21069],[16,21068,21016],{"id":21022},[21,21070,21025],{},[122,123,124,125,4161,127],{},"\u002Fblog\u002Fnew-vue-default",4.8,{"title":21016,"description":21064},"blog\u002Fnew-vue-default","Framework","55GnzRI6XRTUY5n5mtrZGTaeUgYBpR35_L29JV8N-gM",{"id":21080,"title":21081,"author":21082,"body":21083,"canonical":116,"categories":116,"date":21115,"description":21116,"excerpt":21117,"extension":119,"featuredImg":116,"img":120,"keywords":21123,"language":4162,"meta":21124,"navigation":130,"ogImage":116,"path":21125,"rating":132,"readTime":474,"seo":21126,"stem":21127,"tag":21128,"__hash__":21129},"blog\u002Fblog\u002Fnew-website.md","My New Website",{"name":9,"website":10,"img":11},{"type":13,"value":21084,"toc":21111},[21085,21088,21091,21094,21099,21102,21106],[32,21086,21087],{"id":3612},"Performance",[21,21089,21090],{},"Nuxt.js provides some unique advantages which allowed for it to be the main choice when creating my website.",[21,21092,21093],{},"Vue.js is my framework of choice in most cases. Nuxt.js provides an \"intutitve\" developer experience (DX).",[3830,21095,21096],{},[21,21097,21098],{},"Nuxt.js has zero configuration, allowing for file-system routing, components auto-import and seo friendly for indexing.",[21,21100,21101],{},"Paramount to this application using the power modules- Content, that allows for my web app to using MDX for this blog section.",[32,21103,21105],{"id":21104},"future-updates","Future Updates",[2805,21107,21108],{},[21,21109,21110],{},"Addition of Youtube videos section will added shortly, Integration of Twitch API....",{"title":56,"searchDepth":111,"depth":111,"links":21112},[21113,21114],{"id":3612,"depth":114,"text":21087},{"id":21104,"depth":114,"text":21105},"2021-12-01","Built with Nuxt.js 2",{"type":13,"value":21118},[21119,21121],[32,21120,21087],{"id":3612},[21,21122,21090],{},[122,123,124,125,4161,127],{},"\u002Fblog\u002Fnew-website",{"title":21081,"description":21116},"blog\u002Fnew-website","New Stack","7ddvu12o4bcrFM2UczxcQCYXzxqy-5cjmQ5aIhS383o",{"id":21131,"title":21132,"author":21133,"body":21134,"canonical":116,"categories":116,"date":21345,"description":21346,"excerpt":116,"extension":119,"featuredImg":116,"img":21347,"keywords":21348,"language":3788,"meta":21353,"navigation":130,"ogImage":116,"path":21354,"rating":474,"readTime":474,"seo":21355,"stem":21356,"tag":3793,"__hash__":21357},"blog\u002Fblog\u002Fnew-year-new-code.md","New Year, New Stack: Embracing TanStack Start & AI Integrations in 2026",{"name":9,"img":11,"website":327},{"type":13,"value":21135,"toc":21337},[21136,21138,21153,21155,21159,21165,21168,21173,21177,21182,21185,21199,21335],[16,21137,333],{"id":332},[21,21139,21140,21141,21144,21145,21148,21149,21152],{},"A new year always brings fresh energy—and in tech, that energy often shows up as better tools, smarter workflows, and new ways of thinking. As we step into ",[151,21142,21143],{},"2026",", this is the year of embracing modern frameworks like ",[151,21146,21147],{},"TanStack Start"," and leaning fully into ",[151,21150,21151],{},"AI integrations"," to build faster, more intelligent digital experiences.",[16,21154,4373],{"id":4372},[32,21156,21158],{"id":21157},"why-a-new-stack-matters","Why a New Stack Matters",[21,21160,21161,21162,165],{},"The web is evolving quickly. Users expect instant feedback, seamless navigation, and personalized experiences. To meet those expectations, developers need tools that are ",[151,21163,21164],{},"performant, flexible, and future-proof",[21,21166,21167],{},"That’s where modern frameworks come in.",[25,21169,21170],{"type":363},[21,21171,21172],{},"Choosing the right framework isn’t about hype—it’s about long-term maintainability and developer experience.",[32,21174,21176],{"id":21175},"tanstack-start-a-fresh-way-to-build","TanStack Start: A Fresh Way to Build",[21,21178,21179,21181],{},[151,21180,21147],{}," represents a shift toward a more unified, type-safe, and scalable approach to building full-stack applications. It brings together ideas we already love—routing, data fetching, and server-first thinking—into a cohesive system.",[21,21183,21184],{},"Why it’s exciting:",[383,21186,21187,21190,21193,21196],{},[386,21188,21189],{},"End-to-end type safety",[386,21191,21192],{},"Powerful data management with TanStack Query",[386,21194,21195],{},"Server-first architecture without unnecessary complexity",[386,21197,21198],{},"Freedom from heavy abstractions",[2805,21200,21201,21205,21216,21219,21223,21226,21229,21243,21250,21253,21257,21267],{},[2808,21202,21204],{"id":21203},"what-tanstack-start-encourages","What TanStack Start Encourages",[383,21206,21207,21210,21213],{},[386,21208,21209],{},"Thinking in data, not just pages",[386,21211,21212],{},"Clear separation of concerns",[386,21214,21215],{},"Performance by default\n::",[21,21217,21218],{},"It’s less about fighting the framework and more about building with confidence.",[32,21220,21222],{"id":21221},"ai-integrations-from-nice-to-have-to-essential","AI Integrations: From “Nice-to-Have” to Essential",[21,21224,21225],{},"AI is no longer experimental—it’s becoming foundational.",[21,21227,21228],{},"In 2026, AI integrations are helping teams:",[383,21230,21231,21234,21237,21240],{},[386,21232,21233],{},"Automate repetitive workflows",[386,21235,21236],{},"Enhance user experiences with personalization",[386,21238,21239],{},"Provide smarter search and recommendations",[386,21241,21242],{},"Improve developer productivity",[427,21244,21247],{"icon":21245,"title":21246},"🤖","AI as a Teammate",[21,21248,21249],{},"The best AI tools don’t replace developers—they amplify what developers can do.",[21,21251,21252],{},"From intelligent chat assistants to backend automation, AI is reshaping how products are built and how users interact with them.",[32,21254,21256],{"id":21255},"building-smarter-not-harder","Building Smarter, Not Harder",[21,21258,21259,21260,21263,21264,165],{},"The real power comes from combining ",[151,21261,21262],{},"modern frameworks"," with ",[151,21265,21266],{},"AI-driven features",[48,21268,21271],{"className":670,"code":21269,"filename":21270,"language":673,"meta":56,"style":56},"const newYearStack = {\n  framework: \"TanStack Start\",\n  ai: \"Integrated at every layer\",\n  goal: \"Faster builds, smarter products\",\n};\n\nconsole.log(\"Welcome to 2026 🚀\");\n","future.ts",[40,21272,21273,21284,21294,21304,21314,21318,21322],{"__ignoreMap":56},[449,21274,21275,21277,21280,21282],{"class":451,"line":452},[449,21276,711],{"class":680},[449,21278,21279],{"class":714}," newYearStack",[449,21281,718],{"class":680},[449,21283,1501],{"class":684},[449,21285,21286,21289,21292],{"class":451,"line":114},[449,21287,21288],{"class":684},"  framework: ",[449,21290,21291],{"class":691},"\"TanStack Start\"",[449,21293,779],{"class":684},[449,21295,21296,21299,21302],{"class":451,"line":111},[449,21297,21298],{"class":684},"  ai: ",[449,21300,21301],{"class":691},"\"Integrated at every layer\"",[449,21303,779],{"class":684},[449,21305,21306,21309,21312],{"class":451,"line":468},[449,21307,21308],{"class":684},"  goal: ",[449,21310,21311],{"class":691},"\"Faster builds, smarter products\"",[449,21313,779],{"class":684},[449,21315,21316],{"class":451,"line":474},[449,21317,20963],{"class":684},[449,21319,21320],{"class":451,"line":480},[449,21321,700],{"emptyLinePlaceholder":130},[449,21323,21324,21326,21328,21330,21333],{"class":451,"line":486},[449,21325,1672],{"class":684},[449,21327,1675],{"class":721},[449,21329,725],{"class":684},[449,21331,21332],{"class":691},"\"Welcome to 2026 🚀\"",[449,21334,740],{"class":684},[3728,21336,20979],{},{"title":56,"searchDepth":111,"depth":111,"links":21338},[21339,21340,21343,21344],{"id":21157,"depth":114,"text":21158},{"id":21175,"depth":114,"text":21176,"children":21341},[21342],{"id":21203,"depth":111,"text":21204},{"id":21221,"depth":114,"text":21222},{"id":21255,"depth":114,"text":21256},"2026-01-01","A New Year reflection on adopting modern frameworks like TanStack Start and integrating AI to build faster, smarter digital products.","https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1767533051\u002FPXL_20251114_022510096_kq4fyh.jpg",[21349,21350,21351,21003,21352],"tanstack","tanstack start","ai integration",2026,{},"\u002Fblog\u002Fnew-year-new-code",{"title":21132,"description":21346},"blog\u002Fnew-year-new-code","ujbxEsod-GX7IadByS6iOvfra8MXsa2dq9CZu3hEpQA",{"id":21359,"title":21360,"author":21361,"body":21362,"canonical":116,"categories":116,"date":22027,"description":22028,"excerpt":22029,"extension":119,"featuredImg":116,"img":22045,"keywords":22046,"language":3788,"meta":22047,"navigation":130,"ogImage":116,"path":22048,"rating":474,"readTime":133,"seo":22049,"stem":22050,"tag":3793,"__hash__":22051},"blog\u002Fblog\u002Fnitro-build.md","How to Use Nitro: Build and Deploy Modern Servers Anywhere",{"name":9,"img":11,"website":327},{"type":13,"value":21363,"toc":22007},[21364,21366,21378,21385,21387,21391,21396,21424,21431,21438,21440,21444,21448,21453,21479,21482,21488,21496,21500,21503,21515,21525,21527,21531,21542,21546,21552,21586,21595,21604,21606,21610,21619,21623,21688,21694,21696,21700,21708,21712,21765,21768,21804,21814,21816,21820,21832,21839,21841,21845,21852,21864,21873,21876,21903,21909,21911,21915,21926,21929,21931,21935,21947,21950,21961,21963,21965,21970,22002,22005],[16,21365,333],{"id":332},[21,21367,21368,21369,21372,21373,21375,21376],{},"Modern web applications increasingly require flexible, performant backends that can run ",[151,21370,21371],{},"anywhere from edge servers to traditional Node hosts",". That’s where ",[151,21374,4189],{}," comes in — a lightweight, runtime-agnostic server toolkit that lets you build APIs, server logic, and backend functionality with minimal configuration and deploy it across platforms seamlessly. Nitro works standalone or as the server engine under frameworks like Nuxt and Vite-based apps. ",[9897,21377,9900],{"index":9899},[21,21379,21380,21381,21384],{},"In this post, we’ll explore how to ",[151,21382,21383],{},"use Nitro",", walk through practical examples, and show you how to build and deploy real server-side logic using this powerful tool.",[16,21386,4373],{"id":4372},[32,21388,21390],{"id":21389},"what-is-nitro-and-why-use-it","What Is Nitro and Why Use It?",[21,21392,9912,21393,21395],{},[151,21394,4189],{}," is a server engine and framework designed to make backend development simple, portable, and efficient. It gives you:",[383,21397,21398,21404,21410,21416,21419],{},[386,21399,21400,21403],{},[151,21401,21402],{},"Out-of-the-box server routing"," with filesystem-based handlers",[386,21405,21406,21409],{},[151,21407,21408],{},"Multi-runtime support"," — Node, Bun, Deno, and more",[386,21411,21412,21415],{},[151,21413,21414],{},"Zero-config deployment"," for many platforms",[386,21417,21418],{},"Hot reloading and developer experience conveniences",[386,21420,21421,21422],{},"Minimal overhead — compiled output is very small ",[9897,21423,9926],{"index":4798},[21,21425,21426,21427,21430],{},"Instead of wrestling with server setups or environment differences, Nitro lets you focus on your ",[151,21428,21429],{},"handlers and business logic"," while it handles the rest.",[25,21432,21433],{"type":363},[21,21434,21435,21436],{},"Nitro works both as a standalone server toolkit and as the server engine powering full-stack frameworks like Nuxt — giving you flexibility to choose how you build your backend. ",[9897,21437,9938],{"index":4826},[73,21439],{},[32,21441,21443],{"id":21442},"getting-started-with-nitro","Getting Started with Nitro",[2808,21445,21447],{"id":21446},"step-1-create-a-new-nitro-project","Step 1: Create a New Nitro Project",[21,21449,21450,21451],{},"Nitro provides a starter template to help you bootstrap quickly (and you can even try it in your browser with an online playground). ",[9897,21452,9985],{"index":4849},[48,21454,21456],{"className":839,"code":21455,"language":841,"meta":56,"style":56},"npx create-nitro-app nitro-app\ncd nitro-app\nnpm install\n",[40,21457,21458,21467,21473],{"__ignoreMap":56},[449,21459,21460,21462,21464],{"class":451,"line":452},[449,21461,8887],{"class":721},[449,21463,10555],{"class":691},[449,21465,21466],{"class":691}," nitro-app\n",[449,21468,21469,21471],{"class":451,"line":114},[449,21470,4490],{"class":714},[449,21472,21466],{"class":691},[449,21474,21475,21477],{"class":451,"line":111},[449,21476,3703],{"class":721},[449,21478,4512],{"class":691},[21,21480,21481],{},"Once installed, you’ll have a Nitro project with a directory structure like:",[48,21483,21486],{"className":21484,"code":21485,"language":53},[51],"server\u002Froutes\u002F\nserver\u002Fapi\u002F\nserver\u002Futils\u002F\nserver\u002Fplugins\u002F\nnitro.config.ts\n",[40,21487,21485],{"__ignoreMap":56},[21,21489,21490,21491,827],{},"These folders are where you’ll place your routes, logic, utilities, and plugins. (",[3861,21492,4189],{"href":21493,"rel":21494,"title":21495},"https:\u002F\u002Fnitro.build\u002Fguide?utm_source=chatgpt.com",[3865],"Docs - Nitro",[2808,21497,21499],{"id":21498},"step-2-run-the-development-server","Step 2: Run the Development Server",[21,21501,21502],{},"Nitro comes with a built-in development server that supports hot reload:",[48,21504,21505],{"className":839,"code":3854,"language":841,"meta":56,"style":56},[40,21506,21507],{"__ignoreMap":56},[449,21508,21509,21511,21513],{"class":451,"line":452},[449,21510,3703],{"class":721},[449,21512,5297],{"class":691},[449,21514,5300],{"class":691},[21,21516,21517,21518,21521,21522,827],{},"By default, Nitro starts on ",[40,21519,21520],{},"http:\u002F\u002Flocalhost:3000\u002F",". You’ll see your handlers and static files served automatically. (",[3861,21523,4189],{"href":21493,"rel":21524,"title":21495},[3865],[73,21526],{},[32,21528,21530],{"id":21529},"filesystem-routing-api-routes-handlers","Filesystem Routing: API Routes & Handlers",[21,21532,21533,21534,21537,21538,21541],{},"Just like many modern server frameworks, Nitro uses ",[151,21535,21536],{},"filesystem routing",": files you create under ",[40,21539,21540],{},"server\u002Froutes\u002F"," automatically become endpoints.",[2808,21543,21545],{"id":21544},"example-create-a-simple-api-route","Example: Create a Simple API Route",[21,21547,21548,21549,3070],{},"Create a file named ",[40,21550,21551],{},"server\u002Fapi\u002Fhello.ts",[48,21553,21555],{"className":670,"code":21554,"language":673,"meta":56,"style":56},"export default defineEventHandler(() => {\n  return { message: \"Hello from Nitro!\" };\n});\n",[40,21556,21557,21571,21582],{"__ignoreMap":56},[449,21558,21559,21561,21563,21565,21567,21569],{"class":451,"line":452},[449,21560,4629],{"class":680},[449,21562,4632],{"class":680},[449,21564,4714],{"class":721},[449,21566,4717],{"class":684},[449,21568,1498],{"class":680},[449,21570,1501],{"class":684},[449,21572,21573,21575,21577,21580],{"class":451,"line":114},[449,21574,4726],{"class":680},[449,21576,12355],{"class":684},[449,21578,21579],{"class":691},"\"Hello from Nitro!\"",[449,21581,1520],{"class":684},[449,21583,21584],{"class":451,"line":111},[449,21585,784],{"class":684},[21,21587,7215,21588,21591,21592,827],{},[40,21589,21590],{},"http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fhello"," in the browser to see the JSON response. Nitro does the routing for you based on file paths. (",[3861,21593,4189],{"href":21493,"rel":21594,"title":21495},[3865],[21,21596,21597,21598,21600,21601,10052],{},"Nitro routes can be nested — create folders within ",[40,21599,21540],{}," to structure your API and handlers naturally. (",[3861,21602,4189],{"href":21493,"rel":21603,"title":21495},[3865],[73,21605],{},[32,21607,21609],{"id":21608},"using-utility-functions","Using Utility Functions",[21,21611,21612,21613,827],{},"Nitro auto-imports useful utilities that help you build more expressive handlers without boilerplate. For example, parsing query parameters, reading cookies, or handling headers can be done with helpers from h3 (Nitro’s HTTP utility library under the hood). (",[3861,21614,21618],{"href":21615,"rel":21616,"title":21617},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002F3.x\u002Fguide\u002Fconcepts\u002Fserver-engine?utm_source=chatgpt.com",[3865],"Server Engine · Nuxt Concepts v3","Nuxt",[2808,21620,21622],{"id":21621},"example-reading-query-parameters","Example: Reading Query Parameters",[48,21624,21626],{"className":670,"code":21625,"language":673,"meta":56,"style":56},"export default defineEventHandler((event) => {\n  const { name } = getQuery(event);\n  return { greeting: `Hello ${name ?? \"World\"}` };\n});\n",[40,21627,21628,21646,21664,21684],{"__ignoreMap":56},[449,21629,21630,21632,21634,21636,21638,21640,21642,21644],{"class":451,"line":452},[449,21631,4629],{"class":680},[449,21633,4632],{"class":680},[449,21635,4714],{"class":721},[449,21637,5164],{"class":684},[449,21639,2991],{"class":1491},[449,21641,1758],{"class":684},[449,21643,1498],{"class":680},[449,21645,1501],{"class":684},[449,21647,21648,21650,21652,21654,21657,21659,21662],{"class":451,"line":114},[449,21649,5048],{"class":680},[449,21651,14227],{"class":684},[449,21653,13144],{"class":714},[449,21655,21656],{"class":684}," } ",[449,21658,5014],{"class":680},[449,21660,21661],{"class":721}," getQuery",[449,21663,12843],{"class":684},[449,21665,21666,21668,21671,21674,21676,21679,21682],{"class":451,"line":111},[449,21667,4726],{"class":680},[449,21669,21670],{"class":684}," { greeting: ",[449,21672,21673],{"class":691},"`Hello ${",[449,21675,13144],{"class":684},[449,21677,21678],{"class":680}," ??",[449,21680,21681],{"class":691}," \"World\"}`",[449,21683,1520],{"class":684},[449,21685,21686],{"class":451,"line":468},[449,21687,784],{"class":684},[21,21689,7215,21690,21693],{},[40,21691,21692],{},"\u002Fapi\u002Fhello?name=Vantol"," and Nitro will handle parsing automatically.",[73,21695],{},[32,21697,21699],{"id":21698},"configuration-with-nitroconfigts","Configuration with nitro.config.ts",[21,21701,21702,21703,827],{},"Nitro can be customized via a configuration file. You might want to set runtime config values or adjust build behavior. (",[3861,21704,4189],{"href":21705,"rel":21706,"title":21707},"https:\u002F\u002Fnitro.build\u002Fguide\u002Fconfiguration\u002F?utm_source=chatgpt.com",[3865],"Configuration - Nitro",[2808,21709,21711],{"id":21710},"example-runtime-config","Example: Runtime Config",[48,21713,21715],{"className":670,"code":21714,"language":673,"meta":56,"style":56},"import { defineNitroConfig } from \"nitro\u002Fconfig\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    apiToken: \"dev_token\",\n  },\n});\n",[40,21716,21717,21729,21733,21743,21747,21757,21761],{"__ignoreMap":56},[449,21718,21719,21721,21723,21725,21727],{"class":451,"line":452},[449,21720,681],{"class":680},[449,21722,15369],{"class":684},[449,21724,688],{"class":680},[449,21726,15374],{"class":691},[449,21728,695],{"class":684},[449,21730,21731],{"class":451,"line":114},[449,21732,700],{"emptyLinePlaceholder":130},[449,21734,21735,21737,21739,21741],{"class":451,"line":111},[449,21736,4629],{"class":680},[449,21738,4632],{"class":680},[449,21740,15389],{"class":721},[449,21742,1391],{"class":684},[449,21744,21745],{"class":451,"line":468},[449,21746,15396],{"class":684},[449,21748,21749,21752,21755],{"class":451,"line":474},[449,21750,21751],{"class":684},"    apiToken: ",[449,21753,21754],{"class":691},"\"dev_token\"",[449,21756,779],{"class":684},[449,21758,21759],{"class":451,"line":480},[449,21760,1474],{"class":684},[449,21762,21763],{"class":451,"line":486},[449,21764,784],{"class":684},[21,21766,21767],{},"Then, within handlers you can access this config:",[48,21769,21771],{"className":670,"code":21770,"language":673,"meta":56,"style":56},"export default defineEventHandler((event) => {\n  return useRuntimeConfig().apiToken;\n});\n",[40,21772,21773,21791,21800],{"__ignoreMap":56},[449,21774,21775,21777,21779,21781,21783,21785,21787,21789],{"class":451,"line":452},[449,21776,4629],{"class":680},[449,21778,4632],{"class":680},[449,21780,4714],{"class":721},[449,21782,5164],{"class":684},[449,21784,2991],{"class":1491},[449,21786,1758],{"class":684},[449,21788,1498],{"class":680},[449,21790,1501],{"class":684},[449,21792,21793,21795,21797],{"class":451,"line":114},[449,21794,4726],{"class":680},[449,21796,15457],{"class":721},[449,21798,21799],{"class":684},"().apiToken;\n",[449,21801,21802],{"class":451,"line":111},[449,21803,784],{"class":684},[21,21805,21806,21807,21810,21811,827],{},"You can override these values with environment variables prefixed with ",[40,21808,21809],{},"NITRO_"," for different environments (development, staging, production). (",[3861,21812,4189],{"href":21705,"rel":21813,"title":21707},[3865],[73,21815],{},[32,21817,21819],{"id":21818},"serving-static-files-and-custom-renderers","Serving Static Files and Custom Renderers",[21,21821,21822,21823,21826,21827,827],{},"Nitro can serve static files like HTML, images, and assets from unconfigured folders. It also supports fallback renderers — for example serving an ",[40,21824,21825],{},"index.html"," for all non-API routes in single-page applications. (",[3861,21828,4189],{"href":21829,"rel":21830,"title":21831},"https:\u002F\u002Fv3.nitro.build\u002Fdocs\u002Frenderer?utm_source=chatgpt.com",[3865],"Nitro Renderer - Nitro",[21,21833,21834,21835,21838],{},"This makes Nitro useful for ",[151,21836,21837],{},"hybrid applications"," that combine server APIs with frontend PWAs or SPAs.",[73,21840],{},[32,21842,21844],{"id":21843},"deploying-your-nitro-app","Deploying Your Nitro App",[21,21846,21847,21848,21851],{},"One of Nitro’s strengths is its ability to ",[151,21849,21850],{},"deploy to multiple environments with minimal changes",". After building your app:",[48,21853,21854],{"className":839,"code":17038,"language":841,"meta":56,"style":56},[40,21855,21856],{"__ignoreMap":56},[449,21857,21858,21860,21862],{"class":451,"line":452},[449,21859,3703],{"class":721},[449,21861,5297],{"class":691},[449,21863,6799],{"class":691},[21,21865,21866,21867,21869,21870,827],{},"Nitro outputs a production-ready server in the ",[40,21868,17054],{}," directory that can run on various targets. (",[3861,21871,4189],{"href":21493,"rel":21872,"title":21495},[3865],[21,21874,21875],{},"You can deploy to:",[383,21877,21878,21886,21892],{},[386,21879,21880,21882,21883],{},[151,21881,17060],{}," — run ",[40,21884,21885],{},".output\u002Fserver\u002Findex.mjs",[386,21887,21888,21891],{},[151,21889,21890],{},"Edge platforms"," — Cloudflare Workers, Deno Deploy with presets",[386,21893,21894,21897,21898,827],{},[151,21895,21896],{},"Serverless providers"," — AWS Lambda, Vercel, Netlify, etc. (",[3861,21899,4189],{"href":21900,"rel":21901,"title":21902},"https:\u002F\u002Fnitro.build\u002Fdeploy?utm_source=chatgpt.com",[3865],"Deploy - Nitro",[21,21904,21905,21906,827],{},"Nitro often autodetects the hosting provider and configures itself accordingly — meaning fewer environment-specific tweaks. (",[3861,21907,4189],{"href":21900,"rel":21908,"title":21902},[3865],[73,21910],{},[32,21912,21914],{"id":21913},"advanced-plugins-middleware","Advanced: Plugins & Middleware",[21,21916,21917,21918,21921,21922,21925],{},"If you need to extend Nitro’s behavior, you can create your own ",[151,21919,21920],{},"plugins"," in ",[40,21923,21924],{},"server\u002Fplugins\u002F",". These let you hook into the lifecycle of requests, register middleware, or augment server behavior in powerful ways.",[21,21927,21928],{},"This pattern helps modularize cross-cutting concerns like authentication, logging, or error reporting.",[73,21930],{},[32,21932,21934],{"id":21933},"example-full-api-frontend-integration","Example: Full API + Frontend Integration",[21,21936,21937,21938,21941,21942,827],{},"You can integrate Nitro with frontend frameworks like Vite to create ",[151,21939,21940],{},"full-stack apps"," where your UI and backend live in one project. Nitro handles server APIs and static assets, while Vite serves HMR and frontend bundling. (",[3861,21943,4189],{"href":21944,"rel":21945,"title":21946},"https:\u002F\u002Fv3.nitro.build\u002Fdocs\u002Fquick-start?utm_source=chatgpt.com",[3865],"Quick Start - Nitro",[21,21948,21949],{},"This setup enables:",[383,21951,21952,21955,21958],{},[386,21953,21954],{},"Server APIs without CORS complexity",[386,21956,21957],{},"Sharing code between backend and frontend",[386,21959,21960],{},"Fast development workflows with hot reload",[73,21962],{},[16,21964,3681],{"id":3680},[21,21966,21967,21969],{},[151,21968,4189],{}," is an incredibly flexible and powerful tool for modern backend development. Whether you’re building APIs, hybrid apps, or full-stack projects, Nitro offers:",[383,21971,21972,21977,21982,21987,21992],{},[386,21973,21974],{},[151,21975,21976],{},"Filesystem routing and simple handlers",[386,21978,21979],{},[151,21980,21981],{},"Configurable runtime environments",[386,21983,21984],{},[151,21985,21986],{},"Cross-runtime deployment",[386,21988,21989],{},[151,21990,21991],{},"Out-of-the-box utility functions and developer experience",[386,21993,21994,1913,21997,827],{},[151,21995,21996],{},"Easy integration with frontend frameworks",[3861,21998,4189],{"href":21999,"rel":22000,"title":22001},"https:\u002F\u002Fnitro.build\u002F?utm_source=chatgpt.com",[3865],"Nitro - Next Generation Server Toolkit",[21,22003,22004],{},"With these capabilities, Nitro enables developers to build fast, scalable, and portable server apps without sacrificing simplicity — making it a strong choice for teams building modern web applications. 🚀",[3728,22006,15769],{},{"title":56,"searchDepth":111,"depth":111,"links":22008},[22009,22010,22014,22017,22020,22023,22024,22025,22026],{"id":21389,"depth":114,"text":21390},{"id":21442,"depth":114,"text":21443,"children":22011},[22012,22013],{"id":21446,"depth":111,"text":21447},{"id":21498,"depth":111,"text":21499},{"id":21529,"depth":114,"text":21530,"children":22015},[22016],{"id":21544,"depth":111,"text":21545},{"id":21608,"depth":114,"text":21609,"children":22018},[22019],{"id":21621,"depth":111,"text":21622},{"id":21698,"depth":114,"text":21699,"children":22021},[22022],{"id":21710,"depth":111,"text":21711},{"id":21818,"depth":114,"text":21819},{"id":21843,"depth":114,"text":21844},{"id":21913,"depth":114,"text":21914},{"id":21933,"depth":114,"text":21934},"2026-01-20","An in-depth look at Nitro — what it is, how to use it to build servers and APIs, and practical steps to get started with real examples.",{"type":13,"value":22030},[22031,22033,22041],[16,22032,333],{"id":332},[21,22034,21368,22035,21372,22037,21375,22039],{},[151,22036,21371],{},[151,22038,4189],{},[9897,22040,9900],{"index":9899},[21,22042,21380,22043,21384],{},[151,22044,21383],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1498050108023-c5249f4df085",[7065,17245,127,7069,15838],{},"\u002Fblog\u002Fnitro-build",{"title":21360,"description":22028},"blog\u002Fnitro-build","hYMQEZWJZoljxwFAfVZX3PyPi-4z8Nb5BiDsy_fyG5w",{"id":22053,"title":22054,"author":22055,"body":22056,"canonical":116,"categories":116,"date":22655,"description":22656,"excerpt":22657,"extension":119,"featuredImg":116,"img":22677,"keywords":22678,"language":3788,"meta":22680,"navigation":130,"ogImage":116,"path":22681,"rating":474,"readTime":492,"seo":22682,"stem":22683,"tag":3793,"__hash__":22684},"blog\u002Fblog\u002Fnitro-plugins.md","Extending Nitro with Plugins: How to Build and Ideas for Real World Use",{"name":9,"img":11,"website":327},{"type":13,"value":22057,"toc":22637},[22058,22060,22069,22072,22083,22085,22089,22097,22101,22111,22114,22159,22167,22171,22180,22183,22268,22271,22356,22360,22363,22370,22373,22384,22387,22389,22396,22399,22507,22510,22512,22519,22522,22525,22528,22539,22541,22548,22551,22554,22592,22594,22601,22604,22607,22609,22613,22618,22620,22622,22625,22628,22634],[16,22059,333],{"id":332},[21,22061,22062,22063,22066,22067],{},"Nitro is a lightweight, runtime-agnostic server framework that lets you build fast APIs and backends deployable anywhere. But what happens when you need more than basic routes? That’s where ",[151,22064,22065],{},"Nitro plugins"," come in — a powerful way to hook into Nitro’s runtime and extend its behavior.:contentReference",[449,22068,9926],{"index":4798},[21,22070,22071],{},"In this post we’ll cover:",[383,22073,22074,22077,22080],{},[386,22075,22076],{},"What Nitro plugins are",[386,22078,22079],{},"How to create one",[386,22081,22082],{},"Useful plugin ideas you can build for real applications",[16,22084,4373],{"id":4372},[32,22086,22088],{"id":22087},"what-are-nitro-plugins","What Are Nitro Plugins?",[21,22090,22091,22092,22094,22095],{},"Nitro plugins allow you to extend Nitro’s runtime behavior in a modular and reusable way. They’re executed when the server starts and can hook into internal lifecycle events, letting you react to incoming requests, errors, responses, and more. Nitro registers plugins automatically from your ",[40,22093,21924],{}," directory or ones you list in the Nitro config.:contentReference",[449,22096,9938],{"index":4826},[32,22098,22100],{"id":22099},"how-to-create-a-simple-nitro-plugin","How to Create a Simple Nitro Plugin",[21,22102,22103,22104,22107,22108,22110],{},"Creating a Nitro plugin starts with the ",[40,22105,22106],{},"defineNitroPlugin"," function. Plugins receive the ",[40,22109,16746],{}," context — the runtime environment you can interact with.",[21,22112,22113],{},"For example, a simple plugin that logs when the server starts could look like:",[48,22115,22117],{"className":670,"code":22116,"language":673,"meta":56,"style":56},"\u002F\u002F server\u002Fplugins\u002Flogger.ts\nexport default defineNitroPlugin((nitroApp) => {\n  console.log(\"Nitro server initialized!\");\n});\n",[40,22118,22119,22124,22142,22155],{"__ignoreMap":56},[449,22120,22121],{"class":451,"line":452},[449,22122,22123],{"class":705},"\u002F\u002F server\u002Fplugins\u002Flogger.ts\n",[449,22125,22126,22128,22130,22132,22134,22136,22138,22140],{"class":451,"line":114},[449,22127,4629],{"class":680},[449,22129,4632],{"class":680},[449,22131,16741],{"class":721},[449,22133,5164],{"class":684},[449,22135,16746],{"class":1491},[449,22137,1758],{"class":684},[449,22139,1498],{"class":680},[449,22141,1501],{"class":684},[449,22143,22144,22146,22148,22150,22153],{"class":451,"line":111},[449,22145,5444],{"class":684},[449,22147,1675],{"class":721},[449,22149,725],{"class":684},[449,22151,22152],{"class":691},"\"Nitro server initialized!\"",[449,22154,740],{"class":684},[449,22156,22157],{"class":451,"line":468},[449,22158,784],{"class":684},[21,22160,22161,22162,22164,22165,827],{},"Nitro runs your plugin as part of server initialization. You can even register plugins from custom directories by adding them to ",[40,22163,15357],{},".([nitro.build]",[449,22166,4826],{},[32,22168,22170],{"id":22169},"using-nitro-lifecycle-hooks","Using Nitro Lifecycle Hooks",[21,22172,22173,22174,22177,22178,827],{},"Plugins become especially powerful when you use ",[151,22175,22176],{},"lifecycle hooks",". Nitro exposes several event hooks that let you react to server behavior — from incoming requests to errors and responses.([nitro.build]",[449,22179,4826],{},[21,22181,22182],{},"Here’s a plugin that logs every request URL:",[48,22184,22186],{"className":670,"code":22185,"language":673,"meta":56,"style":56},"\u002F\u002F server\u002Fplugins\u002Frequest-logger.ts\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook(\"request\", (event) => {\n    console.log(`[Request] ${event.method} ${event.path}`);\n  });\n});\n",[40,22187,22188,22193,22211,22231,22260,22264],{"__ignoreMap":56},[449,22189,22190],{"class":451,"line":452},[449,22191,22192],{"class":705},"\u002F\u002F server\u002Fplugins\u002Frequest-logger.ts\n",[449,22194,22195,22197,22199,22201,22203,22205,22207,22209],{"class":451,"line":114},[449,22196,4629],{"class":680},[449,22198,4632],{"class":680},[449,22200,16741],{"class":721},[449,22202,5164],{"class":684},[449,22204,16746],{"class":1491},[449,22206,1758],{"class":684},[449,22208,1498],{"class":680},[449,22210,1501],{"class":684},[449,22212,22213,22215,22217,22219,22221,22223,22225,22227,22229],{"class":451,"line":111},[449,22214,16757],{"class":684},[449,22216,16760],{"class":721},[449,22218,725],{"class":684},[449,22220,16765],{"class":691},[449,22222,3500],{"class":684},[449,22224,2991],{"class":1491},[449,22226,1758],{"class":684},[449,22228,1498],{"class":680},[449,22230,1501],{"class":684},[449,22232,22233,22235,22237,22239,22242,22244,22246,22248,22250,22252,22254,22256,22258],{"class":451,"line":468},[449,22234,3002],{"class":684},[449,22236,1675],{"class":721},[449,22238,725],{"class":684},[449,22240,22241],{"class":691},"`[Request] ${",[449,22243,2991],{"class":684},[449,22245,165],{"class":691},[449,22247,16807],{"class":684},[449,22249,16810],{"class":691},[449,22251,2991],{"class":684},[449,22253,165],{"class":691},[449,22255,16817],{"class":684},[449,22257,1517],{"class":691},[449,22259,740],{"class":684},[449,22261,22262],{"class":451,"line":474},[449,22263,13321],{"class":684},[449,22265,22266],{"class":451,"line":480},[449,22267,784],{"class":684},[21,22269,22270],{},"And you can also hook into errors to capture and log them:",[48,22272,22274],{"className":670,"code":22273,"language":673,"meta":56,"style":56},"\u002F\u002F server\u002Fplugins\u002Ferror-catcher.ts\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook(\"error\", (error, { event }) => {\n    console.error(`Error at ${event.path}:`, error);\n  });\n});\n",[40,22275,22276,22281,22299,22325,22348,22352],{"__ignoreMap":56},[449,22277,22278],{"class":451,"line":452},[449,22279,22280],{"class":705},"\u002F\u002F server\u002Fplugins\u002Ferror-catcher.ts\n",[449,22282,22283,22285,22287,22289,22291,22293,22295,22297],{"class":451,"line":114},[449,22284,4629],{"class":680},[449,22286,4632],{"class":680},[449,22288,16741],{"class":721},[449,22290,5164],{"class":684},[449,22292,16746],{"class":1491},[449,22294,1758],{"class":684},[449,22296,1498],{"class":680},[449,22298,1501],{"class":684},[449,22300,22301,22303,22305,22307,22310,22312,22314,22317,22319,22321,22323],{"class":451,"line":111},[449,22302,16757],{"class":684},[449,22304,16760],{"class":721},[449,22306,725],{"class":684},[449,22308,22309],{"class":691},"\"error\"",[449,22311,3500],{"class":684},[449,22313,17495],{"class":1491},[449,22315,22316],{"class":684},", { ",[449,22318,2991],{"class":1491},[449,22320,1495],{"class":684},[449,22322,1498],{"class":680},[449,22324,1501],{"class":684},[449,22326,22327,22329,22331,22333,22336,22338,22340,22342,22345],{"class":451,"line":468},[449,22328,3002],{"class":684},[449,22330,17495],{"class":721},[449,22332,725],{"class":684},[449,22334,22335],{"class":691},"`Error at ${",[449,22337,2991],{"class":684},[449,22339,165],{"class":691},[449,22341,16817],{"class":684},[449,22343,22344],{"class":691},"}:`",[449,22346,22347],{"class":684},", error);\n",[449,22349,22350],{"class":451,"line":474},[449,22351,13321],{"class":684},[449,22353,22354],{"class":451,"line":480},[449,22355,784],{"class":684},[32,22357,22359],{"id":22358},"plugin-ideas-you-can-build-today","Plugin Ideas You Can Build Today",[21,22361,22362],{},"Here are a handful of practical Nitro plugin ideas you could build into your app — especially handy for real projects like an e-commerce backend, food truck API, or admin dashboard API.",[2808,22364,22366,22367],{"id":22365},"_1-request-metrics-analytics-plugin","📊 1. ",[151,22368,22369],{},"Request Metrics & Analytics Plugin",[21,22371,22372],{},"Track performance of your endpoints in real time.",[383,22374,22375,22378,22381],{},[386,22376,22377],{},"Count hits per route",[386,22379,22380],{},"Record timing and latency",[386,22382,22383],{},"Write structured logs or push to analytics back end",[21,22385,22386],{},"Example benefit: track how many orders per hour your API gets and surface performance bottlenecks.",[73,22388],{},[2808,22390,22392,22393],{"id":22391},"_2-api-key-token-validation-plugin","🔐 2. ",[151,22394,22395],{},"API Key \u002F Token Validation Plugin",[21,22397,22398],{},"Centralize API key checks before your route handlers run.",[48,22400,22402],{"className":670,"code":22401,"language":673,"meta":56,"style":56},"\u002F\u002F server\u002Fplugins\u002Fapi-auth.ts\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook(\"request\", (event) => {\n    const key = event.headers.get(\"x-api-key\");\n    if (!isValidKey(key)) {\n      throw createError({ statusCode: 401, statusMessage: \"Unauthorized\" });\n    }\n  });\n});\n",[40,22403,22404,22409,22427,22447,22465,22479,22495,22499,22503],{"__ignoreMap":56},[449,22405,22406],{"class":451,"line":452},[449,22407,22408],{"class":705},"\u002F\u002F server\u002Fplugins\u002Fapi-auth.ts\n",[449,22410,22411,22413,22415,22417,22419,22421,22423,22425],{"class":451,"line":114},[449,22412,4629],{"class":680},[449,22414,4632],{"class":680},[449,22416,16741],{"class":721},[449,22418,5164],{"class":684},[449,22420,16746],{"class":1491},[449,22422,1758],{"class":684},[449,22424,1498],{"class":680},[449,22426,1501],{"class":684},[449,22428,22429,22431,22433,22435,22437,22439,22441,22443,22445],{"class":451,"line":111},[449,22430,16757],{"class":684},[449,22432,16760],{"class":721},[449,22434,725],{"class":684},[449,22436,16765],{"class":691},[449,22438,3500],{"class":684},[449,22440,2991],{"class":1491},[449,22442,1758],{"class":684},[449,22444,1498],{"class":680},[449,22446,1501],{"class":684},[449,22448,22449,22451,22453,22455,22457,22459,22461,22463],{"class":451,"line":468},[449,22450,12985],{"class":680},[449,22452,16959],{"class":714},[449,22454,718],{"class":680},[449,22456,16964],{"class":684},[449,22458,12644],{"class":721},[449,22460,725],{"class":684},[449,22462,16971],{"class":691},[449,22464,740],{"class":684},[449,22466,22467,22469,22471,22473,22476],{"class":451,"line":474},[449,22468,13044],{"class":680},[449,22470,1913],{"class":684},[449,22472,5085],{"class":680},[449,22474,22475],{"class":721},"isValidKey",[449,22477,22478],{"class":684},"(key)) {\n",[449,22480,22481,22483,22485,22487,22489,22491,22493],{"class":451,"line":480},[449,22482,13056],{"class":680},[449,22484,5113],{"class":721},[449,22486,16641],{"class":684},[449,22488,17000],{"class":714},[449,22490,16646],{"class":684},[449,22492,17005],{"class":691},[449,22494,2051],{"class":684},[449,22496,22497],{"class":451,"line":486},[449,22498,7544],{"class":684},[449,22500,22501],{"class":451,"line":492},[449,22502,13321],{"class":684},[449,22504,22505],{"class":451,"line":498},[449,22506,784],{"class":684},[21,22508,22509],{},"This saves you from adding auth logic inside each route and ensures consistent security.",[73,22511],{},[2808,22513,22515,22516],{"id":22514},"_3-response-caching-plugin","📦 3. ",[151,22517,22518],{},"Response Caching Plugin",[21,22520,22521],{},"A plugin that caches successful GET responses in memory or Redis to speed up repeat calls.",[21,22523,22524],{},"Useful for endpoints like menus or business hours that don’t change often.",[21,22526,22527],{},"Example concept:",[383,22529,22530,22533,22536],{},[386,22531,22532],{},"Check cache on request",[386,22534,22535],{},"Bypass expensive data work if present",[386,22537,22538],{},"Store responses with TTL",[73,22540],{},[2808,22542,22544,22545],{"id":22543},"_4-request-body-sanitizer-plugin","📥 4. ",[151,22546,22547],{},"Request Body Sanitizer Plugin",[21,22549,22550],{},"Automatically sanitize or validate JSON bodies before they hit route handlers.",[21,22552,22553],{},"This helps enforce stricter API contracts and cleaner data at the router level.",[48,22555,22557],{"className":670,"code":22556,"language":673,"meta":56,"style":56},"nitroApp.hooks.hook(\"request\", (event) => {\n  sanitize(event.body);\n});\n",[40,22558,22559,22580,22588],{"__ignoreMap":56},[449,22560,22561,22564,22566,22568,22570,22572,22574,22576,22578],{"class":451,"line":452},[449,22562,22563],{"class":684},"nitroApp.hooks.",[449,22565,16760],{"class":721},[449,22567,725],{"class":684},[449,22569,16765],{"class":691},[449,22571,3500],{"class":684},[449,22573,2991],{"class":1491},[449,22575,1758],{"class":684},[449,22577,1498],{"class":680},[449,22579,1501],{"class":684},[449,22581,22582,22585],{"class":451,"line":114},[449,22583,22584],{"class":721},"  sanitize",[449,22586,22587],{"class":684},"(event.body);\n",[449,22589,22590],{"class":451,"line":111},[449,22591,784],{"class":684},[73,22593],{},[2808,22595,22597,22598],{"id":22596},"_5-feature-flag-config-plugin","🛠 5. ",[151,22599,22600],{},"Feature Flag & Config Plugin",[21,22602,22603],{},"Load feature flags or custom runtime config from environment, remote store, or a file, and broadcast them server-wide.",[21,22605,22606],{},"Example: enable\u002Fdisable special holiday menus, seasonal pricing, or debug logging without code changes.",[73,22608],{},[32,22610,22612],{"id":22611},"when-plugins-run","When Plugins Run",[21,22614,22615,22616,827],{},"Nitro plugins execute once during server startup and the hooks you register can fire at various points during request processing — giving you centralized control over behavior, logging, auth, or data flow.([v3.nitro.build]",[449,22617,4798],{},[73,22619],{},[16,22621,3681],{"id":3680},[21,22623,22624],{},"Nitro’s plugin system gives you the flexibility to extend your server logic beyond basic routes — letting you implement logging, auth, caching, monitoring, and more in reusable packages.",[21,22626,22627],{},"If you’re building an API that needs observability, security, or business logic centralized in one place, plugins make Nitro even more powerful without complicating your routes.🚀",[21,22629,22630,22631,5085],{},"Let me know if you want ",[151,22632,22633],{},"tutorial examples for those plugin ideas",[3728,22635,22636],{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":56,"searchDepth":111,"depth":111,"links":22638},[22639,22640,22641,22642,22654],{"id":22087,"depth":114,"text":22088},{"id":22099,"depth":114,"text":22100},{"id":22169,"depth":114,"text":22170},{"id":22358,"depth":114,"text":22359,"children":22643},[22644,22646,22648,22650,22652],{"id":22365,"depth":111,"text":22645},"📊 1. Request Metrics & Analytics Plugin",{"id":22391,"depth":111,"text":22647},"🔐 2. API Key \u002F Token Validation Plugin",{"id":22514,"depth":111,"text":22649},"📦 3. Response Caching Plugin",{"id":22543,"depth":111,"text":22651},"📥 4. Request Body Sanitizer Plugin",{"id":22596,"depth":111,"text":22653},"🛠 5. Feature Flag & Config Plugin",{"id":22611,"depth":114,"text":22612},"2026-01-29","Learn how to create Nitro plugins to extend your server’s behavior, with examples and practical plugin ideas you can build into your application.",{"type":13,"value":22658},[22659,22661,22667,22669],[16,22660,333],{"id":332},[21,22662,22062,22663,22066,22665],{},[151,22664,22065],{},[449,22666,9926],{"index":4798},[21,22668,22071],{},[383,22670,22671,22673,22675],{},[386,22672,22076],{},[386,22674,22079],{},[386,22676,22082],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1769836111\u002FNitroFull_ww4pbg.png",[7065,22679,7067,7069,3784],"nitro plugin",{},"\u002Fblog\u002Fnitro-plugins",{"title":22054,"description":22656},"blog\u002Fnitro-plugins","nepfLWzhqZXUA1okeBfC0X1K6GrGqT5YTs6Go7O0uCQ",{"id":22686,"title":22687,"author":22688,"body":22689,"canonical":116,"categories":116,"date":22970,"description":22971,"excerpt":22972,"extension":119,"featuredImg":116,"img":22677,"keywords":23000,"language":3788,"meta":23001,"navigation":130,"ogImage":116,"path":23002,"rating":474,"readTime":318,"seo":23003,"stem":23004,"tag":3793,"__hash__":23005},"blog\u002Fblog\u002Fnitro-tutorial.md","Building Real Nitro Plugins: Step-by-Step Tutorials You Can Use Today",{"name":9,"img":11,"website":327},{"type":13,"value":22690,"toc":22959},[22691,22693,22704,22707,22720,22730,22734,22737,22777,22781,22784,22787,22793,22796,22800,22803,22806,22809,22812,22815,22818,22822,22825,22831,22834,22840,22842,22846,22849,22852,22855,22859,22862,22865,22871,22874,22877,22883,22885,22889,22892,22895,22898,22902,22905,22908,22911,22915,22918,22921,22924,22928,22931,22934,22937,22940,22943,22946,22949,22951,22954,22957],[16,22692,333],{"id":332},[21,22694,22695,22696,22699,22700,22703],{},"In the previous post, we explored ",[151,22697,22698],{},"what Nitro plugins are"," and why they’re one of Nitro’s most powerful features. In this tutorial-focused follow-up, we’ll ",[151,22701,22702],{},"build real Nitro plugins step by step"," — the kind you’d actually use in production.",[21,22705,22706],{},"By the end, you’ll know how to create plugins for:",[383,22708,22709,22712,22715,22717],{},[386,22710,22711],{},"Request logging",[386,22713,22714],{},"API key authentication",[386,22716,19231],{},[386,22718,22719],{},"Feature flags and runtime configuration",[21,22721,22722,22723,22725,22726,22729],{},"All examples use ",[151,22724,3788],{}," and work in ",[151,22727,22728],{},"Nuxt + Nitro"," or standalone Nitro apps.",[16,22731,22733],{"id":22732},"project-setup","Project Setup",[21,22735,22736],{},"Assuming a Nitro or Nuxt project, your folder structure should include:",[48,22738,22740],{"className":443,"code":22739,"language":445,"meta":56,"style":56},"server\u002F\n  plugins\u002F\n    logger.ts\n    auth.ts\n    cache.ts\n    feature-flags.ts\nNitro automatically loads plugins from server\u002Fplugins\u002F.\n",[40,22741,22742,22747,22752,22757,22762,22767,22772],{"__ignoreMap":56},[449,22743,22744],{"class":451,"line":452},[449,22745,22746],{},"server\u002F\n",[449,22748,22749],{"class":451,"line":114},[449,22750,22751],{},"  plugins\u002F\n",[449,22753,22754],{"class":451,"line":111},[449,22755,22756],{},"    logger.ts\n",[449,22758,22759],{"class":451,"line":468},[449,22760,22761],{},"    auth.ts\n",[449,22763,22764],{"class":451,"line":474},[449,22765,22766],{},"    cache.ts\n",[449,22768,22769],{"class":451,"line":480},[449,22770,22771],{},"    feature-flags.ts\n",[449,22773,22774],{"class":451,"line":486},[449,22775,22776],{},"Nitro automatically loads plugins from server\u002Fplugins\u002F.\n",[16,22778,22780],{"id":22779},"tutorial-1-request-logger-plugin","Tutorial 1: Request Logger Plugin",[21,22782,22783],{},"Goal\nLog every incoming request with method, path, and timing.",[21,22785,22786],{},"Step 1: Create the Plugin\n\u002F\u002F server\u002Fplugins\u002Flogger.ts\nexport default defineNitroPlugin((nitroApp) => {\nnitroApp.hooks.hook(\"request\", (event) => {\nconst start = Date.now()",[48,22788,22791],{"className":22789,"code":22790,"language":53},[51],"event.node.res.on(\"finish\", () => {\n  const duration = Date.now() - start\n  console.log(\n    `[${event.method}] ${event.path} - ${duration}ms`\n  )\n})\n",[40,22792,22790],{"__ignoreMap":56},[21,22794,22795],{},"})\n})",[32,22797,22799],{"id":22798},"what-this-does","What This Does",[21,22801,22802],{},"Hooks into every request",[21,22804,22805],{},"Measures request duration",[21,22807,22808],{},"Logs after the response finishes",[21,22810,22811],{},"When to Use\nDebugging slow endpoints",[21,22813,22814],{},"Monitoring API usage",[21,22816,22817],{},"Lightweight analytics",[32,22819,22821],{"id":22820},"tutorial-2-api-key-authentication-plugin","Tutorial 2: API Key Authentication Plugin",[21,22823,22824],{},"Goal\nProtect your API by validating an API key before routes run.",[21,22826,22827,22828,827],{},"Step 1: Define a Validator\nconst VALID_KEYS = new Set(",[449,22829,22830],{},"\"dev-key-123\", \"prod-key-456\"",[21,22832,22833],{},"function isValidKey(key?: string | null) {\nreturn key && VALID_KEYS.has(key)\n}\nStep 2: Create the Plugin\n\u002F\u002F server\u002Fplugins\u002Fauth.ts\nexport default defineNitroPlugin((nitroApp) => {\nnitroApp.hooks.hook(\"request\", (event) => {\nconst apiKey = event.headers.get(\"x-api-key\")",[48,22835,22838],{"className":22836,"code":22837,"language":53},[51],"if (!isValidKey(apiKey)) {\n  throw createError({\n    statusCode: 401,\n    statusMessage: \"Invalid API Key\"\n  })\n}\n",[40,22839,22837],{"__ignoreMap":56},[21,22841,22795],{},[32,22843,22845],{"id":22844},"why-this-is-powerful","Why This Is Powerful",[21,22847,22848],{},"No auth logic in individual routes",[21,22850,22851],{},"Centralized, reusable security",[21,22853,22854],{},"Easy to extend with JWT or OAuth later",[32,22856,22858],{"id":22857},"tutorial-3-simple-response-caching-plugin","Tutorial 3: Simple Response Caching Plugin",[21,22860,22861],{},"Goal\nCache GET responses for frequently accessed endpoints (menus, products, settings).",[21,22863,22864],{},"Step 1: Create an In-Memory Cache\nconst cache = new Map\u003Cstring, { value: any; expires: number }>()\nconst TTL = 60_000 \u002F\u002F 60 seconds\nStep 2: Build the Plugin\n\u002F\u002F server\u002Fplugins\u002Fcache.ts\nexport default defineNitroPlugin((nitroApp) => {\nnitroApp.hooks.hook(\"request\", async (event) => {\nif (event.method !== \"GET\") return",[48,22866,22869],{"className":22867,"code":22868,"language":53},[51],"const key = event.path\nconst cached = cache.get(key)\n\nif (cached && cached.expires > Date.now()) {\n  return cached.value\n}\n",[40,22870,22868],{"__ignoreMap":56},[21,22872,22873],{},"})",[21,22875,22876],{},"nitroApp.hooks.hook(\"afterResponse\", (event, response) => {\nif (event.method !== \"GET\") return",[48,22878,22881],{"className":22879,"code":22880,"language":53},[51],"cache.set(event.path, {\n  value: response,\n  expires: Date.now() + TTL\n})\n",[40,22882,22880],{"__ignoreMap":56},[21,22884,22795],{},[32,22886,22888],{"id":22887},"real-world-use-case","Real-World Use Case",[21,22890,22891],{},"Food truck menu API",[21,22893,22894],{},"Business hours endpoint",[21,22896,22897],{},"Pricing data",[32,22899,22901],{"id":22900},"tutorial-4-feature-flags-plugin","Tutorial 4: Feature Flags Plugin",[21,22903,22904],{},"Goal\nEnable or disable features at runtime without touching routes.",[21,22906,22907],{},"Step 1: Define Flags\nconst flags = {\nseasonalMenu: true,\nenableDiscounts: false\n}\nStep 2: Attach Flags to Runtime\n\u002F\u002F server\u002Fplugins\u002Ffeature-flags.ts\nexport default defineNitroPlugin((nitroApp) => {\nnitroApp.hooks.hook(\"request\", (event) => {\nevent.context.features = flags\n})\n})\nStep 3: Use in a Route\nexport default defineEventHandler((event) => {\nif (event.context.features.seasonalMenu) {\nreturn { menu: \"Winter Specials\" }\n}",[21,22909,22910],{},"return { menu: \"Standard Menu\" }\n})",[32,22912,22914],{"id":22913},"why-this-matters","Why This Matters",[21,22916,22917],{},"Toggle features instantly",[21,22919,22920],{},"Safe rollouts",[21,22922,22923],{},"Environment-based behavior",[32,22925,22927],{"id":22926},"combining-plugins-for-a-real-app","Combining Plugins for a Real App",[21,22929,22930],{},"For a coffee shop or food truck API, you might use:",[21,22932,22933],{},"Plugin Purpose\nLogger Track traffic & performance\nAuth Secure admin endpoints\nCache Speed up menu reads\nFeature Flags Enable promotions\nAll without bloating your route handlers.",[32,22935,20267],{"id":22936},"best-practices",[21,22938,22939],{},"Keep plugins focused on one responsibility",[21,22941,22942],{},"Avoid heavy computation in request hooks",[21,22944,22945],{},"Use plugins for cross-cutting concerns, not business logic",[21,22947,22948],{},"Prefer plugins over middleware duplication\n::",[16,22950,3681],{"id":3680},[21,22952,22953],{},"Nitro plugins give you framework-level power without framework-level complexity. Instead of repeating logic in routes, plugins let you build reusable, centralized behaviors that scale with your app.",[21,22955,22956],{},"If you’re serious about building maintainable APIs — whether for Nuxt apps, serverless deployments, or edge runtimes — mastering Nitro plugins is a game changer. 🚀",[3728,22958,4140],{},{"title":56,"searchDepth":111,"depth":111,"links":22960},[22961,22962,22963,22964,22965,22966,22967,22968,22969],{"id":22798,"depth":114,"text":22799},{"id":22820,"depth":114,"text":22821},{"id":22844,"depth":114,"text":22845},{"id":22857,"depth":114,"text":22858},{"id":22887,"depth":114,"text":22888},{"id":22900,"depth":114,"text":22901},{"id":22913,"depth":114,"text":22914},{"id":22926,"depth":114,"text":22927},{"id":22936,"depth":114,"text":20267},"2026-01-30","Hands-on Nitro plugin tutorials showing how to build logging, authentication, caching, and feature flag plugins for real-world applications.",{"type":13,"value":22973},[22974,22976,22982,22984,22994],[16,22975,333],{"id":332},[21,22977,22695,22978,22699,22980,22703],{},[151,22979,22698],{},[151,22981,22702],{},[21,22983,22706],{},[383,22985,22986,22988,22990,22992],{},[386,22987,22711],{},[386,22989,22714],{},[386,22991,19231],{},[386,22993,22719],{},[21,22995,22722,22996,22725,22998,22729],{},[151,22997,3788],{},[151,22999,22728],{},[7065,21920,7067,7068,3784],{},"\u002Fblog\u002Fnitro-tutorial",{"title":22687,"description":22971},"blog\u002Fnitro-tutorial","vCkfrJNwhNIzwYGXP7Wnznp6yFQcFGz38Lv5XuG97zg",{"id":23007,"title":23008,"author":23009,"body":23010,"canonical":116,"categories":116,"date":23744,"description":23745,"excerpt":23746,"extension":119,"featuredImg":116,"img":22045,"keywords":23760,"language":3788,"meta":23765,"navigation":130,"ogImage":116,"path":23766,"rating":474,"readTime":133,"seo":23767,"stem":23768,"tag":3793,"__hash__":23769},"blog\u002Fblog\u002Fnuxt-42-steady-movements-to-5.md","Evaluating Nuxt 4.2: How the Latest Stable Release Empowers Modern Developers",{"name":9,"img":11,"website":327},{"type":13,"value":23011,"toc":23723},[23012,23014,23025,23031,23033,23037,23044,23058,23061,23066,23068,23072,23082,23085,23087,23098,23102,23226,23229,23231,23235,23238,23254,23257,23260,23262,23266,23269,23276,23280,23291,23295,23306,23309,23311,23315,23322,23359,23362,23373,23376,23378,23382,23388,23399,23402,23404,23408,23415,23419,23430,23466,23469,23471,23475,23478,23481,23654,23657,23668,23671,23673,23677,23680,23700,23703,23705,23707,23710,23717,23720],[16,23013,333],{"id":332},[21,23015,23016,23017,23020,23021,23024],{},"Nuxt has consistently positioned itself as one of the most developer-friendly frameworks in the Vue ecosystem. With the release of ",[151,23018,23019],{},"Nuxt 4",", the framework doubled down on clarity, performance, and full-stack flexibility. The latest stable release, ",[151,23022,23023],{},"Nuxt 4.2",", continues that trajectory—not by reinventing the framework, but by polishing the parts developers interact with every single day.",[21,23026,23027,23028,165],{},"This post evaluates Nuxt 4.2 from a practical standpoint: what’s new, why it matters, and how these changes help developers build ",[151,23029,23030],{},"faster, more resilient, and more maintainable applications",[16,23032,4373],{"id":4372},[32,23034,23036],{"id":23035},"nuxt-42-in-context","Nuxt 4.2 in Context",[21,23038,23039,23040,23043],{},"Nuxt 4.2 is best understood as a ",[151,23041,23042],{},"developer-experience release",". Rather than introducing breaking changes or radical APIs, it focuses on:",[383,23045,23046,23049,23052,23055],{},[386,23047,23048],{},"More control over async behavior",[386,23050,23051],{},"Better debugging ergonomics",[386,23053,23054],{},"Smarter performance optimizations",[386,23056,23057],{},"Stronger alignment with Vite and Nitro",[21,23059,23060],{},"These improvements target real-world pain points that surface as applications grow.",[25,23062,23063],{"type":363},[21,23064,23065],{},"Nuxt 4.2 is a stable minor release, meaning it’s safe to adopt for production apps already running on Nuxt 4.",[73,23067],{},[32,23069,23071],{"id":23070},"abortable-data-fetching-a-real-world-necessity","Abortable Data Fetching: A Real-World Necessity",[21,23073,23074,23075,23078,23079,165],{},"One of the most impactful additions in Nuxt 4.2 is ",[151,23076,23077],{},"native support for aborting async data requests"," using ",[40,23080,23081],{},"AbortController",[21,23083,23084],{},"In dynamic interfaces—search inputs, filters, route transitions—users often trigger multiple requests in quick succession. Without cancellation, older requests can overwrite newer state.",[2808,23086,22914],{"id":22913},[383,23088,23089,23092,23095],{},[386,23090,23091],{},"Prevents race conditions",[386,23093,23094],{},"Eliminates unnecessary network traffic",[386,23096,23097],{},"Keeps UI state predictable",[32,23099,23101],{"id":23100},"code-example","Code Example",[48,23103,23106],{"className":670,"code":23104,"filename":23105,"language":673,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nconst controller = new AbortController()\n\nconst { data } = await useAsyncData('users', () =>\n  $fetch('\u002Fapi\u002Fusers', {\n    signal: controller.signal\n  })\n)\n\n\u002F\u002F Cancel the request if the user navigates away\ncontroller.abort()\n\u003C\u002Fscript>\n","abortable-fetch.ts",[40,23107,23108,23123,23139,23143,23171,23183,23188,23193,23197,23201,23206,23216],{"__ignoreMap":56},[449,23109,23110,23112,23115,23117,23120],{"class":451,"line":452},[449,23111,5547],{"class":680},[449,23113,23114],{"class":684},"script setup lang",[449,23116,5014],{"class":680},[449,23118,23119],{"class":691},"\"ts\"",[449,23121,23122],{"class":680},">\n",[449,23124,23125,23127,23130,23132,23134,23137],{"class":451,"line":114},[449,23126,711],{"class":680},[449,23128,23129],{"class":714}," controller",[449,23131,718],{"class":680},[449,23133,1343],{"class":680},[449,23135,23136],{"class":721}," AbortController",[449,23138,11195],{"class":684},[449,23140,23141],{"class":451,"line":111},[449,23142,700],{"emptyLinePlaceholder":130},[449,23144,23145,23147,23149,23151,23153,23155,23157,23160,23162,23165,23168],{"class":451,"line":468},[449,23146,711],{"class":680},[449,23148,14227],{"class":684},[449,23150,1755],{"class":714},[449,23152,21656],{"class":684},[449,23154,5014],{"class":680},[449,23156,1654],{"class":680},[449,23158,23159],{"class":721}," useAsyncData",[449,23161,725],{"class":684},[449,23163,23164],{"class":691},"'users'",[449,23166,23167],{"class":684},", () ",[449,23169,23170],{"class":680},"=>\n",[449,23172,23173,23176,23178,23181],{"class":451,"line":474},[449,23174,23175],{"class":721},"  $fetch",[449,23177,725],{"class":684},[449,23179,23180],{"class":691},"'\u002Fapi\u002Fusers'",[449,23182,768],{"class":684},[449,23184,23185],{"class":451,"line":480},[449,23186,23187],{"class":684},"    signal: controller.signal\n",[449,23189,23190],{"class":451,"line":486},[449,23191,23192],{"class":684},"  })\n",[449,23194,23195],{"class":451,"line":492},[449,23196,11185],{"class":684},[449,23198,23199],{"class":451,"line":498},[449,23200,700],{"emptyLinePlaceholder":130},[449,23202,23203],{"class":451,"line":133},[449,23204,23205],{"class":705},"\u002F\u002F Cancel the request if the user navigates away\n",[449,23207,23208,23211,23214],{"class":451,"line":509},[449,23209,23210],{"class":684},"controller.",[449,23212,23213],{"class":721},"abort",[449,23215,11195],{"class":684},[449,23217,23218,23221,23224],{"class":451,"line":318},[449,23219,23220],{"class":680},"\u003C\u002F",[449,23222,23223],{"class":684},"script",[449,23225,23122],{"class":680},[21,23227,23228],{},"This feature brings Nuxt’s data handling closer to native browser behavior—something developers have wanted for a long time.",[73,23230],{},[32,23232,23234],{"id":23233},"improved-error-handling-during-development","Improved Error Handling During Development",[21,23236,23237],{},"Debugging is a daily activity, and Nuxt 4.2 makes it less disruptive. When an error occurs during development, Nuxt now displays:",[383,23239,23240,23247],{},[386,23241,23242,23243,23246],{},"Your ",[151,23244,23245],{},"custom error page"," (what users would see)",[386,23248,23249,23250,23253],{},"A ",[151,23251,23252],{},"toggleable technical overlay"," with stack traces and diagnostics",[21,23255,23256],{},"This dual-view approach keeps developers grounded in the user experience while still providing deep technical insight.",[21,23258,23259],{},"Poor error visibility often leads to longer debugging sessions and fragile fixes—Nuxt 4.2 directly addresses this.\n::",[73,23261],{},[32,23263,23265],{"id":23264},"performance-improvements-that-scale","Performance Improvements That Scale",[21,23267,23268],{},"Performance optimizations in Nuxt 4.2 are subtle but powerful, especially for production-grade applications.",[21,23270,23271,23272,23275],{},"One standout improvement is ",[151,23273,23274],{},"async data handler extraction"," (experimental). Nuxt can now move certain async logic into build-time chunks, preventing unnecessary JavaScript from being shipped to the browser.",[2808,23277,23279],{"id":23278},"developer-impact","Developer Impact",[383,23281,23282,23285,23288],{},[386,23283,23284],{},"Smaller client bundles",[386,23286,23287],{},"Faster initial page loads",[386,23289,23290],{},"Better SEO and Lighthouse scores",[2808,23292,23294],{"id":23293},"performance-wins-in-practice","Performance Wins in Practice",[383,23296,23297,23300,23303],{},[386,23298,23299],{},"Reduced client-side JavaScript",[386,23301,23302],{},"Faster cold starts",[386,23304,23305],{},"Improved perceived performance for users\n::",[21,23307,23308],{},"These gains matter most at scale—when milliseconds start adding up across thousands of users.",[73,23310],{},[32,23312,23314],{"id":23313},"vite-environment-api-preparing-for-the-future","Vite Environment API: Preparing for the Future",[21,23316,23317,23318,23321],{},"Nuxt 4.2 introduces optional support for Vite’s new ",[151,23319,23320],{},"Environment API",", allowing more control over environment-specific behavior.",[48,23323,23325],{"className":670,"code":23324,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  experimental: {\n    viteEnvironmentApi: true,\n  },\n});\n",[40,23326,23327,23337,23342,23351,23355],{"__ignoreMap":56},[449,23328,23329,23331,23333,23335],{"class":451,"line":452},[449,23330,4629],{"class":680},[449,23332,4632],{"class":680},[449,23334,4635],{"class":721},[449,23336,1391],{"class":684},[449,23338,23339],{"class":451,"line":114},[449,23340,23341],{"class":684},"  experimental: {\n",[449,23343,23344,23347,23349],{"class":451,"line":111},[449,23345,23346],{"class":684},"    viteEnvironmentApi: ",[449,23348,2169],{"class":714},[449,23350,779],{"class":684},[449,23352,23353],{"class":451,"line":468},[449,23354,1474],{"class":684},[449,23356,23357],{"class":451,"line":474},[449,23358,784],{"class":684},[21,23360,23361],{},"This is particularly valuable for teams managing:",[383,23363,23364,23367,23370],{},[386,23365,23366],{},"Multiple deployment stages",[386,23368,23369],{},"Complex environment variables",[386,23371,23372],{},"Shared infrastructure across apps",[21,23374,23375],{},"While still experimental, it signals Nuxt’s commitment to evolving alongside Vite rather than lagging behind it.",[73,23377],{},[32,23379,23381],{"id":23380},"a-more-modular-nitro-architecture","A More Modular Nitro Architecture",[21,23383,23384,23385,23387],{},"Behind the scenes, Nuxt 4.2 improves how ",[151,23386,4189],{},"—Nuxt’s server engine—is integrated. By extracting server integration into a dedicated package, Nuxt gains:",[383,23389,23390,23393,23396],{},[386,23391,23392],{},"Cleaner separation between frontend and backend concerns",[386,23394,23395],{},"More flexibility for future runtime targets",[386,23397,23398],{},"Improved long-term maintainability",[21,23400,23401],{},"Most developers won’t notice this day to day, but it lays the groundwork for future innovation without breaking existing apps.",[73,23403],{},[32,23405,23407],{"id":23406},"typescript-tooling-improvements","TypeScript Tooling Improvements",[21,23409,23410,23411,23414],{},"TypeScript users benefit from experimental tooling enhancements in Nuxt 4.2. These improvements focus on ",[151,23412,23413],{},"editor intelligence",", making large codebases easier to navigate.",[2808,23416,23418],{"id":23417},"what-developers-gain","What Developers Gain",[383,23420,23421,23424,23427],{},[386,23422,23423],{},"Better go-to-definition support",[386,23425,23426],{},"Smarter component renaming",[386,23428,23429],{},"Improved navigation between server routes and client fetches",[48,23431,23433],{"className":670,"code":23432,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  experimental: {\n    typescriptPlugin: true,\n  },\n});\n",[40,23434,23435,23445,23449,23458,23462],{"__ignoreMap":56},[449,23436,23437,23439,23441,23443],{"class":451,"line":452},[449,23438,4629],{"class":680},[449,23440,4632],{"class":680},[449,23442,4635],{"class":721},[449,23444,1391],{"class":684},[449,23446,23447],{"class":451,"line":114},[449,23448,23341],{"class":684},[449,23450,23451,23454,23456],{"class":451,"line":111},[449,23452,23453],{"class":684},"    typescriptPlugin: ",[449,23455,2169],{"class":714},[449,23457,779],{"class":684},[449,23459,23460],{"class":451,"line":468},[449,23461,1474],{"class":684},[449,23463,23464],{"class":451,"line":474},[449,23465,784],{"class":684},[21,23467,23468],{},"For teams working in TypeScript-first environments, these changes reduce cognitive overhead and make refactoring safer.",[73,23470],{},[32,23472,23474],{"id":23473},"practical-pattern-search-with-request-cancellation","Practical Pattern: Search With Request Cancellation",[21,23476,23477],{},"Here’s a real-world pattern enabled by Nuxt 4.2’s abortable requests:",[32,23479,23101],{"id":23480},"code-example-1",[48,23482,23485],{"className":670,"code":23483,"filename":23484,"language":673,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nconst query = ref('')\nlet controller = new AbortController()\n\nwatch(query, async () => {\n  controller.abort()\n  controller = new AbortController()\n\n  await useAsyncData(\n    ['search', query.value],\n    () =>\n      $fetch(`\u002Fapi\u002Fsearch?q=${query.value}`, {\n        signal: controller.signal\n      })\n  )\n})\n\u003C\u002Fscript>\n","search-pattern.ts",[40,23486,23487,23499,23518,23533,23537,23553,23562,23575,23579,23587,23598,23605,23627,23632,23637,23642,23646],{"__ignoreMap":56},[449,23488,23489,23491,23493,23495,23497],{"class":451,"line":452},[449,23490,5547],{"class":680},[449,23492,23114],{"class":684},[449,23494,5014],{"class":680},[449,23496,23119],{"class":691},[449,23498,23122],{"class":680},[449,23500,23501,23503,23506,23508,23511,23513,23516],{"class":451,"line":114},[449,23502,711],{"class":680},[449,23504,23505],{"class":714}," query",[449,23507,718],{"class":680},[449,23509,23510],{"class":721}," ref",[449,23512,725],{"class":684},[449,23514,23515],{"class":691},"''",[449,23517,11185],{"class":684},[449,23519,23520,23522,23525,23527,23529,23531],{"class":451,"line":111},[449,23521,5534],{"class":680},[449,23523,23524],{"class":684}," controller ",[449,23526,5014],{"class":680},[449,23528,1343],{"class":680},[449,23530,23136],{"class":721},[449,23532,11195],{"class":684},[449,23534,23535],{"class":451,"line":468},[449,23536,700],{"emptyLinePlaceholder":130},[449,23538,23539,23542,23545,23547,23549,23551],{"class":451,"line":474},[449,23540,23541],{"class":721},"watch",[449,23543,23544],{"class":684},"(query, ",[449,23546,1485],{"class":680},[449,23548,2090],{"class":684},[449,23550,1498],{"class":680},[449,23552,1501],{"class":684},[449,23554,23555,23558,23560],{"class":451,"line":480},[449,23556,23557],{"class":684},"  controller.",[449,23559,23213],{"class":721},[449,23561,11195],{"class":684},[449,23563,23564,23567,23569,23571,23573],{"class":451,"line":486},[449,23565,23566],{"class":684},"  controller ",[449,23568,5014],{"class":680},[449,23570,1343],{"class":680},[449,23572,23136],{"class":721},[449,23574,11195],{"class":684},[449,23576,23577],{"class":451,"line":492},[449,23578,700],{"emptyLinePlaceholder":130},[449,23580,23581,23583,23585],{"class":451,"line":498},[449,23582,2099],{"class":680},[449,23584,23159],{"class":721},[449,23586,5567],{"class":684},[449,23588,23589,23592,23595],{"class":451,"line":133},[449,23590,23591],{"class":684},"    [",[449,23593,23594],{"class":691},"'search'",[449,23596,23597],{"class":684},", query.value],\n",[449,23599,23600,23603],{"class":451,"line":509},[449,23601,23602],{"class":684},"    () ",[449,23604,23170],{"class":680},[449,23606,23607,23610,23612,23615,23618,23620,23623,23625],{"class":451,"line":318},[449,23608,23609],{"class":721},"      $fetch",[449,23611,725],{"class":684},[449,23613,23614],{"class":691},"`\u002Fapi\u002Fsearch?q=${",[449,23616,23617],{"class":684},"query",[449,23619,165],{"class":691},[449,23621,23622],{"class":684},"value",[449,23624,1517],{"class":691},[449,23626,768],{"class":684},[449,23628,23629],{"class":451,"line":520},[449,23630,23631],{"class":684},"        signal: controller.signal\n",[449,23633,23634],{"class":451,"line":526},[449,23635,23636],{"class":684},"      })\n",[449,23638,23639],{"class":451,"line":532},[449,23640,23641],{"class":684},"  )\n",[449,23643,23644],{"class":451,"line":2790},[449,23645,4113],{"class":684},[449,23647,23648,23650,23652],{"class":451,"line":3511},[449,23649,23220],{"class":680},[449,23651,23223],{"class":684},[449,23653,23122],{"class":680},[21,23655,23656],{},"This approach:",[383,23658,23659,23662,23665],{},[386,23660,23661],{},"Cancels outdated requests automatically",[386,23663,23664],{},"Keeps results in sync with user input",[386,23666,23667],{},"Improves perceived responsiveness",[21,23669,23670],{},"It’s a small API change with a huge real-world payoff.",[73,23672],{},[32,23674,23676],{"id":23675},"who-benefits-most-from-nuxt-42","Who Benefits Most From Nuxt 4.2?",[21,23678,23679],{},"Nuxt 4.2 shines for:",[383,23681,23682,23688,23694,23697],{},[386,23683,23684,23685],{},"Teams building ",[151,23686,23687],{},"interactive, data-driven UIs",[386,23689,23690,23691],{},"Developers optimizing for ",[151,23692,23693],{},"performance and SEO",[386,23695,23696],{},"TypeScript-heavy projects",[386,23698,23699],{},"Full-stack Nuxt apps using Nitro",[21,23701,23702],{},"If you’re already on Nuxt 4, upgrading to 4.2 is a low-risk way to gain immediate DX and performance benefits.\n::",[73,23704],{},[32,23706,3681],{"id":3680},[21,23708,23709],{},"Nuxt 4.2 is a thoughtful, developer-focused release. It doesn’t chase trends—it solves real problems. By improving async control, debugging clarity, performance, and tooling, Nuxt 4.2 makes everyday development smoother and production applications more robust.",[21,23711,23712,23713,23716],{},"For developers who value ",[151,23714,23715],{},"clarity, performance, and long-term maintainability",", Nuxt 4.2 is not just an upgrade—it’s a refinement of everything that makes Nuxt a pleasure to use.",[21,23718,23719],{},"If you’re building serious Vue applications in 2026, Nuxt 4.2 deserves a place at the center of your stack.",[3728,23721,23722],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}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);}",{"title":56,"searchDepth":111,"depth":111,"links":23724},[23725,23726,23729,23730,23731,23735,23736,23737,23740,23741,23742,23743],{"id":23035,"depth":114,"text":23036},{"id":23070,"depth":114,"text":23071,"children":23727},[23728],{"id":22913,"depth":111,"text":22914},{"id":23100,"depth":114,"text":23101},{"id":23233,"depth":114,"text":23234},{"id":23264,"depth":114,"text":23265,"children":23732},[23733,23734],{"id":23278,"depth":111,"text":23279},{"id":23293,"depth":111,"text":23294},{"id":23313,"depth":114,"text":23314},{"id":23380,"depth":114,"text":23381},{"id":23406,"depth":114,"text":23407,"children":23738},[23739],{"id":23417,"depth":111,"text":23418},{"id":23473,"depth":114,"text":23474},{"id":23480,"depth":114,"text":23101},{"id":23675,"depth":114,"text":23676},{"id":3680,"depth":114,"text":3681},"2026-01-09","A deep evaluation of Nuxt 4.2, exploring new features, performance improvements, and why this release makes building modern Vue applications faster and more reliable.",{"type":13,"value":23747},[23748,23750,23756],[16,23749,333],{"id":332},[21,23751,23016,23752,23020,23754,23024],{},[151,23753,23019],{},[151,23755,23023],{},[21,23757,23027,23758,165],{},[151,23759,23030],{},[23761,23762,23763,7065,127,23764],"nuxt 4","nuxt 4.2","vue","web performance",{},"\u002Fblog\u002Fnuxt-42-steady-movements-to-5",{"title":23008,"description":23745},"blog\u002Fnuxt-42-steady-movements-to-5","Xy8gO5k8R9uqEbjWIe0oXg1oJVhdzuqYtwAxOuaaMjo",{"id":23771,"title":23772,"author":23773,"body":23774,"canonical":116,"categories":116,"date":24232,"description":24233,"excerpt":24234,"extension":119,"featuredImg":116,"img":24244,"keywords":24245,"language":3788,"meta":24250,"navigation":130,"ogImage":116,"path":24251,"rating":474,"readTime":492,"seo":24252,"stem":24253,"tag":3793,"__hash__":24254},"blog\u002Fblog\u002Fnuxt-46-still-here-still-mine.md","Nuxt 4.6: Still Here, Still Mine",{"name":9,"img":11,"website":327},{"type":13,"value":23775,"toc":24220},[23776,23778,23785,23788,23790,23794,23813,23828,23830,23836,23852,23942,23948,23950,23954,23965,24080,24087,24089,24096,24126,24128,24132,24161,24163,24167,24174,24176,24180,24187,24202,24204,24206,24209,24217],[16,23777,333],{"id":332},[21,23779,23780,23781,23784],{},"I'll be honest: when I saw Daniel Roe's post go up for ",[151,23782,23783],{},"Nuxt 4.6",", I smiled before I read a word. Not because of any single feature — because the framework I build this very site on is still moving, still cared for, still shipping. Over 420 commits since v4.5.2. Read that again. In a year when AI announcements drown out everything else in tech, the Nuxt team quietly did one of the biggest minor releases in the framework's history.",[21,23786,23787],{},"Am I a little disappointed we're not at Nuxt 5 yet? Sure. I won't pretend otherwise. But 4.6 is the release that makes me confident 5.0 will land on solid ground — and it's full of things worth using today.",[16,23789,4373],{"id":4372},[32,23791,23793],{"id":23792},"not-nuxt-5-and-thats-okay","Not Nuxt 5 — and that's okay",[21,23795,23796,23797,23800,23801,23804,23805,23808,23809,23812],{},"The headline of 4.6 isn't a version number. It's a direction: ",[151,23798,23799],{},"a server-agnostic Nuxt",". The new ",[40,23802,23803],{},"nuxt\u002Fserver"," import surface, the ",[40,23806,23807],{},"appSecret"," foundation, the rebuilt typed ",[40,23810,23811],{},"$fetch"," — almost every big item in this release is already on the Nuxt 5 branch, and most of it runs today behind either nothing or a single flag. I'd rather have this — a 4.6 that pre-pays the 5.0 migration — than a rushed major.",[25,23814,23815],{"type":363},[21,23816,23817,23818,23823,23824,165],{},"Based on the official ",[3861,23819,23822],{"href":23820,"rel":23821},"https:\u002F\u002Fnuxt.com\u002Fblog\u002Fv4-6",[3865],"Nuxt 4.6 release notes"," by Daniel Roe and the team. If you want the hands-on version, I turned this release into a full tutorial run: ",[3861,23825,23827],{"href":23826},"\u002Flearn\u002Fnuxt-4-6","Learning Nuxt 4.6",[73,23829],{},[32,23831,23833,23834],{"id":23832},"the-one-that-matters-most-nuxtserver","The one that matters most: ",[40,23835,23803],{},[21,23837,23838,23839,23841,23842,23845,23846],{},"Server code in Nuxt has always imported from ",[40,23840,2808],{}," and ",[40,23843,23844],{},"nitropack"," directly, which quietly pinned every module to whatever majors Nuxt happened to depend on. 4.6 draws a line: ",[151,23847,23848,23849,23851],{},"your code imports from ",[40,23850,23803],{},", typed on web standards, and Nuxt worries about the engine underneath.",[48,23853,23855],{"className":670,"code":23854,"filename":21551,"language":673,"meta":56,"style":56},"import { defineEventHandler, getQuery } from \"nuxt\u002Fserver\";\n\nexport default defineEventHandler((event) => {\n  const { name } = getQuery\u003C{ name?: string }>(event);\n  return { message: `Hello, ${name ?? \"world\"}!` };\n});\n",[40,23856,23857,23871,23875,23893,23920,23938],{"__ignoreMap":56},[449,23858,23859,23861,23864,23866,23869],{"class":451,"line":452},[449,23860,681],{"class":680},[449,23862,23863],{"class":684}," { defineEventHandler, getQuery } ",[449,23865,688],{"class":680},[449,23867,23868],{"class":691}," \"nuxt\u002Fserver\"",[449,23870,695],{"class":684},[449,23872,23873],{"class":451,"line":114},[449,23874,700],{"emptyLinePlaceholder":130},[449,23876,23877,23879,23881,23883,23885,23887,23889,23891],{"class":451,"line":111},[449,23878,4629],{"class":680},[449,23880,4632],{"class":680},[449,23882,4714],{"class":721},[449,23884,5164],{"class":684},[449,23886,2991],{"class":1491},[449,23888,1758],{"class":684},[449,23890,1498],{"class":680},[449,23892,1501],{"class":684},[449,23894,23895,23897,23899,23901,23903,23905,23907,23910,23912,23915,23917],{"class":451,"line":468},[449,23896,5048],{"class":680},[449,23898,14227],{"class":684},[449,23900,13144],{"class":714},[449,23902,21656],{"class":684},[449,23904,5014],{"class":680},[449,23906,21661],{"class":721},[449,23908,23909],{"class":684},"\u003C{ ",[449,23911,13144],{"class":1491},[449,23913,23914],{"class":680},"?:",[449,23916,6081],{"class":714},[449,23918,23919],{"class":684}," }>(event);\n",[449,23921,23922,23924,23926,23929,23931,23933,23936],{"class":451,"line":474},[449,23923,4726],{"class":680},[449,23925,12355],{"class":684},[449,23927,23928],{"class":691},"`Hello, ${",[449,23930,13144],{"class":684},[449,23932,21678],{"class":680},[449,23934,23935],{"class":691}," \"world\"}!`",[449,23937,1520],{"class":684},[449,23939,23940],{"class":451,"line":480},[449,23941,784],{"class":684},[21,23943,23944,23945],{},"Same handler, portable across Nitro v2, Nitro v3, and the experimental Vite server — and unchanged into Nuxt 5. I upgraded this site to 4.6 and proved it with a live route before writing this post. For anyone maintaining server code (I count myself), this is the gift of the release: ",[151,23946,23947],{},"write it once on 4.6, carry it into 5.",[73,23949],{},[32,23951,23953],{"id":23952},"sessions-with-zero-storage","Sessions with zero storage",[21,23955,23956,23957,23960,23961,23964],{},"The first fruit of the new ",[40,23958,23959],{},"runtimeConfig.appSecret"," foundation is ",[40,23962,23963],{},"useSession"," — sealed cookie sessions via iron, no database, no store:",[48,23966,23969],{"className":670,"code":23967,"filename":23968,"language":673,"meta":56,"style":56},"import { defineEventHandler, useSession } from \"nuxt\u002Fserver\";\n\nexport default defineEventHandler(async (event) => {\n  const session = await useSession\u003C{ visits: number }>(event);\n  await session.update((data) => ({ visits: (data.visits ?? 0) + 1 }));\n  return { visits: session.data.visits };\n});\n","server\u002Fapi\u002Fvisits.ts",[40,23970,23971,23984,23988,24010,24035,24069,24076],{"__ignoreMap":56},[449,23972,23973,23975,23978,23980,23982],{"class":451,"line":452},[449,23974,681],{"class":680},[449,23976,23977],{"class":684}," { defineEventHandler, useSession } ",[449,23979,688],{"class":680},[449,23981,23868],{"class":691},[449,23983,695],{"class":684},[449,23985,23986],{"class":451,"line":114},[449,23987,700],{"emptyLinePlaceholder":130},[449,23989,23990,23992,23994,23996,23998,24000,24002,24004,24006,24008],{"class":451,"line":111},[449,23991,4629],{"class":680},[449,23993,4632],{"class":680},[449,23995,4714],{"class":721},[449,23997,725],{"class":684},[449,23999,1485],{"class":680},[449,24001,1913],{"class":684},[449,24003,2991],{"class":1491},[449,24005,1758],{"class":684},[449,24007,1498],{"class":680},[449,24009,1501],{"class":684},[449,24011,24012,24014,24017,24019,24021,24024,24026,24029,24031,24033],{"class":451,"line":468},[449,24013,5048],{"class":680},[449,24015,24016],{"class":714}," session",[449,24018,718],{"class":680},[449,24020,1654],{"class":680},[449,24022,24023],{"class":721}," useSession",[449,24025,23909],{"class":684},[449,24027,24028],{"class":1491},"visits",[449,24030,3070],{"class":680},[449,24032,4975],{"class":714},[449,24034,23919],{"class":684},[449,24036,24037,24039,24042,24044,24046,24048,24050,24052,24055,24057,24059,24061,24064,24066],{"class":451,"line":474},[449,24038,2099],{"class":680},[449,24040,24041],{"class":684}," session.",[449,24043,13952],{"class":721},[449,24045,5164],{"class":684},[449,24047,1755],{"class":1491},[449,24049,1758],{"class":684},[449,24051,1498],{"class":680},[449,24053,24054],{"class":684}," ({ visits: (data.visits ",[449,24056,734],{"class":680},[449,24058,5103],{"class":714},[449,24060,1758],{"class":684},[449,24062,24063],{"class":680},"+",[449,24065,20024],{"class":714},[449,24067,24068],{"class":684}," }));\n",[449,24070,24071,24073],{"class":451,"line":480},[449,24072,4726],{"class":680},[449,24074,24075],{"class":684}," { visits: session.data.visits };\n",[449,24077,24078],{"class":451,"line":486},[449,24079,784],{"class":684},[21,24081,24082,24083,24086],{},"One ",[40,24084,24085],{},"NUXT_APP_SECRET",", per-visitor state for counters, flags, buckets — on every deploy target including the edge. This is the kind of boring-in-the-best-way infrastructure that makes small features shippable in an evening.",[73,24088],{},[32,24090,24092,24093,24095],{"id":24091},"typed-fetch-without-the-fear","Typed ",[40,24094,23811],{}," without the fear",[21,24097,24098,24099,24101,24102,24105,24106,24109,24110,24113,24114,349,24116,1542,24118,24121,24122,24125],{},"Past a few hundred routes, typed ",[40,24100,23811],{}," used to risk ",[40,24103,24104],{},"TS2589: Type instantiation is excessively deep"," — the old ",[40,24107,24108],{},"InternalApi"," typing resolved every call against the whole route union. Rebuilt on ",[40,24111,24112],{},"fetchdts",", 4.6 compiles routes into an exact-match table: a 3000-route app went from ~72M instantiations to ~100k, memory from 946 MB to 140 MB. And calls are now checked against the ",[40,24115,16248],{},[40,24117,23617],{},[40,24119,24120],{},"headers"," each handler validates. It's opt-in (",[40,24123,24124],{},"experimental.routeTypedFetch","), default in Nuxt 5 — I'm adopting it now to pre-pay that migration too.",[73,24127],{},[32,24129,24131],{"id":24130},"the-daily-workflow-stuff-cli-v4-and-errors-that-respect-you","The daily-workflow stuff: CLI v4 and errors that respect you",[21,24133,24134,24135,24138,24139,24142,24143,24146,24147,1124,24150,1124,24153,24156,24157,24160],{},"Nuxt 4.6 ships ",[151,24136,24137],{},"Nuxt CLI v4"," automatically: ",[40,24140,24141],{},"nuxt dev"," gets an interactive panel (request ids tying logs to the request that caused them, restart reasons, config diffs, per-module setup times), a ",[40,24144,24145],{},".nuxt\u002F"," lock so an agent-spawned second server takes over instead of fighting yours, and ",[40,24148,24149],{},"nuxt curl",[40,24151,24152],{},"nuxt task",[40,24154,24155],{},"nuxt docs"," companions. And the Youch iframe is gone — the ",[151,24158,24159],{},"my-bad"," pipeline gives mapped SSR stacks, source code frames, and a Copy-error-as-agent-prompt button. Errors rendered once, not once per layer. These are the minutes-back-every-day changes.",[73,24162],{},[32,24164,24166],{"id":24165},"why-im-still-confident-when-ai-gets-the-headlines","Why I'm still confident when AI gets the headlines",[21,24168,24169,24170,24173],{},"Here's the personal part. AI has overshadowed frameworks this past year — every keynote is models, agents, prompts. Frameworks don't trend. And yet: this site, my tutorials, my daily work — all Nuxt. What keeps me here isn't hype, it's ",[151,24171,24172],{},"stewardship",". A team that writes 420 careful commits, thanks its server engineers by name, documents the migration path before demanding it, and keeps the framework the same Nuxt while making its insides replaceable — that's a team I trust with my stack. Hype cycles come and go. Maintainership compounds.",[73,24175],{},[32,24177,24179],{"id":24178},"thank-you","Thank you",[21,24181,24182,24183,24186],{},"To Daniel Roe for leading this release and writing it up so clearly. To Pooya Parsa (pi0), whose years of work on h3, Nitro, and web-standard server primitives made a portable ",[40,24184,24185],{},"RequestEvent"," possible at all. To the contributors behind sessions, typed fetch, CLI v4, Vapor support, and the error pipeline — and to Sébastien, Anthony, Hugo, and everyone reviewing, testing, and documenting. You don't get keynote slots for framework minors. You have my gratitude anyway. 💚",[25,24188,24189],{"type":27},[21,24190,24191,24192,24195,24196,24201],{},"4.6 raises the Node floor to ",[40,24193,24194],{},"^22.22.3 || ^24.15.0 || >=26.0.0"," — check CI images before upgrading. And Nuxt 3 is now end-of-life: if you're still on v3, the ",[3861,24197,24200],{"href":24198,"rel":24199},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fgetting-started\u002Fupgrade",[3865],"upgrade guide"," is waiting.",[73,24203],{},[32,24205,3681],{"id":3680},[21,24207,24208],{},"Nuxt 4.6 is a small number on a big release: server-agnostic foundations, zero-storage sessions, fearless typed fetch, a dev CLI that finally explains itself, and errors that help instead of taunt. Not Nuxt 5 — the runway to it. I'm glad the team took the time to pave it properly, and I'm gladder still they're still here building.",[21,24210,24211,24212,24216],{},"If this post earned your curiosity, the next step is hands-on: ",[151,24213,24214],{},[3861,24215,23827],{"href":23826}," — six lessons, same features, runnable code. Let's learn it together.",[3728,24218,24219],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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);}",{"title":56,"searchDepth":111,"depth":111,"links":24221},[24222,24223,24225,24226,24228,24229,24230,24231],{"id":23792,"depth":114,"text":23793},{"id":23832,"depth":114,"text":24224},"The one that matters most: nuxt\u002Fserver",{"id":23952,"depth":114,"text":23953},{"id":24091,"depth":114,"text":24227},"Typed $fetch without the fear",{"id":24130,"depth":114,"text":24131},{"id":24165,"depth":114,"text":24166},{"id":24178,"depth":114,"text":24179},{"id":3680,"depth":114,"text":3681},"2026-10-15","Nuxt 4.6 is here — a server-agnostic nuxt\u002Fserver surface, sealed cookie sessions, rebuilt typed $fetch, Nuxt CLI v4, Vue Vapor support, and far better dev errors. A personal note on why I'm still all-in on Nuxt, even with AI hype everywhere and Nuxt 5 still on the horizon.",{"type":13,"value":24235},[24236,24238,24242],[16,24237,333],{"id":332},[21,24239,23780,24240,23784],{},[151,24241,23783],{},[21,24243,23787],{},"\u002Fnuxt_learn.png",[24246,24247,23763,7065,24248,24249,10426],"nuxt","nuxt 4.6","nuxt server","daniel roe",{},"\u002Fblog\u002Fnuxt-46-still-here-still-mine",{"title":23772,"description":24233},"blog\u002Fnuxt-46-still-here-still-mine","QpiSKl4Jpm09tKjec0I_uMukdXVFCTQVSbdTpHI1rL4",{"id":24256,"title":24257,"author":24258,"body":24259,"canonical":116,"categories":116,"date":26201,"description":26202,"excerpt":26203,"extension":119,"featuredImg":26223,"img":26224,"keywords":26225,"language":3788,"meta":26229,"navigation":130,"ogImage":116,"path":26230,"rating":474,"readTime":133,"seo":26231,"stem":26232,"tag":3793,"__hash__":26233},"blog\u002Fblog\u002Fnuxt-47-the-test-drive.md","Nuxt 4.7: The Test Drive",{"name":9,"img":11,"website":327},{"type":13,"value":24260,"toc":26180},[24261,24267,24274,24277,24290,24292,24296,24309,24312,24327,24336,24347,24356,24360,24390,24393,24422,24425,24428,24468,24476,24486,24488,24492,24499,24502,24538,24544,24798,24817,24834,24847,24854,24918,24925,25043,25057,25062,25069,25071,25075,25091,25109,25112,25119,25122,25163,25173,25177,25180,25214,25221,25223,25227,25237,25349,25367,25381,25384,25402,25404,25408,25419,25432,25587,25590,25596,25603,25605,25609,25612,25618,25621,25657,25682,25686,25731,25735,25738,25745,25749,25784,25802,25804,25808,25811,25922,25924,25928,25931,25979,25998,26000,26004,26007,26106,26109,26127,26136,26138,26142,26148,26154,26157,26160,26174,26177],[21,24262,24263,24264],{},"Last time I wrote about Nuxt, I called 4.6 the runway to Nuxt 5. I meant it as a compliment: a release that pre-paid the migration instead of rushing the major. ",[151,24265,24266],{},"Nuxt 4.7 is the first time we get to taxi down that runway.",[21,24268,24269,24270,24273],{},"Around 350 commits since v4.6.4. The headline is not a new UI feature or a compiler trick. It is this: ",[151,24271,24272],{},"you can build your Nuxt 4 app with Nitro v3 today",", the same server engine Nuxt 5 is built on. No config rewrite. Add one dependency. See what happens.",[21,24275,24276],{},"That is a different kind of release. It is a test drive.",[21,24278,24279,24280,349,24283,1542,24286,24289],{},"Full disclosure: this site is on 4.7 now. It runs ",[40,24281,24282],{},"staticRoutes",[40,24284,24285],{},"webmcp",[40,24287,24288],{},"ssrErrorBoundary",", and its public config is declared with Zod. The build passed before I wrote a word.",[16,24291,4373],{"id":4372},[32,24293,24295],{"id":24294},"the-main-event-nitro-v3-under-nuxt","The main event: Nitro v3 under Nuxt",[21,24297,24298,24299,5872,24302,349,24305,24308],{},"Nitro v3 is a ground-up rewrite of the server: h3 v2, web-standard ",[40,24300,24301],{},"Request",[40,24303,24304],{},"Response",[40,24306,24307],{},"srvx",", a compiled router, a much smaller install, runtime mode, Vitest support, and the same deploy-anywhere promise. It is also the foundation of Nuxt 5. Until 4.7, testing it meant leaving Nuxt.",[21,24310,24311],{},"Now it is one line:",[48,24313,24315],{"className":839,"code":24314,"filename":4384,"language":841,"meta":56,"style":56},"pnpm add nitro\n",[40,24316,24317],{"__ignoreMap":56},[449,24318,24319,24322,24324],{"class":451,"line":452},[449,24320,24321],{"class":721},"pnpm",[449,24323,2478],{"class":691},[449,24325,24326],{"class":691}," nitro\n",[21,24328,24329,24330,24332,24333,24335],{},"If ",[40,24331,7065],{}," is in your ",[40,24334,4520],{},", Nuxt builds with Nitro v3. Remove it, and you are back on Nitro v2. That is the whole switch.",[21,24337,24338,24339,24342,24343,24346],{},"I went the other way: I built a standalone Nitro v3 app first, then came back to Nuxt. The first thing I noticed was not a crash. It was the speed. On Nuxt's benchmark app with about 170 pages, the same app served ",[151,24340,24341],{},"33% more requests per second"," on the home page with Nitro v3 (926 → 1,236), and ",[151,24344,24345],{},"44% more"," on a page with 1,000 links (219 → 316), with identical HTML. That is not a micro-benchmark. That is the server engine doing less work per request.",[25,24348,24349],{"type":27},[21,24350,24351,24352,24355],{},"Nitro v3 is still a release candidate. It is ",[151,24353,24354],{},"highly experimental"," in Nuxt 4.7. Try it on a branch, not in production. The point is to find the code that still depends on Nitro v2 before Nuxt 5 finds it for you.",[2808,24357,24359],{"id":24358},"the-compatibility-layer-is-the-teacher","The compatibility layer is the teacher",[21,24361,24362,24363,24366,24367,349,24369,1542,24371,24374,24375,349,24378,24381,24382,24385,24386,24389],{},"Most Nuxt 4 apps and modules were written for Nitro v2 and h3 v1. So Nuxt 4.7 runs Nitro v3 with a compatibility layer called ",[40,24364,24365],{},"nitroLegacy",", on by default. It keeps imports from ",[40,24368,2808],{},[40,24370,23844],{},[40,24372,24373],{},"#imports"," resolving; keeps the Nitro v2 auto-imports; keeps ",[40,24376,24377],{},"useRuntimeConfig(event)",[40,24379,24380],{},"event.node",", and the old hooks working; and keeps a long list of h3 v1 behaviours, from ",[40,24383,24384],{},"sendRedirect"," ending the response to the ",[40,24387,24388],{},"cache-control"," headers cached routes send.",[21,24391,24392],{},"That layer is not a permanent home. It is a diagnostic tool. Turn it off:",[48,24394,24396],{"className":670,"code":24395,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  nitroLegacy: false,\n});\n",[40,24397,24398,24408,24418],{"__ignoreMap":56},[449,24399,24400,24402,24404,24406],{"class":451,"line":452},[449,24401,4629],{"class":680},[449,24403,4632],{"class":680},[449,24405,4635],{"class":721},[449,24407,1391],{"class":684},[449,24409,24410,24413,24416],{"class":451,"line":114},[449,24411,24412],{"class":684},"  nitroLegacy: ",[449,24414,24415],{"class":714},"false",[449,24417,779],{"class":684},[449,24419,24420],{"class":451,"line":111},[449,24421,784],{"class":684},[21,24423,24424],{},"Then the errors tell you exactly which files still expect the old world. In my case, most of them were imports I had stopped thinking about years ago.",[21,24426,24427],{},"Two changes happen regardless of the layer:",[816,24429,24430,24451],{},[386,24431,24432,24435,24436,24438,24439,24442,24443,24446,24447,24450],{},[151,24433,24434],{},"Route rule patterns."," Nitro v3 matches with rou3. A single ",[40,24437,13175],{}," now matches any number of segments, so ",[40,24440,24441],{},"\u002Fblog\u002F*"," also applies to ",[40,24444,24445],{},"\u002Fblog\u002F2026\u002Fhello",". Nuxt warns about every rule whose meaning changes and stops on a rule with more than one wildcard. Use a named parameter (",[40,24448,24449],{},"\u002Fblog\u002F:slug",") when you mean one segment.",[386,24452,24453,24456,24457,24460,24461,24463,24464,24467],{},[151,24454,24455],{},"Imports your server code never declared."," Nitro v2 quietly fell back to Nuxt's own dependency tree. Nitro v3 does not. If your server imports ",[40,24458,24459],{},"ufo"," but your app does not depend on it, ",[40,24462,24141],{}," fails with ",[40,24465,24466],{},"Cannot find package 'ufo'",". That is a good failure. It makes the dependency real.",[21,24469,24470,24471,24475],{},"There is a longer list in the ",[3861,24472,24200],{"href":24473,"rel":24474},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fgetting-started\u002Fupgrade#testing-nitro-v3",[3865],", and it is worth reading before you flip the switch. The short version: try it, turn off the layer, fix what it finds, and you have done most of the Nuxt 5 server migration on 4.7.",[21,24477,24478,24479,24485],{},"That standalone app is Ampyard: a fictional EV charging depot with no Nuxt in the room. Nine stages, real D1, cron, SSE, WebSockets, and a charger-agent OpenAPI contract. If you want the engine without the framework conventions, start here: ",[151,24480,24481],{},[3861,24482,24484],{"href":24483},"\u002Flearn\u002Fnitro-v3","Nitro v3 in Practice: Build Ampyard",". It is the companion piece to this post.",[73,24487],{},[32,24489,24491],{"id":24490},"webmcp-the-fun-one","WebMCP: the fun one",[21,24493,24494,24495,24498],{},"The second headline is ",[151,24496,24497],{},"WebMCP",", an experimental browser API that lets a page offer tools to AI agents running in the browser. It started from Sarah Drasner's proposal for Vue and WebMCP, and Nuxt 4.7 ships an implementation.",[21,24500,24501],{},"Turn it on:",[48,24503,24505],{"className":670,"code":24504,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  experimental: {\n    webmcp: true,\n  },\n});\n",[40,24506,24507,24517,24521,24530,24534],{"__ignoreMap":56},[449,24508,24509,24511,24513,24515],{"class":451,"line":452},[449,24510,4629],{"class":680},[449,24512,4632],{"class":680},[449,24514,4635],{"class":721},[449,24516,1391],{"class":684},[449,24518,24519],{"class":451,"line":114},[449,24520,23341],{"class":684},[449,24522,24523,24526,24528],{"class":451,"line":111},[449,24524,24525],{"class":684},"    webmcp: ",[449,24527,2169],{"class":714},[449,24529,779],{"class":684},[449,24531,24532],{"class":451,"line":468},[449,24533,1474],{"class":684},[449,24535,24536],{"class":451,"line":474},[449,24537,784],{"class":684},[21,24539,24540,24541,3070],{},"Most of what an agent needs is already bound in your template. Tag a function with ",[40,24542,24543],{},"@tool",[48,24545,24549],{"className":24546,"code":24547,"filename":24548,"language":23763,"meta":56,"style":56},"language-vue shiki shiki-themes github-light github-dark","\u003Cscript setup lang=\"ts\">\nconst { data: products } = await useFetch('\u002Fapi\u002Fproducts')\nconst cart = useCart()\n\n\u002F**\n * Add one of a product to the cart. Use when the user wants to buy something.\n * @tool\n *\u002F\nfunction addToCart (sku: string) {\n  cart.value.push(sku)\n}\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cul>\n    \u003Cli v-for=\"product in products\" :key=\"product.sku\">\n      {{ product.name }}\n      \u003Cbutton :disabled=\"!product.inStock\" @click=\"addToCart(product.sku)\">\n        Add\n      \u003C\u002Fbutton>\n    \u003C\u002Fli>\n  \u003C\u002Ful>\n\u003C\u002Ftemplate>\n","app\u002Fpages\u002Findex.vue",[40,24550,24551,24569,24598,24612,24616,24621,24626,24634,24639,24658,24668,24672,24680,24684,24693,24702,24727,24732,24758,24763,24772,24781,24790],{"__ignoreMap":56},[449,24552,24553,24555,24557,24560,24563,24565,24567],{"class":451,"line":452},[449,24554,5547],{"class":684},[449,24556,23223],{"class":17370},[449,24558,24559],{"class":721}," setup",[449,24561,24562],{"class":721}," lang",[449,24564,5014],{"class":684},[449,24566,23119],{"class":691},[449,24568,23122],{"class":684},[449,24570,24571,24573,24575,24577,24579,24582,24584,24586,24588,24591,24593,24596],{"class":451,"line":114},[449,24572,711],{"class":680},[449,24574,14227],{"class":684},[449,24576,1755],{"class":1491},[449,24578,1482],{"class":684},[449,24580,24581],{"class":714},"products",[449,24583,21656],{"class":684},[449,24585,5014],{"class":680},[449,24587,1654],{"class":680},[449,24589,24590],{"class":721}," useFetch",[449,24592,725],{"class":684},[449,24594,24595],{"class":691},"'\u002Fapi\u002Fproducts'",[449,24597,11185],{"class":684},[449,24599,24600,24602,24605,24607,24610],{"class":451,"line":111},[449,24601,711],{"class":680},[449,24603,24604],{"class":714}," cart",[449,24606,718],{"class":680},[449,24608,24609],{"class":721}," useCart",[449,24611,11195],{"class":684},[449,24613,24614],{"class":451,"line":468},[449,24615,700],{"emptyLinePlaceholder":130},[449,24617,24618],{"class":451,"line":474},[449,24619,24620],{"class":705},"\u002F**\n",[449,24622,24623],{"class":451,"line":480},[449,24624,24625],{"class":705}," * Add one of a product to the cart. Use when the user wants to buy something.\n",[449,24627,24628,24631],{"class":451,"line":486},[449,24629,24630],{"class":705}," * ",[449,24632,24633],{"class":680},"@tool\n",[449,24635,24636],{"class":451,"line":492},[449,24637,24638],{"class":705}," *\u002F\n",[449,24640,24641,24644,24647,24649,24652,24654,24656],{"class":451,"line":498},[449,24642,24643],{"class":680},"function",[449,24645,24646],{"class":721}," addToCart",[449,24648,1913],{"class":684},[449,24650,24651],{"class":1491},"sku",[449,24653,3070],{"class":680},[449,24655,6081],{"class":714},[449,24657,3417],{"class":684},[449,24659,24660,24663,24665],{"class":451,"line":133},[449,24661,24662],{"class":684},"  cart.value.",[449,24664,5258],{"class":721},[449,24666,24667],{"class":684},"(sku)\n",[449,24669,24670],{"class":451,"line":509},[449,24671,4604],{"class":684},[449,24673,24674,24676,24678],{"class":451,"line":318},[449,24675,23220],{"class":684},[449,24677,23223],{"class":17370},[449,24679,23122],{"class":684},[449,24681,24682],{"class":451,"line":520},[449,24683,700],{"emptyLinePlaceholder":130},[449,24685,24686,24688,24691],{"class":451,"line":526},[449,24687,5547],{"class":684},[449,24689,24690],{"class":17370},"template",[449,24692,23122],{"class":684},[449,24694,24695,24698,24700],{"class":451,"line":532},[449,24696,24697],{"class":684},"  \u003C",[449,24699,383],{"class":17370},[449,24701,23122],{"class":684},[449,24703,24704,24707,24709,24712,24714,24717,24720,24722,24725],{"class":451,"line":2790},[449,24705,24706],{"class":684},"    \u003C",[449,24708,386],{"class":17370},[449,24710,24711],{"class":721}," v-for",[449,24713,5014],{"class":684},[449,24715,24716],{"class":691},"\"product in products\"",[449,24718,24719],{"class":721}," :key",[449,24721,5014],{"class":684},[449,24723,24724],{"class":691},"\"product.sku\"",[449,24726,23122],{"class":684},[449,24728,24729],{"class":451,"line":3511},[449,24730,24731],{"class":684},"      {{ product.name }}\n",[449,24733,24734,24737,24740,24743,24745,24748,24751,24753,24756],{"class":451,"line":3526},[449,24735,24736],{"class":684},"      \u003C",[449,24738,24739],{"class":17370},"button",[449,24741,24742],{"class":721}," :disabled",[449,24744,5014],{"class":684},[449,24746,24747],{"class":691},"\"!product.inStock\"",[449,24749,24750],{"class":721}," @click",[449,24752,5014],{"class":684},[449,24754,24755],{"class":691},"\"addToCart(product.sku)\"",[449,24757,23122],{"class":684},[449,24759,24760],{"class":451,"line":3531},[449,24761,24762],{"class":684},"        Add\n",[449,24764,24765,24768,24770],{"class":451,"line":3536},[449,24766,24767],{"class":684},"      \u003C\u002F",[449,24769,24739],{"class":17370},[449,24771,23122],{"class":684},[449,24773,24774,24777,24779],{"class":451,"line":4009},[449,24775,24776],{"class":684},"    \u003C\u002F",[449,24778,386],{"class":17370},[449,24780,23122],{"class":684},[449,24782,24783,24786,24788],{"class":451,"line":4015},[449,24784,24785],{"class":684},"  \u003C\u002F",[449,24787,383],{"class":17370},[449,24789,23122],{"class":684},[449,24791,24792,24794,24796],{"class":451,"line":4021},[449,24793,23220],{"class":684},[449,24795,24690],{"class":17370},[449,24797,23122],{"class":684},[21,24799,24800,24801,24804,24805,24808,24809,24812,24813,24816],{},"That registers an ",[40,24802,24803],{},"add_to_cart"," tool. The arguments come from the template, so an agent can only do what a user could click, and it cannot run while the button is disabled. Inside a ",[40,24806,24807],{},"v-for",", the ",[40,24810,24811],{},":key"," becomes a target the agent picks, and a shared ",[40,24814,24815],{},"list_targets"," tool lists what is on screen.",[21,24818,24819,24820,24823,24824,23841,24827,24830,24831,24833],{},"On this site, the article page registers a ",[40,24821,24822],{},"copy_article_link"," tool with ",[40,24825,24826],{},"defineAgentTool()",[40,24828,24829],{},"useAgentTool()",", and the Save button carries the template ",[40,24832,24543],{}," tag.",[21,24835,23249,24836,24838,24839,24842,24843,24846],{},[40,24837,24543],{}," bound to ",[40,24840,24841],{},"@submit"," becomes a form tool. Its input is the form's ",[40,24844,24845],{},"v-model"," bindings, and a call fills in the form and submits it for real, so your validation and submit handler run exactly as they would for a person.",[21,24848,24849,24850,23841,24852,3070],{},"For tools that do not map to a single control, there is ",[40,24851,24826],{},[40,24853,24829],{},[48,24855,24858],{"className":24546,"code":24856,"filename":24857,"language":23763,"meta":56,"style":56},"const searchProducts = defineAgentTool({\n  name: 'search_products',\n  description: 'Find products by name. Use when the user asks what is for sale.',\n  input: z.object({ query: z.string() }),\n  annotations: { readOnlyHint: true },\n  execute: ({ query }, { signal }) => $fetch('\u002Fapi\u002Fproducts', {\n    query: { q: query },\n    signal,\n  }),\n})\n\nuseAgentTool(searchProducts)\n","app\u002Fpages\u002Fproducts.vue",[40,24859,24860,24865,24870,24875,24880,24885,24890,24895,24900,24905,24909,24913],{"__ignoreMap":56},[449,24861,24862],{"class":451,"line":452},[449,24863,24864],{"class":684},"const searchProducts = defineAgentTool({\n",[449,24866,24867],{"class":451,"line":114},[449,24868,24869],{"class":684},"  name: 'search_products',\n",[449,24871,24872],{"class":451,"line":111},[449,24873,24874],{"class":684},"  description: 'Find products by name. Use when the user asks what is for sale.',\n",[449,24876,24877],{"class":451,"line":468},[449,24878,24879],{"class":684},"  input: z.object({ query: z.string() }),\n",[449,24881,24882],{"class":451,"line":474},[449,24883,24884],{"class":684},"  annotations: { readOnlyHint: true },\n",[449,24886,24887],{"class":451,"line":480},[449,24888,24889],{"class":684},"  execute: ({ query }, { signal }) => $fetch('\u002Fapi\u002Fproducts', {\n",[449,24891,24892],{"class":451,"line":486},[449,24893,24894],{"class":684},"    query: { q: query },\n",[449,24896,24897],{"class":451,"line":492},[449,24898,24899],{"class":684},"    signal,\n",[449,24901,24902],{"class":451,"line":498},[449,24903,24904],{"class":684},"  }),\n",[449,24906,24907],{"class":451,"line":133},[449,24908,4113],{"class":684},[449,24910,24911],{"class":451,"line":509},[449,24912,700],{"emptyLinePlaceholder":130},[449,24914,24915],{"class":451,"line":318},[449,24916,24917],{"class":684},"useAgentTool(searchProducts)\n",[21,24919,24920,24921,24924],{},"And ",[40,24922,24923],{},"useAgentActivity()"," lets you show the user what the agent is doing, and stop it:",[48,24926,24929],{"className":24546,"code":24927,"filename":24928,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nconst { current, stop } = useAgentActivity()\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cp v-if=\"current\">\n    {{ current.message }} \u003Cbutton @click=\"stop\">Stop\u003C\u002Fbutton>\n  \u003C\u002Fp>\n\u003C\u002Ftemplate>\n","app\u002Fcomponents\u002FAgentStatus.vue",[40,24930,24931,24947,24970,24978,24982,24990,25006,25027,25035],{"__ignoreMap":56},[449,24932,24933,24935,24937,24939,24941,24943,24945],{"class":451,"line":452},[449,24934,5547],{"class":684},[449,24936,23223],{"class":17370},[449,24938,24559],{"class":721},[449,24940,24562],{"class":721},[449,24942,5014],{"class":684},[449,24944,23119],{"class":691},[449,24946,23122],{"class":684},[449,24948,24949,24951,24953,24956,24958,24961,24963,24965,24968],{"class":451,"line":114},[449,24950,711],{"class":680},[449,24952,14227],{"class":684},[449,24954,24955],{"class":714},"current",[449,24957,349],{"class":684},[449,24959,24960],{"class":714},"stop",[449,24962,21656],{"class":684},[449,24964,5014],{"class":680},[449,24966,24967],{"class":721}," useAgentActivity",[449,24969,11195],{"class":684},[449,24971,24972,24974,24976],{"class":451,"line":111},[449,24973,23220],{"class":684},[449,24975,23223],{"class":17370},[449,24977,23122],{"class":684},[449,24979,24980],{"class":451,"line":468},[449,24981,700],{"emptyLinePlaceholder":130},[449,24983,24984,24986,24988],{"class":451,"line":474},[449,24985,5547],{"class":684},[449,24987,24690],{"class":17370},[449,24989,23122],{"class":684},[449,24991,24992,24994,24996,24999,25001,25004],{"class":451,"line":480},[449,24993,24697],{"class":684},[449,24995,21],{"class":17370},[449,24997,24998],{"class":721}," v-if",[449,25000,5014],{"class":684},[449,25002,25003],{"class":691},"\"current\"",[449,25005,23122],{"class":684},[449,25007,25008,25011,25013,25015,25017,25020,25023,25025],{"class":451,"line":486},[449,25009,25010],{"class":684},"    {{ current.message }} \u003C",[449,25012,24739],{"class":17370},[449,25014,24750],{"class":721},[449,25016,5014],{"class":684},[449,25018,25019],{"class":691},"\"stop\"",[449,25021,25022],{"class":684},">Stop\u003C\u002F",[449,25024,24739],{"class":17370},[449,25026,23122],{"class":684},[449,25028,25029,25031,25033],{"class":451,"line":492},[449,25030,24785],{"class":684},[449,25032,21],{"class":17370},[449,25034,23122],{"class":684},[449,25036,25037,25039,25041],{"class":451,"line":498},[449,25038,23220],{"class":684},[449,25040,24690],{"class":17370},[449,25042,23122],{"class":684},[21,25044,25045,25046,25049,25050,25053,25054,165],{},"Nuxt also registers a ",[40,25047,25048],{},"navigate"," tool listing your pages, warns at build time about bindings that cannot become tools, and in development writes the tools of each page you visit to ",[40,25051,25052],{},".nuxt\u002Fwebmcp\u002Fschema.json",", ready for ",[40,25055,25056],{},"webmcp-evals",[25,25058,25059],{"type":363},[21,25060,25061],{},"The WebMCP spec is still moving, and the API is in early preview in Chrome behind a flag. In browsers without it, nothing registers and your app behaves exactly as before. That is the right failure mode for an experiment.",[21,25063,25064,25065,25068],{},"Why I like this one: it is the first AI feature in a framework release that feels ",[151,25066,25067],{},"native to the web"," instead of bolted on. The tools are the UI. The agent cannot hallucinate a button that does not exist. It can only click what you already shipped.",[73,25070],{},[32,25072,25074],{"id":25073},"one-drawer-for-all-your-problems","One drawer for all your problems",[21,25076,25077,25078,25080,25081,25083,25084,25087,25088,3070],{},"Nuxt 4.6 brought ",[40,25079,24159],{}," error pages to development. In 4.7, with ",[40,25082,24159],{}," v1 and ",[40,25085,25086],{},"vite-plugin-checker"," v1, the same badge in the corner also collects ",[151,25089,25090],{},"problems",[383,25092,25093,25100,25103,25106],{},[386,25094,25095,25096,25099],{},"type errors, when ",[40,25097,25098],{},"typescript.typeCheck"," is on;",[386,25101,25102],{},"any checker you add to Vite, such as ESLint;",[386,25104,25105],{},"Vue compiler warnings that used to be lost in the terminal;",[386,25107,25108],{},"Nuxt's own warnings from scanning your app, such as duplicate component names or conflicting imports.",[21,25110,25111],{},"Each source becomes a problem set. The badge sums them into one pill. Click it and you get a drawer beside the page, grouped by source, with source snippets, links to the rule docs, and a button to open each one in your editor.",[21,25113,25114,25115,25118],{},"This is the feature I did not know I wanted. I used to keep three terminals open: dev server, ",[40,25116,25117],{},"vue-tsc --watch",", ESLint. Now the page tells me. The DevTools v4 Problems panel shows the same list if you prefer the dock.",[21,25120,25121],{},"You can also choose when type checking runs:",[48,25123,25125],{"className":670,"code":25124,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  typescript: {\n    typeCheck: 'dev', \u002F\u002F `true`, 'build' or 'dev'\n  },\n});\n",[40,25126,25127,25137,25142,25155,25159],{"__ignoreMap":56},[449,25128,25129,25131,25133,25135],{"class":451,"line":452},[449,25130,4629],{"class":680},[449,25132,4632],{"class":680},[449,25134,4635],{"class":721},[449,25136,1391],{"class":684},[449,25138,25139],{"class":451,"line":114},[449,25140,25141],{"class":684},"  typescript: {\n",[449,25143,25144,25147,25150,25152],{"class":451,"line":111},[449,25145,25146],{"class":684},"    typeCheck: ",[449,25148,25149],{"class":691},"'dev'",[449,25151,349],{"class":684},[449,25153,25154],{"class":705},"\u002F\u002F `true`, 'build' or 'dev'\n",[449,25156,25157],{"class":451,"line":468},[449,25158,1474],{"class":684},[449,25160,25161],{"class":451,"line":474},[449,25162,784],{"class":684},[21,25164,25165,25166,25169,25170,25172],{},"If you already run ",[40,25167,25168],{},"nuxt typecheck"," in CI, ",[40,25171,25149],{}," is the right default. You get the feedback while you work, and the production build stays fast.",[32,25174,25176],{"id":25175},"template-diagnostics-the-compiler-knows-your-app","Template diagnostics: the compiler knows your app",[21,25178,25179],{},"The Vue compiler cannot know about your pages or your server components. Nuxt can. So 4.7 checks templates for mistakes that only make sense with that knowledge:",[383,25181,25182,25197,25208],{},[386,25183,25184,25185,25188,25189,25192,25193,25196],{},"a ",[40,25186,25187],{},"\u003CNuxtLink>"," whose static ",[40,25190,25191],{},"to"," does not match any page (",[40,25194,25195],{},"NUXT_B4025",");",[386,25198,25199,9920,25202,25204,25205,25196],{},[40,25200,25201],{},"v-on",[40,25203,24845],{}," on a server component, which cannot work (",[40,25206,25207],{},"NUXT_B3014",[386,25209,25210,25211,374],{},"a function or class instance passed as a prop to a server component (",[40,25212,25213],{},"NUXT_B3015",[21,25215,25216,25217,25220],{},"In development these show up on every open page as a problem set until you fix them. They are on by default. Turn them off with ",[40,25218,25219],{},"experimental.templateDiagnostics: false"," if you need quiet, but I would leave them on. A dead link in a template is exactly the kind of thing that survives to production because no one clicks it in review.",[73,25222],{},[32,25224,25226],{"id":25225},"error-boundaries-that-hold-on-the-server","Error boundaries that hold on the server",[21,25228,25229,25232,25233,25236],{},[40,25230,25231],{},"\u003CNuxtErrorBoundary>"," used to catch errors on the client only. A component that threw while server rendering went straight past it to your error page. With ",[40,25234,25235],{},"experimental.ssrErrorBoundary",", it catches on the server too:",[48,25238,25240],{"className":24546,"code":25239,"filename":24548,"language":23763,"meta":56,"style":56},"\u003Ctemplate>\n  \u003CNuxtErrorBoundary>\n    \u003CBrokenWidget \u002F>\n    \u003Ctemplate #error=\"{ error, clearBoundaryError }\">\n      \u003Cp>Widget unavailable\u003C\u002Fp>\n      \u003Cbutton @click=\"clearBoundaryError\">Retry\u003C\u002Fbutton>\n    \u003C\u002Ftemplate>\n  \u003C\u002FNuxtErrorBoundary>\n\u003C\u002Ftemplate>\n",[40,25241,25242,25250,25259,25269,25292,25305,25325,25333,25341],{"__ignoreMap":56},[449,25243,25244,25246,25248],{"class":451,"line":452},[449,25245,5547],{"class":684},[449,25247,24690],{"class":17370},[449,25249,23122],{"class":684},[449,25251,25252,25254,25257],{"class":451,"line":114},[449,25253,24697],{"class":684},[449,25255,25256],{"class":17370},"NuxtErrorBoundary",[449,25258,23122],{"class":684},[449,25260,25261,25263,25266],{"class":451,"line":111},[449,25262,24706],{"class":684},[449,25264,25265],{"class":17370},"BrokenWidget",[449,25267,25268],{"class":684}," \u002F>\n",[449,25270,25271,25273,25275,25278,25280,25282,25285,25288,25290],{"class":451,"line":468},[449,25272,24706],{"class":684},[449,25274,24690],{"class":17370},[449,25276,25277],{"class":684}," #",[449,25279,17495],{"class":721},[449,25281,5014],{"class":684},[449,25283,25284],{"class":691},"\"",[449,25286,25287],{"class":684},"{ error, clearBoundaryError }",[449,25289,25284],{"class":691},[449,25291,23122],{"class":684},[449,25293,25294,25296,25298,25301,25303],{"class":451,"line":474},[449,25295,24736],{"class":684},[449,25297,21],{"class":17370},[449,25299,25300],{"class":684},">Widget unavailable\u003C\u002F",[449,25302,21],{"class":17370},[449,25304,23122],{"class":684},[449,25306,25307,25309,25311,25313,25315,25318,25321,25323],{"class":451,"line":480},[449,25308,24736],{"class":684},[449,25310,24739],{"class":17370},[449,25312,24750],{"class":721},[449,25314,5014],{"class":684},[449,25316,25317],{"class":691},"\"clearBoundaryError\"",[449,25319,25320],{"class":684},">Retry\u003C\u002F",[449,25322,24739],{"class":17370},[449,25324,23122],{"class":684},[449,25326,25327,25329,25331],{"class":451,"line":486},[449,25328,24776],{"class":684},[449,25330,24690],{"class":17370},[449,25332,23122],{"class":684},[449,25334,25335,25337,25339],{"class":451,"line":492},[449,25336,24785],{"class":684},[449,25338,25256],{"class":17370},[449,25340,23122],{"class":684},[449,25342,25343,25345,25347],{"class":451,"line":498},[449,25344,23220],{"class":684},[449,25346,24690],{"class":17370},[449,25348,23122],{"class":684},[21,25350,24329,25351,25354,25355,25358,25359,25362,25363,25366],{},[40,25352,25353],{},"\u003CBrokenWidget>"," throws on the server, the response is a ",[40,25356,25357],{},"200"," with the rest of the page intact and the ",[40,25360,25361],{},"#error"," slot in its place. The client hydrates into the same state. In production, errors that are not HTTP errors reach the slot as a plain ",[40,25364,25365],{},"500",", so server error messages stay out of your HTML.",[21,25368,25369,25370,25373,25374,25376,25377,25380],{},"There is also a new ",[40,25371,25372],{},"retry-on-client"," prop: serve the ",[40,25375,25361],{}," slot in the HTML, then try the real content again in the browser. That is the replacement for ",[40,25378,25379],{},"\u003CNuxtClientFallback>",", which is now deprecated.",[21,25382,25383],{},"On this site, the reader stats row (views, reactions, presence) is wrapped in a boundary. If presence is down, the essay still renders.",[21,25385,25386,25387,25390,25391,25394,25395,25398,25399,25401],{},"One small but important rename: the slot exposes ",[40,25388,25389],{},"clearBoundaryError"," instead of ",[40,25392,25393],{},"clearError",". If you forgot to destructure the old name, your template called the ",[151,25396,25397],{},"global"," ",[40,25400,25393],{}," and the boundary stayed broken. The new name cannot collide. Good API design is often a rename that removes a footgun.",[73,25403],{},[32,25405,25407],{"id":25406},"runtime-config-that-fails-at-boot-not-in-production","Runtime config that fails at boot, not in production",[21,25409,25410,25411,25414,25415,25418],{},"Runtime config values have always been typed from their defaults, and environment variables were cast with ",[40,25412,25413],{},"destr",". That meant you could not really declare a required value, or an enum, and occasionally a number-looking string such as ",[40,25416,25417],{},"4848e0"," turned into a number.",[21,25420,25421,25422,25425,25426,25431],{},"Now any value in ",[40,25423,25424],{},"runtimeConfig"," can be a ",[3861,25427,25430],{"href":25428,"rel":25429},"https:\u002F\u002Fstandardschema.dev",[3865],"Standard Schema",", such as Zod, ArkType, or Valibot:",[48,25433,25435],{"className":670,"code":25434,"filename":4619,"language":673,"meta":56,"style":56},"import { z } from 'zod'\n\nexport default defineNuxtConfig({\n  runtimeConfig: {\n    apiSecret: z.string(), \u002F\u002F required, so it must be set at runtime\n    session: z.object({\n      maxAge: z.number().int().default(60 * 60),\n      secure: z.boolean().default(true),\n    }),\n    public: {\n      mode: z.enum(['preview', 'production']).default('production'),\n    },\n  },\n})\n",[40,25436,25437,25449,25453,25463,25467,25480,25490,25519,25537,25541,25545,25575,25579,25583],{"__ignoreMap":56},[449,25438,25439,25441,25444,25446],{"class":451,"line":452},[449,25440,681],{"class":680},[449,25442,25443],{"class":684}," { z } ",[449,25445,688],{"class":680},[449,25447,25448],{"class":691}," 'zod'\n",[449,25450,25451],{"class":451,"line":114},[449,25452,700],{"emptyLinePlaceholder":130},[449,25454,25455,25457,25459,25461],{"class":451,"line":111},[449,25456,4629],{"class":680},[449,25458,4632],{"class":680},[449,25460,4635],{"class":721},[449,25462,1391],{"class":684},[449,25464,25465],{"class":451,"line":468},[449,25466,15396],{"class":684},[449,25468,25469,25472,25475,25477],{"class":451,"line":474},[449,25470,25471],{"class":684},"    apiSecret: z.",[449,25473,25474],{"class":721},"string",[449,25476,10892],{"class":684},[449,25478,25479],{"class":705},"\u002F\u002F required, so it must be set at runtime\n",[449,25481,25482,25485,25488],{"class":451,"line":480},[449,25483,25484],{"class":684},"    session: z.",[449,25486,25487],{"class":721},"object",[449,25489,1391],{"class":684},[449,25491,25492,25495,25498,25500,25503,25505,25507,25509,25512,25514,25517],{"class":451,"line":486},[449,25493,25494],{"class":684},"      maxAge: z.",[449,25496,25497],{"class":721},"number",[449,25499,5237],{"class":684},[449,25501,25502],{"class":721},"int",[449,25504,5237],{"class":684},[449,25506,10920],{"class":721},[449,25508,725],{"class":684},[449,25510,25511],{"class":714},"60",[449,25513,11428],{"class":680},[449,25515,25516],{"class":714}," 60",[449,25518,1613],{"class":684},[449,25520,25521,25524,25527,25529,25531,25533,25535],{"class":451,"line":492},[449,25522,25523],{"class":684},"      secure: z.",[449,25525,25526],{"class":721},"boolean",[449,25528,5237],{"class":684},[449,25530,10920],{"class":721},[449,25532,725],{"class":684},[449,25534,2169],{"class":714},[449,25536,1613],{"class":684},[449,25538,25539],{"class":451,"line":498},[449,25540,4101],{"class":684},[449,25542,25543],{"class":451,"line":133},[449,25544,15401],{"class":684},[449,25546,25547,25550,25553,25556,25559,25561,25564,25567,25569,25571,25573],{"class":451,"line":509},[449,25548,25549],{"class":684},"      mode: z.",[449,25551,25552],{"class":721},"enum",[449,25554,25555],{"class":684},"([",[449,25557,25558],{"class":691},"'preview'",[449,25560,349],{"class":684},[449,25562,25563],{"class":691},"'production'",[449,25565,25566],{"class":684},"]).",[449,25568,10920],{"class":721},[449,25570,725],{"class":684},[449,25572,25563],{"class":691},[449,25574,1613],{"class":684},[449,25576,25577],{"class":451,"line":318},[449,25578,1458],{"class":684},[449,25580,25581],{"class":451,"line":520},[449,25582,1474],{"class":684},[449,25584,25585],{"class":451,"line":526},[449,25586,4113],{"class":684},[21,25588,25589],{},"The schema sets the type, and its default is the default value. Environment variables are converted to that type when the server starts. If a value is missing or cannot be converted, the server does not start, and you get one error listing everything that is wrong.",[21,25591,25592,25593,165],{},"The best part: the schema never ends up in your server bundle. Nuxt compiles it at build time into a tiny description (types, required values, enums, unions). Modules can declare schemas too with ",[40,25594,25595],{},"updateRuntimeConfig()",[21,25597,25598,25599,25602],{},"This is boring infrastructure in the best way. A missing secret should stop a deploy, not surface as ",[40,25600,25601],{},"undefined"," in a Stripe call three hours later. This site now declares its public config with the same schema.",[73,25604],{},[32,25606,25608],{"id":25607},"performance-the-free-kind","Performance: the free kind",[21,25610,25611],{},"I have written about framework performance before, and I am suspicious of benchmarks that need a special branch to reproduce. This release is different: most of it is on by default, and the one big win is a single flag.",[2808,25613,25615,25617],{"id":25614},"staticroutes-is-free-speed",[40,25616,24282],{}," is free speed",[21,25619,25620],{},"By default, Nuxt creates a fresh vue-router matcher for every server request, in case your app adds routes at runtime. If your routes are fixed at build time, tell Nuxt:",[48,25622,25624],{"className":670,"code":25623,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  experimental: {\n    staticRoutes: true,\n  },\n});\n",[40,25625,25626,25636,25640,25649,25653],{"__ignoreMap":56},[449,25627,25628,25630,25632,25634],{"class":451,"line":452},[449,25629,4629],{"class":680},[449,25631,4632],{"class":680},[449,25633,4635],{"class":721},[449,25635,1391],{"class":684},[449,25637,25638],{"class":451,"line":114},[449,25639,23341],{"class":684},[449,25641,25642,25645,25647],{"class":451,"line":111},[449,25643,25644],{"class":684},"    staticRoutes: ",[449,25646,2169],{"class":714},[449,25648,779],{"class":684},[449,25650,25651],{"class":451,"line":468},[449,25652,1474],{"class":684},[449,25654,25655],{"class":451,"line":474},[449,25656,784],{"class":684},[21,25658,25659,25660,25663,25664,349,25667,1542,25670,25673,25674,25677,25678,25681],{},"The server builds the matcher once. On Nuxt's benchmark app with about 170 pages, this more than doubles throughput for a small page: ",[151,25661,25662],{},"890 → 1,976 requests per second",". The trade-off is that ",[40,25665,25666],{},"router.addRoute()",[40,25668,25669],{},"removeRoute()",[40,25671,25672],{},"clearRoutes()"," throw and disappear from the type of ",[40,25675,25676],{},"useRouter()",". Add routes with the ",[40,25679,25680],{},"pages:extend"," hook instead. If you do not add routes at runtime, it is free performance. I enabled it on this site.",[2808,25683,25685],{"id":25684},"a-lighter-client","A lighter client",[383,25687,25688,25696,25706,25720,25728],{},[386,25689,25690,25693,25694,165],{},[40,25691,25692],{},"ofetch"," is left out of the client bundle when nothing uses ",[40,25695,23811],{},[386,25697,25698,25701,25702,25705],{},[40,25699,25700],{},"unhead"," is left out when nothing on the client touches the head; if your app has no ",[40,25703,25704],{},"error.vue",", the built-in error page brings it only when it renders.",[386,25707,25708,25709,23841,25712,25715,25716,25719],{},"Static ",[40,25710,25711],{},"useHead()",[40,25713,25714],{},"useSeoMeta()"," calls in ",[40,25717,25718],{},"app.vue"," are hoisted into the server renderer, so SPA shells get them too.",[386,25721,25722,25724,25725,25727],{},[40,25723,25187],{},"s with a static internal ",[40,25726,25191],{}," compile to a plain anchor in production client builds, with no component instance.",[386,25729,25730],{},"The Nuxt UI landing page hydrated 15% faster (757 → 644 ms) and cut total blocking time 35% (276 → 180 ms).",[2808,25732,25734],{"id":25733},"faster-hydration-and-rendering","Faster hydration and rendering",[21,25736,25737],{},"Nuxt adds V8 compile hints to the entry, layout, and page chunks, so Chrome compiles them off the main thread while they download. In the measurements in the PR, hydration of a heavy landing page went from 477 ms to 311 ms, and total blocking time from 137 ms to 40 ms. The browser also paints before hydrating, and hydration yields between boot phases instead of running one long task.",[21,25739,25740,25741,25744],{},"On the server, rendered HTML is encoded chunk by chunk. A single ",[40,25742,25743],{},"→"," in a template used to make V8 encode the whole document as a two-byte string. Small fix, surprising impact.",[2808,25746,25748],{"id":25747},"the-build-and-dev-loop","The build and dev loop",[383,25750,25751,25762,25765,25771,25781],{},[386,25752,25753,25754,25757,25758,25761],{},"With ",[40,25755,25756],{},"experimental.viteEnvironmentApi"," (or ",[40,25759,25760],{},"compatibilityVersion: 5","), the client and server build at the same time, about 11% faster on a starter.",[386,25763,25764],{},"Auto-imported components are resolved inside the Vue template compiler instead of a separate pass.",[386,25766,25767,25768,165],{},"Babel only runs on server files that actually contain a decorator, making builds about 30% faster with ",[40,25769,25770],{},"experimental.decorators",[386,25772,25773,25776,25777,25780],{},[40,25774,25775],{},"nuxt.schema"," files load natively without ",[40,25778,25779],{},"jiti",": about 100 ms to 3 ms.",[386,25782,25783],{},"A request that is still rendering when the server rebuilds now finishes on the old code instead of failing with a 503.",[21,25785,24920,25786,25789,25790,25793,25794,25797,25798,25801],{},[151,25787,25788],{},"Nuxt CLI 4.1"," now renders the whole production build itself from a set of new build hooks. ",[40,25791,25792],{},"nuxt build"," shows one coherent build instead of each tool's logs one after another, with the same output for Vite, webpack, Rspack, and Rsbuild. ",[40,25795,25796],{},"nuxt generate"," lists the prerendered routes and ends by suggesting where to deploy. ",[40,25799,25800],{},"nuxt dev --https"," serves over HTTP\u002F2, so modules load in parallel on one connection.",[73,25803],{},[32,25805,25807],{"id":25806},"the-rest-of-the-toolbox","The rest of the toolbox",[21,25809,25810],{},"A few smaller things I do not want to lose:",[383,25812,25813,25829,25846,25860,25869,25878,25901,25909],{},[386,25814,25815,25398,25818,25821,25822,25825,25826,165],{},[151,25816,25817],{},"Rsbuild builder.",[40,25819,25820],{},"@nuxt\u002Frsbuild-builder"," hands the build to Rsbuild itself. It replaces ",[40,25823,25824],{},"@nuxt\u002Frspack-builder",", which is deprecated but still works. Set ",[40,25827,25828],{},"builder: 'rsbuild'",[386,25830,25831,25398,25834,25837,25838,25841,25842,25845],{},[151,25832,25833],{},"Renderer plugins for module authors.",[40,25835,25836],{},"addRendererPlugin()"," attaches to the renderer instead of a particular server, so it works with Nitro v2, Nitro v3, and ",[40,25839,25840],{},"@nuxt\u002Fvite-server",". There is also a new ",[40,25843,25844],{},"render:document"," hook with the finished HTML of a non-streamed response.",[386,25847,25848,25855,25856,25859],{},[151,25849,25850,1546,25853,165],{},[40,25851,25852],{},"defineHandler",[40,25854,23803],{}," The Nitro v3 name, with ",[40,25857,25858],{},"defineEventHandler"," as an alias. Same portable handler, one less rename on the way to Nuxt 5.",[386,25861,25862,25868],{},[151,25863,25864,25867],{},[40,25865,25866],{},"serverFetch"," is typed against your server routes."," Internal calls finally know what they are calling.",[386,25870,25871,25877],{},[151,25872,25873,25876],{},[40,25874,25875],{},"addRouteMiddleware"," returns an unregister function."," Onboarding middleware can remove itself when the user is done.",[386,25879,25880,25890,25891,25893,25894,25897,25898,165],{},[151,25881,25882,25885,25886,25889],{},[40,25883,25884],{},"navigateTo(url, { open })"," can pass ",[40,25887,25888],{},"noopener"," by default."," On with ",[40,25892,25760],{},", or set ",[40,25895,25896],{},"experimental.defaults.navigateTo.noopener: true",". The opened page cannot reach back through ",[40,25899,25900],{},"window.opener",[386,25902,25903,25908],{},[151,25904,25905],{},[40,25906,25907],{},"sourcemap: { client: 'nosource' }"," generates source maps without your original source, so you can publish them safely.",[386,25910,25911,25921],{},[151,25912,25913,25916,25917,25920],{},[40,25914,25915],{},"\u003CNuxtLoadingIndicator>"," has a ",[40,25918,25919],{},"finish-color"," prop."," Small, but I have wanted it.",[73,25923],{},[32,25925,25927],{"id":25926},"security-upgrade-then-purge","Security: upgrade, then purge",[21,25929,25930],{},"This release also fixes security issues, and one of them has a cache-shaped tail. The advisories are linked in the release notes; the short version:",[383,25932,25933,25960,25970],{},[386,25934,25935,25941,25942,349,25945,25948,25949,25952,25953,25956,25957,25959],{},[151,25936,25937,25938],{},"Route rules on ",[40,25939,25940],{},"_payload.json"," (GHSA-jxc9-w3j6-pwp2, medium). If you use a wildcard ",[40,25943,25944],{},"cache",[40,25946,25947],{},"swr",", or ",[40,25950,25951],{},"isr"," rule together with a more specific rule for a page — for example ",[40,25954,25955],{},"cache: false"," for an authenticated section — a request for the page's ",[40,25958,25940],{}," could be matched by the wildcard only. One user's page data could be cached and served to another.",[386,25961,25962,25965,25966,25969],{},[151,25963,25964],{},"Encoded slashes on catch-all routes"," (GHSA-vrh2-cfcx-c3fg, medium). An incomplete fix for an earlier advisory. If you rely on route rules for a catch-all page such as ",[40,25967,25968],{},"pages\u002F[...slug].vue",", a repeated or leading encoded slash could bypass them.",[386,25971,25972,25975,25976,25978],{},[151,25973,25974],{},"Dev server runtime config"," (GHSA-h5xj-x893-p5f7, low, development only). If you run ",[40,25977,24141],{}," reachable from an untrusted network, private runtime config could be read from earlier Nitro build output.",[25,25980,25981],{"type":27},[21,25982,25983,25984,349,25986,25948,25988,25990,25991,25997],{},"If you use ",[40,25985,25944],{},[40,25987,25947],{},[40,25989,25951],{}," route rules on pages with user-specific data, ",[151,25992,25993,25994,25996],{},"purge any CDN or edge cache that may already hold a ",[40,25995,25940],{}," after you upgrade",". Upgrading the code does not evict the old entries.",[73,25999],{},[32,26001,26003],{"id":26002},"before-you-upgrade","Before you upgrade",[21,26005,26006],{},"None of these should break your app, but they are worth knowing:",[383,26008,26009,26026,26045,26061,26072,26087,26097],{},[386,26010,26011,26014,26015,26018,26019,26022,26023,26025],{},[151,26012,26013],{},"Nuxt DevTools is no longer installed with Nuxt."," Add ",[40,26016,26017],{},"@nuxt\u002Fdevtools"," to ",[40,26020,26021],{},"devDependencies",", or click the button ",[40,26024,24141],{}," shows you. Fresh installs are smaller; you pick v3 or v4.",[386,26027,26028,1913,26034,26037,26038,2425,26041,26044],{},[151,26029,26030,26031,26033],{},"Nuxt warns when your ",[40,26032,23763],{}," is older than it needs",[40,26035,26036],{},"NUXT_B7042","). 4.7 requires ",[40,26039,26040],{},"vue ^3.5.46",[40,26042,26043],{},"npx nuxt upgrade --dedupe"," updates it with Nuxt.",[386,26046,26047,26050,26051,26053,26054,26057,26058,25920],{},[151,26048,26049],{},"Template diagnostics are on."," You may see new ",[40,26052,25195],{}," warnings for links to pages that do not exist. If a link points at a server route, a file in ",[40,26055,26056],{},"public\u002F",", or another site, add the ",[40,26059,26060],{},"external",[386,26062,26063,26068,26069,165],{},[151,26064,25753,26065,26067],{},[40,26066,25756],{},", the client and server build in parallel."," If a Vite plugin reads the client build output from the server build, set ",[40,26070,26071],{},"experimental.parallelBuild: false",[386,26073,26074,26080,26081,26083,26084,165],{},[151,26075,26076,26079],{},[40,26077,26078],{},"globalThis.$fetch"," is only installed on the client when something uses it."," If you read it from the browser console, an inline script, or a file in ",[40,26082,26056],{},", set ",[40,26085,26086],{},"experimental.globalFetch: true",[386,26088,26089,26094,26095,165],{},[151,26090,26091,26093],{},[40,26092,25824],{}," is deprecated"," in favour of ",[40,26096,25820],{},[386,26098,26099,26094,26103,165],{},[151,26100,26101,26093],{},[40,26102,25379],{},[40,26104,26105],{},"\u003CNuxtErrorBoundary retry-on-client>",[21,26107,26108],{},"The upgrade command is still the same:",[48,26110,26112],{"className":839,"code":26111,"language":841,"meta":56,"style":56},"npx nuxt upgrade --dedupe\n",[40,26113,26114],{"__ignoreMap":56},[449,26115,26116,26118,26121,26124],{"class":451,"line":452},[449,26117,8887],{"class":721},[449,26119,26120],{"class":691}," nuxt",[449,26122,26123],{"class":691}," upgrade",[449,26125,26126],{"class":714}," --dedupe\n",[21,26128,26129,26130,26132,26133,26135],{},"It refreshes the lockfile and pulls in Nuxt CLI 4.1, ",[40,26131,24159],{}," v1, and ",[40,26134,25086],{}," v1.",[73,26137],{},[32,26139,26141],{"id":26140},"why-this-release-matters","Why this release matters",[21,26143,26144,26145],{},"I keep coming back to the same idea: ",[151,26146,26147],{},"Nuxt 4.7 is a release about confidence.",[21,26149,26150,26151,26153],{},"Nitro v3 under Nuxt means you can find your Nuxt 5 server problems now, on a minor, with a compatibility layer that explains itself. WebMCP means you can experiment with the agentic web without inventing a second UI for machines. The problems drawer and template diagnostics mean the framework tells you what is wrong before your users do. Validated runtime config means a missing secret stops the boot, not the checkout. ",[40,26152,24282],{}," means the boring optimization is one flag.",[21,26155,26156],{},"None of that is a keynote demo. It is the work of a team that would rather make the next major safe than make this minor loud.",[21,26158,26159],{},"Last year I wrote that maintainership compounds. 4.7 is the interest payment. The runway is still a runway — Nuxt 5 is not here — but for the first time we are moving down it, and the engine underneath is the one we will use when we take off.",[21,26161,26162,26163,26169,26170,165],{},"If you want the hands-on version of this release, I turned it into a seven-step run: ",[151,26164,26165],{},[3861,26166,26168],{"href":26167},"\u002Flearn\u002Fnuxt-4-7","Learning Nuxt 4.7",". And if you want to meet Nitro v3 without Nuxt in the room, the depot is open: ",[151,26171,26172],{},[3861,26173,24484],{"href":24483},[21,26175,26176],{},"Thank you to Daniel Roe, the Nuxt team, and everyone who tested Nitro v3 on a branch so the rest of us could see the road. 💚",[3728,26178,26179],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":26181},[26182,26185,26186,26187,26188,26189,26190,26197,26198,26199,26200],{"id":24294,"depth":114,"text":24295,"children":26183},[26184],{"id":24358,"depth":111,"text":24359},{"id":24490,"depth":114,"text":24491},{"id":25073,"depth":114,"text":25074},{"id":25175,"depth":114,"text":25176},{"id":25225,"depth":114,"text":25226},{"id":25406,"depth":114,"text":25407},{"id":25607,"depth":114,"text":25608,"children":26191},[26192,26194,26195,26196],{"id":25614,"depth":111,"text":26193},"staticRoutes is free speed",{"id":25684,"depth":111,"text":25685},{"id":25733,"depth":111,"text":25734},{"id":25747,"depth":111,"text":25748},{"id":25806,"depth":114,"text":25807},{"id":25926,"depth":114,"text":25927},{"id":26002,"depth":114,"text":26003},{"id":26140,"depth":114,"text":26141},"2026-11-23T12:00:00","Nuxt 4.7 lets you opt into Nitro v3 before Nuxt 5, adds experimental WebMCP, a unified problems drawer, server-side error boundaries, validated runtime config, and a serious performance pass. A personal note on the release that finally lets us drive the future instead of waiting for it.",{"type":13,"value":26204},[26205,26209,26213,26215],[21,26206,24263,26207],{},[151,26208,24266],{},[21,26210,24269,26211,24273],{},[151,26212,24272],{},[21,26214,24276],{},[21,26216,24279,26217,349,26219,1542,26221,24289],{},[40,26218,24282],{},[40,26220,24285],{},[40,26222,24288],{},"\u002Fblog-nuxt-47-featured.png","\u002Fblog-nuxt-47.png",[24246,26226,26227,24285,23763,26228,24249],"nuxt 4.7","nitro v3","nuxt 5",{},"\u002Fblog\u002Fnuxt-47-the-test-drive",{"title":24257,"description":26202},"blog\u002Fnuxt-47-the-test-drive","ueducM9Tv5Dh0ZQKu7oUJbm6XJP5Erouu8NY3mNCYMs",{"id":26235,"title":26236,"author":26237,"body":26238,"canonical":116,"categories":116,"date":7031,"description":31094,"excerpt":31095,"extension":119,"featuredImg":116,"img":7063,"keywords":31123,"language":3788,"meta":31128,"navigation":130,"ogImage":116,"path":31129,"rating":474,"readTime":532,"seo":31130,"stem":31131,"tag":3793,"__hash__":31132},"blog\u002Fblog\u002Fnuxt-auth-guide.md","Complete Guide to Authentication in Nuxt 4: From Basics to Production",{"name":9,"img":11,"website":327},{"type":13,"value":26239,"toc":31075},[26240,26242,26245,26250,26273,26276,26278,26282,26285,26351,26356,26358,26360,26363,26391,26394,26425,26440,26442,26446,26449,26453,26579,26587,26594,26617,26619,26623,26626,26631,27103,27109,27111,27115,27118,27123,27515,27520,27679,27681,27685,27688,27693,28063,28067,28072,28368,28372,28377,28429,28433,28438,28727,28729,28733,28736,28740,29070,29076,29078,29082,29085,29092,29097,29122,29126,29254,29259,29358,29360,29364,29369,29998,30003,30584,30586,30590,30593,30845,30847,30851,30854,31072],[16,26241,333],{"id":332},[21,26243,26244],{},"Every production application needs authentication. Yet it's one of the most commonly botched parts of web development—poorly implemented auth leads to security vulnerabilities, frustrated users, and late-night debugging sessions.",[21,26246,26247,26248,3070],{},"In this comprehensive guide, we'll cover everything you need to know about authentication in ",[151,26249,23019],{},[383,26251,26252,26255,26258,26261,26264,26267,26270],{},[386,26253,26254],{},"Authentication strategies and when to use each",[386,26256,26257],{},"Implementing session-based auth",[386,26259,26260],{},"JWT authentication flow",[386,26262,26263],{},"OAuth with GitHub and Google",[386,26265,26266],{},"Protecting API routes",[386,26268,26269],{},"Secure password handling",[386,26271,26272],{},"Type-safe auth with TypeScript",[21,26274,26275],{},"Let's build a complete auth system for our BrewStop application.",[16,26277,4373],{"id":4372},[32,26279,26281],{"id":26280},"understanding-authentication-strategies","Understanding Authentication Strategies",[21,26283,26284],{},"Before we write code, let's understand the three main authentication strategies:",[547,26286,26287,26301],{},[550,26288,26289],{},[553,26290,26291,26294,26297,26299],{},[556,26292,26293],{},"Strategy",[556,26295,26296],{},"Best For",[556,26298,18891],{},[556,26300,18907],{},[569,26302,26303,26319,26335],{},[553,26304,26305,26310,26313,26316],{},[574,26306,26307],{},[151,26308,26309],{},"Session",[574,26311,26312],{},"Traditional web apps",[574,26314,26315],{},"Simple, familiar UX",[574,26317,26318],{},"CSRF concerns, server state",[553,26320,26321,26326,26329,26332],{},[574,26322,26323],{},[151,26324,26325],{},"JWT",[574,26327,26328],{},"SPAs, APIs, mobile",[574,26330,26331],{},"Stateless, scalable",[574,26333,26334],{},"Token management complexity",[553,26336,26337,26342,26345,26348],{},[574,26338,26339],{},[151,26340,26341],{},"OAuth",[574,26343,26344],{},"Social login",[574,26346,26347],{},"Frictionless, trusted",[574,26349,26350],{},"Third-party dependency",[25,26352,26353],{"type":363},[21,26354,26355],{},"For most Nuxt applications, a hybrid approach works best: JWT for API authentication, OAuth for social login, and session-like behavior via cookies.",[73,26357],{},[32,26359,10535],{"id":10534},[21,26361,26362],{},"Let's create a fresh Nuxt project with authentication in mind.",[48,26364,26366],{"className":839,"code":26365,"filename":4384,"language":841,"meta":56,"style":56},"npx nuxi@latest init brewstop-auth\ncd brewstop-auth\nnpm install\n",[40,26367,26368,26379,26385],{"__ignoreMap":56},[449,26369,26370,26372,26374,26376],{"class":451,"line":452},[449,26371,8887],{"class":721},[449,26373,4475],{"class":691},[449,26375,4478],{"class":691},[449,26377,26378],{"class":691}," brewstop-auth\n",[449,26380,26381,26383],{"class":451,"line":114},[449,26382,4490],{"class":714},[449,26384,26378],{"class":691},[449,26386,26387,26389],{"class":451,"line":111},[449,26388,3703],{"class":721},[449,26390,4512],{"class":691},[21,26392,26393],{},"We'll need some additional packages:",[48,26395,26397],{"className":839,"code":26396,"filename":4384,"language":841,"meta":56,"style":56},"npm install @sidebase\u002Fnuxt-auth next-auth@beta jose\nnpm install -D @types\u002Fnode\n",[40,26398,26399,26414],{"__ignoreMap":56},[449,26400,26401,26403,26405,26408,26411],{"class":451,"line":452},[449,26402,3703],{"class":721},[449,26404,3706],{"class":691},[449,26406,26407],{"class":691}," @sidebase\u002Fnuxt-auth",[449,26409,26410],{"class":691}," next-auth@beta",[449,26412,26413],{"class":691}," jose\n",[449,26415,26416,26418,26420,26422],{"class":451,"line":114},[449,26417,3703],{"class":721},[449,26419,3706],{"class":691},[449,26421,10594],{"class":714},[449,26423,26424],{"class":691}," @types\u002Fnode\n",[427,26426,26429],{"icon":26427,"title":26428},"🔐","Security First",[21,26430,26431,26432,26435,26436,26439],{},"We're using ",[40,26433,26434],{},"@sidebase\u002Fnuxt-auth"," which provides first-class support for NextAuth.js in Nuxt, and ",[40,26437,26438],{},"jose"," for JWT operations.",[73,26441],{},[32,26443,26445],{"id":26444},"step-2-configure-nuxt-auth","Step 2: Configure Nuxt Auth",[21,26447,26448],{},"Add the auth module to your Nuxt configuration.",[21,26450,4697,26451,3070],{},[40,26452,4619],{},[48,26454,26456],{"className":670,"code":26455,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  modules: [\"@sidebase\u002Fnuxt-auth\"],\n\n  auth: {\n    provider: {\n      type: \"authjs\",\n      defaultProvider: \"credentials\",\n    },\n    globalAppMiddleware: true,\n  },\n\n  runtimeConfig: {\n    authSecret: process.env.AUTH_SECRET,\n    public: {\n      authOrigin: process.env.AUTH_ORIGIN || \"http:\u002F\u002Flocalhost:3000\",\n    },\n  },\n});\n",[40,26457,26458,26468,26478,26482,26487,26492,26502,26512,26516,26525,26529,26533,26537,26547,26551,26567,26571,26575],{"__ignoreMap":56},[449,26459,26460,26462,26464,26466],{"class":451,"line":452},[449,26461,4629],{"class":680},[449,26463,4632],{"class":680},[449,26465,4635],{"class":721},[449,26467,1391],{"class":684},[449,26469,26470,26473,26476],{"class":451,"line":114},[449,26471,26472],{"class":684},"  modules: [",[449,26474,26475],{"class":691},"\"@sidebase\u002Fnuxt-auth\"",[449,26477,1469],{"class":684},[449,26479,26480],{"class":451,"line":111},[449,26481,700],{"emptyLinePlaceholder":130},[449,26483,26484],{"class":451,"line":468},[449,26485,26486],{"class":684},"  auth: {\n",[449,26488,26489],{"class":451,"line":474},[449,26490,26491],{"class":684},"    provider: {\n",[449,26493,26494,26497,26500],{"class":451,"line":480},[449,26495,26496],{"class":684},"      type: ",[449,26498,26499],{"class":691},"\"authjs\"",[449,26501,779],{"class":684},[449,26503,26504,26507,26510],{"class":451,"line":486},[449,26505,26506],{"class":684},"      defaultProvider: ",[449,26508,26509],{"class":691},"\"credentials\"",[449,26511,779],{"class":684},[449,26513,26514],{"class":451,"line":492},[449,26515,1458],{"class":684},[449,26517,26518,26521,26523],{"class":451,"line":498},[449,26519,26520],{"class":684},"    globalAppMiddleware: ",[449,26522,2169],{"class":714},[449,26524,779],{"class":684},[449,26526,26527],{"class":451,"line":133},[449,26528,1474],{"class":684},[449,26530,26531],{"class":451,"line":509},[449,26532,700],{"emptyLinePlaceholder":130},[449,26534,26535],{"class":451,"line":318},[449,26536,15396],{"class":684},[449,26538,26539,26542,26545],{"class":451,"line":520},[449,26540,26541],{"class":684},"    authSecret: process.env.",[449,26543,26544],{"class":714},"AUTH_SECRET",[449,26546,779],{"class":684},[449,26548,26549],{"class":451,"line":526},[449,26550,15401],{"class":684},[449,26552,26553,26556,26559,26562,26565],{"class":451,"line":532},[449,26554,26555],{"class":684},"      authOrigin: process.env.",[449,26557,26558],{"class":714},"AUTH_ORIGIN",[449,26560,26561],{"class":680}," ||",[449,26563,26564],{"class":691}," \"http:\u002F\u002Flocalhost:3000\"",[449,26566,779],{"class":684},[449,26568,26569],{"class":451,"line":2790},[449,26570,1458],{"class":684},[449,26572,26573],{"class":451,"line":3511},[449,26574,1474],{"class":684},[449,26576,26577],{"class":451,"line":3526},[449,26578,784],{"class":684},[25,26580,26581],{"type":27},[21,26582,26583,26584,26586],{},"Never commit your ",[40,26585,26544],{},". Use environment variables for all secrets.",[21,26588,26589,26590,26593],{},"Create a ",[40,26591,26592],{},".env"," file:",[48,26595,26597],{"className":839,"code":26596,"filename":26592,"language":841,"meta":56,"style":56},"AUTH_SECRET=your-super-secret-key-change-in-production\nAUTH_ORIGIN=http:\u002F\u002Flocalhost:3000\n",[40,26598,26599,26608],{"__ignoreMap":56},[449,26600,26601,26603,26605],{"class":451,"line":452},[449,26602,26544],{"class":684},[449,26604,5014],{"class":680},[449,26606,26607],{"class":691},"your-super-secret-key-change-in-production\n",[449,26609,26610,26612,26614],{"class":451,"line":114},[449,26611,26558],{"class":684},[449,26613,5014],{"class":680},[449,26615,26616],{"class":691},"http:\u002F\u002Flocalhost:3000\n",[73,26618],{},[32,26620,26622],{"id":26621},"step-3-create-the-authentication-backend","Step 3: Create the Authentication Backend",[21,26624,26625],{},"We'll build a credentials-based auth system with proper password hashing.",[21,26627,4697,26628,3070],{},[40,26629,26630],{},"server\u002Futils\u002Fauth.ts",[48,26632,26634],{"className":670,"code":26633,"filename":26630,"language":673,"meta":56,"style":56},"import { SignJWT, jwtVerify } from \"jose\";\nimport { hash, verify } from \"@node-rs\u002Fargon2\";\n\nconst secret = new TextEncoder().encode(process.env.AUTH_SECRET || \"fallback-secret\");\n\nexport async function hashPassword(password: string): Promise\u003Cstring> {\n  return hash(password, {\n    memoryCost: 19456,\n    timeCost: 2,\n    outputLen: 32,\n    parallelism: 1,\n  });\n}\n\nexport async function verifyPassword(hash: string, password: string): Promise\u003Cboolean> {\n  return verify(hash, password);\n}\n\nexport async function createToken(userId: string, email: string): Promise\u003Cstring> {\n  return new SignJWT({ userId, email })\n    .setProtectedHeader({ alg: \"HS256\" })\n    .setIssuedAt()\n    .setExpirationTime(\"7d\")\n    .sign(secret);\n}\n\nexport async function verifyToken(\n  token: string,\n): Promise\u003C{ userId: string; email: string } | null> {\n  try {\n    const { payload } = await jwtVerify(token, secret);\n    return payload as { userId: string; email: string };\n  } catch {\n    return null;\n  }\n}\n",[40,26635,26636,26650,26664,26668,26699,26703,26736,26746,26756,26765,26775,26784,26788,26792,26796,26836,26846,26850,26854,26895,26907,26923,26932,26946,26956,26960,26964,26977,26988,27023,27030,27051,27078,27087,27095,27099],{"__ignoreMap":56},[449,26637,26638,26640,26643,26645,26648],{"class":451,"line":452},[449,26639,681],{"class":680},[449,26641,26642],{"class":684}," { SignJWT, jwtVerify } ",[449,26644,688],{"class":680},[449,26646,26647],{"class":691}," \"jose\"",[449,26649,695],{"class":684},[449,26651,26652,26654,26657,26659,26662],{"class":451,"line":114},[449,26653,681],{"class":680},[449,26655,26656],{"class":684}," { hash, verify } ",[449,26658,688],{"class":680},[449,26660,26661],{"class":691}," \"@node-rs\u002Fargon2\"",[449,26663,695],{"class":684},[449,26665,26666],{"class":451,"line":111},[449,26667,700],{"emptyLinePlaceholder":130},[449,26669,26670,26672,26675,26677,26679,26682,26684,26687,26690,26692,26694,26697],{"class":451,"line":468},[449,26671,711],{"class":680},[449,26673,26674],{"class":714}," secret",[449,26676,718],{"class":680},[449,26678,1343],{"class":680},[449,26680,26681],{"class":721}," TextEncoder",[449,26683,5237],{"class":684},[449,26685,26686],{"class":721},"encode",[449,26688,26689],{"class":684},"(process.env.",[449,26691,26544],{"class":714},[449,26693,26561],{"class":680},[449,26695,26696],{"class":691}," \"fallback-secret\"",[449,26698,740],{"class":684},[449,26700,26701],{"class":451,"line":474},[449,26702,700],{"emptyLinePlaceholder":130},[449,26704,26705,26707,26709,26711,26714,26716,26719,26721,26723,26725,26727,26729,26731,26733],{"class":451,"line":480},[449,26706,4629],{"class":680},[449,26708,5597],{"class":680},[449,26710,5433],{"class":680},[449,26712,26713],{"class":721}," hashPassword",[449,26715,725],{"class":684},[449,26717,26718],{"class":1491},"password",[449,26720,3070],{"class":680},[449,26722,6081],{"class":714},[449,26724,827],{"class":684},[449,26726,3070],{"class":680},[449,26728,5161],{"class":721},[449,26730,5547],{"class":684},[449,26732,25474],{"class":714},[449,26734,26735],{"class":684},"> {\n",[449,26737,26738,26740,26743],{"class":451,"line":486},[449,26739,4726],{"class":680},[449,26741,26742],{"class":721}," hash",[449,26744,26745],{"class":684},"(password, {\n",[449,26747,26748,26751,26754],{"class":451,"line":492},[449,26749,26750],{"class":684},"    memoryCost: ",[449,26752,26753],{"class":714},"19456",[449,26755,779],{"class":684},[449,26757,26758,26761,26763],{"class":451,"line":498},[449,26759,26760],{"class":684},"    timeCost: ",[449,26762,4826],{"class":714},[449,26764,779],{"class":684},[449,26766,26767,26770,26773],{"class":451,"line":133},[449,26768,26769],{"class":684},"    outputLen: ",[449,26771,26772],{"class":714},"32",[449,26774,779],{"class":684},[449,26776,26777,26780,26782],{"class":451,"line":509},[449,26778,26779],{"class":684},"    parallelism: ",[449,26781,4798],{"class":714},[449,26783,779],{"class":684},[449,26785,26786],{"class":451,"line":318},[449,26787,13321],{"class":684},[449,26789,26790],{"class":451,"line":520},[449,26791,4604],{"class":684},[449,26793,26794],{"class":451,"line":526},[449,26795,700],{"emptyLinePlaceholder":130},[449,26797,26798,26800,26802,26804,26807,26809,26812,26814,26816,26818,26820,26822,26824,26826,26828,26830,26832,26834],{"class":451,"line":532},[449,26799,4629],{"class":680},[449,26801,5597],{"class":680},[449,26803,5433],{"class":680},[449,26805,26806],{"class":721}," verifyPassword",[449,26808,725],{"class":684},[449,26810,26811],{"class":1491},"hash",[449,26813,3070],{"class":680},[449,26815,6081],{"class":714},[449,26817,349],{"class":684},[449,26819,26718],{"class":1491},[449,26821,3070],{"class":680},[449,26823,6081],{"class":714},[449,26825,827],{"class":684},[449,26827,3070],{"class":680},[449,26829,5161],{"class":721},[449,26831,5547],{"class":684},[449,26833,25526],{"class":714},[449,26835,26735],{"class":684},[449,26837,26838,26840,26843],{"class":451,"line":2790},[449,26839,4726],{"class":680},[449,26841,26842],{"class":721}," verify",[449,26844,26845],{"class":684},"(hash, password);\n",[449,26847,26848],{"class":451,"line":3511},[449,26849,4604],{"class":684},[449,26851,26852],{"class":451,"line":3526},[449,26853,700],{"emptyLinePlaceholder":130},[449,26855,26856,26858,26860,26862,26865,26867,26870,26872,26874,26876,26879,26881,26883,26885,26887,26889,26891,26893],{"class":451,"line":3531},[449,26857,4629],{"class":680},[449,26859,5597],{"class":680},[449,26861,5433],{"class":680},[449,26863,26864],{"class":721}," createToken",[449,26866,725],{"class":684},[449,26868,26869],{"class":1491},"userId",[449,26871,3070],{"class":680},[449,26873,6081],{"class":714},[449,26875,349],{"class":684},[449,26877,26878],{"class":1491},"email",[449,26880,3070],{"class":680},[449,26882,6081],{"class":714},[449,26884,827],{"class":684},[449,26886,3070],{"class":680},[449,26888,5161],{"class":721},[449,26890,5547],{"class":684},[449,26892,25474],{"class":714},[449,26894,26735],{"class":684},[449,26896,26897,26899,26901,26904],{"class":451,"line":3536},[449,26898,4726],{"class":680},[449,26900,1343],{"class":680},[449,26902,26903],{"class":721}," SignJWT",[449,26905,26906],{"class":684},"({ userId, email })\n",[449,26908,26909,26911,26914,26917,26920],{"class":451,"line":4009},[449,26910,11190],{"class":684},[449,26912,26913],{"class":721},"setProtectedHeader",[449,26915,26916],{"class":684},"({ alg: ",[449,26918,26919],{"class":691},"\"HS256\"",[449,26921,26922],{"class":684}," })\n",[449,26924,26925,26927,26930],{"class":451,"line":4015},[449,26926,11190],{"class":684},[449,26928,26929],{"class":721},"setIssuedAt",[449,26931,11195],{"class":684},[449,26933,26934,26936,26939,26941,26944],{"class":451,"line":4021},[449,26935,11190],{"class":684},[449,26937,26938],{"class":721},"setExpirationTime",[449,26940,725],{"class":684},[449,26942,26943],{"class":691},"\"7d\"",[449,26945,11185],{"class":684},[449,26947,26948,26950,26953],{"class":451,"line":4027},[449,26949,11190],{"class":684},[449,26951,26952],{"class":721},"sign",[449,26954,26955],{"class":684},"(secret);\n",[449,26957,26958],{"class":451,"line":4032},[449,26959,4604],{"class":684},[449,26961,26962],{"class":451,"line":4038},[449,26963,700],{"emptyLinePlaceholder":130},[449,26965,26966,26968,26970,26972,26975],{"class":451,"line":4044},[449,26967,4629],{"class":680},[449,26969,5597],{"class":680},[449,26971,5433],{"class":680},[449,26973,26974],{"class":721}," verifyToken",[449,26976,5567],{"class":684},[449,26978,26979,26982,26984,26986],{"class":451,"line":4049},[449,26980,26981],{"class":1491},"  token",[449,26983,3070],{"class":680},[449,26985,6081],{"class":714},[449,26987,779],{"class":684},[449,26989,26990,26992,26994,26996,26998,27000,27002,27004,27007,27009,27011,27013,27015,27018,27021],{"class":451,"line":4054},[449,26991,827],{"class":684},[449,26993,3070],{"class":680},[449,26995,5161],{"class":721},[449,26997,23909],{"class":684},[449,26999,26869],{"class":1491},[449,27001,3070],{"class":680},[449,27003,6081],{"class":714},[449,27005,27006],{"class":684},"; ",[449,27008,26878],{"class":1491},[449,27010,3070],{"class":680},[449,27012,6081],{"class":714},[449,27014,21656],{"class":684},[449,27016,27017],{"class":680},"|",[449,27019,27020],{"class":714}," null",[449,27022,26735],{"class":684},[449,27024,27025,27028],{"class":451,"line":4059},[449,27026,27027],{"class":680},"  try",[449,27029,1501],{"class":684},[449,27031,27032,27034,27036,27039,27041,27043,27045,27048],{"class":451,"line":4065},[449,27033,12985],{"class":680},[449,27035,14227],{"class":684},[449,27037,27038],{"class":714},"payload",[449,27040,21656],{"class":684},[449,27042,5014],{"class":680},[449,27044,1654],{"class":680},[449,27046,27047],{"class":721}," jwtVerify",[449,27049,27050],{"class":684},"(token, secret);\n",[449,27052,27053,27055,27058,27060,27062,27064,27066,27068,27070,27072,27074,27076],{"class":451,"line":4070},[449,27054,1506],{"class":680},[449,27056,27057],{"class":684}," payload ",[449,27059,5066],{"class":680},[449,27061,14227],{"class":684},[449,27063,26869],{"class":1491},[449,27065,3070],{"class":680},[449,27067,6081],{"class":714},[449,27069,27006],{"class":684},[449,27071,26878],{"class":1491},[449,27073,3070],{"class":680},[449,27075,6081],{"class":714},[449,27077,1520],{"class":684},[449,27079,27080,27083,27085],{"class":451,"line":4075},[449,27081,27082],{"class":684},"  } ",[449,27084,5746],{"class":680},[449,27086,1501],{"class":684},[449,27088,27089,27091,27093],{"class":451,"line":4081},[449,27090,1506],{"class":680},[449,27092,27020],{"class":714},[449,27094,695],{"class":684},[449,27096,27097],{"class":451,"line":4086},[449,27098,4599],{"class":684},[449,27100,27101],{"class":451,"line":4092},[449,27102,4604],{"class":684},[427,27104,27106],{"icon":11370,"title":27105},"Password Security",[21,27107,27108],{},"We're using Argon2id—the winner of the Password Hashing Competition. It's memory-hard and resistant to GPU attacks.",[73,27110],{},[32,27112,27114],{"id":27113},"step-4-create-users-database","Step 4: Create Users Database",[21,27116,27117],{},"For simplicity, we'll use a file-based approach (replace with Drizzle\u002FPrisma in production).",[21,27119,4697,27120,3070],{},[40,27121,27122],{},"server\u002Futils\u002Fdb.ts",[48,27124,27126],{"className":670,"code":27125,"filename":27122,"language":673,"meta":56,"style":56},"import { db } from \".\u002Fdb\";\nimport { users } from \".\u002Fschema\";\nimport { eq } from \"drizzle-orm\";\nimport { hashPassword, verifyPassword } from \".\u002Fauth\";\n\ninterface CreateUserInput {\n  email: string;\n  password: string;\n  name: string;\n}\n\nexport async function createUser(input: CreateUserInput) {\n  const hashedPassword = await hashPassword(input.password);\n\n  await db.insert(users).values({\n    id: crypto.randomUUID(),\n    email: input.email,\n    password: hashedPassword,\n    name: input.name,\n  });\n}\n\nexport async function findUserByEmail(email: string) {\n  return db.select().from(users).where(eq(users.email, email)).get();\n}\n\nexport async function validateUserCredentials(email: string, password: string) {\n  const user = await findUserByEmail(email);\n\n  if (!user) {\n    return null;\n  }\n\n  const isValid = await verifyPassword(user.password, password);\n\n  if (!isValid) {\n    return null;\n  }\n\n  return { id: user.id, email: user.email, name: user.name };\n}\n",[40,27127,27128,27141,27154,27166,27180,27184,27193,27204,27215,27225,27229,27233,27255,27271,27275,27290,27298,27303,27308,27313,27317,27321,27325,27346,27373,27377,27381,27410,27426,27430,27441,27449,27453,27457,27473,27477,27488,27496,27500,27504,27511],{"__ignoreMap":56},[449,27129,27130,27132,27134,27136,27139],{"class":451,"line":452},[449,27131,681],{"class":680},[449,27133,11703],{"class":684},[449,27135,688],{"class":680},[449,27137,27138],{"class":691}," \".\u002Fdb\"",[449,27140,695],{"class":684},[449,27142,27143,27145,27148,27150,27152],{"class":451,"line":114},[449,27144,681],{"class":680},[449,27146,27147],{"class":684}," { users } ",[449,27149,688],{"class":680},[449,27151,11439],{"class":691},[449,27153,695],{"class":684},[449,27155,27156,27158,27160,27162,27164],{"class":451,"line":111},[449,27157,681],{"class":680},[449,27159,12758],{"class":684},[449,27161,688],{"class":680},[449,27163,10771],{"class":691},[449,27165,695],{"class":684},[449,27167,27168,27170,27173,27175,27178],{"class":451,"line":468},[449,27169,681],{"class":680},[449,27171,27172],{"class":684}," { hashPassword, verifyPassword } ",[449,27174,688],{"class":680},[449,27176,27177],{"class":691}," \".\u002Fauth\"",[449,27179,695],{"class":684},[449,27181,27182],{"class":451,"line":474},[449,27183,700],{"emptyLinePlaceholder":130},[449,27185,27186,27188,27191],{"class":451,"line":480},[449,27187,4960],{"class":680},[449,27189,27190],{"class":721}," CreateUserInput",[449,27192,1501],{"class":684},[449,27194,27195,27198,27200,27202],{"class":451,"line":486},[449,27196,27197],{"class":1491},"  email",[449,27199,3070],{"class":680},[449,27201,6081],{"class":714},[449,27203,695],{"class":684},[449,27205,27206,27209,27211,27213],{"class":451,"line":492},[449,27207,27208],{"class":1491},"  password",[449,27210,3070],{"class":680},[449,27212,6081],{"class":714},[449,27214,695],{"class":684},[449,27216,27217,27219,27221,27223],{"class":451,"line":498},[449,27218,6076],{"class":1491},[449,27220,3070],{"class":680},[449,27222,6081],{"class":714},[449,27224,695],{"class":684},[449,27226,27227],{"class":451,"line":133},[449,27228,4604],{"class":684},[449,27230,27231],{"class":451,"line":509},[449,27232,700],{"emptyLinePlaceholder":130},[449,27234,27235,27237,27239,27241,27244,27246,27249,27251,27253],{"class":451,"line":318},[449,27236,4629],{"class":680},[449,27238,5597],{"class":680},[449,27240,5433],{"class":680},[449,27242,27243],{"class":721}," createUser",[449,27245,725],{"class":684},[449,27247,27248],{"class":1491},"input",[449,27250,3070],{"class":680},[449,27252,27190],{"class":721},[449,27254,3417],{"class":684},[449,27256,27257,27259,27262,27264,27266,27268],{"class":451,"line":520},[449,27258,5048],{"class":680},[449,27260,27261],{"class":714}," hashedPassword",[449,27263,718],{"class":680},[449,27265,1654],{"class":680},[449,27267,26713],{"class":721},[449,27269,27270],{"class":684},"(input.password);\n",[449,27272,27273],{"class":451,"line":526},[449,27274,700],{"emptyLinePlaceholder":130},[449,27276,27277,27279,27281,27283,27286,27288],{"class":451,"line":532},[449,27278,2099],{"class":680},[449,27280,12255],{"class":684},[449,27282,12306],{"class":721},[449,27284,27285],{"class":684},"(users).",[449,27287,12311],{"class":721},[449,27289,1391],{"class":684},[449,27291,27292,27294,27296],{"class":451,"line":2790},[449,27293,5203],{"class":684},[449,27295,5206],{"class":721},[449,27297,1624],{"class":684},[449,27299,27300],{"class":451,"line":3511},[449,27301,27302],{"class":684},"    email: input.email,\n",[449,27304,27305],{"class":451,"line":3526},[449,27306,27307],{"class":684},"    password: hashedPassword,\n",[449,27309,27310],{"class":451,"line":3531},[449,27311,27312],{"class":684},"    name: input.name,\n",[449,27314,27315],{"class":451,"line":3536},[449,27316,13321],{"class":684},[449,27318,27319],{"class":451,"line":4009},[449,27320,4604],{"class":684},[449,27322,27323],{"class":451,"line":4015},[449,27324,700],{"emptyLinePlaceholder":130},[449,27326,27327,27329,27331,27333,27336,27338,27340,27342,27344],{"class":451,"line":4021},[449,27328,4629],{"class":680},[449,27330,5597],{"class":680},[449,27332,5433],{"class":680},[449,27334,27335],{"class":721}," findUserByEmail",[449,27337,725],{"class":684},[449,27339,26878],{"class":1491},[449,27341,3070],{"class":680},[449,27343,6081],{"class":714},[449,27345,3417],{"class":684},[449,27347,27348,27350,27352,27354,27356,27358,27360,27362,27364,27366,27369,27371],{"class":451,"line":4027},[449,27349,4726],{"class":680},[449,27351,12255],{"class":684},[449,27353,12452],{"class":721},[449,27355,5237],{"class":684},[449,27357,688],{"class":721},[449,27359,27285],{"class":684},[449,27361,12461],{"class":721},[449,27363,725],{"class":684},[449,27365,13024],{"class":721},[449,27367,27368],{"class":684},"(users.email, email)).",[449,27370,12644],{"class":721},[449,27372,1322],{"class":684},[449,27374,27375],{"class":451,"line":4032},[449,27376,4604],{"class":684},[449,27378,27379],{"class":451,"line":4038},[449,27380,700],{"emptyLinePlaceholder":130},[449,27382,27383,27385,27387,27389,27392,27394,27396,27398,27400,27402,27404,27406,27408],{"class":451,"line":4044},[449,27384,4629],{"class":680},[449,27386,5597],{"class":680},[449,27388,5433],{"class":680},[449,27390,27391],{"class":721}," validateUserCredentials",[449,27393,725],{"class":684},[449,27395,26878],{"class":1491},[449,27397,3070],{"class":680},[449,27399,6081],{"class":714},[449,27401,349],{"class":684},[449,27403,26718],{"class":1491},[449,27405,3070],{"class":680},[449,27407,6081],{"class":714},[449,27409,3417],{"class":684},[449,27411,27412,27414,27417,27419,27421,27423],{"class":451,"line":4049},[449,27413,5048],{"class":680},[449,27415,27416],{"class":714}," user",[449,27418,718],{"class":680},[449,27420,1654],{"class":680},[449,27422,27335],{"class":721},[449,27424,27425],{"class":684},"(email);\n",[449,27427,27428],{"class":451,"line":4054},[449,27429,700],{"emptyLinePlaceholder":130},[449,27431,27432,27434,27436,27438],{"class":451,"line":4059},[449,27433,5080],{"class":680},[449,27435,1913],{"class":684},[449,27437,5085],{"class":680},[449,27439,27440],{"class":684},"user) {\n",[449,27442,27443,27445,27447],{"class":451,"line":4065},[449,27444,1506],{"class":680},[449,27446,27020],{"class":714},[449,27448,695],{"class":684},[449,27450,27451],{"class":451,"line":4070},[449,27452,4599],{"class":684},[449,27454,27455],{"class":451,"line":4075},[449,27456,700],{"emptyLinePlaceholder":130},[449,27458,27459,27461,27464,27466,27468,27470],{"class":451,"line":4081},[449,27460,5048],{"class":680},[449,27462,27463],{"class":714}," isValid",[449,27465,718],{"class":680},[449,27467,1654],{"class":680},[449,27469,26806],{"class":721},[449,27471,27472],{"class":684},"(user.password, password);\n",[449,27474,27475],{"class":451,"line":4086},[449,27476,700],{"emptyLinePlaceholder":130},[449,27478,27479,27481,27483,27485],{"class":451,"line":4092},[449,27480,5080],{"class":680},[449,27482,1913],{"class":684},[449,27484,5085],{"class":680},[449,27486,27487],{"class":684},"isValid) {\n",[449,27489,27490,27492,27494],{"class":451,"line":4098},[449,27491,1506],{"class":680},[449,27493,27020],{"class":714},[449,27495,695],{"class":684},[449,27497,27498],{"class":451,"line":4104},[449,27499,4599],{"class":684},[449,27501,27502],{"class":451,"line":4110},[449,27503,700],{"emptyLinePlaceholder":130},[449,27505,27506,27508],{"class":451,"line":5782},[449,27507,4726],{"class":680},[449,27509,27510],{"class":684}," { id: user.id, email: user.email, name: user.name };\n",[449,27512,27513],{"class":451,"line":5788},[449,27514,4604],{"class":684},[21,27516,27517,27518,3070],{},"Create the users schema in ",[40,27519,10740],{},[48,27521,27523],{"className":670,"code":27522,"filename":10740,"language":673,"meta":56,"style":56},"import { sqliteTable, text, integer } from \"drizzle-orm\u002Fsqlite-core\";\n\nexport const users = sqliteTable(\"users\", {\n  id: text(\"id\").primaryKey(),\n  email: text(\"email\").notNull().unique(),\n  password: text(\"password\").notNull(),\n  name: text(\"name\").notNull(),\n  createdAt: integer(\"created_at\", { mode: \"timestamp\" }).notNull(),\n});\n\nexport type User = typeof users.$inferSelect;\n",[40,27524,27525,27538,27542,27562,27578,27601,27619,27635,27655,27659,27663],{"__ignoreMap":56},[449,27526,27527,27529,27532,27534,27536],{"class":451,"line":452},[449,27528,681],{"class":680},[449,27530,27531],{"class":684}," { sqliteTable, text, integer } ",[449,27533,688],{"class":680},[449,27535,10757],{"class":691},[449,27537,695],{"class":684},[449,27539,27540],{"class":451,"line":114},[449,27541,700],{"emptyLinePlaceholder":130},[449,27543,27544,27546,27548,27551,27553,27555,27557,27560],{"class":451,"line":111},[449,27545,4629],{"class":680},[449,27547,10789],{"class":680},[449,27549,27550],{"class":714}," users",[449,27552,718],{"class":680},[449,27554,10797],{"class":721},[449,27556,725],{"class":684},[449,27558,27559],{"class":691},"\"users\"",[449,27561,768],{"class":684},[449,27563,27564,27566,27568,27570,27572,27574,27576],{"class":451,"line":468},[449,27565,10809],{"class":684},[449,27567,53],{"class":721},[449,27569,725],{"class":684},[449,27571,10816],{"class":691},[449,27573,374],{"class":684},[449,27575,10821],{"class":721},[449,27577,1624],{"class":684},[449,27579,27580,27583,27585,27587,27590,27592,27594,27596,27599],{"class":451,"line":474},[449,27581,27582],{"class":684},"  email: ",[449,27584,53],{"class":721},[449,27586,725],{"class":684},[449,27588,27589],{"class":691},"\"email\"",[449,27591,374],{"class":684},[449,27593,10839],{"class":721},[449,27595,5237],{"class":684},[449,27597,27598],{"class":721},"unique",[449,27600,1624],{"class":684},[449,27602,27603,27606,27608,27610,27613,27615,27617],{"class":451,"line":480},[449,27604,27605],{"class":684},"  password: ",[449,27607,53],{"class":721},[449,27609,725],{"class":684},[449,27611,27612],{"class":691},"\"password\"",[449,27614,374],{"class":684},[449,27616,10839],{"class":721},[449,27618,1624],{"class":684},[449,27620,27621,27623,27625,27627,27629,27631,27633],{"class":451,"line":486},[449,27622,1396],{"class":684},[449,27624,53],{"class":721},[449,27626,725],{"class":684},[449,27628,10834],{"class":691},[449,27630,374],{"class":684},[449,27632,10839],{"class":721},[449,27634,1624],{"class":684},[449,27636,27637,27639,27641,27643,27645,27647,27649,27651,27653],{"class":451,"line":492},[449,27638,10931],{"class":684},[449,27640,10903],{"class":721},[449,27642,725],{"class":684},[449,27644,10938],{"class":691},[449,27646,10911],{"class":684},[449,27648,10943],{"class":691},[449,27650,10917],{"class":684},[449,27652,10839],{"class":721},[449,27654,1624],{"class":684},[449,27656,27657],{"class":451,"line":498},[449,27658,784],{"class":684},[449,27660,27661],{"class":451,"line":133},[449,27662,700],{"emptyLinePlaceholder":130},[449,27664,27665,27667,27669,27672,27674,27676],{"class":451,"line":509},[449,27666,4629],{"class":680},[449,27668,11308],{"class":680},[449,27670,27671],{"class":721}," User",[449,27673,718],{"class":680},[449,27675,11316],{"class":680},[449,27677,27678],{"class":684}," users.$inferSelect;\n",[73,27680],{},[32,27682,27684],{"id":27683},"step-5-create-authentication-api-routes","Step 5: Create Authentication API Routes",[2808,27686,27687],{"id":1356},"Register",[21,27689,4697,27690,3070],{},[40,27691,27692],{},"server\u002Fapi\u002Fauth\u002Fregister.post.ts",[48,27694,27696],{"className":670,"code":27695,"filename":27692,"language":673,"meta":56,"style":56},"import { createUser, findUserByEmail } from \"..\u002F..\u002Futils\u002Fdb\";\nimport { createToken } from \"..\u002F..\u002Futils\u002Fauth\";\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n\n  \u002F\u002F Validate input\n  if (!body.email || !body.password || !body.name) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Email, password, and name are required\",\n    });\n  }\n\n  \u002F\u002F Check if user exists\n  const existing = await findUserByEmail(body.email);\n\n  if (existing) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"User already exists\",\n    });\n  }\n\n  \u002F\u002F Create user\n  await createUser({\n    email: body.email,\n    password: body.password,\n    name: body.name,\n  });\n\n  \u002F\u002F Generate token\n  const token = await createToken(body.email, body.email);\n\n  setCookie(event, \"auth_token\", token, {\n    httpOnly: true,\n    secure: process.env.NODE_ENV === \"production\",\n    sameSite: \"lax\",\n    maxAge: 60 * 60 * 24 * 7, \u002F\u002F 7 days\n  });\n\n  return { success: true, email: body.email };\n});\n",[40,27697,27698,27712,27726,27730,27752,27766,27770,27774,27799,27807,27815,27824,27828,27832,27836,27841,27857,27861,27868,27876,27884,27893,27897,27901,27905,27910,27918,27923,27928,27933,27937,27941,27946,27962,27966,27979,27988,28003,28013,28039,28043,28047,28059],{"__ignoreMap":56},[449,27699,27700,27702,27705,27707,27710],{"class":451,"line":452},[449,27701,681],{"class":680},[449,27703,27704],{"class":684}," { createUser, findUserByEmail } ",[449,27706,688],{"class":680},[449,27708,27709],{"class":691}," \"..\u002F..\u002Futils\u002Fdb\"",[449,27711,695],{"class":684},[449,27713,27714,27716,27719,27721,27724],{"class":451,"line":114},[449,27715,681],{"class":680},[449,27717,27718],{"class":684}," { createToken } ",[449,27720,688],{"class":680},[449,27722,27723],{"class":691}," \"..\u002F..\u002Futils\u002Fauth\"",[449,27725,695],{"class":684},[449,27727,27728],{"class":451,"line":111},[449,27729,700],{"emptyLinePlaceholder":130},[449,27731,27732,27734,27736,27738,27740,27742,27744,27746,27748,27750],{"class":451,"line":468},[449,27733,4629],{"class":680},[449,27735,4632],{"class":680},[449,27737,4714],{"class":721},[449,27739,725],{"class":684},[449,27741,1485],{"class":680},[449,27743,1913],{"class":684},[449,27745,2991],{"class":1491},[449,27747,1758],{"class":684},[449,27749,1498],{"class":680},[449,27751,1501],{"class":684},[449,27753,27754,27756,27758,27760,27762,27764],{"class":451,"line":474},[449,27755,5048],{"class":680},[449,27757,5051],{"class":714},[449,27759,718],{"class":680},[449,27761,1654],{"class":680},[449,27763,5060],{"class":721},[449,27765,12843],{"class":684},[449,27767,27768],{"class":451,"line":480},[449,27769,700],{"emptyLinePlaceholder":130},[449,27771,27772],{"class":451,"line":486},[449,27773,12852],{"class":705},[449,27775,27776,27778,27780,27782,27785,27787,27789,27792,27794,27796],{"class":451,"line":492},[449,27777,5080],{"class":680},[449,27779,1913],{"class":684},[449,27781,5085],{"class":680},[449,27783,27784],{"class":684},"body.email ",[449,27786,5091],{"class":680},[449,27788,12868],{"class":680},[449,27790,27791],{"class":684},"body.password ",[449,27793,5091],{"class":680},[449,27795,12868],{"class":680},[449,27797,27798],{"class":684},"body.name) {\n",[449,27800,27801,27803,27805],{"class":451,"line":498},[449,27802,5110],{"class":680},[449,27804,5113],{"class":721},[449,27806,1391],{"class":684},[449,27808,27809,27811,27813],{"class":451,"line":133},[449,27810,5120],{"class":684},[449,27812,5123],{"class":714},[449,27814,779],{"class":684},[449,27816,27817,27819,27822],{"class":451,"line":509},[449,27818,5130],{"class":684},[449,27820,27821],{"class":691},"\"Email, password, and name are required\"",[449,27823,779],{"class":684},[449,27825,27826],{"class":451,"line":318},[449,27827,3484],{"class":684},[449,27829,27830],{"class":451,"line":520},[449,27831,4599],{"class":684},[449,27833,27834],{"class":451,"line":526},[449,27835,700],{"emptyLinePlaceholder":130},[449,27837,27838],{"class":451,"line":532},[449,27839,27840],{"class":705},"  \u002F\u002F Check if user exists\n",[449,27842,27843,27845,27848,27850,27852,27854],{"class":451,"line":2790},[449,27844,5048],{"class":680},[449,27846,27847],{"class":714}," existing",[449,27849,718],{"class":680},[449,27851,1654],{"class":680},[449,27853,27335],{"class":721},[449,27855,27856],{"class":684},"(body.email);\n",[449,27858,27859],{"class":451,"line":3511},[449,27860,700],{"emptyLinePlaceholder":130},[449,27862,27863,27865],{"class":451,"line":3526},[449,27864,5080],{"class":680},[449,27866,27867],{"class":684}," (existing) {\n",[449,27869,27870,27872,27874],{"class":451,"line":3531},[449,27871,5110],{"class":680},[449,27873,5113],{"class":721},[449,27875,1391],{"class":684},[449,27877,27878,27880,27882],{"class":451,"line":3536},[449,27879,5120],{"class":684},[449,27881,5123],{"class":714},[449,27883,779],{"class":684},[449,27885,27886,27888,27891],{"class":451,"line":4009},[449,27887,5130],{"class":684},[449,27889,27890],{"class":691},"\"User already exists\"",[449,27892,779],{"class":684},[449,27894,27895],{"class":451,"line":4015},[449,27896,3484],{"class":684},[449,27898,27899],{"class":451,"line":4021},[449,27900,4599],{"class":684},[449,27902,27903],{"class":451,"line":4027},[449,27904,700],{"emptyLinePlaceholder":130},[449,27906,27907],{"class":451,"line":4032},[449,27908,27909],{"class":705},"  \u002F\u002F Create user\n",[449,27911,27912,27914,27916],{"class":451,"line":4038},[449,27913,2099],{"class":680},[449,27915,27243],{"class":721},[449,27917,1391],{"class":684},[449,27919,27920],{"class":451,"line":4044},[449,27921,27922],{"class":684},"    email: body.email,\n",[449,27924,27925],{"class":451,"line":4049},[449,27926,27927],{"class":684},"    password: body.password,\n",[449,27929,27930],{"class":451,"line":4054},[449,27931,27932],{"class":684},"    name: body.name,\n",[449,27934,27935],{"class":451,"line":4059},[449,27936,13321],{"class":684},[449,27938,27939],{"class":451,"line":4065},[449,27940,700],{"emptyLinePlaceholder":130},[449,27942,27943],{"class":451,"line":4070},[449,27944,27945],{"class":705},"  \u002F\u002F Generate token\n",[449,27947,27948,27950,27953,27955,27957,27959],{"class":451,"line":4075},[449,27949,5048],{"class":680},[449,27951,27952],{"class":714}," token",[449,27954,718],{"class":680},[449,27956,1654],{"class":680},[449,27958,26864],{"class":721},[449,27960,27961],{"class":684},"(body.email, body.email);\n",[449,27963,27964],{"class":451,"line":4081},[449,27965,700],{"emptyLinePlaceholder":130},[449,27967,27968,27971,27973,27976],{"class":451,"line":4086},[449,27969,27970],{"class":721},"  setCookie",[449,27972,12554],{"class":684},[449,27974,27975],{"class":691},"\"auth_token\"",[449,27977,27978],{"class":684},", token, {\n",[449,27980,27981,27984,27986],{"class":451,"line":4092},[449,27982,27983],{"class":684},"    httpOnly: ",[449,27985,2169],{"class":714},[449,27987,779],{"class":684},[449,27989,27990,27993,27996,27998,28001],{"class":451,"line":4098},[449,27991,27992],{"class":684},"    secure: process.env.",[449,27994,27995],{"class":714},"NODE_ENV",[449,27997,5100],{"class":680},[449,27999,28000],{"class":691}," \"production\"",[449,28002,779],{"class":684},[449,28004,28005,28008,28011],{"class":451,"line":4104},[449,28006,28007],{"class":684},"    sameSite: ",[449,28009,28010],{"class":691},"\"lax\"",[449,28012,779],{"class":684},[449,28014,28015,28018,28020,28022,28024,28026,28029,28031,28034,28036],{"class":451,"line":4110},[449,28016,28017],{"class":684},"    maxAge: ",[449,28019,25511],{"class":714},[449,28021,11428],{"class":680},[449,28023,25516],{"class":714},[449,28025,11428],{"class":680},[449,28027,28028],{"class":714}," 24",[449,28030,11428],{"class":680},[449,28032,28033],{"class":714}," 7",[449,28035,349],{"class":684},[449,28037,28038],{"class":705},"\u002F\u002F 7 days\n",[449,28040,28041],{"class":451,"line":5782},[449,28042,13321],{"class":684},[449,28044,28045],{"class":451,"line":5788},[449,28046,700],{"emptyLinePlaceholder":130},[449,28048,28049,28051,28054,28056],{"class":451,"line":5794},[449,28050,4726],{"class":680},[449,28052,28053],{"class":684}," { success: ",[449,28055,2169],{"class":714},[449,28057,28058],{"class":684},", email: body.email };\n",[449,28060,28061],{"class":451,"line":5799},[449,28062,784],{"class":684},[2808,28064,28066],{"id":28065},"login","Login",[21,28068,4697,28069,3070],{},[40,28070,28071],{},"server\u002Fapi\u002Fauth\u002Flogin.post.ts",[48,28073,28075],{"className":670,"code":28074,"filename":28071,"language":673,"meta":56,"style":56},"import { validateUserCredentials } from \"..\u002F..\u002Futils\u002Fdb\";\nimport { createToken } from \"..\u002F..\u002Futils\u002Fauth\";\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n\n  if (!body.email || !body.password) {\n    throw createError({\n      statusCode: 400,\n      statusMessage: \"Email and password are required\",\n    });\n  }\n\n  const user = await validateUserCredentials(body.email, body.password);\n\n  if (!user) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"Invalid credentials\",\n    });\n  }\n\n  const token = await createToken(user.id, user.email);\n\n  setCookie(event, \"auth_token\", token, {\n    httpOnly: true,\n    secure: process.env.NODE_ENV === \"production\",\n    sameSite: \"lax\",\n    maxAge: 60 * 60 * 24 * 7, \u002F\u002F 7 days\n  });\n\n  return { success: true, user: { email: user.email, name: user.name } };\n});\n",[40,28076,28077,28090,28102,28106,28128,28142,28146,28163,28171,28179,28188,28192,28196,28200,28215,28219,28229,28237,28245,28254,28258,28262,28266,28281,28285,28295,28303,28315,28323,28345,28349,28353,28364],{"__ignoreMap":56},[449,28078,28079,28081,28084,28086,28088],{"class":451,"line":452},[449,28080,681],{"class":680},[449,28082,28083],{"class":684}," { validateUserCredentials } ",[449,28085,688],{"class":680},[449,28087,27709],{"class":691},[449,28089,695],{"class":684},[449,28091,28092,28094,28096,28098,28100],{"class":451,"line":114},[449,28093,681],{"class":680},[449,28095,27718],{"class":684},[449,28097,688],{"class":680},[449,28099,27723],{"class":691},[449,28101,695],{"class":684},[449,28103,28104],{"class":451,"line":111},[449,28105,700],{"emptyLinePlaceholder":130},[449,28107,28108,28110,28112,28114,28116,28118,28120,28122,28124,28126],{"class":451,"line":468},[449,28109,4629],{"class":680},[449,28111,4632],{"class":680},[449,28113,4714],{"class":721},[449,28115,725],{"class":684},[449,28117,1485],{"class":680},[449,28119,1913],{"class":684},[449,28121,2991],{"class":1491},[449,28123,1758],{"class":684},[449,28125,1498],{"class":680},[449,28127,1501],{"class":684},[449,28129,28130,28132,28134,28136,28138,28140],{"class":451,"line":474},[449,28131,5048],{"class":680},[449,28133,5051],{"class":714},[449,28135,718],{"class":680},[449,28137,1654],{"class":680},[449,28139,5060],{"class":721},[449,28141,12843],{"class":684},[449,28143,28144],{"class":451,"line":480},[449,28145,700],{"emptyLinePlaceholder":130},[449,28147,28148,28150,28152,28154,28156,28158,28160],{"class":451,"line":486},[449,28149,5080],{"class":680},[449,28151,1913],{"class":684},[449,28153,5085],{"class":680},[449,28155,27784],{"class":684},[449,28157,5091],{"class":680},[449,28159,12868],{"class":680},[449,28161,28162],{"class":684},"body.password) {\n",[449,28164,28165,28167,28169],{"class":451,"line":492},[449,28166,5110],{"class":680},[449,28168,5113],{"class":721},[449,28170,1391],{"class":684},[449,28172,28173,28175,28177],{"class":451,"line":498},[449,28174,5120],{"class":684},[449,28176,5123],{"class":714},[449,28178,779],{"class":684},[449,28180,28181,28183,28186],{"class":451,"line":133},[449,28182,5130],{"class":684},[449,28184,28185],{"class":691},"\"Email and password are required\"",[449,28187,779],{"class":684},[449,28189,28190],{"class":451,"line":509},[449,28191,3484],{"class":684},[449,28193,28194],{"class":451,"line":318},[449,28195,4599],{"class":684},[449,28197,28198],{"class":451,"line":520},[449,28199,700],{"emptyLinePlaceholder":130},[449,28201,28202,28204,28206,28208,28210,28212],{"class":451,"line":526},[449,28203,5048],{"class":680},[449,28205,27416],{"class":714},[449,28207,718],{"class":680},[449,28209,1654],{"class":680},[449,28211,27391],{"class":721},[449,28213,28214],{"class":684},"(body.email, body.password);\n",[449,28216,28217],{"class":451,"line":532},[449,28218,700],{"emptyLinePlaceholder":130},[449,28220,28221,28223,28225,28227],{"class":451,"line":2790},[449,28222,5080],{"class":680},[449,28224,1913],{"class":684},[449,28226,5085],{"class":680},[449,28228,27440],{"class":684},[449,28230,28231,28233,28235],{"class":451,"line":3511},[449,28232,5110],{"class":680},[449,28234,5113],{"class":721},[449,28236,1391],{"class":684},[449,28238,28239,28241,28243],{"class":451,"line":3526},[449,28240,5120],{"class":684},[449,28242,17000],{"class":714},[449,28244,779],{"class":684},[449,28246,28247,28249,28252],{"class":451,"line":3531},[449,28248,5130],{"class":684},[449,28250,28251],{"class":691},"\"Invalid credentials\"",[449,28253,779],{"class":684},[449,28255,28256],{"class":451,"line":3536},[449,28257,3484],{"class":684},[449,28259,28260],{"class":451,"line":4009},[449,28261,4599],{"class":684},[449,28263,28264],{"class":451,"line":4015},[449,28265,700],{"emptyLinePlaceholder":130},[449,28267,28268,28270,28272,28274,28276,28278],{"class":451,"line":4021},[449,28269,5048],{"class":680},[449,28271,27952],{"class":714},[449,28273,718],{"class":680},[449,28275,1654],{"class":680},[449,28277,26864],{"class":721},[449,28279,28280],{"class":684},"(user.id, user.email);\n",[449,28282,28283],{"class":451,"line":4027},[449,28284,700],{"emptyLinePlaceholder":130},[449,28286,28287,28289,28291,28293],{"class":451,"line":4032},[449,28288,27970],{"class":721},[449,28290,12554],{"class":684},[449,28292,27975],{"class":691},[449,28294,27978],{"class":684},[449,28296,28297,28299,28301],{"class":451,"line":4038},[449,28298,27983],{"class":684},[449,28300,2169],{"class":714},[449,28302,779],{"class":684},[449,28304,28305,28307,28309,28311,28313],{"class":451,"line":4044},[449,28306,27992],{"class":684},[449,28308,27995],{"class":714},[449,28310,5100],{"class":680},[449,28312,28000],{"class":691},[449,28314,779],{"class":684},[449,28316,28317,28319,28321],{"class":451,"line":4049},[449,28318,28007],{"class":684},[449,28320,28010],{"class":691},[449,28322,779],{"class":684},[449,28324,28325,28327,28329,28331,28333,28335,28337,28339,28341,28343],{"class":451,"line":4054},[449,28326,28017],{"class":684},[449,28328,25511],{"class":714},[449,28330,11428],{"class":680},[449,28332,25516],{"class":714},[449,28334,11428],{"class":680},[449,28336,28028],{"class":714},[449,28338,11428],{"class":680},[449,28340,28033],{"class":714},[449,28342,349],{"class":684},[449,28344,28038],{"class":705},[449,28346,28347],{"class":451,"line":4059},[449,28348,13321],{"class":684},[449,28350,28351],{"class":451,"line":4065},[449,28352,700],{"emptyLinePlaceholder":130},[449,28354,28355,28357,28359,28361],{"class":451,"line":4070},[449,28356,4726],{"class":680},[449,28358,28053],{"class":684},[449,28360,2169],{"class":714},[449,28362,28363],{"class":684},", user: { email: user.email, name: user.name } };\n",[449,28365,28366],{"class":451,"line":4075},[449,28367,784],{"class":684},[2808,28369,28371],{"id":28370},"logout","Logout",[21,28373,4697,28374,3070],{},[40,28375,28376],{},"server\u002Fapi\u002Fauth\u002Flogout.post.ts",[48,28378,28380],{"className":670,"code":28379,"filename":28376,"language":673,"meta":56,"style":56},"export default defineEventHandler(async (event) => {\n  deleteCookie(event, \"auth_token\");\n  return { success: true };\n});\n",[40,28381,28382,28404,28415,28425],{"__ignoreMap":56},[449,28383,28384,28386,28388,28390,28392,28394,28396,28398,28400,28402],{"class":451,"line":452},[449,28385,4629],{"class":680},[449,28387,4632],{"class":680},[449,28389,4714],{"class":721},[449,28391,725],{"class":684},[449,28393,1485],{"class":680},[449,28395,1913],{"class":684},[449,28397,2991],{"class":1491},[449,28399,1758],{"class":684},[449,28401,1498],{"class":680},[449,28403,1501],{"class":684},[449,28405,28406,28409,28411,28413],{"class":451,"line":114},[449,28407,28408],{"class":721},"  deleteCookie",[449,28410,12554],{"class":684},[449,28412,27975],{"class":691},[449,28414,740],{"class":684},[449,28416,28417,28419,28421,28423],{"class":451,"line":111},[449,28418,4726],{"class":680},[449,28420,28053],{"class":684},[449,28422,2169],{"class":714},[449,28424,1520],{"class":684},[449,28426,28427],{"class":451,"line":468},[449,28428,784],{"class":684},[2808,28430,28432],{"id":28431},"get-current-user","Get Current User",[21,28434,4697,28435,3070],{},[40,28436,28437],{},"server\u002Fapi\u002Fauth\u002Fme.get.ts",[48,28439,28441],{"className":670,"code":28440,"filename":28437,"language":673,"meta":56,"style":56},"import { verifyToken } from \"..\u002F..\u002Futils\u002Fauth\";\nimport { findUserByEmail } from \"..\u002F..\u002Futils\u002Fdb\";\n\nexport default defineEventHandler(async (event) => {\n  const token = getCookie(event, \"auth_token\");\n\n  if (!token) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"Not authenticated\",\n    });\n  }\n\n  const payload = await verifyToken(token);\n\n  if (!payload) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"Invalid token\",\n    });\n  }\n\n  const user = await findUserByEmail(payload.email);\n\n  if (!user) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"User not found\",\n    });\n  }\n\n  return {\n    id: user.id,\n    email: user.email,\n    name: user.name,\n  };\n});\n",[40,28442,28443,28456,28469,28473,28495,28512,28516,28527,28535,28543,28552,28556,28560,28564,28580,28584,28595,28603,28611,28620,28624,28628,28632,28647,28651,28661,28669,28677,28686,28690,28694,28698,28704,28709,28714,28719,28723],{"__ignoreMap":56},[449,28444,28445,28447,28450,28452,28454],{"class":451,"line":452},[449,28446,681],{"class":680},[449,28448,28449],{"class":684}," { verifyToken } ",[449,28451,688],{"class":680},[449,28453,27723],{"class":691},[449,28455,695],{"class":684},[449,28457,28458,28460,28463,28465,28467],{"class":451,"line":114},[449,28459,681],{"class":680},[449,28461,28462],{"class":684}," { findUserByEmail } ",[449,28464,688],{"class":680},[449,28466,27709],{"class":691},[449,28468,695],{"class":684},[449,28470,28471],{"class":451,"line":111},[449,28472,700],{"emptyLinePlaceholder":130},[449,28474,28475,28477,28479,28481,28483,28485,28487,28489,28491,28493],{"class":451,"line":468},[449,28476,4629],{"class":680},[449,28478,4632],{"class":680},[449,28480,4714],{"class":721},[449,28482,725],{"class":684},[449,28484,1485],{"class":680},[449,28486,1913],{"class":684},[449,28488,2991],{"class":1491},[449,28490,1758],{"class":684},[449,28492,1498],{"class":680},[449,28494,1501],{"class":684},[449,28496,28497,28499,28501,28503,28506,28508,28510],{"class":451,"line":474},[449,28498,5048],{"class":680},[449,28500,27952],{"class":714},[449,28502,718],{"class":680},[449,28504,28505],{"class":721}," getCookie",[449,28507,12554],{"class":684},[449,28509,27975],{"class":691},[449,28511,740],{"class":684},[449,28513,28514],{"class":451,"line":480},[449,28515,700],{"emptyLinePlaceholder":130},[449,28517,28518,28520,28522,28524],{"class":451,"line":486},[449,28519,5080],{"class":680},[449,28521,1913],{"class":684},[449,28523,5085],{"class":680},[449,28525,28526],{"class":684},"token) {\n",[449,28528,28529,28531,28533],{"class":451,"line":492},[449,28530,5110],{"class":680},[449,28532,5113],{"class":721},[449,28534,1391],{"class":684},[449,28536,28537,28539,28541],{"class":451,"line":498},[449,28538,5120],{"class":684},[449,28540,17000],{"class":714},[449,28542,779],{"class":684},[449,28544,28545,28547,28550],{"class":451,"line":133},[449,28546,5130],{"class":684},[449,28548,28549],{"class":691},"\"Not authenticated\"",[449,28551,779],{"class":684},[449,28553,28554],{"class":451,"line":509},[449,28555,3484],{"class":684},[449,28557,28558],{"class":451,"line":318},[449,28559,4599],{"class":684},[449,28561,28562],{"class":451,"line":520},[449,28563,700],{"emptyLinePlaceholder":130},[449,28565,28566,28568,28571,28573,28575,28577],{"class":451,"line":526},[449,28567,5048],{"class":680},[449,28569,28570],{"class":714}," payload",[449,28572,718],{"class":680},[449,28574,1654],{"class":680},[449,28576,26974],{"class":721},[449,28578,28579],{"class":684},"(token);\n",[449,28581,28582],{"class":451,"line":532},[449,28583,700],{"emptyLinePlaceholder":130},[449,28585,28586,28588,28590,28592],{"class":451,"line":2790},[449,28587,5080],{"class":680},[449,28589,1913],{"class":684},[449,28591,5085],{"class":680},[449,28593,28594],{"class":684},"payload) {\n",[449,28596,28597,28599,28601],{"class":451,"line":3511},[449,28598,5110],{"class":680},[449,28600,5113],{"class":721},[449,28602,1391],{"class":684},[449,28604,28605,28607,28609],{"class":451,"line":3526},[449,28606,5120],{"class":684},[449,28608,17000],{"class":714},[449,28610,779],{"class":684},[449,28612,28613,28615,28618],{"class":451,"line":3531},[449,28614,5130],{"class":684},[449,28616,28617],{"class":691},"\"Invalid token\"",[449,28619,779],{"class":684},[449,28621,28622],{"class":451,"line":3536},[449,28623,3484],{"class":684},[449,28625,28626],{"class":451,"line":4009},[449,28627,4599],{"class":684},[449,28629,28630],{"class":451,"line":4015},[449,28631,700],{"emptyLinePlaceholder":130},[449,28633,28634,28636,28638,28640,28642,28644],{"class":451,"line":4021},[449,28635,5048],{"class":680},[449,28637,27416],{"class":714},[449,28639,718],{"class":680},[449,28641,1654],{"class":680},[449,28643,27335],{"class":721},[449,28645,28646],{"class":684},"(payload.email);\n",[449,28648,28649],{"class":451,"line":4027},[449,28650,700],{"emptyLinePlaceholder":130},[449,28652,28653,28655,28657,28659],{"class":451,"line":4032},[449,28654,5080],{"class":680},[449,28656,1913],{"class":684},[449,28658,5085],{"class":680},[449,28660,27440],{"class":684},[449,28662,28663,28665,28667],{"class":451,"line":4038},[449,28664,5110],{"class":680},[449,28666,5113],{"class":721},[449,28668,1391],{"class":684},[449,28670,28671,28673,28675],{"class":451,"line":4044},[449,28672,5120],{"class":684},[449,28674,17000],{"class":714},[449,28676,779],{"class":684},[449,28678,28679,28681,28684],{"class":451,"line":4049},[449,28680,5130],{"class":684},[449,28682,28683],{"class":691},"\"User not found\"",[449,28685,779],{"class":684},[449,28687,28688],{"class":451,"line":4054},[449,28689,3484],{"class":684},[449,28691,28692],{"class":451,"line":4059},[449,28693,4599],{"class":684},[449,28695,28696],{"class":451,"line":4065},[449,28697,700],{"emptyLinePlaceholder":130},[449,28699,28700,28702],{"class":451,"line":4070},[449,28701,4726],{"class":680},[449,28703,1501],{"class":684},[449,28705,28706],{"class":451,"line":4075},[449,28707,28708],{"class":684},"    id: user.id,\n",[449,28710,28711],{"class":451,"line":4081},[449,28712,28713],{"class":684},"    email: user.email,\n",[449,28715,28716],{"class":451,"line":4086},[449,28717,28718],{"class":684},"    name: user.name,\n",[449,28720,28721],{"class":451,"line":4092},[449,28722,4763],{"class":684},[449,28724,28725],{"class":451,"line":4098},[449,28726,784],{"class":684},[73,28728],{},[32,28730,28732],{"id":28731},"step-6-protect-api-routes","Step 6: Protect API Routes",[21,28734,28735],{},"Now let's protect our order management endpoints so only authenticated users can access them.",[21,28737,4616,28738,3070],{},[40,28739,14059],{},[48,28741,28743],{"className":670,"code":28742,"filename":14059,"language":673,"meta":56,"style":56},"import { db } from \"..\u002Fdb\";\nimport { orders, orderItems } from \"..\u002Fdb\u002Fschema\";\nimport { verifyToken } from \"..\u002Futils\u002Fauth\";\n\nexport default defineEventHandler(async (event) => {\n  \u002F\u002F Authentication check\n  const token = getCookie(event, \"auth_token\");\n\n  if (!token) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"Authentication required\",\n    });\n  }\n\n  const payload = await verifyToken(token);\n\n  if (!payload) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: \"Invalid token\",\n    });\n  }\n\n  const allOrders = await db.select().from(orders).orderBy(orders.createdAt);\n\n  const ordersWithItems = await Promise.all(\n    allOrders.map(async (order) => {\n      const items = await db.select().from(orderItems).where(orderItems.orderId.equals(order.id));\n      return { ...order, items };\n    }),\n  );\n\n  return { orders: ordersWithItems };\n});\n",[40,28744,28745,28757,28769,28782,28786,28808,28813,28829,28833,28843,28851,28859,28868,28872,28876,28880,28894,28898,28908,28916,28924,28932,28936,28940,28944,28968,28972,28990,29010,29038,29048,29052,29056,29060,29066],{"__ignoreMap":56},[449,28746,28747,28749,28751,28753,28755],{"class":451,"line":452},[449,28748,681],{"class":680},[449,28750,11703],{"class":684},[449,28752,688],{"class":680},[449,28754,11708],{"class":691},[449,28756,695],{"class":684},[449,28758,28759,28761,28763,28765,28767],{"class":451,"line":114},[449,28760,681],{"class":680},[449,28762,14083],{"class":684},[449,28764,688],{"class":680},[449,28766,11722],{"class":691},[449,28768,695],{"class":684},[449,28770,28771,28773,28775,28777,28780],{"class":451,"line":111},[449,28772,681],{"class":680},[449,28774,28449],{"class":684},[449,28776,688],{"class":680},[449,28778,28779],{"class":691}," \"..\u002Futils\u002Fauth\"",[449,28781,695],{"class":684},[449,28783,28784],{"class":451,"line":468},[449,28785,700],{"emptyLinePlaceholder":130},[449,28787,28788,28790,28792,28794,28796,28798,28800,28802,28804,28806],{"class":451,"line":474},[449,28789,4629],{"class":680},[449,28791,4632],{"class":680},[449,28793,4714],{"class":721},[449,28795,725],{"class":684},[449,28797,1485],{"class":680},[449,28799,1913],{"class":684},[449,28801,2991],{"class":1491},[449,28803,1758],{"class":684},[449,28805,1498],{"class":680},[449,28807,1501],{"class":684},[449,28809,28810],{"class":451,"line":480},[449,28811,28812],{"class":705},"  \u002F\u002F Authentication check\n",[449,28814,28815,28817,28819,28821,28823,28825,28827],{"class":451,"line":486},[449,28816,5048],{"class":680},[449,28818,27952],{"class":714},[449,28820,718],{"class":680},[449,28822,28505],{"class":721},[449,28824,12554],{"class":684},[449,28826,27975],{"class":691},[449,28828,740],{"class":684},[449,28830,28831],{"class":451,"line":492},[449,28832,700],{"emptyLinePlaceholder":130},[449,28834,28835,28837,28839,28841],{"class":451,"line":498},[449,28836,5080],{"class":680},[449,28838,1913],{"class":684},[449,28840,5085],{"class":680},[449,28842,28526],{"class":684},[449,28844,28845,28847,28849],{"class":451,"line":133},[449,28846,5110],{"class":680},[449,28848,5113],{"class":721},[449,28850,1391],{"class":684},[449,28852,28853,28855,28857],{"class":451,"line":509},[449,28854,5120],{"class":684},[449,28856,17000],{"class":714},[449,28858,779],{"class":684},[449,28860,28861,28863,28866],{"class":451,"line":318},[449,28862,5130],{"class":684},[449,28864,28865],{"class":691},"\"Authentication required\"",[449,28867,779],{"class":684},[449,28869,28870],{"class":451,"line":520},[449,28871,3484],{"class":684},[449,28873,28874],{"class":451,"line":526},[449,28875,4599],{"class":684},[449,28877,28878],{"class":451,"line":532},[449,28879,700],{"emptyLinePlaceholder":130},[449,28881,28882,28884,28886,28888,28890,28892],{"class":451,"line":2790},[449,28883,5048],{"class":680},[449,28885,28570],{"class":714},[449,28887,718],{"class":680},[449,28889,1654],{"class":680},[449,28891,26974],{"class":721},[449,28893,28579],{"class":684},[449,28895,28896],{"class":451,"line":3511},[449,28897,700],{"emptyLinePlaceholder":130},[449,28899,28900,28902,28904,28906],{"class":451,"line":3526},[449,28901,5080],{"class":680},[449,28903,1913],{"class":684},[449,28905,5085],{"class":680},[449,28907,28594],{"class":684},[449,28909,28910,28912,28914],{"class":451,"line":3531},[449,28911,5110],{"class":680},[449,28913,5113],{"class":721},[449,28915,1391],{"class":684},[449,28917,28918,28920,28922],{"class":451,"line":3536},[449,28919,5120],{"class":684},[449,28921,17000],{"class":714},[449,28923,779],{"class":684},[449,28925,28926,28928,28930],{"class":451,"line":4009},[449,28927,5130],{"class":684},[449,28929,28617],{"class":691},[449,28931,779],{"class":684},[449,28933,28934],{"class":451,"line":4015},[449,28935,3484],{"class":684},[449,28937,28938],{"class":451,"line":4021},[449,28939,4599],{"class":684},[449,28941,28942],{"class":451,"line":4027},[449,28943,700],{"emptyLinePlaceholder":130},[449,28945,28946,28948,28950,28952,28954,28956,28958,28960,28962,28964,28966],{"class":451,"line":4032},[449,28947,5048],{"class":680},[449,28949,14118],{"class":714},[449,28951,718],{"class":680},[449,28953,1654],{"class":680},[449,28955,12255],{"class":684},[449,28957,12452],{"class":721},[449,28959,5237],{"class":684},[449,28961,688],{"class":721},[449,28963,13260],{"class":684},[449,28965,14135],{"class":721},[449,28967,14138],{"class":684},[449,28969,28970],{"class":451,"line":4038},[449,28971,700],{"emptyLinePlaceholder":130},[449,28973,28974,28976,28978,28980,28982,28984,28986,28988],{"class":451,"line":4044},[449,28975,5048],{"class":680},[449,28977,14154],{"class":714},[449,28979,718],{"class":680},[449,28981,1654],{"class":680},[449,28983,5161],{"class":714},[449,28985,165],{"class":684},[449,28987,5813],{"class":721},[449,28989,5567],{"class":684},[449,28991,28992,28994,28996,28998,29000,29002,29004,29006,29008],{"class":451,"line":4049},[449,28993,14171],{"class":684},[449,28995,6391],{"class":721},[449,28997,725],{"class":684},[449,28999,1485],{"class":680},[449,29001,1913],{"class":684},[449,29003,14182],{"class":1491},[449,29005,1758],{"class":684},[449,29007,1498],{"class":680},[449,29009,1501],{"class":684},[449,29011,29012,29014,29016,29018,29020,29022,29024,29026,29028,29030,29032,29034,29036],{"class":451,"line":4054},[449,29013,14193],{"class":680},[449,29015,12443],{"class":714},[449,29017,718],{"class":680},[449,29019,1654],{"class":680},[449,29021,12255],{"class":684},[449,29023,12452],{"class":721},[449,29025,5237],{"class":684},[449,29027,688],{"class":721},[449,29029,13410],{"class":684},[449,29031,12461],{"class":721},[449,29033,14214],{"class":684},[449,29035,12638],{"class":721},[449,29037,14219],{"class":684},[449,29039,29040,29042,29044,29046],{"class":451,"line":4059},[449,29041,14224],{"class":680},[449,29043,14227],{"class":684},[449,29045,14230],{"class":680},[449,29047,14233],{"class":684},[449,29049,29050],{"class":451,"line":4065},[449,29051,4101],{"class":684},[449,29053,29054],{"class":451,"line":4070},[449,29055,14242],{"class":684},[449,29057,29058],{"class":451,"line":4075},[449,29059,700],{"emptyLinePlaceholder":130},[449,29061,29062,29064],{"class":451,"line":4081},[449,29063,4726],{"class":680},[449,29065,14253],{"class":684},[449,29067,29068],{"class":451,"line":4086},[449,29069,784],{"class":684},[427,29071,29073],{"icon":14306,"title":29072},"Middleware Pattern",[21,29074,29075],{},"You can extract this auth check into a reusable middleware function to protect multiple routes without repetition.",[73,29077],{},[32,29079,29081],{"id":29080},"step-7-add-oauth-with-github","Step 7: Add OAuth with GitHub",[21,29083,29084],{},"Let's add social login using GitHub as an example.",[21,29086,29087,29088],{},"First, create a GitHub OAuth app at ",[3861,29089,29090],{"href":29090,"rel":29091},"https:\u002F\u002Fgithub.com\u002Fsettings\u002Fdevelopers",[3865],[21,29093,29094,29095,3070],{},"Add credentials to your ",[40,29096,26592],{},[48,29098,29100],{"className":839,"code":29099,"filename":26592,"language":841,"meta":56,"style":56},"GITHUB_CLIENT_ID=your_client_id\nGITHUB_CLIENT_SECRET=your_client_secret\n",[40,29101,29102,29112],{"__ignoreMap":56},[449,29103,29104,29107,29109],{"class":451,"line":452},[449,29105,29106],{"class":684},"GITHUB_CLIENT_ID",[449,29108,5014],{"class":680},[449,29110,29111],{"class":691},"your_client_id\n",[449,29113,29114,29117,29119],{"class":451,"line":114},[449,29115,29116],{"class":684},"GITHUB_CLIENT_SECRET",[449,29118,5014],{"class":680},[449,29120,29121],{"class":691},"your_client_secret\n",[21,29123,4616,29124,3070],{},[40,29125,4619],{},[48,29127,29129],{"className":670,"code":29128,"filename":4619,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  auth: {\n    provider: {\n      type: \"authjs\",\n      provider: \"github\",\n    },\n    globalAppMiddleware: true,\n  },\n\n  runtimeConfig: {\n    authSecret: process.env.AUTH_SECRET,\n    github: {\n      clientId: process.env.GITHUB_CLIENT_ID,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET,\n    },\n    public: {\n      authOrigin: process.env.AUTH_ORIGIN || \"http:\u002F\u002Flocalhost:3000\",\n    },\n  },\n});\n",[40,29130,29131,29141,29145,29149,29157,29167,29171,29179,29183,29187,29191,29199,29204,29213,29222,29226,29230,29242,29246,29250],{"__ignoreMap":56},[449,29132,29133,29135,29137,29139],{"class":451,"line":452},[449,29134,4629],{"class":680},[449,29136,4632],{"class":680},[449,29138,4635],{"class":721},[449,29140,1391],{"class":684},[449,29142,29143],{"class":451,"line":114},[449,29144,26486],{"class":684},[449,29146,29147],{"class":451,"line":111},[449,29148,26491],{"class":684},[449,29150,29151,29153,29155],{"class":451,"line":468},[449,29152,26496],{"class":684},[449,29154,26499],{"class":691},[449,29156,779],{"class":684},[449,29158,29159,29162,29165],{"class":451,"line":474},[449,29160,29161],{"class":684},"      provider: ",[449,29163,29164],{"class":691},"\"github\"",[449,29166,779],{"class":684},[449,29168,29169],{"class":451,"line":480},[449,29170,1458],{"class":684},[449,29172,29173,29175,29177],{"class":451,"line":486},[449,29174,26520],{"class":684},[449,29176,2169],{"class":714},[449,29178,779],{"class":684},[449,29180,29181],{"class":451,"line":492},[449,29182,1474],{"class":684},[449,29184,29185],{"class":451,"line":498},[449,29186,700],{"emptyLinePlaceholder":130},[449,29188,29189],{"class":451,"line":133},[449,29190,15396],{"class":684},[449,29192,29193,29195,29197],{"class":451,"line":509},[449,29194,26541],{"class":684},[449,29196,26544],{"class":714},[449,29198,779],{"class":684},[449,29200,29201],{"class":451,"line":318},[449,29202,29203],{"class":684},"    github: {\n",[449,29205,29206,29209,29211],{"class":451,"line":520},[449,29207,29208],{"class":684},"      clientId: process.env.",[449,29210,29106],{"class":714},[449,29212,779],{"class":684},[449,29214,29215,29218,29220],{"class":451,"line":526},[449,29216,29217],{"class":684},"      clientSecret: process.env.",[449,29219,29116],{"class":714},[449,29221,779],{"class":684},[449,29223,29224],{"class":451,"line":532},[449,29225,1458],{"class":684},[449,29227,29228],{"class":451,"line":2790},[449,29229,15401],{"class":684},[449,29231,29232,29234,29236,29238,29240],{"class":451,"line":3511},[449,29233,26555],{"class":684},[449,29235,26558],{"class":714},[449,29237,26561],{"class":680},[449,29239,26564],{"class":691},[449,29241,779],{"class":684},[449,29243,29244],{"class":451,"line":3526},[449,29245,1458],{"class":684},[449,29247,29248],{"class":451,"line":3531},[449,29249,1474],{"class":684},[449,29251,29252],{"class":451,"line":3536},[449,29253,784],{"class":684},[21,29255,4697,29256,3070],{},[40,29257,29258],{},"server\u002Fapi\u002Fauth\u002F[...].ts",[48,29260,29262],{"className":670,"code":29261,"filename":29258,"language":673,"meta":56,"style":56},"import { NuxtAuthHandler } from \"@sidebase\u002Fnuxt-auth\";\nimport GithubProvider from \"next-auth\u002Fproviders\u002Fgithub\";\n\nexport default NuxtAuthHandler({\n  secret: process.env.AUTH_SECRET,\n  providers: [\n    GithubProvider.default({\n      clientId: process.env.GITHUB_CLIENT_ID,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET,\n    }),\n  ],\n});\n",[40,29263,29264,29278,29292,29296,29307,29316,29321,29330,29338,29346,29350,29354],{"__ignoreMap":56},[449,29265,29266,29268,29271,29273,29276],{"class":451,"line":452},[449,29267,681],{"class":680},[449,29269,29270],{"class":684}," { NuxtAuthHandler } ",[449,29272,688],{"class":680},[449,29274,29275],{"class":691}," \"@sidebase\u002Fnuxt-auth\"",[449,29277,695],{"class":684},[449,29279,29280,29282,29285,29287,29290],{"class":451,"line":114},[449,29281,681],{"class":680},[449,29283,29284],{"class":684}," GithubProvider ",[449,29286,688],{"class":680},[449,29288,29289],{"class":691}," \"next-auth\u002Fproviders\u002Fgithub\"",[449,29291,695],{"class":684},[449,29293,29294],{"class":451,"line":111},[449,29295,700],{"emptyLinePlaceholder":130},[449,29297,29298,29300,29302,29305],{"class":451,"line":468},[449,29299,4629],{"class":680},[449,29301,4632],{"class":680},[449,29303,29304],{"class":721}," NuxtAuthHandler",[449,29306,1391],{"class":684},[449,29308,29309,29312,29314],{"class":451,"line":474},[449,29310,29311],{"class":684},"  secret: process.env.",[449,29313,26544],{"class":714},[449,29315,779],{"class":684},[449,29317,29318],{"class":451,"line":480},[449,29319,29320],{"class":684},"  providers: [\n",[449,29322,29323,29326,29328],{"class":451,"line":486},[449,29324,29325],{"class":684},"    GithubProvider.",[449,29327,10920],{"class":721},[449,29329,1391],{"class":684},[449,29331,29332,29334,29336],{"class":451,"line":492},[449,29333,29208],{"class":684},[449,29335,29106],{"class":714},[449,29337,779],{"class":684},[449,29339,29340,29342,29344],{"class":451,"line":498},[449,29341,29217],{"class":684},[449,29343,29116],{"class":714},[449,29345,779],{"class":684},[449,29347,29348],{"class":451,"line":133},[449,29349,4101],{"class":684},[449,29351,29352],{"class":451,"line":509},[449,29353,4107],{"class":684},[449,29355,29356],{"class":451,"line":318},[449,29357,784],{"class":684},[73,29359],{},[32,29361,29363],{"id":29362},"step-8-create-the-frontend-auth-pages","Step 8: Create the Frontend Auth Pages",[21,29365,4697,29366,3070],{},[40,29367,29368],{},"pages\u002Flogin.vue",[48,29370,29372],{"className":24546,"code":29371,"filename":29368,"language":23763,"meta":56,"style":56},"\u003Ctemplate>\n  \u003Cdiv class=\"auth-page\">\n    \u003Ch1>Login to BrewStop\u003C\u002Fh1>\n\n    \u003Cform @submit.prevent=\"handleLogin\">\n      \u003Cdiv class=\"form-group\">\n        \u003Clabel>Email\u003C\u002Flabel>\n        \u003Cinput v-model=\"email\" type=\"email\" required \u002F>\n      \u003C\u002Fdiv>\n\n      \u003Cdiv class=\"form-group\">\n        \u003Clabel>Password\u003C\u002Flabel>\n        \u003Cinput v-model=\"password\" type=\"password\" required \u002F>\n      \u003C\u002Fdiv>\n\n      \u003Cbutton type=\"submit\" :disabled=\"loading\">\n        {{ loading ? \"Logging in...\" : \"Login\" }}\n      \u003C\u002Fbutton>\n\n      \u003Cp v-if=\"error\" class=\"error\">{{ error }}\u003C\u002Fp>\n    \u003C\u002Fform>\n\n    \u003Cp class=\"oauth-separator\">or\u003C\u002Fp>\n\n    \u003Cbutton @click=\"loginWithGithub\" class=\"github-btn\">Continue with GitHub\u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup lang=\"ts\">\nconst email = ref(\"\");\nconst password = ref(\"\");\nconst loading = ref(false);\nconst error = ref(\"\");\n\nasync function handleLogin() {\n  loading.value = true;\n  error.value = \"\";\n\n  try {\n    await $fetch(\"\u002Fapi\u002Fauth\u002Flogin\", {\n      method: \"POST\",\n      body: { email: email.value, password: password.value },\n    });\n\n    navigateTo(\"\u002Fdashboard\");\n  } catch (e: any) {\n    error.value = e.data?.statusMessage || \"Login failed\";\n  } finally {\n    loading.value = false;\n  }\n}\n\nasync function loginWithGithub() {\n  await navigateTo(\"\u002Fapi\u002Fauth\u002Fsignin\u002Fgithub\", { external: true });\n}\n\u003C\u002Fscript>\n",[40,29373,29374,29382,29399,29412,29416,29433,29448,29463,29487,29495,29499,29513,29526,29548,29556,29560,29582,29587,29595,29599,29624,29632,29636,29656,29660,29687,29695,29703,29707,29723,29741,29758,29775,29792,29796,29807,29819,29831,29835,29841,29855,29865,29870,29874,29878,29890,29907,29924,29933,29944,29948,29952,29956,29967,29986,29990],{"__ignoreMap":56},[449,29375,29376,29378,29380],{"class":451,"line":452},[449,29377,5547],{"class":684},[449,29379,24690],{"class":17370},[449,29381,23122],{"class":684},[449,29383,29384,29386,29389,29392,29394,29397],{"class":451,"line":114},[449,29385,24697],{"class":684},[449,29387,29388],{"class":17370},"div",[449,29390,29391],{"class":721}," class",[449,29393,5014],{"class":684},[449,29395,29396],{"class":691},"\"auth-page\"",[449,29398,23122],{"class":684},[449,29400,29401,29403,29405,29408,29410],{"class":451,"line":111},[449,29402,24706],{"class":684},[449,29404,16],{"class":17370},[449,29406,29407],{"class":684},">Login to BrewStop\u003C\u002F",[449,29409,16],{"class":17370},[449,29411,23122],{"class":684},[449,29413,29414],{"class":451,"line":468},[449,29415,700],{"emptyLinePlaceholder":130},[449,29417,29418,29420,29423,29426,29428,29431],{"class":451,"line":474},[449,29419,24706],{"class":684},[449,29421,29422],{"class":17370},"form",[449,29424,29425],{"class":721}," @submit.prevent",[449,29427,5014],{"class":684},[449,29429,29430],{"class":691},"\"handleLogin\"",[449,29432,23122],{"class":684},[449,29434,29435,29437,29439,29441,29443,29446],{"class":451,"line":480},[449,29436,24736],{"class":684},[449,29438,29388],{"class":17370},[449,29440,29391],{"class":721},[449,29442,5014],{"class":684},[449,29444,29445],{"class":691},"\"form-group\"",[449,29447,23122],{"class":684},[449,29449,29450,29453,29456,29459,29461],{"class":451,"line":486},[449,29451,29452],{"class":684},"        \u003C",[449,29454,29455],{"class":17370},"label",[449,29457,29458],{"class":684},">Email\u003C\u002F",[449,29460,29455],{"class":17370},[449,29462,23122],{"class":684},[449,29464,29465,29467,29469,29472,29474,29476,29478,29480,29482,29485],{"class":451,"line":492},[449,29466,29452],{"class":684},[449,29468,27248],{"class":17370},[449,29470,29471],{"class":721}," v-model",[449,29473,5014],{"class":684},[449,29475,27589],{"class":691},[449,29477,11308],{"class":721},[449,29479,5014],{"class":684},[449,29481,27589],{"class":691},[449,29483,29484],{"class":721}," required",[449,29486,25268],{"class":684},[449,29488,29489,29491,29493],{"class":451,"line":498},[449,29490,24767],{"class":684},[449,29492,29388],{"class":17370},[449,29494,23122],{"class":684},[449,29496,29497],{"class":451,"line":133},[449,29498,700],{"emptyLinePlaceholder":130},[449,29500,29501,29503,29505,29507,29509,29511],{"class":451,"line":509},[449,29502,24736],{"class":684},[449,29504,29388],{"class":17370},[449,29506,29391],{"class":721},[449,29508,5014],{"class":684},[449,29510,29445],{"class":691},[449,29512,23122],{"class":684},[449,29514,29515,29517,29519,29522,29524],{"class":451,"line":318},[449,29516,29452],{"class":684},[449,29518,29455],{"class":17370},[449,29520,29521],{"class":684},">Password\u003C\u002F",[449,29523,29455],{"class":17370},[449,29525,23122],{"class":684},[449,29527,29528,29530,29532,29534,29536,29538,29540,29542,29544,29546],{"class":451,"line":520},[449,29529,29452],{"class":684},[449,29531,27248],{"class":17370},[449,29533,29471],{"class":721},[449,29535,5014],{"class":684},[449,29537,27612],{"class":691},[449,29539,11308],{"class":721},[449,29541,5014],{"class":684},[449,29543,27612],{"class":691},[449,29545,29484],{"class":721},[449,29547,25268],{"class":684},[449,29549,29550,29552,29554],{"class":451,"line":526},[449,29551,24767],{"class":684},[449,29553,29388],{"class":17370},[449,29555,23122],{"class":684},[449,29557,29558],{"class":451,"line":532},[449,29559,700],{"emptyLinePlaceholder":130},[449,29561,29562,29564,29566,29568,29570,29573,29575,29577,29580],{"class":451,"line":2790},[449,29563,24736],{"class":684},[449,29565,24739],{"class":17370},[449,29567,11308],{"class":721},[449,29569,5014],{"class":684},[449,29571,29572],{"class":691},"\"submit\"",[449,29574,24742],{"class":721},[449,29576,5014],{"class":684},[449,29578,29579],{"class":691},"\"loading\"",[449,29581,23122],{"class":684},[449,29583,29584],{"class":451,"line":3511},[449,29585,29586],{"class":684},"        {{ loading ? \"Logging in...\" : \"Login\" }}\n",[449,29588,29589,29591,29593],{"class":451,"line":3526},[449,29590,24767],{"class":684},[449,29592,24739],{"class":17370},[449,29594,23122],{"class":684},[449,29596,29597],{"class":451,"line":3531},[449,29598,700],{"emptyLinePlaceholder":130},[449,29600,29601,29603,29605,29607,29609,29611,29613,29615,29617,29620,29622],{"class":451,"line":3536},[449,29602,24736],{"class":684},[449,29604,21],{"class":17370},[449,29606,24998],{"class":721},[449,29608,5014],{"class":684},[449,29610,22309],{"class":691},[449,29612,29391],{"class":721},[449,29614,5014],{"class":684},[449,29616,22309],{"class":691},[449,29618,29619],{"class":684},">{{ error }}\u003C\u002F",[449,29621,21],{"class":17370},[449,29623,23122],{"class":684},[449,29625,29626,29628,29630],{"class":451,"line":4009},[449,29627,24776],{"class":684},[449,29629,29422],{"class":17370},[449,29631,23122],{"class":684},[449,29633,29634],{"class":451,"line":4015},[449,29635,700],{"emptyLinePlaceholder":130},[449,29637,29638,29640,29642,29644,29646,29649,29652,29654],{"class":451,"line":4021},[449,29639,24706],{"class":684},[449,29641,21],{"class":17370},[449,29643,29391],{"class":721},[449,29645,5014],{"class":684},[449,29647,29648],{"class":691},"\"oauth-separator\"",[449,29650,29651],{"class":684},">or\u003C\u002F",[449,29653,21],{"class":17370},[449,29655,23122],{"class":684},[449,29657,29658],{"class":451,"line":4027},[449,29659,700],{"emptyLinePlaceholder":130},[449,29661,29662,29664,29666,29668,29670,29673,29675,29677,29680,29683,29685],{"class":451,"line":4032},[449,29663,24706],{"class":684},[449,29665,24739],{"class":17370},[449,29667,24750],{"class":721},[449,29669,5014],{"class":684},[449,29671,29672],{"class":691},"\"loginWithGithub\"",[449,29674,29391],{"class":721},[449,29676,5014],{"class":684},[449,29678,29679],{"class":691},"\"github-btn\"",[449,29681,29682],{"class":684},">Continue with GitHub\u003C\u002F",[449,29684,24739],{"class":17370},[449,29686,23122],{"class":684},[449,29688,29689,29691,29693],{"class":451,"line":4038},[449,29690,24785],{"class":684},[449,29692,29388],{"class":17370},[449,29694,23122],{"class":684},[449,29696,29697,29699,29701],{"class":451,"line":4044},[449,29698,23220],{"class":684},[449,29700,24690],{"class":17370},[449,29702,23122],{"class":684},[449,29704,29705],{"class":451,"line":4049},[449,29706,700],{"emptyLinePlaceholder":130},[449,29708,29709,29711,29713,29715,29717,29719,29721],{"class":451,"line":4054},[449,29710,5547],{"class":684},[449,29712,23223],{"class":17370},[449,29714,24559],{"class":721},[449,29716,24562],{"class":721},[449,29718,5014],{"class":684},[449,29720,23119],{"class":691},[449,29722,23122],{"class":684},[449,29724,29725,29727,29730,29732,29734,29736,29739],{"class":451,"line":4059},[449,29726,711],{"class":680},[449,29728,29729],{"class":714}," email",[449,29731,718],{"class":680},[449,29733,23510],{"class":721},[449,29735,725],{"class":684},[449,29737,29738],{"class":691},"\"\"",[449,29740,740],{"class":684},[449,29742,29743,29745,29748,29750,29752,29754,29756],{"class":451,"line":4065},[449,29744,711],{"class":680},[449,29746,29747],{"class":714}," password",[449,29749,718],{"class":680},[449,29751,23510],{"class":721},[449,29753,725],{"class":684},[449,29755,29738],{"class":691},[449,29757,740],{"class":684},[449,29759,29760,29762,29765,29767,29769,29771,29773],{"class":451,"line":4070},[449,29761,711],{"class":680},[449,29763,29764],{"class":714}," loading",[449,29766,718],{"class":680},[449,29768,23510],{"class":721},[449,29770,725],{"class":684},[449,29772,24415],{"class":714},[449,29774,740],{"class":684},[449,29776,29777,29779,29782,29784,29786,29788,29790],{"class":451,"line":4075},[449,29778,711],{"class":680},[449,29780,29781],{"class":714}," error",[449,29783,718],{"class":680},[449,29785,23510],{"class":721},[449,29787,725],{"class":684},[449,29789,29738],{"class":691},[449,29791,740],{"class":684},[449,29793,29794],{"class":451,"line":4081},[449,29795,700],{"emptyLinePlaceholder":130},[449,29797,29798,29800,29802,29805],{"class":451,"line":4086},[449,29799,1485],{"class":680},[449,29801,5433],{"class":680},[449,29803,29804],{"class":721}," handleLogin",[449,29806,5439],{"class":684},[449,29808,29809,29812,29814,29817],{"class":451,"line":4092},[449,29810,29811],{"class":684},"  loading.value ",[449,29813,5014],{"class":680},[449,29815,29816],{"class":714}," true",[449,29818,695],{"class":684},[449,29820,29821,29824,29826,29829],{"class":451,"line":4098},[449,29822,29823],{"class":684},"  error.value ",[449,29825,5014],{"class":680},[449,29827,29828],{"class":691}," \"\"",[449,29830,695],{"class":684},[449,29832,29833],{"class":451,"line":4104},[449,29834,700],{"emptyLinePlaceholder":130},[449,29836,29837,29839],{"class":451,"line":4110},[449,29838,27027],{"class":680},[449,29840,1501],{"class":684},[449,29842,29843,29845,29848,29850,29853],{"class":451,"line":5782},[449,29844,12301],{"class":680},[449,29846,29847],{"class":721}," $fetch",[449,29849,725],{"class":684},[449,29851,29852],{"class":691},"\"\u002Fapi\u002Fauth\u002Flogin\"",[449,29854,768],{"class":684},[449,29856,29857,29860,29863],{"class":451,"line":5788},[449,29858,29859],{"class":684},"      method: ",[449,29861,29862],{"class":691},"\"POST\"",[449,29864,779],{"class":684},[449,29866,29867],{"class":451,"line":5794},[449,29868,29869],{"class":684},"      body: { email: email.value, password: password.value },\n",[449,29871,29872],{"class":451,"line":5799},[449,29873,3484],{"class":684},[449,29875,29876],{"class":451,"line":5804},[449,29877,700],{"emptyLinePlaceholder":130},[449,29879,29880,29883,29885,29888],{"class":451,"line":5819},[449,29881,29882],{"class":721},"    navigateTo",[449,29884,725],{"class":684},[449,29886,29887],{"class":691},"\"\u002Fdashboard\"",[449,29889,740],{"class":684},[449,29891,29892,29894,29896,29898,29901,29903,29905],{"class":451,"line":5824},[449,29893,27082],{"class":684},[449,29895,5746],{"class":680},[449,29897,1913],{"class":684},[449,29899,29900],{"class":1491},"e",[449,29902,3070],{"class":680},[449,29904,5008],{"class":714},[449,29906,3417],{"class":684},[449,29908,29909,29912,29914,29917,29919,29922],{"class":451,"line":5846},[449,29910,29911],{"class":684},"    error.value ",[449,29913,5014],{"class":680},[449,29915,29916],{"class":684}," e.data?.statusMessage ",[449,29918,5091],{"class":680},[449,29920,29921],{"class":691}," \"Login failed\"",[449,29923,695],{"class":684},[449,29925,29926,29928,29931],{"class":451,"line":5880},[449,29927,27082],{"class":684},[449,29929,29930],{"class":680},"finally",[449,29932,1501],{"class":684},[449,29934,29935,29938,29940,29942],{"class":451,"line":5885},[449,29936,29937],{"class":684},"    loading.value ",[449,29939,5014],{"class":680},[449,29941,8905],{"class":714},[449,29943,695],{"class":684},[449,29945,29946],{"class":451,"line":5899},[449,29947,4599],{"class":684},[449,29949,29950],{"class":451,"line":5919},[449,29951,4604],{"class":684},[449,29953,29954],{"class":451,"line":5938},[449,29955,700],{"emptyLinePlaceholder":130},[449,29957,29958,29960,29962,29965],{"class":451,"line":5973},[449,29959,1485],{"class":680},[449,29961,5433],{"class":680},[449,29963,29964],{"class":721}," loginWithGithub",[449,29966,5439],{"class":684},[449,29968,29969,29971,29974,29976,29979,29982,29984],{"class":451,"line":5978},[449,29970,2099],{"class":680},[449,29972,29973],{"class":721}," navigateTo",[449,29975,725],{"class":684},[449,29977,29978],{"class":691},"\"\u002Fapi\u002Fauth\u002Fsignin\u002Fgithub\"",[449,29980,29981],{"class":684},", { external: ",[449,29983,2169],{"class":714},[449,29985,2051],{"class":684},[449,29987,29988],{"class":451,"line":5983},[449,29989,4604],{"class":684},[449,29991,29992,29994,29996],{"class":451,"line":12114},[449,29993,23220],{"class":684},[449,29995,23223],{"class":17370},[449,29997,23122],{"class":684},[21,29999,4697,30000,3070],{},[40,30001,30002],{},"pages\u002Fregister.vue",[48,30004,30006],{"className":24546,"code":30005,"filename":30002,"language":23763,"meta":56,"style":56},"\u003Ctemplate>\n  \u003Cdiv class=\"auth-page\">\n    \u003Ch1>Create an Account\u003C\u002Fh1>\n\n    \u003Cform @submit.prevent=\"handleRegister\">\n      \u003Cdiv class=\"form-group\">\n        \u003Clabel>Name\u003C\u002Flabel>\n        \u003Cinput v-model=\"name\" type=\"text\" required \u002F>\n      \u003C\u002Fdiv>\n\n      \u003Cdiv class=\"form-group\">\n        \u003Clabel>Email\u003C\u002Flabel>\n        \u003Cinput v-model=\"email\" type=\"email\" required \u002F>\n      \u003C\u002Fdiv>\n\n      \u003Cdiv class=\"form-group\">\n        \u003Clabel>Password\u003C\u002Flabel>\n        \u003Cinput v-model=\"password\" type=\"password\" required \u002F>\n      \u003C\u002Fdiv>\n\n      \u003Cbutton type=\"submit\" :disabled=\"loading\">\n        {{ loading ? \"Creating account...\" : \"Register\" }}\n      \u003C\u002Fbutton>\n\n      \u003Cp v-if=\"error\" class=\"error\">{{ error }}\u003C\u002Fp>\n    \u003C\u002Fform>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup lang=\"ts\">\nconst name = ref(\"\");\nconst email = ref(\"\");\nconst password = ref(\"\");\nconst loading = ref(false);\nconst error = ref(\"\");\n\nasync function handleRegister() {\n  loading.value = true;\n  error.value = \"\";\n\n  try {\n    await $fetch(\"\u002Fapi\u002Fauth\u002Fregister\", {\n      method: \"POST\",\n      body: { name: name.value, email: email.value, password: password.value },\n    });\n\n    navigateTo(\"\u002Fdashboard\");\n  } catch (e: any) {\n    error.value = e.data?.statusMessage || \"Registration failed\";\n  } finally {\n    loading.value = false;\n  }\n}\n\u003C\u002Fscript>\n",[40,30007,30008,30016,30030,30043,30047,30062,30076,30089,30112,30120,30124,30138,30150,30172,30180,30184,30198,30210,30232,30240,30244,30264,30269,30277,30281,30305,30313,30321,30329,30333,30349,30366,30382,30398,30414,30430,30434,30445,30455,30465,30469,30475,30488,30496,30501,30505,30509,30519,30535,30550,30558,30568,30572,30576],{"__ignoreMap":56},[449,30009,30010,30012,30014],{"class":451,"line":452},[449,30011,5547],{"class":684},[449,30013,24690],{"class":17370},[449,30015,23122],{"class":684},[449,30017,30018,30020,30022,30024,30026,30028],{"class":451,"line":114},[449,30019,24697],{"class":684},[449,30021,29388],{"class":17370},[449,30023,29391],{"class":721},[449,30025,5014],{"class":684},[449,30027,29396],{"class":691},[449,30029,23122],{"class":684},[449,30031,30032,30034,30036,30039,30041],{"class":451,"line":111},[449,30033,24706],{"class":684},[449,30035,16],{"class":17370},[449,30037,30038],{"class":684},">Create an Account\u003C\u002F",[449,30040,16],{"class":17370},[449,30042,23122],{"class":684},[449,30044,30045],{"class":451,"line":468},[449,30046,700],{"emptyLinePlaceholder":130},[449,30048,30049,30051,30053,30055,30057,30060],{"class":451,"line":474},[449,30050,24706],{"class":684},[449,30052,29422],{"class":17370},[449,30054,29425],{"class":721},[449,30056,5014],{"class":684},[449,30058,30059],{"class":691},"\"handleRegister\"",[449,30061,23122],{"class":684},[449,30063,30064,30066,30068,30070,30072,30074],{"class":451,"line":480},[449,30065,24736],{"class":684},[449,30067,29388],{"class":17370},[449,30069,29391],{"class":721},[449,30071,5014],{"class":684},[449,30073,29445],{"class":691},[449,30075,23122],{"class":684},[449,30077,30078,30080,30082,30085,30087],{"class":451,"line":486},[449,30079,29452],{"class":684},[449,30081,29455],{"class":17370},[449,30083,30084],{"class":684},">Name\u003C\u002F",[449,30086,29455],{"class":17370},[449,30088,23122],{"class":684},[449,30090,30091,30093,30095,30097,30099,30101,30103,30105,30108,30110],{"class":451,"line":492},[449,30092,29452],{"class":684},[449,30094,27248],{"class":17370},[449,30096,29471],{"class":721},[449,30098,5014],{"class":684},[449,30100,10834],{"class":691},[449,30102,11308],{"class":721},[449,30104,5014],{"class":684},[449,30106,30107],{"class":691},"\"text\"",[449,30109,29484],{"class":721},[449,30111,25268],{"class":684},[449,30113,30114,30116,30118],{"class":451,"line":498},[449,30115,24767],{"class":684},[449,30117,29388],{"class":17370},[449,30119,23122],{"class":684},[449,30121,30122],{"class":451,"line":133},[449,30123,700],{"emptyLinePlaceholder":130},[449,30125,30126,30128,30130,30132,30134,30136],{"class":451,"line":509},[449,30127,24736],{"class":684},[449,30129,29388],{"class":17370},[449,30131,29391],{"class":721},[449,30133,5014],{"class":684},[449,30135,29445],{"class":691},[449,30137,23122],{"class":684},[449,30139,30140,30142,30144,30146,30148],{"class":451,"line":318},[449,30141,29452],{"class":684},[449,30143,29455],{"class":17370},[449,30145,29458],{"class":684},[449,30147,29455],{"class":17370},[449,30149,23122],{"class":684},[449,30151,30152,30154,30156,30158,30160,30162,30164,30166,30168,30170],{"class":451,"line":520},[449,30153,29452],{"class":684},[449,30155,27248],{"class":17370},[449,30157,29471],{"class":721},[449,30159,5014],{"class":684},[449,30161,27589],{"class":691},[449,30163,11308],{"class":721},[449,30165,5014],{"class":684},[449,30167,27589],{"class":691},[449,30169,29484],{"class":721},[449,30171,25268],{"class":684},[449,30173,30174,30176,30178],{"class":451,"line":526},[449,30175,24767],{"class":684},[449,30177,29388],{"class":17370},[449,30179,23122],{"class":684},[449,30181,30182],{"class":451,"line":532},[449,30183,700],{"emptyLinePlaceholder":130},[449,30185,30186,30188,30190,30192,30194,30196],{"class":451,"line":2790},[449,30187,24736],{"class":684},[449,30189,29388],{"class":17370},[449,30191,29391],{"class":721},[449,30193,5014],{"class":684},[449,30195,29445],{"class":691},[449,30197,23122],{"class":684},[449,30199,30200,30202,30204,30206,30208],{"class":451,"line":3511},[449,30201,29452],{"class":684},[449,30203,29455],{"class":17370},[449,30205,29521],{"class":684},[449,30207,29455],{"class":17370},[449,30209,23122],{"class":684},[449,30211,30212,30214,30216,30218,30220,30222,30224,30226,30228,30230],{"class":451,"line":3526},[449,30213,29452],{"class":684},[449,30215,27248],{"class":17370},[449,30217,29471],{"class":721},[449,30219,5014],{"class":684},[449,30221,27612],{"class":691},[449,30223,11308],{"class":721},[449,30225,5014],{"class":684},[449,30227,27612],{"class":691},[449,30229,29484],{"class":721},[449,30231,25268],{"class":684},[449,30233,30234,30236,30238],{"class":451,"line":3531},[449,30235,24767],{"class":684},[449,30237,29388],{"class":17370},[449,30239,23122],{"class":684},[449,30241,30242],{"class":451,"line":3536},[449,30243,700],{"emptyLinePlaceholder":130},[449,30245,30246,30248,30250,30252,30254,30256,30258,30260,30262],{"class":451,"line":4009},[449,30247,24736],{"class":684},[449,30249,24739],{"class":17370},[449,30251,11308],{"class":721},[449,30253,5014],{"class":684},[449,30255,29572],{"class":691},[449,30257,24742],{"class":721},[449,30259,5014],{"class":684},[449,30261,29579],{"class":691},[449,30263,23122],{"class":684},[449,30265,30266],{"class":451,"line":4015},[449,30267,30268],{"class":684},"        {{ loading ? \"Creating account...\" : \"Register\" }}\n",[449,30270,30271,30273,30275],{"class":451,"line":4021},[449,30272,24767],{"class":684},[449,30274,24739],{"class":17370},[449,30276,23122],{"class":684},[449,30278,30279],{"class":451,"line":4027},[449,30280,700],{"emptyLinePlaceholder":130},[449,30282,30283,30285,30287,30289,30291,30293,30295,30297,30299,30301,30303],{"class":451,"line":4032},[449,30284,24736],{"class":684},[449,30286,21],{"class":17370},[449,30288,24998],{"class":721},[449,30290,5014],{"class":684},[449,30292,22309],{"class":691},[449,30294,29391],{"class":721},[449,30296,5014],{"class":684},[449,30298,22309],{"class":691},[449,30300,29619],{"class":684},[449,30302,21],{"class":17370},[449,30304,23122],{"class":684},[449,30306,30307,30309,30311],{"class":451,"line":4038},[449,30308,24776],{"class":684},[449,30310,29422],{"class":17370},[449,30312,23122],{"class":684},[449,30314,30315,30317,30319],{"class":451,"line":4044},[449,30316,24785],{"class":684},[449,30318,29388],{"class":17370},[449,30320,23122],{"class":684},[449,30322,30323,30325,30327],{"class":451,"line":4049},[449,30324,23220],{"class":684},[449,30326,24690],{"class":17370},[449,30328,23122],{"class":684},[449,30330,30331],{"class":451,"line":4054},[449,30332,700],{"emptyLinePlaceholder":130},[449,30334,30335,30337,30339,30341,30343,30345,30347],{"class":451,"line":4059},[449,30336,5547],{"class":684},[449,30338,23223],{"class":17370},[449,30340,24559],{"class":721},[449,30342,24562],{"class":721},[449,30344,5014],{"class":684},[449,30346,23119],{"class":691},[449,30348,23122],{"class":684},[449,30350,30351,30353,30356,30358,30360,30362,30364],{"class":451,"line":4065},[449,30352,711],{"class":680},[449,30354,30355],{"class":714}," name",[449,30357,718],{"class":680},[449,30359,23510],{"class":721},[449,30361,725],{"class":684},[449,30363,29738],{"class":691},[449,30365,740],{"class":684},[449,30367,30368,30370,30372,30374,30376,30378,30380],{"class":451,"line":4070},[449,30369,711],{"class":680},[449,30371,29729],{"class":714},[449,30373,718],{"class":680},[449,30375,23510],{"class":721},[449,30377,725],{"class":684},[449,30379,29738],{"class":691},[449,30381,740],{"class":684},[449,30383,30384,30386,30388,30390,30392,30394,30396],{"class":451,"line":4075},[449,30385,711],{"class":680},[449,30387,29747],{"class":714},[449,30389,718],{"class":680},[449,30391,23510],{"class":721},[449,30393,725],{"class":684},[449,30395,29738],{"class":691},[449,30397,740],{"class":684},[449,30399,30400,30402,30404,30406,30408,30410,30412],{"class":451,"line":4081},[449,30401,711],{"class":680},[449,30403,29764],{"class":714},[449,30405,718],{"class":680},[449,30407,23510],{"class":721},[449,30409,725],{"class":684},[449,30411,24415],{"class":714},[449,30413,740],{"class":684},[449,30415,30416,30418,30420,30422,30424,30426,30428],{"class":451,"line":4086},[449,30417,711],{"class":680},[449,30419,29781],{"class":714},[449,30421,718],{"class":680},[449,30423,23510],{"class":721},[449,30425,725],{"class":684},[449,30427,29738],{"class":691},[449,30429,740],{"class":684},[449,30431,30432],{"class":451,"line":4092},[449,30433,700],{"emptyLinePlaceholder":130},[449,30435,30436,30438,30440,30443],{"class":451,"line":4098},[449,30437,1485],{"class":680},[449,30439,5433],{"class":680},[449,30441,30442],{"class":721}," handleRegister",[449,30444,5439],{"class":684},[449,30446,30447,30449,30451,30453],{"class":451,"line":4104},[449,30448,29811],{"class":684},[449,30450,5014],{"class":680},[449,30452,29816],{"class":714},[449,30454,695],{"class":684},[449,30456,30457,30459,30461,30463],{"class":451,"line":4110},[449,30458,29823],{"class":684},[449,30460,5014],{"class":680},[449,30462,29828],{"class":691},[449,30464,695],{"class":684},[449,30466,30467],{"class":451,"line":5782},[449,30468,700],{"emptyLinePlaceholder":130},[449,30470,30471,30473],{"class":451,"line":5788},[449,30472,27027],{"class":680},[449,30474,1501],{"class":684},[449,30476,30477,30479,30481,30483,30486],{"class":451,"line":5794},[449,30478,12301],{"class":680},[449,30480,29847],{"class":721},[449,30482,725],{"class":684},[449,30484,30485],{"class":691},"\"\u002Fapi\u002Fauth\u002Fregister\"",[449,30487,768],{"class":684},[449,30489,30490,30492,30494],{"class":451,"line":5799},[449,30491,29859],{"class":684},[449,30493,29862],{"class":691},[449,30495,779],{"class":684},[449,30497,30498],{"class":451,"line":5804},[449,30499,30500],{"class":684},"      body: { name: name.value, email: email.value, password: password.value },\n",[449,30502,30503],{"class":451,"line":5819},[449,30504,3484],{"class":684},[449,30506,30507],{"class":451,"line":5824},[449,30508,700],{"emptyLinePlaceholder":130},[449,30510,30511,30513,30515,30517],{"class":451,"line":5846},[449,30512,29882],{"class":721},[449,30514,725],{"class":684},[449,30516,29887],{"class":691},[449,30518,740],{"class":684},[449,30520,30521,30523,30525,30527,30529,30531,30533],{"class":451,"line":5880},[449,30522,27082],{"class":684},[449,30524,5746],{"class":680},[449,30526,1913],{"class":684},[449,30528,29900],{"class":1491},[449,30530,3070],{"class":680},[449,30532,5008],{"class":714},[449,30534,3417],{"class":684},[449,30536,30537,30539,30541,30543,30545,30548],{"class":451,"line":5885},[449,30538,29911],{"class":684},[449,30540,5014],{"class":680},[449,30542,29916],{"class":684},[449,30544,5091],{"class":680},[449,30546,30547],{"class":691}," \"Registration failed\"",[449,30549,695],{"class":684},[449,30551,30552,30554,30556],{"class":451,"line":5899},[449,30553,27082],{"class":684},[449,30555,29930],{"class":680},[449,30557,1501],{"class":684},[449,30559,30560,30562,30564,30566],{"class":451,"line":5919},[449,30561,29937],{"class":684},[449,30563,5014],{"class":680},[449,30565,8905],{"class":714},[449,30567,695],{"class":684},[449,30569,30570],{"class":451,"line":5938},[449,30571,4599],{"class":684},[449,30573,30574],{"class":451,"line":5973},[449,30575,4604],{"class":684},[449,30577,30578,30580,30582],{"class":451,"line":5978},[449,30579,23220],{"class":684},[449,30581,23223],{"class":17370},[449,30583,23122],{"class":684},[73,30585],{},[32,30587,30589],{"id":30588},"step-9-use-auth-composable","Step 9: Use Auth Composable",[21,30591,30592],{},"Nuxt provides a composable for easy auth state management.",[48,30594,30597],{"className":670,"code":30595,"filename":30596,"language":673,"meta":56,"style":56},"export const useAuth = () => {\n  const user = useState(\"auth-user\", () => null);\n  const loading = useState(\"auth-loading\", () => true);\n\n  const fetchUser = async () => {\n    loading.value = true;\n    try {\n      user.value = await $fetch(\"\u002Fapi\u002Fauth\u002Fme\");\n    } catch {\n      user.value = null;\n    } finally {\n      loading.value = false;\n    }\n  };\n\n  const logout = async () => {\n    await $fetch(\"\u002Fapi\u002Fauth\u002Flogout\", { method: \"POST\" });\n    user.value = null;\n    navigateTo(\"\u002Flogin\");\n  };\n\n  return { user, loading, fetchUser, logout };\n};\n","composables\u002FuseAuth.ts",[40,30598,30599,30616,30640,30663,30667,30684,30694,30701,30719,30728,30738,30746,30757,30761,30765,30769,30786,30804,30815,30826,30830,30834,30841],{"__ignoreMap":56},[449,30600,30601,30603,30605,30608,30610,30612,30614],{"class":451,"line":452},[449,30602,4629],{"class":680},[449,30604,10789],{"class":680},[449,30606,30607],{"class":721}," useAuth",[449,30609,718],{"class":680},[449,30611,2090],{"class":684},[449,30613,1498],{"class":680},[449,30615,1501],{"class":684},[449,30617,30618,30620,30622,30624,30627,30629,30632,30634,30636,30638],{"class":451,"line":114},[449,30619,5048],{"class":680},[449,30621,27416],{"class":714},[449,30623,718],{"class":680},[449,30625,30626],{"class":721}," useState",[449,30628,725],{"class":684},[449,30630,30631],{"class":691},"\"auth-user\"",[449,30633,23167],{"class":684},[449,30635,1498],{"class":680},[449,30637,27020],{"class":714},[449,30639,740],{"class":684},[449,30641,30642,30644,30646,30648,30650,30652,30655,30657,30659,30661],{"class":451,"line":111},[449,30643,5048],{"class":680},[449,30645,29764],{"class":714},[449,30647,718],{"class":680},[449,30649,30626],{"class":721},[449,30651,725],{"class":684},[449,30653,30654],{"class":691},"\"auth-loading\"",[449,30656,23167],{"class":684},[449,30658,1498],{"class":680},[449,30660,29816],{"class":714},[449,30662,740],{"class":684},[449,30664,30665],{"class":451,"line":468},[449,30666,700],{"emptyLinePlaceholder":130},[449,30668,30669,30671,30674,30676,30678,30680,30682],{"class":451,"line":474},[449,30670,5048],{"class":680},[449,30672,30673],{"class":721}," fetchUser",[449,30675,718],{"class":680},[449,30677,5597],{"class":680},[449,30679,2090],{"class":684},[449,30681,1498],{"class":680},[449,30683,1501],{"class":684},[449,30685,30686,30688,30690,30692],{"class":451,"line":480},[449,30687,29937],{"class":684},[449,30689,5014],{"class":680},[449,30691,29816],{"class":714},[449,30693,695],{"class":684},[449,30695,30696,30699],{"class":451,"line":486},[449,30697,30698],{"class":680},"    try",[449,30700,1501],{"class":684},[449,30702,30703,30706,30708,30710,30712,30714,30717],{"class":451,"line":492},[449,30704,30705],{"class":684},"      user.value ",[449,30707,5014],{"class":680},[449,30709,1654],{"class":680},[449,30711,29847],{"class":721},[449,30713,725],{"class":684},[449,30715,30716],{"class":691},"\"\u002Fapi\u002Fauth\u002Fme\"",[449,30718,740],{"class":684},[449,30720,30721,30724,30726],{"class":451,"line":498},[449,30722,30723],{"class":684},"    } ",[449,30725,5746],{"class":680},[449,30727,1501],{"class":684},[449,30729,30730,30732,30734,30736],{"class":451,"line":133},[449,30731,30705],{"class":684},[449,30733,5014],{"class":680},[449,30735,27020],{"class":714},[449,30737,695],{"class":684},[449,30739,30740,30742,30744],{"class":451,"line":509},[449,30741,30723],{"class":684},[449,30743,29930],{"class":680},[449,30745,1501],{"class":684},[449,30747,30748,30751,30753,30755],{"class":451,"line":318},[449,30749,30750],{"class":684},"      loading.value ",[449,30752,5014],{"class":680},[449,30754,8905],{"class":714},[449,30756,695],{"class":684},[449,30758,30759],{"class":451,"line":520},[449,30760,7544],{"class":684},[449,30762,30763],{"class":451,"line":526},[449,30764,4763],{"class":684},[449,30766,30767],{"class":451,"line":532},[449,30768,700],{"emptyLinePlaceholder":130},[449,30770,30771,30773,30776,30778,30780,30782,30784],{"class":451,"line":2790},[449,30772,5048],{"class":680},[449,30774,30775],{"class":721}," logout",[449,30777,718],{"class":680},[449,30779,5597],{"class":680},[449,30781,2090],{"class":684},[449,30783,1498],{"class":680},[449,30785,1501],{"class":684},[449,30787,30788,30790,30792,30794,30797,30800,30802],{"class":451,"line":3511},[449,30789,12301],{"class":680},[449,30791,29847],{"class":721},[449,30793,725],{"class":684},[449,30795,30796],{"class":691},"\"\u002Fapi\u002Fauth\u002Flogout\"",[449,30798,30799],{"class":684},", { method: ",[449,30801,29862],{"class":691},[449,30803,2051],{"class":684},[449,30805,30806,30809,30811,30813],{"class":451,"line":3526},[449,30807,30808],{"class":684},"    user.value ",[449,30810,5014],{"class":680},[449,30812,27020],{"class":714},[449,30814,695],{"class":684},[449,30816,30817,30819,30821,30824],{"class":451,"line":3531},[449,30818,29882],{"class":721},[449,30820,725],{"class":684},[449,30822,30823],{"class":691},"\"\u002Flogin\"",[449,30825,740],{"class":684},[449,30827,30828],{"class":451,"line":3536},[449,30829,4763],{"class":684},[449,30831,30832],{"class":451,"line":4009},[449,30833,700],{"emptyLinePlaceholder":130},[449,30835,30836,30838],{"class":451,"line":4015},[449,30837,4726],{"class":680},[449,30839,30840],{"class":684}," { user, loading, fetchUser, logout };\n",[449,30842,30843],{"class":451,"line":4021},[449,30844,20963],{"class":684},[73,30846],{},[32,30848,30850],{"id":30849},"security-checklist","Security Checklist",[21,30852,30853],{},"Before going to production, verify:",[25,30855,30856,30904,30906,30910,30984,30986,30988,30991,31023,31026,31052,31055,31069],{"type":27},[383,30857,30860,30868,30874,30880,30886,30892,30898],{"className":30858},[30859],"contains-task-list",[386,30861,30864,30867],{"className":30862},[30863],"task-list-item",[27248,30865],{"disabled":130,"type":30866},"checkbox"," HTTPS enabled",[386,30869,30871,30873],{"className":30870},[30863],[27248,30872],{"disabled":130,"type":30866}," AUTH_SECRET is set and secure",[386,30875,30877,30879],{"className":30876},[30863],[27248,30878],{"disabled":130,"type":30866}," Passwords are hashed with Argon2 or bcrypt",[386,30881,30883,30885],{"className":30882},[30863],[27248,30884],{"disabled":130,"type":30866}," Cookie has httpOnly, secure, and sameSite flags",[386,30887,30889,30891],{"className":30888},[30863],[27248,30890],{"disabled":130,"type":30866}," Rate limiting on login\u002Fregister endpoints",[386,30893,30895,30897],{"className":30894},[30863],[27248,30896],{"disabled":130,"type":30866}," Email validation implemented",[386,30899,30901,30903],{"className":30900},[30863],[27248,30902],{"disabled":130,"type":30866}," Password strength requirements enforced\n::",[73,30905],{},[32,30907,30909],{"id":30908},"api-routes-summary","API Routes Summary",[547,30911,30912,30922],{},[550,30913,30914],{},[553,30915,30916,30918,30920],{},[556,30917,14520],{},[556,30919,6853],{},[556,30921,923],{},[569,30923,30924,30936,30948,30960,30972],{},[553,30925,30926,30928,30933],{},[574,30927,14556],{},[574,30929,30930],{},[40,30931,30932],{},"\u002Fapi\u002Fauth\u002Fregister",[574,30934,30935],{},"Create new account",[553,30937,30938,30940,30945],{},[574,30939,14556],{},[574,30941,30942],{},[40,30943,30944],{},"\u002Fapi\u002Fauth\u002Flogin",[574,30946,30947],{},"Authenticate user",[553,30949,30950,30952,30957],{},[574,30951,14556],{},[574,30953,30954],{},[40,30955,30956],{},"\u002Fapi\u002Fauth\u002Flogout",[574,30958,30959],{},"Clear session",[553,30961,30962,30964,30969],{},[574,30963,14531],{},[574,30965,30966],{},[40,30967,30968],{},"\u002Fapi\u002Fauth\u002Fme",[574,30970,30971],{},"Get current user",[553,30973,30974,30976,30981],{},[574,30975,14531],{},[574,30977,30978],{},[40,30979,30980],{},"\u002Fapi\u002Fauth\u002F[...]",[574,30982,30983],{},"OAuth handlers",[73,30985],{},[16,30987,3681],{"id":3680},[21,30989,30990],{},"Authentication is complex, but with Nuxt 4 and the right tools, you can build a secure system without reinventing the wheel. We've covered:",[383,30992,30993,30999,31005,31011,31017],{},[386,30994,30995,30998],{},[151,30996,30997],{},"Credentials-based auth"," with secure password hashing",[386,31000,31001,31004],{},[151,31002,31003],{},"JWT tokens"," stored in httpOnly cookies",[386,31006,31007,31010],{},[151,31008,31009],{},"OAuth integration"," with GitHub",[386,31012,31013,31016],{},[151,31014,31015],{},"Protected API routes"," for authenticated endpoints",[386,31018,31019,31022],{},[151,31020,31021],{},"Frontend auth pages"," with proper error handling",[21,31024,31025],{},"The key takeaways:",[816,31027,31028,31034,31040,31046],{},[386,31029,31030,31033],{},[151,31031,31032],{},"Never store plain-text passwords"," — use Argon2 or bcrypt",[386,31035,31036,31039],{},[151,31037,31038],{},"Use httpOnly cookies"," for token storage",[386,31041,31042,31045],{},[151,31043,31044],{},"Validate everything"," on both client and server",[386,31047,31048,31051],{},[151,31049,31050],{},"Use established libraries"," rather than rolling your own",[21,31053,31054],{},"In production, consider adding:",[383,31056,31057,31060,31063,31066],{},[386,31058,31059],{},"Rate limiting on auth endpoints",[386,31061,31062],{},"Email verification flow",[386,31064,31065],{},"Password reset functionality",[386,31067,31068],{},"Two-factor authentication",[21,31070,31071],{},"Now go forth and secure your applications! 🔐",[3728,31073,31074],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":56,"searchDepth":111,"depth":111,"links":31076},[31077,31078,31079,31080,31081,31082,31088,31089,31090,31091,31092,31093],{"id":26280,"depth":114,"text":26281},{"id":10534,"depth":114,"text":10535},{"id":26444,"depth":114,"text":26445},{"id":26621,"depth":114,"text":26622},{"id":27113,"depth":114,"text":27114},{"id":27683,"depth":114,"text":27684,"children":31083},[31084,31085,31086,31087],{"id":1356,"depth":111,"text":27687},{"id":28065,"depth":111,"text":28066},{"id":28370,"depth":111,"text":28371},{"id":28431,"depth":111,"text":28432},{"id":28731,"depth":114,"text":28732},{"id":29080,"depth":114,"text":29081},{"id":29362,"depth":114,"text":29363},{"id":30588,"depth":114,"text":30589},{"id":30849,"depth":114,"text":30850},{"id":30908,"depth":114,"text":30909},"A comprehensive guide to implementing authentication in Nuxt 4. Learn about session management, JWT, OAuth, and securing your API routes with type-safe authentication.",{"type":13,"value":31096},[31097,31099,31101,31105,31121],[16,31098,333],{"id":332},[21,31100,26244],{},[21,31102,26247,31103,3070],{},[151,31104,23019],{},[383,31106,31107,31109,31111,31113,31115,31117,31119],{},[386,31108,26254],{},[386,31110,26257],{},[386,31112,26260],{},[386,31114,26263],{},[386,31116,26266],{},[386,31118,26269],{},[386,31120,26272],{},[21,31122,26275],{},[24246,14639,31124,31125,31126,3608,31127],"auth","jwt","session","nuxt auth",{},"\u002Fblog\u002Fnuxt-auth-guide",{"title":26236,"description":31094},"blog\u002Fnuxt-auth-guide","l8tEttbQgPQRLnwovE4PsXPy4jotaShSRhyTYaK38B8",{"id":31134,"title":31135,"author":31136,"body":31137,"canonical":116,"categories":116,"date":32417,"description":32418,"excerpt":32419,"extension":119,"featuredImg":116,"img":32447,"keywords":32448,"language":3788,"meta":32453,"navigation":130,"ogImage":116,"path":32454,"rating":474,"readTime":532,"seo":32455,"stem":32456,"tag":21618,"__hash__":32457},"blog\u002Fblog\u002Fnuxt-layer.md","Mastering Nuxt Layers: A Complete Guide to Scalable Nuxt 3 Architecture",{"name":9,"img":11,"website":327},{"type":13,"value":31138,"toc":32389},[31139,31143,31145,31156,31159,31170,31173,31180,31182,31186,31196,31199,31210,31213,31236,31242,31244,31248,31255,31259,31276,31282,31284,31288,31294,31305,31311,31313,31317,31321,31349,31352,31387,31390,31392,31396,31439,31442,31595,31597,31601,31605,31633,31636,31670,31673,31708,31710,31714,31721,31758,31761,31763,31767,31770,31779,31782,31785,31794,31797,31799,31803,31806,31872,31875,31877,31881,31884,31986,31989,31991,31995,31998,32043,32046,32048,32052,32055,32075,32078,32083,32085,32089,32139,32142,32144,32148,32151,32176,32219,32222,32224,32228,32231,32241,32247,32249,32253,32267,32273,32275,32279,32335,32338,32340,32344,32349,32360,32365,32373,32375,32377,32380,32383,32386],[16,31140,31142],{"id":31141},"mastering-nuxt-layers","Mastering Nuxt Layers",[32,31144,333],{"id":332},[21,31146,31147,31148,31151,31152,31155],{},"Nuxt 3 introduced many powerful features, but ",[151,31149,31150],{},"Nuxt Layers"," stand out as one of the most transformative. Layers allow you to build applications by ",[151,31153,31154],{},"composing reusable Nuxt projects",", instead of maintaining large monolithic codebases or copying boilerplate across repositories.",[21,31157,31158],{},"If you’ve ever wanted to:",[383,31160,31161,31164,31167],{},[386,31162,31163],{},"Reuse layouts, components, and pages across projects",[386,31165,31166],{},"Build a scalable SaaS architecture",[386,31168,31169],{},"Maintain a shared design system or feature set",[21,31171,31172],{},"Then Nuxt Layers are exactly what you’re looking for.",[21,31174,31175,31176,31179],{},"This guide is written as a ",[151,31177,31178],{},"long-form tutorial",". You can follow along step by step and apply everything directly to real projects.",[73,31181],{},[32,31183,31185],{"id":31184},"what-are-nuxt-layers","What Are Nuxt Layers?",[21,31187,23249,31188,31191,31192,31195],{},[151,31189,31190],{},"Nuxt Layer"," is a Nuxt application that is designed to be ",[151,31193,31194],{},"extended",", not deployed on its own.",[21,31197,31198],{},"In simple terms:",[383,31200,31201,31204,31207],{},[386,31202,31203],{},"A layer looks like a normal Nuxt app",[386,31205,31206],{},"Another Nuxt app can extend it",[386,31208,31209],{},"Nuxt merges everything together at runtime",[21,31211,31212],{},"Layers can contain:",[383,31214,31215,31218,31221,31224,31227,31230,31233],{},[386,31216,31217],{},"Pages",[386,31219,31220],{},"Components",[386,31222,31223],{},"Layouts",[386,31225,31226],{},"Composables",[386,31228,31229],{},"Assets",[386,31231,31232],{},"Configuration",[386,31234,31235],{},"Dependencies",[31237,31238,31239],"blockquote",{},[21,31240,31241],{},"Think of layers as inheritance for Nuxt applications.",[73,31243],{},[32,31245,31247],{"id":31246},"why-nuxt-layers-matter","Why Nuxt Layers Matter",[21,31249,31250,31251,31254],{},"Before layers, reuse often meant duplication. Layers introduce a ",[151,31252,31253],{},"first-class architectural pattern"," for sharing functionality.",[2808,31256,31258],{"id":31257},"benefits-of-using-layers","Benefits of Using Layers",[383,31260,31261,31264,31267,31270,31273],{},[386,31262,31263],{},"Reusable features across multiple apps",[386,31265,31266],{},"Cleaner separation of concerns",[386,31268,31269],{},"Faster project setup",[386,31271,31272],{},"Easier long-term maintenance",[386,31274,31275],{},"Ideal for SaaS platforms and white-label apps",[21,31277,31278,31279,165],{},"Layers help teams move faster ",[151,31280,31281],{},"without sacrificing structure",[73,31283],{},[32,31285,31287],{"id":31286},"how-nuxt-layers-work","How Nuxt Layers Work",[21,31289,31290,31291,3070],{},"Nuxt merges layers ",[151,31292,31293],{},"from bottom to top",[816,31295,31296,31299,31302],{},[386,31297,31298],{},"Base layers (design system, shared config)",[386,31300,31301],{},"Feature layers (auth, billing, dashboards)",[386,31303,31304],{},"Final application (branding, custom logic)",[21,31306,31307,31308,165],{},"If multiple layers define the same file, ",[151,31309,31310],{},"the closest one wins",[73,31312],{},[32,31314,31316],{"id":31315},"creating-your-first-nuxt-layer","Creating Your First Nuxt Layer",[2808,31318,31320],{"id":31319},"step-1-create-the-layer","Step 1: Create the Layer",[48,31322,31324],{"className":839,"code":31323,"language":841,"meta":56,"style":56},"npx nuxi init layers\u002Fbase-ui\ncd layers\u002Fbase-ui\nnpm install\n",[40,31325,31326,31337,31343],{"__ignoreMap":56},[449,31327,31328,31330,31332,31334],{"class":451,"line":452},[449,31329,8887],{"class":721},[449,31331,6796],{"class":691},[449,31333,4478],{"class":691},[449,31335,31336],{"class":691}," layers\u002Fbase-ui\n",[449,31338,31339,31341],{"class":451,"line":114},[449,31340,4490],{"class":714},[449,31342,31336],{"class":691},[449,31344,31345,31347],{"class":451,"line":111},[449,31346,3703],{"class":721},[449,31348,4512],{"class":691},[21,31350,31351],{},"This creates a standard Nuxt project structure:",[48,31353,31355],{"className":443,"code":31354,"language":445,"meta":56,"style":56},"layers\u002Fbase-ui\u002F\n├─ components\u002F\n├─ layouts\u002F\n├─ composables\u002F\n├─ assets\u002F\n├─ nuxt.config.ts\n",[40,31356,31357,31362,31367,31372,31377,31382],{"__ignoreMap":56},[449,31358,31359],{"class":451,"line":452},[449,31360,31361],{},"layers\u002Fbase-ui\u002F\n",[449,31363,31364],{"class":451,"line":114},[449,31365,31366],{},"├─ components\u002F\n",[449,31368,31369],{"class":451,"line":111},[449,31370,31371],{},"├─ layouts\u002F\n",[449,31373,31374],{"class":451,"line":468},[449,31375,31376],{},"├─ composables\u002F\n",[449,31378,31379],{"class":451,"line":474},[449,31380,31381],{},"├─ assets\u002F\n",[449,31383,31384],{"class":451,"line":480},[449,31385,31386],{},"├─ nuxt.config.ts\n",[21,31388,31389],{},"You will not run this project directly—it exists to be extended.",[73,31391],{},[2808,31393,31395],{"id":31394},"step-2-configure-the-layer","Step 2: Configure the Layer",[48,31397,31399],{"className":670,"code":31398,"language":673,"meta":56,"style":56},"\u002F\u002F layers\u002Fbase-ui\u002Fnuxt.config.ts\nexport default defineNuxtConfig({\n  components: true,\n  css: [\"~\u002Fassets\u002Fmain.css\"],\n});\n",[40,31400,31401,31406,31416,31425,31435],{"__ignoreMap":56},[449,31402,31403],{"class":451,"line":452},[449,31404,31405],{"class":705},"\u002F\u002F layers\u002Fbase-ui\u002Fnuxt.config.ts\n",[449,31407,31408,31410,31412,31414],{"class":451,"line":114},[449,31409,4629],{"class":680},[449,31411,4632],{"class":680},[449,31413,4635],{"class":721},[449,31415,1391],{"class":684},[449,31417,31418,31421,31423],{"class":451,"line":111},[449,31419,31420],{"class":684},"  components: ",[449,31422,2169],{"class":714},[449,31424,779],{"class":684},[449,31426,31427,31430,31433],{"class":451,"line":468},[449,31428,31429],{"class":684},"  css: [",[449,31431,31432],{"class":691},"\"~\u002Fassets\u002Fmain.css\"",[449,31434,1469],{"class":684},[449,31436,31437],{"class":451,"line":474},[449,31438,784],{"class":684},[21,31440,31441],{},"Add a shared component:",[48,31443,31445],{"className":24546,"code":31444,"language":23763,"meta":56,"style":56},"\u003C!-- layers\u002Fbase-ui\u002Fcomponents\u002FBaseButton.vue -->\n\u003Ctemplate>\n  \u003Cbutton class=\"btn\">\n    \u003Cslot \u002F>\n  \u003C\u002Fbutton>\n\u003C\u002Ftemplate>\n\n\u003Cstyle scoped>\n.btn {\n  padding: 0.75rem 1.25rem;\n  border-radius: 0.5rem;\n  background: black;\n  color: white;\n}\n\u003C\u002Fstyle>\n",[40,31446,31447,31452,31460,31475,31487,31495,31503,31507,31518,31525,31545,31559,31571,31583,31587],{"__ignoreMap":56},[449,31448,31449],{"class":451,"line":452},[449,31450,31451],{"class":705},"\u003C!-- layers\u002Fbase-ui\u002Fcomponents\u002FBaseButton.vue -->\n",[449,31453,31454,31456,31458],{"class":451,"line":114},[449,31455,5547],{"class":684},[449,31457,24690],{"class":17370},[449,31459,23122],{"class":684},[449,31461,31462,31464,31466,31468,31470,31473],{"class":451,"line":111},[449,31463,24697],{"class":684},[449,31465,24739],{"class":17370},[449,31467,29391],{"class":721},[449,31469,5014],{"class":684},[449,31471,31472],{"class":691},"\"btn\"",[449,31474,23122],{"class":684},[449,31476,31477,31479,31482,31485],{"class":451,"line":468},[449,31478,24706],{"class":684},[449,31480,31481],{"class":17370},"slot",[449,31483,5866],{"class":31484},"s7hpK",[449,31486,23122],{"class":684},[449,31488,31489,31491,31493],{"class":451,"line":474},[449,31490,24785],{"class":684},[449,31492,24739],{"class":17370},[449,31494,23122],{"class":684},[449,31496,31497,31499,31501],{"class":451,"line":480},[449,31498,23220],{"class":684},[449,31500,24690],{"class":17370},[449,31502,23122],{"class":684},[449,31504,31505],{"class":451,"line":486},[449,31506,700],{"emptyLinePlaceholder":130},[449,31508,31509,31511,31513,31516],{"class":451,"line":492},[449,31510,5547],{"class":684},[449,31512,3728],{"class":17370},[449,31514,31515],{"class":721}," scoped",[449,31517,23122],{"class":684},[449,31519,31520,31523],{"class":451,"line":498},[449,31521,31522],{"class":721},".btn",[449,31524,1501],{"class":684},[449,31526,31527,31530,31532,31535,31538,31541,31543],{"class":451,"line":133},[449,31528,31529],{"class":714},"  padding",[449,31531,1482],{"class":684},[449,31533,31534],{"class":714},"0.75",[449,31536,31537],{"class":680},"rem",[449,31539,31540],{"class":714}," 1.25",[449,31542,31537],{"class":680},[449,31544,695],{"class":684},[449,31546,31547,31550,31552,31555,31557],{"class":451,"line":509},[449,31548,31549],{"class":714},"  border-radius",[449,31551,1482],{"class":684},[449,31553,31554],{"class":714},"0.5",[449,31556,31537],{"class":680},[449,31558,695],{"class":684},[449,31560,31561,31564,31566,31569],{"class":451,"line":318},[449,31562,31563],{"class":714},"  background",[449,31565,1482],{"class":684},[449,31567,31568],{"class":714},"black",[449,31570,695],{"class":684},[449,31572,31573,31576,31578,31581],{"class":451,"line":520},[449,31574,31575],{"class":714},"  color",[449,31577,1482],{"class":684},[449,31579,31580],{"class":714},"white",[449,31582,695],{"class":684},[449,31584,31585],{"class":451,"line":526},[449,31586,4604],{"class":684},[449,31588,31589,31591,31593],{"class":451,"line":532},[449,31590,23220],{"class":684},[449,31592,3728],{"class":17370},[449,31594,23122],{"class":684},[73,31596],{},[32,31598,31600],{"id":31599},"using-a-layer-in-a-nuxt-app","Using a Layer in a Nuxt App",[2808,31602,31604],{"id":31603},"step-3-create-the-app","Step 3: Create the App",[48,31606,31608],{"className":839,"code":31607,"language":841,"meta":56,"style":56},"npx nuxi init apps\u002Fweb\ncd apps\u002Fweb\nnpm install\n",[40,31609,31610,31621,31627],{"__ignoreMap":56},[449,31611,31612,31614,31616,31618],{"class":451,"line":452},[449,31613,8887],{"class":721},[449,31615,6796],{"class":691},[449,31617,4478],{"class":691},[449,31619,31620],{"class":691}," apps\u002Fweb\n",[449,31622,31623,31625],{"class":451,"line":114},[449,31624,4490],{"class":714},[449,31626,31620],{"class":691},[449,31628,31629,31631],{"class":451,"line":111},[449,31630,3703],{"class":721},[449,31632,4512],{"class":691},[21,31634,31635],{},"Extend the layer:",[48,31637,31639],{"className":670,"code":31638,"language":673,"meta":56,"style":56},"\u002F\u002F apps\u002Fweb\u002Fnuxt.config.ts\nexport default defineNuxtConfig({\n  extends: [\"..\u002Flayers\u002Fbase-ui\"],\n});\n",[40,31640,31641,31646,31656,31666],{"__ignoreMap":56},[449,31642,31643],{"class":451,"line":452},[449,31644,31645],{"class":705},"\u002F\u002F apps\u002Fweb\u002Fnuxt.config.ts\n",[449,31647,31648,31650,31652,31654],{"class":451,"line":114},[449,31649,4629],{"class":680},[449,31651,4632],{"class":680},[449,31653,4635],{"class":721},[449,31655,1391],{"class":684},[449,31657,31658,31661,31664],{"class":451,"line":111},[449,31659,31660],{"class":684},"  extends: [",[449,31662,31663],{"class":691},"\"..\u002Flayers\u002Fbase-ui\"",[449,31665,1469],{"class":684},[449,31667,31668],{"class":451,"line":468},[449,31669,784],{"class":684},[21,31671,31672],{},"Now you can use the shared component without importing it:",[48,31674,31676],{"className":24546,"code":31675,"language":23763,"meta":56,"style":56},"\u003Ctemplate>\n  \u003CBaseButton> Click Me \u003C\u002FBaseButton>\n\u003C\u002Ftemplate>\n",[40,31677,31678,31686,31700],{"__ignoreMap":56},[449,31679,31680,31682,31684],{"class":451,"line":452},[449,31681,5547],{"class":684},[449,31683,24690],{"class":17370},[449,31685,23122],{"class":684},[449,31687,31688,31690,31693,31696,31698],{"class":451,"line":114},[449,31689,24697],{"class":684},[449,31691,31692],{"class":17370},"BaseButton",[449,31694,31695],{"class":684},"> Click Me \u003C\u002F",[449,31697,31692],{"class":17370},[449,31699,23122],{"class":684},[449,31701,31702,31704,31706],{"class":451,"line":111},[449,31703,23220],{"class":684},[449,31705,24690],{"class":17370},[449,31707,23122],{"class":684},[73,31709],{},[32,31711,31713],{"id":31712},"using-multiple-layers","Using Multiple Layers",[21,31715,31716,31717,31720],{},"You can extend ",[151,31718,31719],{},"multiple layers"," in a single app.",[48,31722,31724],{"className":670,"code":31723,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  extends: [\"..\u002Flayers\u002Fbase-ui\", \"..\u002Flayers\u002Fauth\", \"..\u002Flayers\u002Fdashboard\"],\n});\n",[40,31725,31726,31736,31754],{"__ignoreMap":56},[449,31727,31728,31730,31732,31734],{"class":451,"line":452},[449,31729,4629],{"class":680},[449,31731,4632],{"class":680},[449,31733,4635],{"class":721},[449,31735,1391],{"class":684},[449,31737,31738,31740,31742,31744,31747,31749,31752],{"class":451,"line":114},[449,31739,31660],{"class":684},[449,31741,31663],{"class":691},[449,31743,349],{"class":684},[449,31745,31746],{"class":691},"\"..\u002Flayers\u002Fauth\"",[449,31748,349],{"class":684},[449,31750,31751],{"class":691},"\"..\u002Flayers\u002Fdashboard\"",[449,31753,1469],{"class":684},[449,31755,31756],{"class":451,"line":111},[449,31757,784],{"class":684},[21,31759,31760],{},"Later layers override earlier ones.",[73,31762],{},[32,31764,31766],{"id":31765},"pages-inside-layers","Pages Inside Layers",[21,31768,31769],{},"Layers can define pages just like an app.",[48,31771,31773],{"className":443,"code":31772,"language":445,"meta":56,"style":56},"layers\u002Fauth\u002Fpages\u002Flogin.vue\n",[40,31774,31775],{"__ignoreMap":56},[449,31776,31777],{"class":451,"line":452},[449,31778,31772],{},[21,31780,31781],{},"That page automatically becomes available in the app.",[21,31783,31784],{},"To override it:",[48,31786,31788],{"className":443,"code":31787,"language":445,"meta":56,"style":56},"apps\u002Fweb\u002Fpages\u002Flogin.vue\n",[40,31789,31790],{"__ignoreMap":56},[449,31791,31792],{"class":451,"line":452},[449,31793,31787],{},[21,31795,31796],{},"Nuxt will use the app’s version instead.",[73,31798],{},[32,31800,31802],{"id":31801},"layouts-in-layers","Layouts in Layers",[21,31804,31805],{},"Shared layouts are ideal for base UI.",[48,31807,31809],{"className":24546,"code":31808,"language":23763,"meta":56,"style":56},"\u003C!-- layers\u002Fbase-ui\u002Flayouts\u002Fdefault.vue -->\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003Cheader>Base Header\u003C\u002Fheader>\n    \u003Cslot \u002F>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n",[40,31810,31811,31816,31824,31832,31846,31856,31864],{"__ignoreMap":56},[449,31812,31813],{"class":451,"line":452},[449,31814,31815],{"class":705},"\u003C!-- layers\u002Fbase-ui\u002Flayouts\u002Fdefault.vue -->\n",[449,31817,31818,31820,31822],{"class":451,"line":114},[449,31819,5547],{"class":684},[449,31821,24690],{"class":17370},[449,31823,23122],{"class":684},[449,31825,31826,31828,31830],{"class":451,"line":111},[449,31827,24697],{"class":684},[449,31829,29388],{"class":17370},[449,31831,23122],{"class":684},[449,31833,31834,31836,31839,31842,31844],{"class":451,"line":468},[449,31835,24706],{"class":684},[449,31837,31838],{"class":17370},"header",[449,31840,31841],{"class":684},">Base Header\u003C\u002F",[449,31843,31838],{"class":17370},[449,31845,23122],{"class":684},[449,31847,31848,31850,31852,31854],{"class":451,"line":474},[449,31849,24706],{"class":684},[449,31851,31481],{"class":17370},[449,31853,5866],{"class":31484},[449,31855,23122],{"class":684},[449,31857,31858,31860,31862],{"class":451,"line":480},[449,31859,24785],{"class":684},[449,31861,29388],{"class":17370},[449,31863,23122],{"class":684},[449,31865,31866,31868,31870],{"class":451,"line":486},[449,31867,23220],{"class":684},[449,31869,24690],{"class":17370},[449,31871,23122],{"class":684},[21,31873,31874],{},"All extending apps inherit this layout automatically.",[73,31876],{},[32,31878,31880],{"id":31879},"composables-in-layers","Composables in Layers",[21,31882,31883],{},"Layers are perfect for shared logic.",[48,31885,31887],{"className":670,"code":31886,"language":673,"meta":56,"style":56},"\u002F\u002F layers\u002Fauth\u002Fcomposables\u002FuseAuth.ts\nexport const useAuth = () => {\n  const user = useState(\"user\", () => null);\n\n  const login = async () => {\n    user.value = { name: \"Vantol\" };\n  };\n\n  return { user, login };\n};\n",[40,31888,31889,31894,31910,31932,31936,31953,31967,31971,31975,31982],{"__ignoreMap":56},[449,31890,31891],{"class":451,"line":452},[449,31892,31893],{"class":705},"\u002F\u002F layers\u002Fauth\u002Fcomposables\u002FuseAuth.ts\n",[449,31895,31896,31898,31900,31902,31904,31906,31908],{"class":451,"line":114},[449,31897,4629],{"class":680},[449,31899,10789],{"class":680},[449,31901,30607],{"class":721},[449,31903,718],{"class":680},[449,31905,2090],{"class":684},[449,31907,1498],{"class":680},[449,31909,1501],{"class":684},[449,31911,31912,31914,31916,31918,31920,31922,31924,31926,31928,31930],{"class":451,"line":111},[449,31913,5048],{"class":680},[449,31915,27416],{"class":714},[449,31917,718],{"class":680},[449,31919,30626],{"class":721},[449,31921,725],{"class":684},[449,31923,2042],{"class":691},[449,31925,23167],{"class":684},[449,31927,1498],{"class":680},[449,31929,27020],{"class":714},[449,31931,740],{"class":684},[449,31933,31934],{"class":451,"line":468},[449,31935,700],{"emptyLinePlaceholder":130},[449,31937,31938,31940,31943,31945,31947,31949,31951],{"class":451,"line":474},[449,31939,5048],{"class":680},[449,31941,31942],{"class":721}," login",[449,31944,718],{"class":680},[449,31946,5597],{"class":680},[449,31948,2090],{"class":684},[449,31950,1498],{"class":680},[449,31952,1501],{"class":684},[449,31954,31955,31957,31959,31962,31965],{"class":451,"line":480},[449,31956,30808],{"class":684},[449,31958,5014],{"class":680},[449,31960,31961],{"class":684}," { name: ",[449,31963,31964],{"class":691},"\"Vantol\"",[449,31966,1520],{"class":684},[449,31968,31969],{"class":451,"line":486},[449,31970,4763],{"class":684},[449,31972,31973],{"class":451,"line":492},[449,31974,700],{"emptyLinePlaceholder":130},[449,31976,31977,31979],{"class":451,"line":498},[449,31978,4726],{"class":680},[449,31980,31981],{"class":684}," { user, login };\n",[449,31983,31984],{"class":451,"line":133},[449,31985,20963],{"class":684},[21,31987,31988],{},"This composable is globally available.",[73,31990],{},[32,31992,31994],{"id":31993},"runtime-config-and-environment-variables","Runtime Config and Environment Variables",[21,31996,31997],{},"Layers can define runtime configuration:",[48,31999,32001],{"className":670,"code":32000,"language":673,"meta":56,"style":56},"export default defineNuxtConfig({\n  runtimeConfig: {\n    public: {\n      appName: \"Base App\",\n    },\n  },\n});\n",[40,32002,32003,32013,32017,32021,32031,32035,32039],{"__ignoreMap":56},[449,32004,32005,32007,32009,32011],{"class":451,"line":452},[449,32006,4629],{"class":680},[449,32008,4632],{"class":680},[449,32010,4635],{"class":721},[449,32012,1391],{"class":684},[449,32014,32015],{"class":451,"line":114},[449,32016,15396],{"class":684},[449,32018,32019],{"class":451,"line":111},[449,32020,15401],{"class":684},[449,32022,32023,32026,32029],{"class":451,"line":468},[449,32024,32025],{"class":684},"      appName: ",[449,32027,32028],{"class":691},"\"Base App\"",[449,32030,779],{"class":684},[449,32032,32033],{"class":451,"line":474},[449,32034,1458],{"class":684},[449,32036,32037],{"class":451,"line":480},[449,32038,1474],{"class":684},[449,32040,32041],{"class":451,"line":486},[449,32042,784],{"class":684},[21,32044,32045],{},"Apps can override these values safely.",[73,32047],{},[32,32049,32051],{"id":32050},"dependencies-in-layers","Dependencies in Layers",[21,32053,32054],{},"Layers may include their own dependencies:",[48,32056,32058],{"className":839,"code":32057,"language":841,"meta":56,"style":56},"cd layers\u002Fbase-ui\nnpm install tailwindcss\n",[40,32059,32060,32066],{"__ignoreMap":56},[449,32061,32062,32064],{"class":451,"line":452},[449,32063,4490],{"class":714},[449,32065,31336],{"class":691},[449,32067,32068,32070,32072],{"class":451,"line":114},[449,32069,3703],{"class":721},[449,32071,3706],{"class":691},[449,32073,32074],{"class":691}," tailwindcss\n",[21,32076,32077],{},"Dependencies are merged into the final build.",[31237,32079,32080],{},[21,32081,32082],{},"Be mindful—shared dependencies affect every extending app.",[73,32084],{},[32,32086,32088],{"id":32087},"recommended-monorepo-structure","Recommended Monorepo Structure",[48,32090,32092],{"className":443,"code":32091,"language":445,"meta":56,"style":56},".\n├─ apps\u002F\n│  ├─ web\n│  └─ admin\n├─ layers\u002F\n│  ├─ base-ui\n│  ├─ auth\n│  ├─ billing\n│  └─ dashboard\n",[40,32093,32094,32099,32104,32109,32114,32119,32124,32129,32134],{"__ignoreMap":56},[449,32095,32096],{"class":451,"line":452},[449,32097,32098],{},".\n",[449,32100,32101],{"class":451,"line":114},[449,32102,32103],{},"├─ apps\u002F\n",[449,32105,32106],{"class":451,"line":111},[449,32107,32108],{},"│  ├─ web\n",[449,32110,32111],{"class":451,"line":468},[449,32112,32113],{},"│  └─ admin\n",[449,32115,32116],{"class":451,"line":474},[449,32117,32118],{},"├─ layers\u002F\n",[449,32120,32121],{"class":451,"line":480},[449,32122,32123],{},"│  ├─ base-ui\n",[449,32125,32126],{"class":451,"line":486},[449,32127,32128],{},"│  ├─ auth\n",[449,32130,32131],{"class":451,"line":492},[449,32132,32133],{},"│  ├─ billing\n",[449,32135,32136],{"class":451,"line":498},[449,32137,32138],{},"│  └─ dashboard\n",[21,32140,32141],{},"This structure works well with pnpm workspaces, Turborepo, or Nx.",[73,32143],{},[32,32145,32147],{"id":32146},"real-world-example-saas-starter","Real-World Example: SaaS Starter",[21,32149,32150],{},"A common production setup:",[383,32152,32153,32159,32164,32170],{},[386,32154,32155,32158],{},[40,32156,32157],{},"base-ui"," – Design system",[386,32160,32161,32163],{},[40,32162,31124],{}," – Authentication and guards",[386,32165,32166,32169],{},[40,32167,32168],{},"billing"," – Stripe and subscriptions",[386,32171,32172,32175],{},[40,32173,32174],{},"dashboard"," – Core product UI",[48,32177,32179],{"className":670,"code":32178,"language":673,"meta":56,"style":56},"extends: [\n  '..\u002Flayers\u002Fbase-ui',\n  '..\u002Flayers\u002Fauth',\n  '..\u002Flayers\u002Fbilling',\n  '..\u002Flayers\u002Fdashboard'\n]\n",[40,32180,32181,32189,32196,32203,32210,32215],{"__ignoreMap":56},[449,32182,32183,32186],{"class":451,"line":452},[449,32184,32185],{"class":721},"extends",[449,32187,32188],{"class":684},": [\n",[449,32190,32191,32194],{"class":451,"line":114},[449,32192,32193],{"class":691},"  '..\u002Flayers\u002Fbase-ui'",[449,32195,779],{"class":684},[449,32197,32198,32201],{"class":451,"line":111},[449,32199,32200],{"class":691},"  '..\u002Flayers\u002Fauth'",[449,32202,779],{"class":684},[449,32204,32205,32208],{"class":451,"line":468},[449,32206,32207],{"class":691},"  '..\u002Flayers\u002Fbilling'",[449,32209,779],{"class":684},[449,32211,32212],{"class":451,"line":474},[449,32213,32214],{"class":691},"  '..\u002Flayers\u002Fdashboard'\n",[449,32216,32217],{"class":451,"line":480},[449,32218,17405],{"class":684},[21,32220,32221],{},"New apps can be launched in days instead of weeks.",[73,32223],{},[32,32225,32227],{"id":32226},"overriding-behavior-safely","Overriding Behavior Safely",[21,32229,32230],{},"You can override:",[383,32232,32233,32235,32237,32239],{},[386,32234,31220],{},[386,32236,31217],{},[386,32238,31223],{},[386,32240,31226],{},[21,32242,32243,32244,165],{},"Nuxt resolves conflicts using ",[151,32245,32246],{},"closest-first resolution",[73,32248],{},[32,32250,32252],{"id":32251},"common-pitfalls","Common Pitfalls",[383,32254,32255,32258,32261,32264],{},[386,32256,32257],{},"Putting app-specific logic in base layers",[386,32259,32260],{},"Creating tight coupling between layers",[386,32262,32263],{},"Ignoring layer order",[386,32265,32266],{},"Treating layers like plugins",[21,32268,32269,32270,32272],{},"Design layers as ",[151,32271,24581],{},", not shortcuts.",[73,32274],{},[32,32276,32278],{"id":32277},"layers-vs-nuxt-modules","Layers vs Nuxt Modules",[547,32280,32281,32294],{},[550,32282,32283],{},[553,32284,32285,32288,32291],{},[556,32286,32287],{},"Feature",[556,32289,32290],{},"Layers",[556,32292,32293],{},"Modules",[569,32295,32296,32307,32316,32325],{},[553,32297,32298,32301,32304],{},[574,32299,32300],{},"Pages & layouts",[574,32302,32303],{},"Yes",[574,32305,32306],{},"No",[553,32308,32309,32312,32314],{},[574,32310,32311],{},"File-system reuse",[574,32313,32303],{},[574,32315,32306],{},[553,32317,32318,32321,32323],{},[574,32319,32320],{},"App architecture",[574,32322,32303],{},[574,32324,32306],{},[553,32326,32327,32330,32333],{},[574,32328,32329],{},"Runtime hooks",[574,32331,32332],{},"Limited",[574,32334,32303],{},[21,32336,32337],{},"They solve different problems and often work best together.",[73,32339],{},[32,32341,32343],{"id":32342},"when-you-should-and-shouldnt-use-layers","When You Should (and Shouldn’t) Use Layers",[21,32345,32346],{},[151,32347,32348],{},"Use layers when:",[383,32350,32351,32354,32357],{},[386,32352,32353],{},"You manage multiple Nuxt apps",[386,32355,32356],{},"You want shared features or UI",[386,32358,32359],{},"You’re building a SaaS platform",[21,32361,32362],{},[151,32363,32364],{},"Avoid layers when:",[383,32366,32367,32370],{},[386,32368,32369],{},"You have a single small app",[386,32371,32372],{},"There is little to no shared logic",[73,32374],{},[32,32376,3681],{"id":3680},[21,32378,32379],{},"Nuxt Layers unlock a new level of scalability and maintainability for Nuxt 3 applications. When designed intentionally, they allow teams to move faster, share more, and maintain cleaner architectures over time.",[21,32381,32382],{},"If you’re serious about building scalable Nuxt applications, mastering layers is no longer optional—it’s essential.",[21,32384,32385],{},"Happy building 🚀",[3728,32387,32388],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}",{"title":56,"searchDepth":111,"depth":111,"links":32390},[32391,32392,32393,32396,32397,32401,32404,32405,32406,32407,32408,32409,32410,32411,32412,32413,32414,32415,32416],{"id":332,"depth":114,"text":333},{"id":31184,"depth":114,"text":31185},{"id":31246,"depth":114,"text":31247,"children":32394},[32395],{"id":31257,"depth":111,"text":31258},{"id":31286,"depth":114,"text":31287},{"id":31315,"depth":114,"text":31316,"children":32398},[32399,32400],{"id":31319,"depth":111,"text":31320},{"id":31394,"depth":111,"text":31395},{"id":31599,"depth":114,"text":31600,"children":32402},[32403],{"id":31603,"depth":111,"text":31604},{"id":31712,"depth":114,"text":31713},{"id":31765,"depth":114,"text":31766},{"id":31801,"depth":114,"text":31802},{"id":31879,"depth":114,"text":31880},{"id":31993,"depth":114,"text":31994},{"id":32050,"depth":114,"text":32051},{"id":32087,"depth":114,"text":32088},{"id":32146,"depth":114,"text":32147},{"id":32226,"depth":114,"text":32227},{"id":32251,"depth":114,"text":32252},{"id":32277,"depth":114,"text":32278},{"id":32342,"depth":114,"text":32343},{"id":3680,"depth":114,"text":3681},"2026-01-06","A comprehensive, tutorial-style deep dive into Nuxt Layers—learn how to design, build, and scale reusable Nuxt 3 applications using layers.",{"type":13,"value":32420},[32421,32423,32425,32431,32433,32441,32443],[16,32422,31142],{"id":31141},[32,32424,333],{"id":332},[21,32426,31147,32427,31151,32429,31155],{},[151,32428,31150],{},[151,32430,31154],{},[21,32432,31158],{},[383,32434,32435,32437,32439],{},[386,32436,31163],{},[386,32438,31166],{},[386,32440,31169],{},[21,32442,31172],{},[21,32444,31175,32445,31179],{},[151,32446,31178],{},"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1517433456452-f9633a875f6f",[24246,32449,32450,23763,32451,32452],"nuxt layers","nuxt 3","architecture","monorepo",{},"\u002Fblog\u002Fnuxt-layer",{"title":31135,"description":32418},"blog\u002Fnuxt-layer","q4OJ_CF-KMEnOZx_oJWTm088iRX1j7olrl0o3sAWJD8",{"id":32459,"title":32460,"author":32461,"body":32462,"canonical":116,"categories":116,"date":32540,"description":32541,"excerpt":32542,"extension":119,"featuredImg":116,"img":120,"keywords":32548,"language":128,"meta":32549,"navigation":130,"ogImage":116,"path":32550,"rating":468,"readTime":133,"seo":32551,"stem":32552,"tag":126,"__hash__":32553},"blog\u002Fblog\u002Fnuxt3-lets-talk.md","Nuxt3-RC 10 Lets Talk",{"name":9,"website":10,"img":11},{"type":13,"value":32463,"toc":32531},[32464,32468,32471,32475,32481,32485,32491,32495,32502,32505,32514,32518,32521,32525,32528],[16,32465,32467],{"id":32466},"nuxt3-rc","Nuxt3 RC",[21,32469,32470],{},"Since its release last year October, Nuxt 3 Beta to RC10; Nuxt developers and maintainers have place a lot of\nemphasis on the performance first to be blazing fast with impressive features suchas auto imports (the best feature to date)\nand not coming to nearly a year the stable version should see the long await Hybrid Generation which will allow developers to\ndevelop web application to exisit on both a static and server side rendered environment. So lets look at RC10 and see if we can make heads or tails of this release.",[16,32472,32474],{"id":32473},"features-at-a-glance","Features at a Glance",[48,32476,32479],{"className":32477,"code":32478,"language":53},[51],"Nuxt 3 Release Candidate 10 is out ✨\n\n🚀 Full Static Generation\n⚡️ Link Prefetching\n💨 Inlined Critical Styles\n0️⃣ Experimental Zero-Client-JS Mode\n🪡 55+ enhancements and bug fixes\n",[40,32480,32478],{"__ignoreMap":56},[32,32482,32484],{"id":32483},"full-static-generation","Full Static Generation",[21,32486,32487,32488,32490],{},"Static rendering is basically files being pre-rendered using ",[40,32489,25796],{}," which allows for Nuxt to be deployed to any static\nhosting without a server API, but Nuxt3 takes it to whole other level based on the update changes in RC10 - however it does not give\nus the long await hybrid or incremental generated pages so its a start (hopefully RC12).",[32,32492,32494],{"id":32493},"link-prefetching","Link Prefetching",[21,32496,32497,32498],{},"This feature ported from Nuxt 2, is automatically prefetching the next pages when a ",[32499,32500,32501],"nuxt-link",{}," is in the viewport.",[21,32503,32504],{},"This feature is integrated with vue-router to prefetch components of the next route and also payload extraction to prefetch the payload of the next pages ahead of time! You can also hook into link:prefetch to do more prefetches.",[2808,32506,32508,32509],{"id":32507},"so-much-more-have-read-here","so much more have ",[3861,32510,32513],{"href":32511,"rel":32512},"https:\u002F\u002Fgithub.com\u002Fnuxt\u002Fframework\u002Fdiscussions\u002F7513",[3865],"read here",[32,32515,32517],{"id":32516},"whats-next","What's Next?",[21,32519,32520],{},"Your guess is as good as mine the stable version was promised from Summer and summer is well summer. It seems the best bet\nwould be for Nuxt 3 to come out in October the same time the beta was announced but I am just guessing.",[32,32522,32524],{"id":32523},"how-to-get-started","How to get started",[21,32526,32527],{},"Well the Nuxt3 RC documentation is your best bet for all your nuxt goodness. I will be starting a deep in Nuxt soon be update.",[21,32529,32530],{},"Peace......",{"title":56,"searchDepth":111,"depth":111,"links":32532},[32533,32534,32538,32539],{"id":32483,"depth":114,"text":32484},{"id":32493,"depth":114,"text":32494,"children":32535},[32536],{"id":32507,"depth":111,"text":32537},"so much more have read here",{"id":32516,"depth":114,"text":32517},{"id":32523,"depth":114,"text":32524},"2022-08-10","Nuxt3 RC is now 10 releases old but how does it stack up with past releases.",{"type":13,"value":32543},[32544,32546],[16,32545,32467],{"id":32466},[21,32547,32470],{},[122,123,124,125,126,127],{},"\u002Fblog\u002Fnuxt3-lets-talk",{"title":32460,"description":32541},"blog\u002Fnuxt3-lets-talk","hUATT_aA27p88ybLP6vDZM4rXeelZipj6wyecr4v7Uc",{"id":32555,"title":32556,"author":32557,"body":32558,"canonical":116,"categories":116,"date":33278,"description":33279,"excerpt":33280,"extension":119,"featuredImg":116,"img":32447,"keywords":33296,"language":3788,"meta":33299,"navigation":130,"ogImage":116,"path":33300,"rating":474,"readTime":133,"seo":33301,"stem":33302,"tag":3793,"__hash__":33303},"blog\u002Fblog\u002Freact-native-vs-dious.md","Dioxus vs React Native: A Modern Cross-Platform UI Comparison",{"name":9,"img":11,"website":327},{"type":13,"value":32559,"toc":33244},[32560,32562,32571,32579,32581,32585,32664,32666,32670,32672,32678,32692,32718,32721,32723,32730,32741,32762,32765,32771,32773,32777,32781,32784,32798,32801,32812,32816,32819,32827,32830,32838,32841,32843,32847,32851,32854,32887,32890,32901,32904,32909,32913,32916,32925,32927,32935,32937,32945,32947,32949,32952,32957,32965,32968,32979,32982,32985,32993,32996,33004,33006,33010,33014,33028,33041,33047,33051,33065,33068,33079,33083,33086,33088,33090,33093,33096,33110,33116,33119,33122,33133,33136,33138,33142,33145,33156,33159,33170,33173,33175,33179,33185,33199,33203,33207,33221,33223,33225,33232,33235,33238,33241],[16,32561,333],{"id":332},[21,32563,32564,32565,32567,32568,32570],{},"Cross-platform development has become the default approach for building modern applications. Among the many frameworks available, ",[151,32566,8872],{}," has long been the industry standard. However, newer frameworks like ",[151,32569,9886],{}," are challenging that position by offering a Rust-first, high-performance alternative.",[21,32572,32573,32574,23841,32576,32578],{},"In this post, we’ll compare ",[151,32575,9915],{},[151,32577,8872],{}," across architecture, performance, developer experience, tooling, and ecosystem to help you decide which framework fits your next project.",[16,32580,4373],{"id":4372},[32,32582,32584],{"id":32583},"high-level-overview","High-Level Overview",[547,32586,32587,32597],{},[550,32588,32589],{},[553,32590,32591,32593,32595],{},[556,32592,32287],{},[556,32594,9886],{},[556,32596,8872],{},[569,32598,32599,32609,32620,32631,32642,32653],{},[553,32600,32601,32604,32606],{},[574,32602,32603],{},"Language",[574,32605,9890],{},[574,32607,32608],{},"JavaScript \u002F TypeScript",[553,32610,32611,32614,32617],{},[574,32612,32613],{},"UI Model",[574,32615,32616],{},"Declarative (RSX)",[574,32618,32619],{},"Declarative (JSX)",[553,32621,32622,32625,32628],{},[574,32623,32624],{},"Platforms",[574,32626,32627],{},"Web, Desktop, Mobile",[574,32629,32630],{},"Mobile (iOS, Android)",[553,32632,32633,32636,32639],{},[574,32634,32635],{},"Rendering",[574,32637,32638],{},"Native + WASM",[574,32640,32641],{},"Native via bridge",[553,32643,32644,32647,32650],{},[574,32645,32646],{},"Backend Integration",[574,32648,32649],{},"Native Rust fullstack",[574,32651,32652],{},"Separate backend",[553,32654,32655,32658,32661],{},[574,32656,32657],{},"Performance Focus",[574,32659,32660],{},"Compile-time + memory safety",[574,32662,32663],{},"Runtime optimizations",[73,32665],{},[32,32667,32669],{"id":32668},"language-type-safety","Language & Type Safety",[2808,32671,9915],{"id":10423},[21,32673,32674,32675,32677],{},"Dioxus is built entirely in ",[151,32676,9890],{},", giving developers:",[383,32679,32680,32683,32686,32689],{},[386,32681,32682],{},"Strong compile-time guarantees",[386,32684,32685],{},"Memory safety without garbage collection",[386,32687,32688],{},"Fearless refactoring",[386,32690,32691],{},"Fewer runtime crashes",[48,32693,32695],{"className":10015,"code":32694,"language":10017,"meta":56,"style":56},"fn App() -> Element {\n    rsx! {\n        div { \"Hello from Rust!\" }\n    }\n}\n",[40,32696,32697,32701,32705,32710,32714],{"__ignoreMap":56},[449,32698,32699],{"class":451,"line":452},[449,32700,10024],{},[449,32702,32703],{"class":451,"line":114},[449,32704,10029],{},[449,32706,32707],{"class":451,"line":111},[449,32708,32709],{},"        div { \"Hello from Rust!\" }\n",[449,32711,32712],{"class":451,"line":468},[449,32713,7544],{},[449,32715,32716],{"class":451,"line":474},[449,32717,4604],{},[21,32719,32720],{},"Rust errors are caught at compile time, reducing runtime failures common in large JavaScript codebases.\n::",[2808,32722,8872],{"id":8293},[21,32724,32725,32726,32729],{},"React Native relies on ",[151,32727,32728],{},"JavaScript or TypeScript",", which offers:",[383,32731,32732,32735,32738],{},[386,32733,32734],{},"Faster onboarding",[386,32736,32737],{},"Massive community knowledge",[386,32739,32740],{},"Runtime flexibility",[48,32742,32746],{"className":32743,"code":32744,"language":32745,"meta":56,"style":56},"language-tsx shiki shiki-themes github-light github-dark","export default function App() {\n  return \u003CText>Hello from React Native\u003C\u002FText>;\n}\n","tsx",[40,32747,32748,32753,32758],{"__ignoreMap":56},[449,32749,32750],{"class":451,"line":452},[449,32751,32752],{},"export default function App() {\n",[449,32754,32755],{"class":451,"line":114},[449,32756,32757],{},"  return \u003CText>Hello from React Native\u003C\u002FText>;\n",[449,32759,32760],{"class":451,"line":111},[449,32761,4604],{},[21,32763,32764],{},"Despite TypeScript, many errors in React Native still surface at runtime, especially around async state and native bridges.\n::",[21,32766,32767,32770],{},[151,32768,32769],{},"Verdict:","\nDioxus wins on safety and correctness. React Native wins on approachability and familiarity.",[73,32772],{},[32,32774,32776],{"id":32775},"performance-architecture","Performance & Architecture",[2808,32778,32780],{"id":32779},"dioxus-performance-model","Dioxus Performance Model",[21,32782,32783],{},"Dioxus benefits from:",[383,32785,32786,32789,32792,32795],{},[386,32787,32788],{},"Zero-cost abstractions",[386,32790,32791],{},"No JS bridge",[386,32793,32794],{},"Direct native execution",[386,32796,32797],{},"WASM for the web",[21,32799,32800],{},"This leads to:",[383,32802,32803,32806,32809],{},[386,32804,32805],{},"Faster startup times",[386,32807,32808],{},"Lower memory usage",[386,32810,32811],{},"Predictable performance",[2808,32813,32815],{"id":32814},"react-native-performance-model","React Native Performance Model",[21,32817,32818],{},"React Native uses:",[383,32820,32821,32824],{},[386,32822,32823],{},"A JS runtime",[386,32825,32826],{},"A native bridge (even with the new architecture)",[21,32828,32829],{},"While performance has improved significantly, complex UIs can still suffer from:",[383,32831,32832,32835],{},[386,32833,32834],{},"Bridge overhead",[386,32836,32837],{},"Thread synchronization issues",[21,32839,32840],{},"If your app is performance-critical (IoT dashboards, embedded systems, real-time UIs), Dioxus has a structural advantage.\n::",[73,32842],{},[32,32844,32846],{"id":32845},"ui-development-experience","UI Development Experience",[2808,32848,32850],{"id":32849},"dioxus-rsx","Dioxus (RSX)",[21,32852,32853],{},"RSX feels similar to JSX but enforces correctness:",[48,32855,32857],{"className":10015,"code":32856,"language":10017,"meta":56,"style":56},"rsx! {\n    button {\n        onclick: move |_| count += 1,\n        \"Increment\"\n    }\n}\n",[40,32858,32859,32864,32869,32874,32879,32883],{"__ignoreMap":56},[449,32860,32861],{"class":451,"line":452},[449,32862,32863],{},"rsx! {\n",[449,32865,32866],{"class":451,"line":114},[449,32867,32868],{},"    button {\n",[449,32870,32871],{"class":451,"line":111},[449,32872,32873],{},"        onclick: move |_| count += 1,\n",[449,32875,32876],{"class":451,"line":468},[449,32877,32878],{},"        \"Increment\"\n",[449,32880,32881],{"class":451,"line":474},[449,32882,7544],{},[449,32884,32885],{"class":451,"line":480},[449,32886,4604],{},[21,32888,32889],{},"Pros:",[383,32891,32892,32895,32898],{},[386,32893,32894],{},"Compile-time UI validation",[386,32896,32897],{},"No undefined props",[386,32899,32900],{},"Cleaner refactors",[21,32902,32903],{},"Cons:",[383,32905,32906],{},[386,32907,32908],{},"Rust macros have a learning curve",[2808,32910,32912],{"id":32911},"react-native-jsx","React Native (JSX)",[21,32914,32915],{},"JSX is flexible and expressive:",[48,32917,32919],{"className":32743,"code":32918,"language":32745,"meta":56,"style":56},"\u003CButton title=\"Increment\" onPress={() => setCount((c) => c + 1)} \u002F>\n",[40,32920,32921],{"__ignoreMap":56},[449,32922,32923],{"class":451,"line":452},[449,32924,32918],{},[21,32926,32889],{},[383,32928,32929,32932],{},[386,32930,32931],{},"Huge component ecosystem",[386,32933,32934],{},"Familiar React mental model",[21,32936,32903],{},[383,32938,32939,32942],{},[386,32940,32941],{},"Runtime UI errors",[386,32943,32944],{},"Props misuse is easy",[73,32946],{},[32,32948,10064],{"id":10063},[2808,32950,9915],{"id":32951},"dioxus-1",[21,32953,10002,32954,32956],{},[151,32955,10070],{}," and hooks that integrate deeply with Rust’s ownership model:",[48,32958,32959],{"className":10015,"code":10078,"language":10017,"meta":56,"style":56},[40,32960,32961],{"__ignoreMap":56},[449,32962,32963],{"class":451,"line":452},[449,32964,10078],{},[21,32966,32967],{},"Benefits:",[383,32969,32970,32973,32976],{},[386,32971,32972],{},"No stale closures",[386,32974,32975],{},"Predictable updates",[386,32977,32978],{},"Compile-time guarantees",[2808,32980,8872],{"id":32981},"react-native-1",[21,32983,32984],{},"React Native relies on:",[383,32986,32987,32990],{},[386,32988,32989],{},"React hooks",[386,32991,32992],{},"External libraries (Redux, Zustand, Recoil)",[21,32994,32995],{},"This flexibility is powerful—but can lead to:",[383,32997,32998,33001],{},[386,32999,33000],{},"State sprawl",[386,33002,33003],{},"Hard-to-debug race conditions",[73,33005],{},[32,33007,33009],{"id":33008},"tooling-developer-experience","Tooling & Developer Experience",[2808,33011,33013],{"id":33012},"dioxus-tooling","Dioxus Tooling",[383,33015,33016,33019,33022,33025],{},[386,33017,33018],{},"Built-in CLI",[386,33020,33021],{},"Hot reload",[386,33023,33024],{},"Unified build pipeline",[386,33026,33027],{},"Rust analyzer integration",[48,33029,33031],{"className":839,"code":33030,"language":841,"meta":56,"style":56},"dx serve\n",[40,33032,33033],{"__ignoreMap":56},[449,33034,33035,33038],{"class":451,"line":452},[449,33036,33037],{"class":721},"dx",[449,33039,33040],{"class":691}," serve\n",[21,33042,33043,33044,165],{},"Everything—from UI to backend—lives in ",[151,33045,33046],{},"one ecosystem",[2808,33048,33050],{"id":33049},"react-native-tooling","React Native Tooling",[383,33052,33053,33056,33059,33062],{},[386,33054,33055],{},"Metro bundler",[386,33057,33058],{},"Native SDKs",[386,33060,33061],{},"Xcode & Android Studio",[386,33063,33064],{},"Many third-party tools",[21,33066,33067],{},"Powerful, but:",[383,33069,33070,33073,33076],{},[386,33071,33072],{},"Complex setup",[386,33074,33075],{},"Platform-specific bugs",[386,33077,33078],{},"Steeper maintenance at scale",[2808,33080,33082],{"id":33081},"tooling-summary","Tooling Summary",[21,33084,33085],{},"Dioxus prioritizes simplicity and cohesion.\nReact Native prioritizes flexibility and scale.\n::",[73,33087],{},[32,33089,10308],{"id":10307},[2808,33091,9915],{"id":33092},"dioxus-2",[21,33094,33095],{},"Dioxus shines here.",[383,33097,33098,33101,33104,33107],{},[386,33099,33100],{},"Frontend and backend both in Rust",[386,33102,33103],{},"Shared types",[386,33105,33106],{},"Server functions",[386,33108,33109],{},"SSR support",[21,33111,33112,33113,165],{},"This makes it ideal for ",[151,33114,33115],{},"end-to-end Rust teams",[2808,33117,8872],{"id":33118},"react-native-2",[21,33120,33121],{},"React Native typically requires:",[383,33123,33124,33127,33130],{},[386,33125,33126],{},"Separate backend stack",[386,33128,33129],{},"API contracts",[386,33131,33132],{},"Data validation duplication",[21,33134,33135],{},"Still powerful—but fragmented.",[73,33137],{},[32,33139,33141],{"id":33140},"ecosystem-community","Ecosystem & Community",[2808,33143,8872],{"id":33144},"react-native-3",[383,33146,33147,33150,33153],{},[386,33148,33149],{},"Massive ecosystem",[386,33151,33152],{},"Thousands of libraries",[386,33154,33155],{},"Long-term industry support",[2808,33157,9915],{"id":33158},"dioxus-3",[383,33160,33161,33164,33167],{},[386,33162,33163],{},"Smaller but growing ecosystem",[386,33165,33166],{},"Strong Rust community backing",[386,33168,33169],{},"Rapid iteration",[21,33171,33172],{},"Dioxus is younger, but its pace of development is significantly faster than React Native’s early years.\n::",[73,33174],{},[32,33176,33178],{"id":33177},"when-to-choose-dioxus","When to Choose Dioxus",[21,33180,33181,33182,33184],{},"Choose ",[151,33183,9915],{}," if:",[383,33186,33187,33190,33193,33196],{},[386,33188,33189],{},"You value performance and safety",[386,33191,33192],{},"Your team knows Rust",[386,33194,33195],{},"You want a unified fullstack solution",[386,33197,33198],{},"You target web + desktop + mobile",[32,33200,33202],{"id":33201},"when-to-choose-react-native","When to Choose React Native",[21,33204,33181,33205,33184],{},[151,33206,8872],{},[383,33208,33209,33212,33215,33218],{},[386,33210,33211],{},"You need mature mobile tooling",[386,33213,33214],{},"You rely on third-party native modules",[386,33216,33217],{},"Your team is React-centric",[386,33219,33220],{},"Time-to-market is critical",[73,33222],{},[16,33224,3681],{"id":3680},[21,33226,33227,33228,33231],{},"React Native remains a dominant force in cross-platform mobile development, backed by a massive ecosystem and years of production usage. However, ",[151,33229,33230],{},"Dioxus 0.7 introduces a compelling alternative","—one built on performance, safety, and architectural simplicity.",[21,33233,33234],{},"For teams willing to invest in Rust, Dioxus offers a future-proof approach to building fast, reliable, cross-platform applications with fewer runtime surprises.",[21,33236,33237],{},"The choice isn’t about which framework is “better”—it’s about which philosophy aligns with your product and team.",[21,33239,33240],{},"And in 2026, Dioxus is no longer experimental—it’s a serious contender. 🚀",[3728,33242,33243],{},"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 .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}",{"title":56,"searchDepth":111,"depth":111,"links":33245},[33246,33247,33251,33255,33259,33263,33268,33272,33276,33277],{"id":32583,"depth":114,"text":32584},{"id":32668,"depth":114,"text":32669,"children":33248},[33249,33250],{"id":10423,"depth":111,"text":9915},{"id":8293,"depth":111,"text":8872},{"id":32775,"depth":114,"text":32776,"children":33252},[33253,33254],{"id":32779,"depth":111,"text":32780},{"id":32814,"depth":111,"text":32815},{"id":32845,"depth":114,"text":32846,"children":33256},[33257,33258],{"id":32849,"depth":111,"text":32850},{"id":32911,"depth":111,"text":32912},{"id":10063,"depth":114,"text":10064,"children":33260},[33261,33262],{"id":32951,"depth":111,"text":9915},{"id":32981,"depth":111,"text":8872},{"id":33008,"depth":114,"text":33009,"children":33264},[33265,33266,33267],{"id":33012,"depth":111,"text":33013},{"id":33049,"depth":111,"text":33050},{"id":33081,"depth":111,"text":33082},{"id":10307,"depth":114,"text":10308,"children":33269},[33270,33271],{"id":33092,"depth":111,"text":9915},{"id":33118,"depth":111,"text":8872},{"id":33140,"depth":114,"text":33141,"children":33273},[33274,33275],{"id":33144,"depth":111,"text":8872},{"id":33158,"depth":111,"text":9915},{"id":33177,"depth":114,"text":33178},{"id":33201,"depth":114,"text":33202},"2026-01-11","A deep comparison of Dioxus 0.7 and React Native, exploring performance, developer experience, tooling, and when to choose each framework.",{"type":13,"value":33281},[33282,33284,33290],[16,33283,333],{"id":332},[21,33285,32564,33286,32567,33288,32570],{},[151,33287,8872],{},[151,33289,9886],{},[21,33291,32573,33292,23841,33294,32578],{},[151,33293,9915],{},[151,33295,8872],{},[10423,33297,10017,10424,33298],"react native","mobile development",{},"\u002Fblog\u002Freact-native-vs-dious",{"title":32556,"description":33279},"blog\u002Freact-native-vs-dious","sOlEGyM1-lMQp4BYzN1wm90RpIqZ9W0TKqzAVXjgIto",{"id":33305,"title":33306,"author":33307,"body":33308,"canonical":116,"categories":116,"date":33506,"description":33507,"excerpt":33508,"extension":119,"featuredImg":116,"img":33520,"keywords":33521,"language":3788,"meta":33526,"navigation":130,"ogImage":116,"path":33527,"rating":474,"readTime":486,"seo":33528,"stem":33529,"tag":3793,"__hash__":33530},"blog\u002Fblog\u002Fsolo-level.md","Level Up in 2026: Why The Solo Level Is a Game-Changer for Developers",{"name":9,"img":11,"website":327},{"type":13,"value":33309,"toc":33497},[33310,33312,33325,33327,33331,33340,33347,33351,33354,33380],[16,33311,333],{"id":332},[21,33313,33314,33315,33318,33319,33322,33323,165],{},"What if leveling up your ",[151,33316,33317],{},"coding skills"," felt more like playing your favorite RPG than checking off tasks? That’s exactly the experience The Solo Level delivers — a gamified, AI-enhanced platform that makes coding ",[151,33320,33321],{},"fun, competitive, and deeply motivating",". If you’re a developer looking to stay engaged, track progress, and connect with others on the same journey, this is one tool you’ll want in your toolkit in ",[151,33324,21143],{},[16,33326,4373],{"id":4372},[32,33328,33330],{"id":33329},"what-is-the-solo-level","What Is The Solo Level?",[21,33332,33333,33334,33337,33338],{},"The Solo Level is an innovative coding platform that transforms everyday programming work into a ",[151,33335,33336],{},"role-playing game experience",". Every commit becomes XP, streaks power up your multiplier, and even bugs can earn you rewards — turning the grind of coding into an adventure. ",[9897,33339,9900],{"index":9899},[25,33341,33342],{"type":363},[21,33343,33344,33345],{},"With seamless VS Code integration and real-time visual stats, you don’t just write code — you level up your developer avatar as you improve. ",[9897,33346,9926],{"index":4798},[32,33348,33350],{"id":33349},"how-it-works-your-coding-quest-begins","How It Works — Your Coding Quest Begins",[21,33352,33353],{},"Getting started is simple:",[816,33355,33356,33364,33372],{},[386,33357,33358,33361,33362],{},[151,33359,33360],{},"Install the Solo Level VS Code extension"," — your editor becomes your dashboard as you code. ",[9897,33363,9938],{"index":4826},[386,33365,33366,33369,33370],{},[151,33367,33368],{},"Write & Commit Code"," — every commit earns you XP and tracks your progress. ",[9897,33371,9985],{"index":4849},[386,33373,33374,33377,33378],{},[151,33375,33376],{},"Earn Badges & Climb the Leaderboards"," — unlock achievements, compete globally, and celebrate your wins with the community. ",[9897,33379,9993],{"index":4873},[2805,33381,33382,33386,33405,33408,33412,33421,33427,33434,33438,33445,33450,33454,33465,33467,33469,33486,33494],{},[2808,33383,33385],{"id":33384},"core-gameplay-features","Core Gameplay Features",[383,33387,33388,33391,33394,33397,33400],{},[386,33389,33390],{},"✔ XP for commits and daily streaks",[386,33392,33393],{},"✔ Visual progress dashboards",[386,33395,33396],{},"✔ Global and guild leaderboards",[386,33398,33399],{},"✔ Bounty system for challenges",[386,33401,33402,33403,15716],{},"✔ Team management and competitions",[6510,33404],{},[21,33406,33407],{},"Whether you’re coding solo or rallying a guild of teammates, Solo Level turns your codebase into a world of quests and rewards.",[32,33409,33411],{"id":33410},"supercharged-by-ai","Supercharged by AI",[21,33413,33414,33415,33418,33419],{},"One of the most exciting aspects of The Solo Level is how it uses ",[151,33416,33417],{},"AI to boost learning and challenge creation",". Personalized AI-generated coding challenges match your skill level and learning goals, offering custom tasks that help you grow faster. ",[9897,33420,10008],{"index":4897},[427,33422,33424],{"icon":21245,"title":33423},"AI That Learns With You",[21,33425,33426],{},"AI isn’t just a buzzword here — it creates tailored challenges and insightful feedback that adapt to your progress.",[21,33428,33429,33430],{},"AI also powers smart analytics, giving actionable insights into your coding habits so you can identify strengths and areas to improve. ",[9897,33431,33433],{"index":33432},"6","oaicite:6",[32,33435,33437],{"id":33436},"go-beyond-solo-build-a-community","Go Beyond Solo — Build a Community",[21,33439,33440,33441],{},"Coding doesn’t have to be a solitary pursuit. With guilds and team challenges, The Solo Level encourages collaboration, friendly competition, and shared accomplishment. Assemble a team, set goals, track progress together, and climb the leaderboards as a squad. ",[9897,33442,33444],{"index":33443},"7","oaicite:7",[25,33446,33447],{"type":27},[21,33448,33449],{},"Friendly competition isn’t just fun — it motivates consistent progress and boosts productivity.",[32,33451,33453],{"id":33452},"why-developers-love-it","Why Developers Love It",[21,33455,33456,33457,33460,33461],{},"Solo Level isn’t just another tool — it’s a ",[151,33458,33459],{},"motivation engine",". Whether you’re a beginner wanting to build habits or a seasoned pro striving for mastery, gamification helps you stay engaged and productive. From day one you’re rewarded, tracked, and connected. ",[9897,33462,33464],{"index":33463},"8","oaicite:8",[73,33466],{},[16,33468,3681],{"id":3680},[21,33470,33471,33472,33475,33476,349,33479,1542,33482,33485],{},"The Solo Level turns coding into something you ",[156,33473,33474],{},"want"," to come back to every day. It blends ",[151,33477,33478],{},"game mechanics",[151,33480,33481],{},"AI-powered challenges",[151,33483,33484],{},"community engagement"," to make improving your craft both fun and measurable. If you’re ready to level up your skills and join a growing guild of developers, there’s never been a better time to start your journey. 🎮🚀",[21,33487,33488,33489,33493],{},"👉 Check it out at ",[3861,33490,33491],{"href":33491,"rel":33492},"https:\u002F\u002Fwww.thesololevel.com\u002F",[3865]," and begin your own coding adventure.",[9897,33495,33496],{},"oaicite:9",{"title":56,"searchDepth":111,"depth":111,"links":33498},[33499,33500,33503,33504,33505],{"id":33329,"depth":114,"text":33330},{"id":33349,"depth":114,"text":33350,"children":33501},[33502],{"id":33384,"depth":111,"text":33385},{"id":33410,"depth":114,"text":33411},{"id":33436,"depth":114,"text":33437},{"id":33452,"depth":114,"text":33453},"2026-01-05","Explore how The Solo Level turns coding into an RPG adventure with AI-powered challenges, XP systems, and community leaderboards.",{"type":13,"value":33509},[33510,33512],[16,33511,333],{"id":332},[21,33513,33314,33514,33318,33516,33322,33518,165],{},[151,33515,33317],{},[151,33517,33321],{},[151,33519,21143],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1767533332\u002Fsolo_level_pqfwko.jpg",[33522,33523,3782,33524,33525],"solo level","coding gamification","developers","productivity",{},"\u002Fblog\u002Fsolo-level",{"title":33306,"description":33507},"blog\u002Fsolo-level","L1XeqKL9qMV1n_oTDe6NLI35AgJzDcfa0ryfad4aFW4",{"id":33532,"title":33533,"author":33534,"body":33535,"canonical":116,"categories":116,"date":34880,"description":34881,"excerpt":34882,"extension":119,"featuredImg":116,"img":7063,"keywords":34888,"language":3788,"meta":34893,"navigation":130,"ogImage":116,"path":34894,"rating":474,"readTime":492,"seo":34895,"stem":34896,"tag":3793,"__hash__":34897},"blog\u002Fblog\u002Ftanstack-query.md","Mastering Data Fetching with TanStack Query: A Modern Approach",{"name":9,"img":11,"website":327},{"type":13,"value":33536,"toc":34864},[33537,33539,33542,33546,33549,33552,33556,33559,33597,33602,33606,33609,33613,33641,33645,33648,33705,33709,33712,33857,33863,33867,33871,33874,34070,34074,34077,34196,34205,34209,34212,34347,34349,34354,34358,34411,34415,34418,34582,34586,34589,34636,34642,34646,34650,34653,34722,34725,34728,34845,34847,34849,34852,34855,34858,34861],[16,33538,333],{"id":332},[21,33540,33541],{},"Data fetching is one of the most common challenges developers face when building modern web applications. While it might seem straightforward at first, managing server state quickly becomes complex when you need to handle caching, background updates, pagination, and error states. This is where TanStack Query (formerly React Query) comes in—a powerful library that transforms how we think about server state management.",[16,33543,33545],{"id":33544},"what-is-tanstack-query","What is TanStack Query?",[21,33547,33548],{},"TanStack Query is a data-fetching and state management library that provides powerful tools for fetching, caching, synchronizing, and updating server state in your applications. Unlike traditional state management solutions, TanStack Query treats server data as a first-class citizen, recognizing that it has fundamentally different characteristics than client state.",[21,33550,33551],{},"The library works seamlessly with React, Vue, Svelte, and Solid, making it a versatile choice regardless of your framework preference. It eliminates the need for writing complex boilerplate code and helps you build more maintainable applications.",[32,33553,33555],{"id":33554},"why-use-tanstack-query","Why Use TanStack Query?",[21,33557,33558],{},"Traditional data fetching approaches often require you to manage loading states, error handling, caching logic, and refetching strategies manually. TanStack Query handles all of this out of the box, providing:",[383,33560,33561,33567,33573,33579,33585,33591],{},[386,33562,33563,33566],{},[151,33564,33565],{},"Automatic caching"," with intelligent cache invalidation",[386,33568,33569,33572],{},[151,33570,33571],{},"Background refetching"," to keep data fresh",[386,33574,33575,33578],{},[151,33576,33577],{},"Optimistic updates"," for better UX",[386,33580,33581,33584],{},[151,33582,33583],{},"Request deduplication"," to prevent unnecessary network calls",[386,33586,33587,33590],{},[151,33588,33589],{},"Pagination and infinite scroll"," support",[386,33592,33593,33596],{},[151,33594,33595],{},"Prefetching"," for improved perceived performance",[25,33598,33599],{"type":363},[21,33600,33601],{},"TanStack Query doesn't replace fetch or axios—it enhances them by providing a smart layer of abstraction for managing server state.",[16,33603,33605],{"id":33604},"getting-started","Getting Started",[21,33607,33608],{},"Let's dive into how you can start using TanStack Query in your React application.",[32,33610,33612],{"id":33611},"installation","Installation",[48,33614,33616],{"className":839,"code":33615,"filename":4384,"language":841,"meta":56,"style":56},"npm install @tanstack\u002Freact-query\n# or\nyarn add @tanstack\u002Freact-query\n",[40,33617,33618,33627,33632],{"__ignoreMap":56},[449,33619,33620,33622,33624],{"class":451,"line":452},[449,33621,3703],{"class":721},[449,33623,3706],{"class":691},[449,33625,33626],{"class":691}," @tanstack\u002Freact-query\n",[449,33628,33629],{"class":451,"line":114},[449,33630,33631],{"class":705},"# or\n",[449,33633,33634,33637,33639],{"class":451,"line":111},[449,33635,33636],{"class":721},"yarn",[449,33638,2478],{"class":691},[449,33640,33626],{"class":691},[32,33642,33644],{"id":33643},"basic-setup","Basic Setup",[21,33646,33647],{},"First, wrap your application with the QueryClientProvider:",[48,33649,33652],{"className":32743,"code":33650,"filename":33651,"language":32745,"meta":56,"style":56},"import { QueryClient, QueryClientProvider } from \"@tanstack\u002Freact-query\";\n\nconst queryClient = new QueryClient();\n\nfunction App() {\n  return (\n    \u003CQueryClientProvider client={queryClient}>\n      \u003CYourApp \u002F>\n    \u003C\u002FQueryClientProvider>\n  );\n}\n","App.tsx",[40,33653,33654,33659,33663,33668,33672,33677,33682,33687,33692,33697,33701],{"__ignoreMap":56},[449,33655,33656],{"class":451,"line":452},[449,33657,33658],{},"import { QueryClient, QueryClientProvider } from \"@tanstack\u002Freact-query\";\n",[449,33660,33661],{"class":451,"line":114},[449,33662,700],{"emptyLinePlaceholder":130},[449,33664,33665],{"class":451,"line":111},[449,33666,33667],{},"const queryClient = new QueryClient();\n",[449,33669,33670],{"class":451,"line":468},[449,33671,700],{"emptyLinePlaceholder":130},[449,33673,33674],{"class":451,"line":474},[449,33675,33676],{},"function App() {\n",[449,33678,33679],{"class":451,"line":480},[449,33680,33681],{},"  return (\n",[449,33683,33684],{"class":451,"line":486},[449,33685,33686],{},"    \u003CQueryClientProvider client={queryClient}>\n",[449,33688,33689],{"class":451,"line":492},[449,33690,33691],{},"      \u003CYourApp \u002F>\n",[449,33693,33694],{"class":451,"line":498},[449,33695,33696],{},"    \u003C\u002FQueryClientProvider>\n",[449,33698,33699],{"class":451,"line":133},[449,33700,14242],{},[449,33702,33703],{"class":451,"line":509},[449,33704,4604],{},[32,33706,33708],{"id":33707},"your-first-query","Your First Query",[21,33710,33711],{},"Here's a simple example of fetching user data:",[48,33713,33716],{"className":32743,"code":33714,"filename":33715,"language":32745,"meta":56,"style":56},"import { useQuery } from \"@tanstack\u002Freact-query\";\n\ninterface User {\n  id: number;\n  name: string;\n  email: string;\n}\n\nasync function fetchUser(userId: string): Promise\u003CUser> {\n  const response = await fetch(`\u002Fapi\u002Fusers\u002F${userId}`);\n  if (!response.ok) throw new Error(\"Failed to fetch user\");\n  return response.json();\n}\n\nfunction UserProfile({ userId }: { userId: string }) {\n  const { data, isLoading, error } = useQuery({\n    queryKey: [\"user\", userId],\n    queryFn: () => fetchUser(userId),\n  });\n\n  if (isLoading) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n\n  return (\n    \u003Cdiv>\n      \u003Ch1>{data.name}\u003C\u002Fh1>\n      \u003Cp>{data.email}\u003C\u002Fp>\n    \u003C\u002Fdiv>\n  );\n}\n","UserProfile.tsx",[40,33717,33718,33723,33727,33732,33737,33742,33747,33751,33755,33760,33765,33770,33775,33779,33783,33788,33793,33798,33803,33807,33811,33816,33821,33825,33829,33834,33839,33844,33849,33853],{"__ignoreMap":56},[449,33719,33720],{"class":451,"line":452},[449,33721,33722],{},"import { useQuery } from \"@tanstack\u002Freact-query\";\n",[449,33724,33725],{"class":451,"line":114},[449,33726,700],{"emptyLinePlaceholder":130},[449,33728,33729],{"class":451,"line":111},[449,33730,33731],{},"interface User {\n",[449,33733,33734],{"class":451,"line":468},[449,33735,33736],{},"  id: number;\n",[449,33738,33739],{"class":451,"line":474},[449,33740,33741],{},"  name: string;\n",[449,33743,33744],{"class":451,"line":480},[449,33745,33746],{},"  email: string;\n",[449,33748,33749],{"class":451,"line":486},[449,33750,4604],{},[449,33752,33753],{"class":451,"line":492},[449,33754,700],{"emptyLinePlaceholder":130},[449,33756,33757],{"class":451,"line":498},[449,33758,33759],{},"async function fetchUser(userId: string): Promise\u003CUser> {\n",[449,33761,33762],{"class":451,"line":133},[449,33763,33764],{},"  const response = await fetch(`\u002Fapi\u002Fusers\u002F${userId}`);\n",[449,33766,33767],{"class":451,"line":509},[449,33768,33769],{},"  if (!response.ok) throw new Error(\"Failed to fetch user\");\n",[449,33771,33772],{"class":451,"line":318},[449,33773,33774],{},"  return response.json();\n",[449,33776,33777],{"class":451,"line":520},[449,33778,4604],{},[449,33780,33781],{"class":451,"line":526},[449,33782,700],{"emptyLinePlaceholder":130},[449,33784,33785],{"class":451,"line":532},[449,33786,33787],{},"function UserProfile({ userId }: { userId: string }) {\n",[449,33789,33790],{"class":451,"line":2790},[449,33791,33792],{},"  const { data, isLoading, error } = useQuery({\n",[449,33794,33795],{"class":451,"line":3511},[449,33796,33797],{},"    queryKey: [\"user\", userId],\n",[449,33799,33800],{"class":451,"line":3526},[449,33801,33802],{},"    queryFn: () => fetchUser(userId),\n",[449,33804,33805],{"class":451,"line":3531},[449,33806,13321],{},[449,33808,33809],{"class":451,"line":3536},[449,33810,700],{"emptyLinePlaceholder":130},[449,33812,33813],{"class":451,"line":4009},[449,33814,33815],{},"  if (isLoading) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n",[449,33817,33818],{"class":451,"line":4015},[449,33819,33820],{},"  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n",[449,33822,33823],{"class":451,"line":4021},[449,33824,700],{"emptyLinePlaceholder":130},[449,33826,33827],{"class":451,"line":4027},[449,33828,33681],{},[449,33830,33831],{"class":451,"line":4032},[449,33832,33833],{},"    \u003Cdiv>\n",[449,33835,33836],{"class":451,"line":4038},[449,33837,33838],{},"      \u003Ch1>{data.name}\u003C\u002Fh1>\n",[449,33840,33841],{"class":451,"line":4044},[449,33842,33843],{},"      \u003Cp>{data.email}\u003C\u002Fp>\n",[449,33845,33846],{"class":451,"line":4049},[449,33847,33848],{},"    \u003C\u002Fdiv>\n",[449,33850,33851],{"class":451,"line":4054},[449,33852,14242],{},[449,33854,33855],{"class":451,"line":4059},[449,33856,4604],{},[427,33858,33860],{"icon":11370,"title":33859},"Query Keys",[21,33861,33862],{},"Query keys are crucial in TanStack Query. They uniquely identify your queries and are used for caching, refetching, and cache invalidation. Use arrays with descriptive values for better organization.",[16,33864,33866],{"id":33865},"advanced-features","Advanced Features",[32,33868,33870],{"id":33869},"mutations","Mutations",[21,33872,33873],{},"Mutations handle data updates, creations, and deletions. Here's how to create a mutation for updating user data:",[48,33875,33878],{"className":32743,"code":33876,"filename":33877,"language":32745,"meta":56,"style":56},"import { useMutation, useQueryClient } from \"@tanstack\u002Freact-query\";\n\ninterface UpdateUserData {\n  name: string;\n  email: string;\n}\n\nfunction UpdateUserForm({ userId }: { userId: string }) {\n  const queryClient = useQueryClient();\n\n  const mutation = useMutation({\n    mutationFn: (userData: UpdateUserData) =>\n      fetch(`\u002Fapi\u002Fusers\u002F${userId}`, {\n        method: \"PUT\",\n        body: JSON.stringify(userData),\n        headers: { \"Content-Type\": \"application\u002Fjson\" },\n      }),\n    onSuccess: () => {\n      \u002F\u002F Invalidate and refetch user data\n      queryClient.invalidateQueries({ queryKey: [\"user\", userId] });\n    },\n  });\n\n  const handleSubmit = (data: UpdateUserData) => {\n    mutation.mutate(data);\n  };\n\n  return (\n    \u003Cform\n      onSubmit={(e) => {\n        e.preventDefault();\n        \u002F\u002F Form handling logic\n      }}\n    >\n      {mutation.isPending && \u003Cp>Updating...\u003C\u002Fp>}\n      {mutation.isError && \u003Cp>Error updating user\u003C\u002Fp>}\n      {mutation.isSuccess && \u003Cp>User updated successfully!\u003C\u002Fp>}\n      {\u002F* Form fields *\u002F}\n    \u003C\u002Fform>\n  );\n}\n","UpdateUser.tsx",[40,33879,33880,33885,33889,33894,33898,33902,33906,33910,33915,33920,33924,33929,33934,33939,33944,33949,33954,33958,33963,33968,33973,33977,33981,33985,33990,33995,33999,34003,34007,34012,34017,34022,34027,34032,34037,34042,34047,34052,34057,34062,34066],{"__ignoreMap":56},[449,33881,33882],{"class":451,"line":452},[449,33883,33884],{},"import { useMutation, useQueryClient } from \"@tanstack\u002Freact-query\";\n",[449,33886,33887],{"class":451,"line":114},[449,33888,700],{"emptyLinePlaceholder":130},[449,33890,33891],{"class":451,"line":111},[449,33892,33893],{},"interface UpdateUserData {\n",[449,33895,33896],{"class":451,"line":468},[449,33897,33741],{},[449,33899,33900],{"class":451,"line":474},[449,33901,33746],{},[449,33903,33904],{"class":451,"line":480},[449,33905,4604],{},[449,33907,33908],{"class":451,"line":486},[449,33909,700],{"emptyLinePlaceholder":130},[449,33911,33912],{"class":451,"line":492},[449,33913,33914],{},"function UpdateUserForm({ userId }: { userId: string }) {\n",[449,33916,33917],{"class":451,"line":498},[449,33918,33919],{},"  const queryClient = useQueryClient();\n",[449,33921,33922],{"class":451,"line":133},[449,33923,700],{"emptyLinePlaceholder":130},[449,33925,33926],{"class":451,"line":509},[449,33927,33928],{},"  const mutation = useMutation({\n",[449,33930,33931],{"class":451,"line":318},[449,33932,33933],{},"    mutationFn: (userData: UpdateUserData) =>\n",[449,33935,33936],{"class":451,"line":520},[449,33937,33938],{},"      fetch(`\u002Fapi\u002Fusers\u002F${userId}`, {\n",[449,33940,33941],{"class":451,"line":526},[449,33942,33943],{},"        method: \"PUT\",\n",[449,33945,33946],{"class":451,"line":532},[449,33947,33948],{},"        body: JSON.stringify(userData),\n",[449,33950,33951],{"class":451,"line":2790},[449,33952,33953],{},"        headers: { \"Content-Type\": \"application\u002Fjson\" },\n",[449,33955,33956],{"class":451,"line":3511},[449,33957,5785],{},[449,33959,33960],{"class":451,"line":3526},[449,33961,33962],{},"    onSuccess: () => {\n",[449,33964,33965],{"class":451,"line":3531},[449,33966,33967],{},"      \u002F\u002F Invalidate and refetch user data\n",[449,33969,33970],{"class":451,"line":3536},[449,33971,33972],{},"      queryClient.invalidateQueries({ queryKey: [\"user\", userId] });\n",[449,33974,33975],{"class":451,"line":4009},[449,33976,1458],{},[449,33978,33979],{"class":451,"line":4015},[449,33980,13321],{},[449,33982,33983],{"class":451,"line":4021},[449,33984,700],{"emptyLinePlaceholder":130},[449,33986,33987],{"class":451,"line":4027},[449,33988,33989],{},"  const handleSubmit = (data: UpdateUserData) => {\n",[449,33991,33992],{"class":451,"line":4032},[449,33993,33994],{},"    mutation.mutate(data);\n",[449,33996,33997],{"class":451,"line":4038},[449,33998,4763],{},[449,34000,34001],{"class":451,"line":4044},[449,34002,700],{"emptyLinePlaceholder":130},[449,34004,34005],{"class":451,"line":4049},[449,34006,33681],{},[449,34008,34009],{"class":451,"line":4054},[449,34010,34011],{},"    \u003Cform\n",[449,34013,34014],{"class":451,"line":4059},[449,34015,34016],{},"      onSubmit={(e) => {\n",[449,34018,34019],{"class":451,"line":4065},[449,34020,34021],{},"        e.preventDefault();\n",[449,34023,34024],{"class":451,"line":4070},[449,34025,34026],{},"        \u002F\u002F Form handling logic\n",[449,34028,34029],{"class":451,"line":4075},[449,34030,34031],{},"      }}\n",[449,34033,34034],{"class":451,"line":4081},[449,34035,34036],{},"    >\n",[449,34038,34039],{"class":451,"line":4086},[449,34040,34041],{},"      {mutation.isPending && \u003Cp>Updating...\u003C\u002Fp>}\n",[449,34043,34044],{"class":451,"line":4092},[449,34045,34046],{},"      {mutation.isError && \u003Cp>Error updating user\u003C\u002Fp>}\n",[449,34048,34049],{"class":451,"line":4098},[449,34050,34051],{},"      {mutation.isSuccess && \u003Cp>User updated successfully!\u003C\u002Fp>}\n",[449,34053,34054],{"class":451,"line":4104},[449,34055,34056],{},"      {\u002F* Form fields *\u002F}\n",[449,34058,34059],{"class":451,"line":4110},[449,34060,34061],{},"    \u003C\u002Fform>\n",[449,34063,34064],{"class":451,"line":5782},[449,34065,14242],{},[449,34067,34068],{"class":451,"line":5788},[449,34069,4604],{},[32,34071,34073],{"id":34072},"optimistic-updates","Optimistic Updates",[21,34075,34076],{},"Optimistic updates provide instant feedback by updating the UI before the server responds:",[48,34078,34081],{"className":32743,"code":34079,"filename":34080,"language":32745,"meta":56,"style":56},"const mutation = useMutation({\n  mutationFn: updateTodo,\n  onMutate: async (newTodo) => {\n    \u002F\u002F Cancel outgoing refetches\n    await queryClient.cancelQueries({ queryKey: [\"todos\"] });\n\n    \u002F\u002F Snapshot the previous value\n    const previousTodos = queryClient.getQueryData([\"todos\"]);\n\n    \u002F\u002F Optimistically update\n    queryClient.setQueryData([\"todos\"], (old: Todo[]) => [...old, newTodo]);\n\n    \u002F\u002F Return context with the snapshot\n    return { previousTodos };\n  },\n  onError: (err, newTodo, context) => {\n    \u002F\u002F Rollback on error\n    queryClient.setQueryData([\"todos\"], context?.previousTodos);\n  },\n  onSettled: () => {\n    \u002F\u002F Refetch after error or success\n    queryClient.invalidateQueries({ queryKey: [\"todos\"] });\n  },\n});\n","OptimisticUpdate.tsx",[40,34082,34083,34088,34093,34098,34103,34108,34112,34117,34122,34126,34131,34136,34140,34145,34150,34154,34159,34164,34169,34173,34178,34183,34188,34192],{"__ignoreMap":56},[449,34084,34085],{"class":451,"line":452},[449,34086,34087],{},"const mutation = useMutation({\n",[449,34089,34090],{"class":451,"line":114},[449,34091,34092],{},"  mutationFn: updateTodo,\n",[449,34094,34095],{"class":451,"line":111},[449,34096,34097],{},"  onMutate: async (newTodo) => {\n",[449,34099,34100],{"class":451,"line":468},[449,34101,34102],{},"    \u002F\u002F Cancel outgoing refetches\n",[449,34104,34105],{"class":451,"line":474},[449,34106,34107],{},"    await queryClient.cancelQueries({ queryKey: [\"todos\"] });\n",[449,34109,34110],{"class":451,"line":480},[449,34111,700],{"emptyLinePlaceholder":130},[449,34113,34114],{"class":451,"line":486},[449,34115,34116],{},"    \u002F\u002F Snapshot the previous value\n",[449,34118,34119],{"class":451,"line":492},[449,34120,34121],{},"    const previousTodos = queryClient.getQueryData([\"todos\"]);\n",[449,34123,34124],{"class":451,"line":498},[449,34125,700],{"emptyLinePlaceholder":130},[449,34127,34128],{"class":451,"line":133},[449,34129,34130],{},"    \u002F\u002F Optimistically update\n",[449,34132,34133],{"class":451,"line":509},[449,34134,34135],{},"    queryClient.setQueryData([\"todos\"], (old: Todo[]) => [...old, newTodo]);\n",[449,34137,34138],{"class":451,"line":318},[449,34139,700],{"emptyLinePlaceholder":130},[449,34141,34142],{"class":451,"line":520},[449,34143,34144],{},"    \u002F\u002F Return context with the snapshot\n",[449,34146,34147],{"class":451,"line":526},[449,34148,34149],{},"    return { previousTodos };\n",[449,34151,34152],{"class":451,"line":532},[449,34153,1474],{},[449,34155,34156],{"class":451,"line":2790},[449,34157,34158],{},"  onError: (err, newTodo, context) => {\n",[449,34160,34161],{"class":451,"line":3511},[449,34162,34163],{},"    \u002F\u002F Rollback on error\n",[449,34165,34166],{"class":451,"line":3526},[449,34167,34168],{},"    queryClient.setQueryData([\"todos\"], context?.previousTodos);\n",[449,34170,34171],{"class":451,"line":3531},[449,34172,1474],{},[449,34174,34175],{"class":451,"line":3536},[449,34176,34177],{},"  onSettled: () => {\n",[449,34179,34180],{"class":451,"line":4009},[449,34181,34182],{},"    \u002F\u002F Refetch after error or success\n",[449,34184,34185],{"class":451,"line":4015},[449,34186,34187],{},"    queryClient.invalidateQueries({ queryKey: [\"todos\"] });\n",[449,34189,34190],{"class":451,"line":4021},[449,34191,1474],{},[449,34193,34194],{"class":451,"line":4027},[449,34195,784],{},[2805,34197,34198,34202],{},[2808,34199,34201],{"id":34200},"performance-benefits","Performance Benefits",[21,34203,34204],{},"Optimistic updates can make your application feel up to 10x faster by eliminating the perceived latency of server responses.",[32,34206,34208],{"id":34207},"pagination","Pagination",[21,34210,34211],{},"TanStack Query makes pagination simple with built-in support:",[48,34213,34216],{"className":32743,"code":34214,"filename":34215,"language":32745,"meta":56,"style":56},"function PaginatedPosts() {\n  const [page, setPage] = useState(1);\n\n  const { data, isLoading, isPlaceholderData } = useQuery({\n    queryKey: [\"posts\", page],\n    queryFn: () => fetchPosts(page),\n    placeholderData: (previousData) => previousData,\n  });\n\n  return (\n    \u003Cdiv>\n      {data?.posts.map((post) => (\n        \u003CPostCard key={post.id} post={post} \u002F>\n      ))}\n\n      \u003Cbutton onClick={() => setPage((old) => Math.max(old - 1, 1))} disabled={page === 1}>\n        Previous\n      \u003C\u002Fbutton>\n\n      \u003Cbutton\n        onClick={() => setPage((old) => old + 1)}\n        disabled={isPlaceholderData || !data?.hasMore}\n      >\n        Next\n      \u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n","PaginatedList.tsx",[40,34217,34218,34223,34228,34232,34237,34242,34247,34252,34256,34260,34264,34268,34273,34278,34283,34287,34292,34297,34302,34306,34311,34316,34321,34326,34331,34335,34339,34343],{"__ignoreMap":56},[449,34219,34220],{"class":451,"line":452},[449,34221,34222],{},"function PaginatedPosts() {\n",[449,34224,34225],{"class":451,"line":114},[449,34226,34227],{},"  const [page, setPage] = useState(1);\n",[449,34229,34230],{"class":451,"line":111},[449,34231,700],{"emptyLinePlaceholder":130},[449,34233,34234],{"class":451,"line":468},[449,34235,34236],{},"  const { data, isLoading, isPlaceholderData } = useQuery({\n",[449,34238,34239],{"class":451,"line":474},[449,34240,34241],{},"    queryKey: [\"posts\", page],\n",[449,34243,34244],{"class":451,"line":480},[449,34245,34246],{},"    queryFn: () => fetchPosts(page),\n",[449,34248,34249],{"class":451,"line":486},[449,34250,34251],{},"    placeholderData: (previousData) => previousData,\n",[449,34253,34254],{"class":451,"line":492},[449,34255,13321],{},[449,34257,34258],{"class":451,"line":498},[449,34259,700],{"emptyLinePlaceholder":130},[449,34261,34262],{"class":451,"line":133},[449,34263,33681],{},[449,34265,34266],{"class":451,"line":509},[449,34267,33833],{},[449,34269,34270],{"class":451,"line":318},[449,34271,34272],{},"      {data?.posts.map((post) => (\n",[449,34274,34275],{"class":451,"line":520},[449,34276,34277],{},"        \u003CPostCard key={post.id} post={post} \u002F>\n",[449,34279,34280],{"class":451,"line":526},[449,34281,34282],{},"      ))}\n",[449,34284,34285],{"class":451,"line":532},[449,34286,700],{"emptyLinePlaceholder":130},[449,34288,34289],{"class":451,"line":2790},[449,34290,34291],{},"      \u003Cbutton onClick={() => setPage((old) => Math.max(old - 1, 1))} disabled={page === 1}>\n",[449,34293,34294],{"class":451,"line":3511},[449,34295,34296],{},"        Previous\n",[449,34298,34299],{"class":451,"line":3526},[449,34300,34301],{},"      \u003C\u002Fbutton>\n",[449,34303,34304],{"class":451,"line":3531},[449,34305,700],{"emptyLinePlaceholder":130},[449,34307,34308],{"class":451,"line":3536},[449,34309,34310],{},"      \u003Cbutton\n",[449,34312,34313],{"class":451,"line":4009},[449,34314,34315],{},"        onClick={() => setPage((old) => old + 1)}\n",[449,34317,34318],{"class":451,"line":4015},[449,34319,34320],{},"        disabled={isPlaceholderData || !data?.hasMore}\n",[449,34322,34323],{"class":451,"line":4021},[449,34324,34325],{},"      >\n",[449,34327,34328],{"class":451,"line":4027},[449,34329,34330],{},"        Next\n",[449,34332,34333],{"class":451,"line":4032},[449,34334,34301],{},[449,34336,34337],{"class":451,"line":4038},[449,34338,33848],{},[449,34340,34341],{"class":451,"line":4044},[449,34342,14242],{},[449,34344,34345],{"class":451,"line":4049},[449,34346,4604],{},[16,34348,20267],{"id":22936},[25,34350,34351],{"type":27},[21,34352,34353],{},"Always provide appropriate staleTime and gcTime values based on your data's characteristics. Not all data needs real-time updates!",[32,34355,34357],{"id":34356},"configure-cache-times-appropriately","Configure Cache Times Appropriately",[48,34359,34362],{"className":32743,"code":34360,"filename":34361,"language":32745,"meta":56,"style":56},"const queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 1000 * 60 * 5, \u002F\u002F 5 minutes\n      gcTime: 1000 * 60 * 10, \u002F\u002F 10 minutes (formerly cacheTime)\n      retry: 3,\n      refetchOnWindowFocus: true,\n    },\n  },\n});\n","queryClient.ts",[40,34363,34364,34369,34374,34379,34384,34389,34394,34399,34403,34407],{"__ignoreMap":56},[449,34365,34366],{"class":451,"line":452},[449,34367,34368],{},"const queryClient = new QueryClient({\n",[449,34370,34371],{"class":451,"line":114},[449,34372,34373],{},"  defaultOptions: {\n",[449,34375,34376],{"class":451,"line":111},[449,34377,34378],{},"    queries: {\n",[449,34380,34381],{"class":451,"line":468},[449,34382,34383],{},"      staleTime: 1000 * 60 * 5, \u002F\u002F 5 minutes\n",[449,34385,34386],{"class":451,"line":474},[449,34387,34388],{},"      gcTime: 1000 * 60 * 10, \u002F\u002F 10 minutes (formerly cacheTime)\n",[449,34390,34391],{"class":451,"line":480},[449,34392,34393],{},"      retry: 3,\n",[449,34395,34396],{"class":451,"line":486},[449,34397,34398],{},"      refetchOnWindowFocus: true,\n",[449,34400,34401],{"class":451,"line":492},[449,34402,1458],{},[449,34404,34405],{"class":451,"line":498},[449,34406,1474],{},[449,34408,34409],{"class":451,"line":133},[449,34410,784],{},[32,34412,34414],{"id":34413},"use-query-keys-consistently","Use Query Keys Consistently",[21,34416,34417],{},"Establish a naming convention for your query keys:",[48,34419,34422],{"className":670,"code":34420,"filename":34421,"language":673,"meta":56,"style":56},"export const queryKeys = {\n  users: {\n    all: [\"users\"] as const,\n    detail: (id: string) => [\"users\", id] as const,\n    posts: (id: string) => [\"users\", id, \"posts\"] as const,\n  },\n  posts: {\n    all: [\"posts\"] as const,\n    detail: (id: string) => [\"posts\", id] as const,\n  },\n};\n","queryKeys.ts",[40,34423,34424,34437,34442,34458,34488,34523,34527,34532,34546,34574,34578],{"__ignoreMap":56},[449,34425,34426,34428,34430,34433,34435],{"class":451,"line":452},[449,34427,4629],{"class":680},[449,34429,10789],{"class":680},[449,34431,34432],{"class":714}," queryKeys",[449,34434,718],{"class":680},[449,34436,1501],{"class":684},[449,34438,34439],{"class":451,"line":114},[449,34440,34441],{"class":684},"  users: {\n",[449,34443,34444,34447,34449,34452,34454,34456],{"class":451,"line":111},[449,34445,34446],{"class":684},"    all: [",[449,34448,27559],{"class":691},[449,34450,34451],{"class":684},"] ",[449,34453,5066],{"class":680},[449,34455,10789],{"class":680},[449,34457,779],{"class":684},[449,34459,34460,34463,34465,34467,34469,34471,34473,34475,34477,34479,34482,34484,34486],{"class":451,"line":468},[449,34461,34462],{"class":721},"    detail",[449,34464,1752],{"class":684},[449,34466,16197],{"class":1491},[449,34468,3070],{"class":680},[449,34470,6081],{"class":714},[449,34472,1758],{"class":684},[449,34474,1498],{"class":680},[449,34476,13639],{"class":684},[449,34478,27559],{"class":691},[449,34480,34481],{"class":684},", id] ",[449,34483,5066],{"class":680},[449,34485,10789],{"class":680},[449,34487,779],{"class":684},[449,34489,34490,34493,34495,34497,34499,34501,34503,34505,34507,34509,34512,34515,34517,34519,34521],{"class":451,"line":474},[449,34491,34492],{"class":721},"    posts",[449,34494,1752],{"class":684},[449,34496,16197],{"class":1491},[449,34498,3070],{"class":680},[449,34500,6081],{"class":714},[449,34502,1758],{"class":684},[449,34504,1498],{"class":680},[449,34506,13639],{"class":684},[449,34508,27559],{"class":691},[449,34510,34511],{"class":684},", id, ",[449,34513,34514],{"class":691},"\"posts\"",[449,34516,34451],{"class":684},[449,34518,5066],{"class":680},[449,34520,10789],{"class":680},[449,34522,779],{"class":684},[449,34524,34525],{"class":451,"line":480},[449,34526,1474],{"class":684},[449,34528,34529],{"class":451,"line":486},[449,34530,34531],{"class":684},"  posts: {\n",[449,34533,34534,34536,34538,34540,34542,34544],{"class":451,"line":492},[449,34535,34446],{"class":684},[449,34537,34514],{"class":691},[449,34539,34451],{"class":684},[449,34541,5066],{"class":680},[449,34543,10789],{"class":680},[449,34545,779],{"class":684},[449,34547,34548,34550,34552,34554,34556,34558,34560,34562,34564,34566,34568,34570,34572],{"class":451,"line":498},[449,34549,34462],{"class":721},[449,34551,1752],{"class":684},[449,34553,16197],{"class":1491},[449,34555,3070],{"class":680},[449,34557,6081],{"class":714},[449,34559,1758],{"class":684},[449,34561,1498],{"class":680},[449,34563,13639],{"class":684},[449,34565,34514],{"class":691},[449,34567,34481],{"class":684},[449,34569,5066],{"class":680},[449,34571,10789],{"class":680},[449,34573,779],{"class":684},[449,34575,34576],{"class":451,"line":133},[449,34577,1474],{"class":684},[449,34579,34580],{"class":451,"line":509},[449,34581,20963],{"class":684},[32,34583,34585],{"id":34584},"enable-devtools","Enable DevTools",[21,34587,34588],{},"TanStack Query comes with excellent developer tools:",[48,34590,34592],{"className":32743,"code":34591,"filename":33651,"language":32745,"meta":56,"style":56},"import { ReactQueryDevtools } from \"@tanstack\u002Freact-query-devtools\";\n\nfunction App() {\n  return (\n    \u003CQueryClientProvider client={queryClient}>\n      \u003CYourApp \u002F>\n      \u003CReactQueryDevtools initialIsOpen={false} \u002F>\n    \u003C\u002FQueryClientProvider>\n  );\n}\n",[40,34593,34594,34599,34603,34607,34611,34615,34619,34624,34628,34632],{"__ignoreMap":56},[449,34595,34596],{"class":451,"line":452},[449,34597,34598],{},"import { ReactQueryDevtools } from \"@tanstack\u002Freact-query-devtools\";\n",[449,34600,34601],{"class":451,"line":114},[449,34602,700],{"emptyLinePlaceholder":130},[449,34604,34605],{"class":451,"line":111},[449,34606,33676],{},[449,34608,34609],{"class":451,"line":468},[449,34610,33681],{},[449,34612,34613],{"class":451,"line":474},[449,34614,33686],{},[449,34616,34617],{"class":451,"line":480},[449,34618,33691],{},[449,34620,34621],{"class":451,"line":486},[449,34622,34623],{},"      \u003CReactQueryDevtools initialIsOpen={false} \u002F>\n",[449,34625,34626],{"class":451,"line":492},[449,34627,33696],{},[449,34629,34630],{"class":451,"line":498},[449,34631,14242],{},[449,34633,34634],{"class":451,"line":133},[449,34635,4604],{},[427,34637,34639],{"icon":14306,"title":34638},"DevTools Pro Tip",[21,34640,34641],{},"The DevTools panel provides real-time insights into your queries, their states, and cached data. It's invaluable for debugging and understanding how TanStack Query manages your data.",[16,34643,34645],{"id":34644},"common-patterns","Common Patterns",[32,34647,34649],{"id":34648},"dependent-queries","Dependent Queries",[21,34651,34652],{},"Sometimes you need to fetch data based on previous query results:",[48,34654,34657],{"className":32743,"code":34655,"filename":34656,"language":32745,"meta":56,"style":56},"function UserPosts({ userId }: { userId: string }) {\n  const { data: user } = useQuery({\n    queryKey: [\"user\", userId],\n    queryFn: () => fetchUser(userId),\n  });\n\n  const { data: posts } = useQuery({\n    queryKey: [\"posts\", user?.id],\n    queryFn: () => fetchUserPosts(user!.id),\n    enabled: !!user, \u002F\u002F Only run when user is available\n  });\n\n  return \u003CPostsList posts={posts} \u002F>;\n}\n","DependentQueries.tsx",[40,34658,34659,34664,34669,34673,34677,34681,34685,34690,34695,34700,34705,34709,34713,34718],{"__ignoreMap":56},[449,34660,34661],{"class":451,"line":452},[449,34662,34663],{},"function UserPosts({ userId }: { userId: string }) {\n",[449,34665,34666],{"class":451,"line":114},[449,34667,34668],{},"  const { data: user } = useQuery({\n",[449,34670,34671],{"class":451,"line":111},[449,34672,33797],{},[449,34674,34675],{"class":451,"line":468},[449,34676,33802],{},[449,34678,34679],{"class":451,"line":474},[449,34680,13321],{},[449,34682,34683],{"class":451,"line":480},[449,34684,700],{"emptyLinePlaceholder":130},[449,34686,34687],{"class":451,"line":486},[449,34688,34689],{},"  const { data: posts } = useQuery({\n",[449,34691,34692],{"class":451,"line":492},[449,34693,34694],{},"    queryKey: [\"posts\", user?.id],\n",[449,34696,34697],{"class":451,"line":498},[449,34698,34699],{},"    queryFn: () => fetchUserPosts(user!.id),\n",[449,34701,34702],{"class":451,"line":133},[449,34703,34704],{},"    enabled: !!user, \u002F\u002F Only run when user is available\n",[449,34706,34707],{"class":451,"line":509},[449,34708,13321],{},[449,34710,34711],{"class":451,"line":318},[449,34712,700],{"emptyLinePlaceholder":130},[449,34714,34715],{"class":451,"line":520},[449,34716,34717],{},"  return \u003CPostsList posts={posts} \u002F>;\n",[449,34719,34720],{"class":451,"line":526},[449,34721,4604],{},[32,34723,33595],{"id":34724},"prefetching",[21,34726,34727],{},"Improve perceived performance by prefetching data:",[48,34729,34732],{"className":32743,"code":34730,"filename":34731,"language":32745,"meta":56,"style":56},"function PostList() {\n  const queryClient = useQueryClient();\n\n  const { data: posts } = useQuery({\n    queryKey: [\"posts\"],\n    queryFn: fetchPosts,\n  });\n\n  const handleMouseEnter = (postId: string) => {\n    queryClient.prefetchQuery({\n      queryKey: [\"post\", postId],\n      queryFn: () => fetchPost(postId),\n    });\n  };\n\n  return (\n    \u003Cdiv>\n      {posts?.map((post) => (\n        \u003Cdiv key={post.id} onMouseEnter={() => handleMouseEnter(post.id)}>\n          \u003CLink to={`\u002Fposts\u002F${post.id}`}>{post.title}\u003C\u002FLink>\n        \u003C\u002Fdiv>\n      ))}\n    \u003C\u002Fdiv>\n  );\n}\n","Prefetching.tsx",[40,34733,34734,34739,34743,34747,34751,34756,34761,34765,34769,34774,34779,34784,34789,34793,34797,34801,34805,34809,34814,34819,34824,34829,34833,34837,34841],{"__ignoreMap":56},[449,34735,34736],{"class":451,"line":452},[449,34737,34738],{},"function PostList() {\n",[449,34740,34741],{"class":451,"line":114},[449,34742,33919],{},[449,34744,34745],{"class":451,"line":111},[449,34746,700],{"emptyLinePlaceholder":130},[449,34748,34749],{"class":451,"line":468},[449,34750,34689],{},[449,34752,34753],{"class":451,"line":474},[449,34754,34755],{},"    queryKey: [\"posts\"],\n",[449,34757,34758],{"class":451,"line":480},[449,34759,34760],{},"    queryFn: fetchPosts,\n",[449,34762,34763],{"class":451,"line":486},[449,34764,13321],{},[449,34766,34767],{"class":451,"line":492},[449,34768,700],{"emptyLinePlaceholder":130},[449,34770,34771],{"class":451,"line":498},[449,34772,34773],{},"  const handleMouseEnter = (postId: string) => {\n",[449,34775,34776],{"class":451,"line":133},[449,34777,34778],{},"    queryClient.prefetchQuery({\n",[449,34780,34781],{"class":451,"line":509},[449,34782,34783],{},"      queryKey: [\"post\", postId],\n",[449,34785,34786],{"class":451,"line":318},[449,34787,34788],{},"      queryFn: () => fetchPost(postId),\n",[449,34790,34791],{"class":451,"line":520},[449,34792,3484],{},[449,34794,34795],{"class":451,"line":526},[449,34796,4763],{},[449,34798,34799],{"class":451,"line":532},[449,34800,700],{"emptyLinePlaceholder":130},[449,34802,34803],{"class":451,"line":2790},[449,34804,33681],{},[449,34806,34807],{"class":451,"line":3511},[449,34808,33833],{},[449,34810,34811],{"class":451,"line":3526},[449,34812,34813],{},"      {posts?.map((post) => (\n",[449,34815,34816],{"class":451,"line":3531},[449,34817,34818],{},"        \u003Cdiv key={post.id} onMouseEnter={() => handleMouseEnter(post.id)}>\n",[449,34820,34821],{"class":451,"line":3536},[449,34822,34823],{},"          \u003CLink to={`\u002Fposts\u002F${post.id}`}>{post.title}\u003C\u002FLink>\n",[449,34825,34826],{"class":451,"line":4009},[449,34827,34828],{},"        \u003C\u002Fdiv>\n",[449,34830,34831],{"class":451,"line":4015},[449,34832,34282],{},[449,34834,34835],{"class":451,"line":4021},[449,34836,33848],{},[449,34838,34839],{"class":451,"line":4027},[449,34840,14242],{},[449,34842,34843],{"class":451,"line":4032},[449,34844,4604],{},[73,34846],{},[16,34848,3681],{"id":3680},[21,34850,34851],{},"TanStack Query has fundamentally changed how developers approach data fetching and state management in modern applications. By providing intelligent caching, automatic background updates, and a simple yet powerful API, it eliminates much of the boilerplate code traditionally associated with server state management.",[21,34853,34854],{},"Whether you're building a small application or a large-scale enterprise system, TanStack Query's flexibility and performance optimizations make it an excellent choice. The library's active community, comprehensive documentation, and framework-agnostic approach ensure it will remain a valuable tool in your development arsenal.",[21,34856,34857],{},"Start small with basic queries and gradually adopt advanced features like optimistic updates and prefetching as your application grows. Your users will appreciate the snappier experience, and your team will benefit from cleaner, more maintainable code.",[21,34859,34860],{},"Happy querying!",[3728,34862,34863],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":34865},[34866,34867,34868,34869,34870,34871,34874,34875,34876,34877,34878,34879],{"id":33554,"depth":114,"text":33555},{"id":33611,"depth":114,"text":33612},{"id":33643,"depth":114,"text":33644},{"id":33707,"depth":114,"text":33708},{"id":33869,"depth":114,"text":33870},{"id":34072,"depth":114,"text":34073,"children":34872},[34873],{"id":34200,"depth":111,"text":34201},{"id":34207,"depth":114,"text":34208},{"id":34356,"depth":114,"text":34357},{"id":34413,"depth":114,"text":34414},{"id":34584,"depth":114,"text":34585},{"id":34648,"depth":114,"text":34649},{"id":34724,"depth":114,"text":33595},"2026-02-05","Discover how TanStack Query revolutionizes data fetching in React applications with powerful caching, synchronization, and state management capabilities.",{"type":13,"value":34883},[34884,34886],[16,34885,333],{"id":332},[21,34887,33541],{},[34889,34890,34891,20802,34892,3784],"tanstack query","react query","data fetching","react",{},"\u002Fblog\u002Ftanstack-query",{"title":33533,"description":34881},"blog\u002Ftanstack-query","5YJzgARn4gce2LO6bDrpCUNbmFcq_pd4qSWeBM8eoZg",{"id":34899,"title":34900,"author":34901,"body":34902,"canonical":116,"categories":116,"date":22970,"description":35666,"excerpt":35667,"extension":119,"featuredImg":116,"img":3779,"keywords":35687,"language":3788,"meta":35689,"navigation":130,"ogImage":116,"path":35690,"rating":474,"readTime":133,"seo":35691,"stem":35692,"tag":3793,"__hash__":35693},"blog\u002Fblog\u002Ftanstack-router.md","Mastering TanStack Router: Type-Safe Routing for Modern Web Apps",{"name":9,"img":11,"website":327},{"type":13,"value":34903,"toc":35649},[34904,34906,34909,34915,34926,34933,34935,34939,34942,34956,34959,34968,34975,34977,34981,34984,35001,35004,35018,35021,35023,35025,35028,35110,35113,35117,35120,35205,35208,35212,35215,35308,35312,35328,35331,35335,35338,35480,35482,35493,35497,35500,35504,35507,35527,35530,35541,35544,35548,35551,35557,35560,35571,35574,35578,35581,35594,35597,35600,35604,35607,35621,35624,35635,35637,35640,35643,35646],[16,34905,333],{"id":332},[21,34907,34908],{},"Routing has always been one of those “it works… until it doesn’t” parts of web development. As applications grow, routes become harder to reason about, parameters drift out of sync, and refactors turn into a game of whack-a-mole.",[21,34910,34911,34914],{},[151,34912,34913],{},"TanStack Router"," was created to solve exactly that problem.",[21,34916,34917,34918,34921,34922,34925],{},"Built with ",[151,34919,34920],{},"type safety first",", TanStack Router flips the traditional routing model on its head. Instead of hoping your routes, params, loaders, and links line up, the router ",[156,34923,34924],{},"guarantees"," they do—at compile time.",[21,34927,34928,34929,34932],{},"In this post, we’ll explore ",[151,34930,34931],{},"what makes TanStack Router different",", why it matters, and how to use it effectively in real-world applications.",[16,34934,4373],{"id":4372},[32,34936,34938],{"id":34937},"why-routing-needed-a-rethink","Why Routing Needed a Rethink",[21,34940,34941],{},"Most routers share a few common pain points:",[383,34943,34944,34947,34950,34953],{},[386,34945,34946],{},"Route params are strings (until runtime)",[386,34948,34949],{},"Loaders and components drift apart",[386,34951,34952],{},"Refactors break links silently",[386,34954,34955],{},"Nested routing becomes fragile",[21,34957,34958],{},"These issues don’t show up on day one—but they absolutely show up at scale.",[25,34960,34961],{"type":363},[21,34962,34963,34964,34967],{},"TanStack Router treats routing as a ",[156,34965,34966],{},"data problem",", not just a URL-matching problem.",[21,34969,34970,34971,34974],{},"Instead of defining routes and hoping everything connects correctly, TanStack Router builds a ",[151,34972,34973],{},"strongly-typed route tree"," that TypeScript understands end to end.",[73,34976],{},[32,34978,34980],{"id":34979},"core-philosophy-of-tanstack-router","Core Philosophy of TanStack Router",[21,34982,34983],{},"At its core, TanStack Router is built around three ideas:",[816,34985,34986,34991,34996],{},[386,34987,34988],{},[151,34989,34990],{},"Type safety everywhere",[386,34992,34993],{},[151,34994,34995],{},"Colocation of route logic",[386,34997,34998],{},[151,34999,35000],{},"Data-first routing",[21,35002,35003],{},"This means:",[383,35005,35006,35009,35012,35015],{},[386,35007,35008],{},"Routes know their params",[386,35010,35011],{},"Loaders know their return types",[386,35013,35014],{},"Links know where they’re going",[386,35016,35017],{},"Components know what data they receive",[21,35019,35020],{},"No guessing. No runtime surprises.",[73,35022],{},[32,35024,33644],{"id":33643},[21,35026,35027],{},"Here’s a minimal example of defining a route.",[48,35029,35032],{"className":670,"code":35030,"filename":35031,"language":673,"meta":56,"style":56},"import { createRouter, createRootRoute } from '@tanstack\u002Freact-router'\n\nconst rootRoute = createRootRoute({\n  component: () => \u003COutlet \u002F>\n})\n\nexport const router = createRouter({\n  routeTree: rootRoute,\n})\n","router.ts",[40,35033,35034,35046,35050,35064,35081,35085,35089,35101,35106],{"__ignoreMap":56},[449,35035,35036,35038,35041,35043],{"class":451,"line":452},[449,35037,681],{"class":680},[449,35039,35040],{"class":684}," { createRouter, createRootRoute } ",[449,35042,688],{"class":680},[449,35044,35045],{"class":691}," '@tanstack\u002Freact-router'\n",[449,35047,35048],{"class":451,"line":114},[449,35049,700],{"emptyLinePlaceholder":130},[449,35051,35052,35054,35057,35059,35062],{"class":451,"line":111},[449,35053,711],{"class":680},[449,35055,35056],{"class":714}," rootRoute",[449,35058,718],{"class":680},[449,35060,35061],{"class":721}," createRootRoute",[449,35063,1391],{"class":684},[449,35065,35066,35069,35072,35074,35076,35079],{"class":451,"line":468},[449,35067,35068],{"class":721},"  component",[449,35070,35071],{"class":684},": () ",[449,35073,1498],{"class":680},[449,35075,2481],{"class":684},[449,35077,35078],{"class":721},"Outlet",[449,35080,25268],{"class":684},[449,35082,35083],{"class":451,"line":474},[449,35084,4113],{"class":684},[449,35086,35087],{"class":451,"line":480},[449,35088,700],{"emptyLinePlaceholder":130},[449,35090,35091,35094,35096,35099],{"class":451,"line":486},[449,35092,35093],{"class":684},"export const router ",[449,35095,5014],{"class":680},[449,35097,35098],{"class":721}," createRouter",[449,35100,1391],{"class":684},[449,35102,35103],{"class":451,"line":492},[449,35104,35105],{"class":684},"  routeTree: rootRoute,\n",[449,35107,35108],{"class":451,"line":498},[449,35109,4113],{"class":684},[21,35111,35112],{},"Already, TypeScript understands your route tree—even before adding child routes.",[32,35114,35116],{"id":35115},"defining-routes-with-type-safety","Defining Routes with Type Safety",[21,35118,35119],{},"Now let’s define a real route.",[48,35121,35123],{"className":670,"code":35122,"language":673,"meta":56,"style":56},"import { createFileRoute } from '@tanstack\u002Freact-router'\n\nexport const Route = createFileRoute('\u002F')({\n  component: HomePage,\n})\n\nfunction HomePage() {\n  return \u003Ch1>Welcome Home\u003C\u002Fh1>\n}\n",[40,35124,35125,35136,35140,35162,35167,35171,35175,35184,35201],{"__ignoreMap":56},[449,35126,35127,35129,35132,35134],{"class":451,"line":452},[449,35128,681],{"class":680},[449,35130,35131],{"class":684}," { createFileRoute } ",[449,35133,688],{"class":680},[449,35135,35045],{"class":691},[449,35137,35138],{"class":451,"line":114},[449,35139,700],{"emptyLinePlaceholder":130},[449,35141,35142,35144,35146,35149,35151,35154,35156,35159],{"class":451,"line":111},[449,35143,4629],{"class":680},[449,35145,10789],{"class":680},[449,35147,35148],{"class":714}," Route",[449,35150,718],{"class":680},[449,35152,35153],{"class":721}," createFileRoute",[449,35155,725],{"class":684},[449,35157,35158],{"class":691},"'\u002F'",[449,35160,35161],{"class":684},")({\n",[449,35163,35164],{"class":451,"line":468},[449,35165,35166],{"class":684},"  component: HomePage,\n",[449,35168,35169],{"class":451,"line":474},[449,35170,4113],{"class":684},[449,35172,35173],{"class":451,"line":480},[449,35174,700],{"emptyLinePlaceholder":130},[449,35176,35177,35179,35182],{"class":451,"line":486},[449,35178,24643],{"class":680},[449,35180,35181],{"class":721}," HomePage",[449,35183,5439],{"class":684},[449,35185,35186,35188,35190,35192,35195,35197,35199],{"class":451,"line":492},[449,35187,4726],{"class":680},[449,35189,2481],{"class":684},[449,35191,16],{"class":721},[449,35193,35194],{"class":684},">Welcome Home",[449,35196,23220],{"class":680},[449,35198,16],{"class":684},[449,35200,23122],{"class":680},[449,35202,35203],{"class":451,"line":498},[449,35204,4604],{"class":684},[21,35206,35207],{},"No string-based route definitions scattered across your app. The route is the source of truth.",[32,35209,35211],{"id":35210},"route-params-that-dont-lie","Route Params That Don’t Lie",[21,35213,35214],{},"Here’s where TanStack Router really shines.",[48,35216,35218],{"className":670,"code":35217,"language":673,"meta":56,"style":56},"export const Route = createFileRoute('\u002Fusers\u002F$userId')({\n  component: UserPage,\n})\n\nfunction UserPage() {\n  const { userId } = Route.useParams()\n  return \u003Cdiv>User ID: {userId}\u003C\u002Fdiv>\n}\n",[40,35219,35220,35239,35244,35248,35252,35261,35281,35304],{"__ignoreMap":56},[449,35221,35222,35224,35226,35228,35230,35232,35234,35237],{"class":451,"line":452},[449,35223,4629],{"class":680},[449,35225,10789],{"class":680},[449,35227,35148],{"class":714},[449,35229,718],{"class":680},[449,35231,35153],{"class":721},[449,35233,725],{"class":684},[449,35235,35236],{"class":691},"'\u002Fusers\u002F$userId'",[449,35238,35161],{"class":684},[449,35240,35241],{"class":451,"line":114},[449,35242,35243],{"class":684},"  component: UserPage,\n",[449,35245,35246],{"class":451,"line":111},[449,35247,4113],{"class":684},[449,35249,35250],{"class":451,"line":468},[449,35251,700],{"emptyLinePlaceholder":130},[449,35253,35254,35256,35259],{"class":451,"line":474},[449,35255,24643],{"class":680},[449,35257,35258],{"class":721}," UserPage",[449,35260,5439],{"class":684},[449,35262,35263,35265,35267,35269,35271,35273,35276,35279],{"class":451,"line":480},[449,35264,5048],{"class":680},[449,35266,14227],{"class":684},[449,35268,26869],{"class":714},[449,35270,21656],{"class":684},[449,35272,5014],{"class":680},[449,35274,35275],{"class":684}," Route.",[449,35277,35278],{"class":721},"useParams",[449,35280,11195],{"class":684},[449,35282,35283,35285,35287,35289,35292,35295,35298,35300,35302],{"class":451,"line":486},[449,35284,4726],{"class":680},[449,35286,2481],{"class":684},[449,35288,29388],{"class":721},[449,35290,35291],{"class":684},">User ",[449,35293,35294],{"class":714},"ID",[449,35296,35297],{"class":684},": {userId}",[449,35299,23220],{"class":680},[449,35301,29388],{"class":684},[449,35303,23122],{"class":680},[449,35305,35306],{"class":451,"line":492},[449,35307,4604],{"class":684},[2808,35309,35311],{"id":35310},"whats-different-here","What’s Different Here?",[383,35313,35314,35319,35322,35325],{},[386,35315,35316,35318],{},[40,35317,26869],{}," is typed",[386,35320,35321],{},"You can’t forget it",[386,35323,35324],{},"You can’t mistype it",[386,35326,35327],{},"You can’t pass the wrong param shape",[21,35329,35330],{},"TypeScript will stop you before the app runs.",[32,35332,35334],{"id":35333},"loaders-as-first-class-citizens","Loaders as First-Class Citizens",[21,35336,35337],{},"TanStack Router treats data loading as part of routing—not an afterthought.",[48,35339,35341],{"className":670,"code":35340,"language":673,"meta":56,"style":56},"export const Route = createFileRoute('\u002Fusers\u002F$userId')({\n  loader: async ({ params }) => {\n    return fetch(`\u002Fapi\u002Fusers\u002F${params.userId}`).then(res => res.json())\n  },\n  component: UserPage,\n})\n\nfunction UserPage() {\n  const user = Route.useLoaderData()\n  return \u003Cdiv>{user.name}\u003C\u002Fdiv>\n}\n",[40,35342,35343,35361,35381,35420,35424,35428,35432,35436,35444,35459,35476],{"__ignoreMap":56},[449,35344,35345,35347,35349,35351,35353,35355,35357,35359],{"class":451,"line":452},[449,35346,4629],{"class":680},[449,35348,10789],{"class":680},[449,35350,35148],{"class":714},[449,35352,718],{"class":680},[449,35354,35153],{"class":721},[449,35356,725],{"class":684},[449,35358,35236],{"class":691},[449,35360,35161],{"class":684},[449,35362,35363,35366,35368,35370,35372,35375,35377,35379],{"class":451,"line":114},[449,35364,35365],{"class":721},"  loader",[449,35367,1482],{"class":684},[449,35369,1485],{"class":680},[449,35371,1488],{"class":684},[449,35373,35374],{"class":1491},"params",[449,35376,1495],{"class":684},[449,35378,1498],{"class":680},[449,35380,1501],{"class":684},[449,35382,35383,35385,35387,35389,35392,35394,35396,35398,35400,35402,35404,35406,35409,35412,35415,35417],{"class":451,"line":111},[449,35384,1506],{"class":680},[449,35386,5660],{"class":721},[449,35388,725],{"class":684},[449,35390,35391],{"class":691},"`\u002Fapi\u002Fusers\u002F${",[449,35393,35374],{"class":684},[449,35395,165],{"class":691},[449,35397,26869],{"class":684},[449,35399,1517],{"class":691},[449,35401,374],{"class":684},[449,35403,6408],{"class":721},[449,35405,725],{"class":684},[449,35407,35408],{"class":1491},"res",[449,35410,35411],{"class":680}," =>",[449,35413,35414],{"class":684}," res.",[449,35416,4521],{"class":721},[449,35418,35419],{"class":684},"())\n",[449,35421,35422],{"class":451,"line":468},[449,35423,1474],{"class":684},[449,35425,35426],{"class":451,"line":474},[449,35427,35243],{"class":684},[449,35429,35430],{"class":451,"line":480},[449,35431,4113],{"class":684},[449,35433,35434],{"class":451,"line":486},[449,35435,700],{"emptyLinePlaceholder":130},[449,35437,35438,35440,35442],{"class":451,"line":492},[449,35439,24643],{"class":680},[449,35441,35258],{"class":721},[449,35443,5439],{"class":684},[449,35445,35446,35448,35450,35452,35454,35457],{"class":451,"line":498},[449,35447,5048],{"class":680},[449,35449,27416],{"class":714},[449,35451,718],{"class":680},[449,35453,35275],{"class":684},[449,35455,35456],{"class":721},"useLoaderData",[449,35458,11195],{"class":684},[449,35460,35461,35463,35465,35467,35470,35472,35474],{"class":451,"line":133},[449,35462,4726],{"class":680},[449,35464,2481],{"class":684},[449,35466,29388],{"class":721},[449,35468,35469],{"class":684},">{user.name}",[449,35471,23220],{"class":680},[449,35473,29388],{"class":684},[449,35475,23122],{"class":680},[449,35477,35478],{"class":451,"line":509},[449,35479,4604],{"class":684},[2808,35481,22914],{"id":22913},[383,35483,35484,35487,35490],{},[386,35485,35486],{},"Loader data is typed",[386,35488,35489],{},"Components can’t access data that doesn’t exist",[386,35491,35492],{},"Refactors stay safe",[32,35494,35496],{"id":35495},"tanstack-router-tanstack-query","TanStack Router + TanStack Query",[21,35498,35499],{},"When paired with TanStack Query, loaders become even more powerful—combining caching, background refetching, and route awareness.",[32,35501,35503],{"id":35502},"navigation-without-fear","Navigation Without Fear",[21,35505,35506],{},"Links are another classic source of bugs. TanStack Router eliminates them.",[48,35508,35510],{"className":32743,"code":35509,"language":32745,"meta":56,"style":56},"\u003CLink to=\"\u002Fusers\u002F$userId\" params={{ userId: \"42\" }}>\n  View User\n\u003C\u002FLink>\n",[40,35511,35512,35517,35522],{"__ignoreMap":56},[449,35513,35514],{"class":451,"line":452},[449,35515,35516],{},"\u003CLink to=\"\u002Fusers\u002F$userId\" params={{ userId: \"42\" }}>\n",[449,35518,35519],{"class":451,"line":114},[449,35520,35521],{},"  View User\n",[449,35523,35524],{"class":451,"line":111},[449,35525,35526],{},"\u003C\u002FLink>\n",[21,35528,35529],{},"If you:",[383,35531,35532,35535,35538],{},[386,35533,35534],{},"Forget a param ❌",[386,35536,35537],{},"Misspell a route ❌",[386,35539,35540],{},"Pass the wrong param type ❌",[21,35542,35543],{},"TypeScript catches it instantly.",[32,35545,35547],{"id":35546},"nested-routes-done-right","Nested Routes Done Right",[21,35549,35550],{},"Nested routing is simple, explicit, and predictable.",[48,35552,35555],{"className":35553,"code":35554,"language":53},[51],"\u002Fusers\n\u002Fusers\u002F$userId\n\u002Fusers\u002F$userId\u002Fsettings\n",[40,35556,35554],{"__ignoreMap":56},[21,35558,35559],{},"Each route:",[383,35561,35562,35565,35568],{},[386,35563,35564],{},"Knows its parent",[386,35566,35567],{},"Inherits context safely",[386,35569,35570],{},"Composes layouts naturally",[21,35572,35573],{},"No magic. No hidden behavior.",[32,35575,35577],{"id":35576},"how-tanstack-router-fits-modern-stacks","How TanStack Router Fits Modern Stacks",[21,35579,35580],{},"TanStack Router pairs especially well with:",[383,35582,35583,35586,35588,35591],{},[386,35584,35585],{},"TanStack Query",[386,35587,21147],{},[386,35589,35590],{},"Server-first architectures",[386,35592,35593],{},"Typed backends",[21,35595,35596],{},"If you care about refactoring confidence and long-term maintainability, TanStack Router pays for itself very quickly.",[21,35598,35599],{},"It’s not about being flashy—it’s about eliminating entire classes of bugs.",[32,35601,35603],{"id":35602},"when-should-you-use-tanstack-router","When Should You Use TanStack Router?",[21,35605,35606],{},"TanStack Router is ideal if:",[383,35608,35609,35612,35615,35618],{},[386,35610,35611],{},"You use TypeScript seriously",[386,35613,35614],{},"Your app has complex routing or data needs",[386,35616,35617],{},"You value refactor safety",[386,35619,35620],{},"You’re building long-lived applications",[21,35622,35623],{},"It might be overkill for:",[383,35625,35626,35629,35632],{},[386,35627,35628],{},"Tiny apps",[386,35630,35631],{},"One-page demos",[386,35633,35634],{},"Projects without TypeScript",[16,35636,3681],{"id":3680},[21,35638,35639],{},"TanStack Router isn’t just another router—it’s a rethinking of what routing should be in modern web applications. By embracing type safety, colocation, and data-first design, it gives developers something rare: confidence.",[21,35641,35642],{},"Confidence to refactor.\nConfidence to scale.\nConfidence that your routes won’t betray you at runtime.",[21,35644,35645],{},"If you’ve ever been burned by routing bugs, TanStack Router is absolutely worth your time.",[3728,35647,35648],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":35650},[35651,35652,35653,35654,35655,35658,35661,35662,35663,35664,35665],{"id":34937,"depth":114,"text":34938},{"id":34979,"depth":114,"text":34980},{"id":33643,"depth":114,"text":33644},{"id":35115,"depth":114,"text":35116},{"id":35210,"depth":114,"text":35211,"children":35656},[35657],{"id":35310,"depth":111,"text":35311},{"id":35333,"depth":114,"text":35334,"children":35659},[35660],{"id":22913,"depth":111,"text":22914},{"id":35495,"depth":114,"text":35496},{"id":35502,"depth":114,"text":35503},{"id":35546,"depth":114,"text":35547},{"id":35576,"depth":114,"text":35577},{"id":35602,"depth":114,"text":35603},"A deep dive into TanStack Router, exploring why type-safe routing matters, how it compares to traditional routers, and how to build scalable applications with confidence.",{"type":13,"value":35668},[35669,35671,35673,35677,35683],[16,35670,333],{"id":332},[21,35672,34908],{},[21,35674,35675,34914],{},[151,35676,34913],{},[21,35678,34917,35679,34921,35681,34925],{},[151,35680,34920],{},[156,35682,34924],{},[21,35684,34928,35685,34932],{},[151,35686,34931],{},[21349,35688,3784,34892,21003],"tanstack router",{},"\u002Fblog\u002Ftanstack-router",{"title":34900,"description":35666},"blog\u002Ftanstack-router","aoUXc4NtavnxbEC1_3ftrW8d7FZ46TNjQ8eeRSK8ExM",{"id":35695,"title":35696,"author":35697,"body":35698,"canonical":116,"categories":116,"date":36805,"description":36806,"excerpt":36807,"extension":119,"featuredImg":116,"img":22045,"keywords":36823,"language":3788,"meta":36825,"navigation":130,"ogImage":116,"path":36826,"rating":474,"readTime":133,"seo":36827,"stem":36828,"tag":3793,"__hash__":36829},"blog\u002Fblog\u002Funjs-packages.md","Using Core UnJS Packages to Build a Modern JavaScript Application",{"name":9,"img":11,"website":327},{"type":13,"value":35699,"toc":36785},[35700,35702,35714,35721,35723,35730,35732,35736,35739,35745,35754,35757,35846,35855,35857,35864,35874,35931,35937,35939,35945,35954,36006,36012,36014,36021,36030,36033,36140,36146,36148,36154,36163,36233,36239,36241,36248,36251,36301,36307,36309,36318,36339,36416,36422,36424,36428,36431,36486,36489,36491,36495,36498,36747,36757,36759,36761,36775,36782],[16,35701,333],{"id":332},[21,35703,1556,35704,35707,35708,35711,35712],{},[151,35705,35706],{},"UnJS ecosystem"," is a large collection of focused, composable JavaScript utilities and tools created to empower developers with performant, agnostic building blocks. Instead of monolithic frameworks with opinionated APIs, UnJS packages are ",[151,35709,35710],{},"small, well-scoped, and interoperable"," — letting you pick exactly what you need for your app’s architecture and tooling. ",[9897,35713,9900],{"index":9899},[21,35715,35716,35717,35720],{},"In this post, we’ll focus on the ",[151,35718,35719],{},"main UnJS packages"," you’d use to build a real-world application and how they integrate together.",[16,35722,4373],{"id":4372},[25,35724,35725],{"type":363},[21,35726,35727,35728],{},"UnJS packages follow a Unix philosophy — each one does one thing well and can be composed with others to form a complete solution. ",[9897,35729,9926],{"index":4798},[73,35731],{},[32,35733,35735],{"id":35734},"key-unjs-packages-for-your-application","Key UnJS Packages for Your Application",[21,35737,35738],{},"Here’s a curated list of the most impactful UnJS packages you’ll likely use in a modern JavaScript\u002FTypeScript application:",[2808,35740,35742,35744],{"id":35741},"nitro-a-universal-server-engine",[151,35743,4189],{}," — A Universal Server Engine",[21,35746,35747,35749,35750,35753],{},[40,35748,7065],{}," lets you build ",[151,35751,35752],{},"fast, portable servers"," that run on Node.js, Deno, Bun, Cloudflare Workers, and more.",[21,35755,35756],{},"Use Nitro to create API routes and server logic without worrying about runtime differences:",[48,35758,35762],{"className":35759,"code":35760,"language":35761,"meta":56,"style":56},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F server\u002Findex.ts\nimport { createNitro } from \"nitro\";\n\nexport default createNitro({\n  handlers: [\n    {\n      route: \"\u002Fapi\u002Fhello\",\n      handler: () => ({ message: \"Hello from Nitro!\" }),\n    },\n  ],\n});\n","js",[40,35763,35764,35769,35783,35787,35798,35803,35808,35818,35834,35838,35842],{"__ignoreMap":56},[449,35765,35766],{"class":451,"line":452},[449,35767,35768],{"class":705},"\u002F\u002F server\u002Findex.ts\n",[449,35770,35771,35773,35776,35778,35781],{"class":451,"line":114},[449,35772,681],{"class":680},[449,35774,35775],{"class":684}," { createNitro } ",[449,35777,688],{"class":680},[449,35779,35780],{"class":691}," \"nitro\"",[449,35782,695],{"class":684},[449,35784,35785],{"class":451,"line":111},[449,35786,700],{"emptyLinePlaceholder":130},[449,35788,35789,35791,35793,35796],{"class":451,"line":468},[449,35790,4629],{"class":680},[449,35792,4632],{"class":680},[449,35794,35795],{"class":721}," createNitro",[449,35797,1391],{"class":684},[449,35799,35800],{"class":451,"line":474},[449,35801,35802],{"class":684},"  handlers: [\n",[449,35804,35805],{"class":451,"line":480},[449,35806,35807],{"class":684},"    {\n",[449,35809,35810,35813,35816],{"class":451,"line":486},[449,35811,35812],{"class":684},"      route: ",[449,35814,35815],{"class":691},"\"\u002Fapi\u002Fhello\"",[449,35817,779],{"class":684},[449,35819,35820,35823,35825,35827,35830,35832],{"class":451,"line":492},[449,35821,35822],{"class":721},"      handler",[449,35824,35071],{"class":684},[449,35826,1498],{"class":680},[449,35828,35829],{"class":684}," ({ message: ",[449,35831,21579],{"class":691},[449,35833,3479],{"class":684},[449,35835,35836],{"class":451,"line":498},[449,35837,1458],{"class":684},[449,35839,35840],{"class":451,"line":133},[449,35841,4107],{"class":684},[449,35843,35844],{"class":451,"line":509},[449,35845,784],{"class":684},[21,35847,35848,35849,827],{},"Nitro becomes the backbone of your backend layer, powering APIs consistently across environments. (",[3861,35850,35854],{"href":35851,"rel":35852,"title":35853},"https:\u002F\u002Funjs.io\u002Fpackages\u002F",[3865],"Packages · UnJS","UnJS",[73,35856],{},[2808,35858,35860,35863],{"id":35859},"c12-smart-configuration-loader",[151,35861,35862],{},"c12"," — Smart Configuration Loader",[21,35865,35866,35868,35869,827],{},[40,35867,35862],{}," simplifies loading configuration from multiple sources (JSON, JSONC, YAML, TOML, .env, RC files) and merges them intelligently. This is useful for environment configs, feature flags, and CLI apps. (",[3861,35870,35854],{"href":35871,"rel":35872,"title":35873},"https:\u002F\u002Funjs.io\u002Fpackages\u002Fc12",[3865],"c12 · Packages · UnJS",[48,35875,35877],{"className":670,"code":35876,"language":673,"meta":56,"style":56},"import { loadConfig } from \"c12\";\n\nconst { config } = await loadConfig({});\nconsole.log(\"App Config:\", config);\n",[40,35878,35879,35893,35897,35917],{"__ignoreMap":56},[449,35880,35881,35883,35886,35888,35891],{"class":451,"line":452},[449,35882,681],{"class":680},[449,35884,35885],{"class":684}," { loadConfig } ",[449,35887,688],{"class":680},[449,35889,35890],{"class":691}," \"c12\"",[449,35892,695],{"class":684},[449,35894,35895],{"class":451,"line":114},[449,35896,700],{"emptyLinePlaceholder":130},[449,35898,35899,35901,35903,35905,35907,35909,35911,35914],{"class":451,"line":111},[449,35900,711],{"class":680},[449,35902,14227],{"class":684},[449,35904,3885],{"class":714},[449,35906,21656],{"class":684},[449,35908,5014],{"class":680},[449,35910,1654],{"class":680},[449,35912,35913],{"class":721}," loadConfig",[449,35915,35916],{"class":684},"({});\n",[449,35918,35919,35921,35923,35925,35928],{"class":451,"line":468},[449,35920,1672],{"class":684},[449,35922,1675],{"class":721},[449,35924,725],{"class":684},[449,35926,35927],{"class":691},"\"App Config:\"",[449,35929,35930],{"class":684},", config);\n",[21,35932,35933,35934,827],{},"It supports layering configs, environment overrides, and HMR during development — making config management a breeze. (",[3861,35935,35854],{"href":35871,"rel":35936,"title":35873},[3865],[73,35938],{},[2808,35940,35942,35944],{"id":35941},"ofetch-a-universal-fetch-api",[151,35943,25692],{}," — A Universal Fetch API",[21,35946,35947,35949,35950,35953],{},[40,35948,25692],{}," gives you a robust, cross-environment ",[40,35951,35952],{},"fetch"," API compatible with Node, browsers, and workers:",[48,35955,35957],{"className":670,"code":35956,"language":673,"meta":56,"style":56},"import { ofetch } from \"ofetch\";\n\nconst user = await ofetch(\"\u002Fapi\u002Fuser\");\nconsole.log(user);\n",[40,35958,35959,35973,35977,35997],{"__ignoreMap":56},[449,35960,35961,35963,35966,35968,35971],{"class":451,"line":452},[449,35962,681],{"class":680},[449,35964,35965],{"class":684}," { ofetch } ",[449,35967,688],{"class":680},[449,35969,35970],{"class":691}," \"ofetch\"",[449,35972,695],{"class":684},[449,35974,35975],{"class":451,"line":114},[449,35976,700],{"emptyLinePlaceholder":130},[449,35978,35979,35981,35983,35985,35987,35990,35992,35995],{"class":451,"line":111},[449,35980,711],{"class":680},[449,35982,27416],{"class":714},[449,35984,718],{"class":680},[449,35986,1654],{"class":680},[449,35988,35989],{"class":721}," ofetch",[449,35991,725],{"class":684},[449,35993,35994],{"class":691},"\"\u002Fapi\u002Fuser\"",[449,35996,740],{"class":684},[449,35998,35999,36001,36003],{"class":451,"line":468},[449,36000,1672],{"class":684},[449,36002,1675],{"class":721},[449,36004,36005],{"class":684},"(user);\n",[21,36007,36008,36009,827],{},"Use it in your client and server code without worrying about environment differences. (",[3861,36010,35854],{"href":35851,"rel":36011,"title":35853},[3865],[73,36013],{},[2808,36015,36017,36020],{"id":36016},"unplugin-plugin-system-across-bundlers",[151,36018,36019],{},"unplugin"," — Plugin System Across Bundlers",[21,36022,36023,36025,36026,36029],{},[40,36024,36019],{}," lets you write ",[151,36027,36028],{},"one plugin"," that works with Vite, Rollup, webpack, and esbuild — ideal for extending builds consistently.",[21,36031,36032],{},"For example, creating a custom import transform:",[48,36034,36036],{"className":35759,"code":36035,"language":35761,"meta":56,"style":56},"import Unplugin from \"unplugin\";\n\nexport default Unplugin(() => ({\n  name: \"example-plugin\",\n  transform(code) {\n    return code.replace(\u002FENV_VAR\u002Fg, JSON.stringify(process.env.NODE_ENV));\n  },\n}));\n",[40,36037,36038,36052,36056,36072,36081,36092,36131,36135],{"__ignoreMap":56},[449,36039,36040,36042,36045,36047,36050],{"class":451,"line":452},[449,36041,681],{"class":680},[449,36043,36044],{"class":684}," Unplugin ",[449,36046,688],{"class":680},[449,36048,36049],{"class":691}," \"unplugin\"",[449,36051,695],{"class":684},[449,36053,36054],{"class":451,"line":114},[449,36055,700],{"emptyLinePlaceholder":130},[449,36057,36058,36060,36062,36065,36067,36069],{"class":451,"line":111},[449,36059,4629],{"class":680},[449,36061,4632],{"class":680},[449,36063,36064],{"class":721}," Unplugin",[449,36066,4717],{"class":684},[449,36068,1498],{"class":680},[449,36070,36071],{"class":684}," ({\n",[449,36073,36074,36076,36079],{"class":451,"line":468},[449,36075,1396],{"class":684},[449,36077,36078],{"class":691},"\"example-plugin\"",[449,36080,779],{"class":684},[449,36082,36083,36086,36088,36090],{"class":451,"line":474},[449,36084,36085],{"class":721},"  transform",[449,36087,725],{"class":684},[449,36089,40],{"class":1491},[449,36091,3417],{"class":684},[449,36093,36094,36096,36099,36102,36104,36106,36110,36112,36115,36117,36120,36122,36125,36127,36129],{"class":451,"line":480},[449,36095,1506],{"class":680},[449,36097,36098],{"class":684}," code.",[449,36100,36101],{"class":721},"replace",[449,36103,725],{"class":684},[449,36105,5872],{"class":691},[449,36107,36109],{"class":36108},"sA_wV","ENV_VAR",[449,36111,5872],{"class":691},[449,36113,36114],{"class":680},"g",[449,36116,349],{"class":684},[449,36118,36119],{"class":714},"JSON",[449,36121,165],{"class":684},[449,36123,36124],{"class":721},"stringify",[449,36126,26689],{"class":684},[449,36128,27995],{"class":714},[449,36130,5183],{"class":684},[449,36132,36133],{"class":451,"line":486},[449,36134,1474],{"class":684},[449,36136,36137],{"class":451,"line":492},[449,36138,36139],{"class":684},"}));\n",[21,36141,36142,36143,827],{},"It’s data-agnostic and integrates with major build systems seamlessly. (",[3861,36144,35854],{"href":35851,"rel":36145,"title":35853},[3865],[73,36147],{},[2808,36149,36151,36153],{"id":36150},"jiti-runtime-typescript-and-esm-support",[151,36152,25779],{}," — Runtime TypeScript and ESM Support",[21,36155,36156,36158,36159,36162],{},[40,36157,25779],{}," makes it easy to load ",[40,36160,36161],{},".ts"," modules at runtime without manual compilation:",[48,36164,36166],{"className":35759,"code":36165,"language":35761,"meta":56,"style":56},"import { createRequire } from \"module\";\nimport jiti from \"jiti\";\n\nconst requireTs = jiti(__filename);\nconst config = requireTs(\".\u002Fconfig.ts\").default;\n",[40,36167,36168,36182,36196,36200,36215],{"__ignoreMap":56},[449,36169,36170,36172,36175,36177,36180],{"class":451,"line":452},[449,36171,681],{"class":680},[449,36173,36174],{"class":684}," { createRequire } ",[449,36176,688],{"class":680},[449,36178,36179],{"class":691}," \"module\"",[449,36181,695],{"class":684},[449,36183,36184,36186,36189,36191,36194],{"class":451,"line":114},[449,36185,681],{"class":680},[449,36187,36188],{"class":684}," jiti ",[449,36190,688],{"class":680},[449,36192,36193],{"class":691}," \"jiti\"",[449,36195,695],{"class":684},[449,36197,36198],{"class":451,"line":111},[449,36199,700],{"emptyLinePlaceholder":130},[449,36201,36202,36204,36207,36209,36212],{"class":451,"line":468},[449,36203,711],{"class":680},[449,36205,36206],{"class":714}," requireTs",[449,36208,718],{"class":680},[449,36210,36211],{"class":721}," jiti",[449,36213,36214],{"class":684},"(__filename);\n",[449,36216,36217,36219,36221,36223,36225,36227,36230],{"class":451,"line":474},[449,36218,711],{"class":680},[449,36220,15452],{"class":714},[449,36222,718],{"class":680},[449,36224,36206],{"class":721},[449,36226,725],{"class":684},[449,36228,36229],{"class":691},"\".\u002Fconfig.ts\"",[449,36231,36232],{"class":684},").default;\n",[21,36234,36235,36236,827],{},"This is invaluable for quick prototyping, custom servers, and tooling that needs TypeScript support without build steps. (",[3861,36237,35854],{"href":35851,"rel":36238,"title":35853},[3865],[73,36240],{},[2808,36242,36244,36247],{"id":36243},"consola-elegant-console-logging",[151,36245,36246],{},"consola"," — Elegant Console Logging",[21,36249,36250],{},"A lightweight yet powerful wrapper around console logs with levels, formatting, and grouping:",[48,36252,36254],{"className":670,"code":36253,"language":673,"meta":56,"style":56},"import { consola } from \"consola\";\n\nconsola.info(\"Server started\");\nconsola.error(\"Unexpected error\");\n",[40,36255,36256,36270,36274,36288],{"__ignoreMap":56},[449,36257,36258,36260,36263,36265,36268],{"class":451,"line":452},[449,36259,681],{"class":680},[449,36261,36262],{"class":684}," { consola } ",[449,36264,688],{"class":680},[449,36266,36267],{"class":691}," \"consola\"",[449,36269,695],{"class":684},[449,36271,36272],{"class":451,"line":114},[449,36273,700],{"emptyLinePlaceholder":130},[449,36275,36276,36279,36281,36283,36286],{"class":451,"line":111},[449,36277,36278],{"class":684},"consola.",[449,36280,363],{"class":721},[449,36282,725],{"class":684},[449,36284,36285],{"class":691},"\"Server started\"",[449,36287,740],{"class":684},[449,36289,36290,36292,36294,36296,36299],{"class":451,"line":468},[449,36291,36278],{"class":684},[449,36293,17495],{"class":721},[449,36295,725],{"class":684},[449,36297,36298],{"class":691},"\"Unexpected error\"",[449,36300,740],{"class":684},[21,36302,36303,36304,827],{},"It improves readability of logs in production and development environments. (",[3861,36305,35854],{"href":35851,"rel":36306,"title":35853},[3865],[73,36308],{},[2808,36310,36312,23841,36315,36317],{"id":36311},"defu-and-destr-defaults-safe-parsing",[151,36313,36314],{},"defu",[151,36316,25413],{}," — Defaults & Safe Parsing",[383,36319,36320,36328],{},[386,36321,36322,36324,36325,827],{},[40,36323,36314],{}," lets you merge objects with recursive defaults — perfect for configs. (",[3861,36326,35854],{"href":35851,"rel":36327,"title":35853},[3865],[386,36329,36330,36332,36333,10243,36336,827],{},[40,36331,25413],{}," safely parses JSON with better performance and security than ",[40,36334,36335],{},"JSON.parse",[3861,36337,35854],{"href":35851,"rel":36338,"title":35853},[3865],[48,36340,36342],{"className":670,"code":36341,"language":673,"meta":56,"style":56},"import { defu } from \"defu\";\nimport { destr } from \"destr\";\n\nconst defaults = { port: 3000 };\nconst config = defu(destr(process.env.APP_CONFIG), defaults);\n",[40,36343,36344,36358,36372,36376,36393],{"__ignoreMap":56},[449,36345,36346,36348,36351,36353,36356],{"class":451,"line":452},[449,36347,681],{"class":680},[449,36349,36350],{"class":684}," { defu } ",[449,36352,688],{"class":680},[449,36354,36355],{"class":691}," \"defu\"",[449,36357,695],{"class":684},[449,36359,36360,36362,36365,36367,36370],{"class":451,"line":114},[449,36361,681],{"class":680},[449,36363,36364],{"class":684}," { destr } ",[449,36366,688],{"class":680},[449,36368,36369],{"class":691}," \"destr\"",[449,36371,695],{"class":684},[449,36373,36374],{"class":451,"line":111},[449,36375,700],{"emptyLinePlaceholder":130},[449,36377,36378,36380,36383,36385,36388,36391],{"class":451,"line":468},[449,36379,711],{"class":680},[449,36381,36382],{"class":714}," defaults",[449,36384,718],{"class":680},[449,36386,36387],{"class":684}," { port: ",[449,36389,36390],{"class":714},"3000",[449,36392,1520],{"class":684},[449,36394,36395,36397,36399,36401,36404,36406,36408,36410,36413],{"class":451,"line":474},[449,36396,711],{"class":680},[449,36398,15452],{"class":714},[449,36400,718],{"class":680},[449,36402,36403],{"class":721}," defu",[449,36405,725],{"class":684},[449,36407,25413],{"class":721},[449,36409,26689],{"class":684},[449,36411,36412],{"class":714},"APP_CONFIG",[449,36414,36415],{"class":684},"), defaults);\n",[21,36417,36418,36419,36421],{},"These utilities pair well with ",[40,36420,35862],{}," for robust config and data handling.",[73,36423],{},[32,36425,36427],{"id":36426},"how-these-fit-together-in-a-real-app","How These Fit Together in a Real App",[21,36429,36430],{},"Let’s imagine building a minimal app with UnJS tools:",[816,36432,36433,36441,36449,36457,36466,36474],{},[386,36434,36435,36437,36438,36440],{},[151,36436,31232],{}," – Use ",[40,36439,35862],{}," to load app configs, merging defaults and environment settings.",[386,36442,36443,36437,36446,36448],{},[151,36444,36445],{},"Server Setup",[40,36447,7065],{}," to define API endpoints and middleware.",[386,36450,36451,36437,36454,36456],{},[151,36452,36453],{},"Data Fetching",[40,36455,25692],{}," on both client-side and server-side for HTTP requests.",[386,36458,36459,36462,36463,36465],{},[151,36460,36461],{},"Build\u002FPlugin Support"," – Enhance the build pipeline with ",[40,36464,36019],{}," for consistent tooling across environments.",[386,36467,36468,36437,36471,36473],{},[151,36469,36470],{},"Runtime TypeScript",[40,36472,25779],{}," in scripts or custom tooling parts of the app.",[386,36475,36476,36437,36479,349,36481,1542,36483,36485],{},[151,36477,36478],{},"Logging & Utilities",[40,36480,36246],{},[40,36482,36314],{},[40,36484,25413],{}," for reliable logging, defaults handling, and parsing.",[21,36487,36488],{},"Each UnJS package is independent and tree-shakeable. Only install what you need to keep your bundles lean.\n(::)",[73,36490],{},[32,36492,36494],{"id":36493},"code-example-putting-it-all-together","Code Example: Putting It All Together",[21,36496,36497],{},"Below is a simple example of a Nitro server with config loading and fetch utility:",[48,36499,36501],{"className":670,"code":36500,"filename":672,"language":673,"meta":56,"style":56},"import { createNitro } from \"nitro\";\nimport { loadConfig } from \"c12\";\nimport { ofetch } from \"ofetch\";\nimport { consola } from \"consola\";\n\nconst { config } = await loadConfig({});\n\nexport default createNitro({\n  async handlers() {\n    return [\n      {\n        route: \"\u002Fapi\u002Fhello\",\n        handler: () => ({\n          message: \"Hello from UnJS App!\",\n          env: config.NODE_ENV,\n        }),\n      },\n      {\n        route: \"\u002Fapi\u002Fuser\",\n        handler: async () => {\n          const user = await ofetch(\"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Fusers\u002F1\");\n          consola.info(\"Fetched user:\", user);\n          return user;\n        },\n      },\n    ];\n  },\n});\n",[40,36502,36503,36515,36527,36539,36551,36555,36573,36577,36587,36597,36603,36608,36617,36628,36638,36647,36652,36656,36660,36668,36682,36702,36717,36725,36730,36734,36739,36743],{"__ignoreMap":56},[449,36504,36505,36507,36509,36511,36513],{"class":451,"line":452},[449,36506,681],{"class":680},[449,36508,35775],{"class":684},[449,36510,688],{"class":680},[449,36512,35780],{"class":691},[449,36514,695],{"class":684},[449,36516,36517,36519,36521,36523,36525],{"class":451,"line":114},[449,36518,681],{"class":680},[449,36520,35885],{"class":684},[449,36522,688],{"class":680},[449,36524,35890],{"class":691},[449,36526,695],{"class":684},[449,36528,36529,36531,36533,36535,36537],{"class":451,"line":111},[449,36530,681],{"class":680},[449,36532,35965],{"class":684},[449,36534,688],{"class":680},[449,36536,35970],{"class":691},[449,36538,695],{"class":684},[449,36540,36541,36543,36545,36547,36549],{"class":451,"line":468},[449,36542,681],{"class":680},[449,36544,36262],{"class":684},[449,36546,688],{"class":680},[449,36548,36267],{"class":691},[449,36550,695],{"class":684},[449,36552,36553],{"class":451,"line":474},[449,36554,700],{"emptyLinePlaceholder":130},[449,36556,36557,36559,36561,36563,36565,36567,36569,36571],{"class":451,"line":480},[449,36558,711],{"class":680},[449,36560,14227],{"class":684},[449,36562,3885],{"class":714},[449,36564,21656],{"class":684},[449,36566,5014],{"class":680},[449,36568,1654],{"class":680},[449,36570,35913],{"class":721},[449,36572,35916],{"class":684},[449,36574,36575],{"class":451,"line":486},[449,36576,700],{"emptyLinePlaceholder":130},[449,36578,36579,36581,36583,36585],{"class":451,"line":492},[449,36580,4629],{"class":680},[449,36582,4632],{"class":680},[449,36584,35795],{"class":721},[449,36586,1391],{"class":684},[449,36588,36589,36592,36595],{"class":451,"line":498},[449,36590,36591],{"class":680},"  async",[449,36593,36594],{"class":721}," handlers",[449,36596,5439],{"class":684},[449,36598,36599,36601],{"class":451,"line":133},[449,36600,1506],{"class":680},[449,36602,4790],{"class":684},[449,36604,36605],{"class":451,"line":509},[449,36606,36607],{"class":684},"      {\n",[449,36609,36610,36613,36615],{"class":451,"line":318},[449,36611,36612],{"class":684},"        route: ",[449,36614,35815],{"class":691},[449,36616,779],{"class":684},[449,36618,36619,36622,36624,36626],{"class":451,"line":520},[449,36620,36621],{"class":721},"        handler",[449,36623,35071],{"class":684},[449,36625,1498],{"class":680},[449,36627,36071],{"class":684},[449,36629,36630,36633,36636],{"class":451,"line":526},[449,36631,36632],{"class":684},"          message: ",[449,36634,36635],{"class":691},"\"Hello from UnJS App!\"",[449,36637,779],{"class":684},[449,36639,36640,36643,36645],{"class":451,"line":532},[449,36641,36642],{"class":684},"          env: config.",[449,36644,27995],{"class":714},[449,36646,779],{"class":684},[449,36648,36649],{"class":451,"line":2790},[449,36650,36651],{"class":684},"        }),\n",[449,36653,36654],{"class":451,"line":3511},[449,36655,4095],{"class":684},[449,36657,36658],{"class":451,"line":3526},[449,36659,36607],{"class":684},[449,36661,36662,36664,36666],{"class":451,"line":3531},[449,36663,36612],{"class":684},[449,36665,35994],{"class":691},[449,36667,779],{"class":684},[449,36669,36670,36672,36674,36676,36678,36680],{"class":451,"line":3536},[449,36671,36621],{"class":721},[449,36673,1482],{"class":684},[449,36675,1485],{"class":680},[449,36677,2090],{"class":684},[449,36679,1498],{"class":680},[449,36681,1501],{"class":684},[449,36683,36684,36687,36689,36691,36693,36695,36697,36700],{"class":451,"line":4009},[449,36685,36686],{"class":680},"          const",[449,36688,27416],{"class":714},[449,36690,718],{"class":680},[449,36692,1654],{"class":680},[449,36694,35989],{"class":721},[449,36696,725],{"class":684},[449,36698,36699],{"class":691},"\"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Fusers\u002F1\"",[449,36701,740],{"class":684},[449,36703,36704,36707,36709,36711,36714],{"class":451,"line":4015},[449,36705,36706],{"class":684},"          consola.",[449,36708,363],{"class":721},[449,36710,725],{"class":684},[449,36712,36713],{"class":691},"\"Fetched user:\"",[449,36715,36716],{"class":684},", user);\n",[449,36718,36719,36722],{"class":451,"line":4021},[449,36720,36721],{"class":680},"          return",[449,36723,36724],{"class":684}," user;\n",[449,36726,36727],{"class":451,"line":4027},[449,36728,36729],{"class":684},"        },\n",[449,36731,36732],{"class":451,"line":4032},[449,36733,4095],{"class":684},[449,36735,36736],{"class":451,"line":4038},[449,36737,36738],{"class":684},"    ];\n",[449,36740,36741],{"class":451,"line":4044},[449,36742,1474],{"class":684},[449,36744,36745],{"class":451,"line":4049},[449,36746,784],{"class":684},[21,36748,36749,36750,36753,36754,827],{},"This sample shows how ",[151,36751,36752],{},"Nitro, c12, ofetch, and consola"," can power a flexible, full-featured backend. (",[3861,36755,35854],{"href":35851,"rel":36756,"title":35853},[3865],[73,36758],{},[16,36760,3681],{"id":3680},[21,36762,1556,36763,36765,36766,36769,36770,827],{},[151,36764,35706],{}," offers a rich — yet modular — toolkit for modern JavaScript applications. By adopting packages like ",[151,36767,36768],{},"Nitro, c12, ofetch, unplugin, jiti, consola, defu, and destr",", you can assemble a highly productive development environment while keeping your dependencies lean. (",[3861,36771,35854],{"href":36772,"rel":36773,"title":36774},"https:\u002F\u002Funjs.io\u002F",[3865],"UnJS: Unleash JavaScript's Potential",[21,36776,36777,36778,36781],{},"Whether you're building servers, tooling, or full-stack apps, UnJS packages empower you to choose ",[156,36779,36780],{},"exactly the components you need"," — embracing composability and simplicity in equal measure. 🚀",[3728,36783,36784],{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sA_wV, html code.shiki .sA_wV{--shiki-default:#032F62;--shiki-dark:#DBEDFF}",{"title":56,"searchDepth":111,"depth":111,"links":36786},[36787,36803,36804],{"id":35734,"depth":114,"text":35735,"children":36788},[36789,36791,36793,36795,36797,36799,36801],{"id":35741,"depth":111,"text":36790},"Nitro — A Universal Server Engine",{"id":35859,"depth":111,"text":36792},"c12 — Smart Configuration Loader",{"id":35941,"depth":111,"text":36794},"ofetch — A Universal Fetch API",{"id":36016,"depth":111,"text":36796},"unplugin — Plugin System Across Bundlers",{"id":36150,"depth":111,"text":36798},"jiti — Runtime TypeScript and ESM Support",{"id":36243,"depth":111,"text":36800},"consola — Elegant Console Logging",{"id":36311,"depth":111,"text":36802},"defu and destr — Defaults & Safe Parsing",{"id":36426,"depth":114,"text":36427},{"id":36493,"depth":114,"text":36494},"2026-01-12","Explore the main UnJS packages and learn how to use them together in a real-world application — from config loading and HTTP servers to fetch utilities and building tools.",{"type":13,"value":36808},[36809,36811,36819],[16,36810,333],{"id":332},[21,36812,1556,36813,35707,36815,35711,36817],{},[151,36814,35706],{},[151,36816,35710],{},[9897,36818,9900],{"index":9899},[21,36820,35716,36821,35720],{},[151,36822,35719],{},[17244,7065,25692,36019,36824,35862],"unstorage",{},"\u002Fblog\u002Funjs-packages",{"title":35696,"description":36806},"blog\u002Funjs-packages","h3ZK6D9PaHnDwrHzHZxqGnk6X0B9h9rE8XgTXgqE6lY",{"id":36831,"title":36832,"author":36833,"body":36834,"canonical":116,"categories":116,"date":40438,"description":40439,"excerpt":40440,"extension":119,"featuredImg":116,"img":40458,"keywords":40459,"language":3788,"meta":40465,"navigation":130,"ogImage":116,"path":40466,"rating":474,"readTime":133,"seo":40467,"stem":40468,"tag":3793,"__hash__":40469},"blog\u002Fblog\u002Fviteplus-teacher-toolkit-package.md","Building a Teacher's Grading Toolkit with Vite+",{"name":9,"img":11,"website":327},{"type":13,"value":36835,"toc":40430},[36836,36838,36841,36848,36863,36872,36876,36879,36911,36914,36918,36921,36942,36953,36956,36991,36995,37000,37200,37204,37208,37613,37617,37835,37838,37926,37930,38221,38225,38681,38685,38762,38766,38771,39650,39653,39665,39680,39684,39689,39777,39780,39794,39798,39810,39813,39843,39856,39860,39865,40039,40042,40054,40058,40061,40074,40286,40290,40357,40362,40373,40377,40409,40411,40421,40424,40427],[16,36837,333],{"id":332},[21,36839,36840],{},"Teachers spend hours every week calculating grades, curving scores, and converting percentages to letter grades. Most of this work happens in spreadsheets with fragile formulas that break the moment a student is added out of order.",[21,36842,36843,36844,36847],{},"What if we packaged those utilities as a reusable TypeScript library — something any teacher or school app developer could ",[40,36845,36846],{},"npm install"," and use?",[21,36849,36850,36851,36854,36855,36858,36859,36862],{},"In this post, we'll build ",[151,36852,36853],{},"teacher-toolkit"," — an npm package for grade calculations — using ",[151,36856,36857],{},"Vite+"," and its ",[40,36860,36861],{},"vp pack"," command. No Webpack config. No tsconfig gymnastics. Just code, test, and ship.",[25,36864,36865],{"type":363},[21,36866,36867,36868,36871],{},"This tutorial assumes you have Vite+ installed. If not, run ",[40,36869,36870],{},"curl -fsSL https:\u002F\u002Fvite.plus | bash"," and open a new terminal.",[16,36873,36875],{"id":36874},"what-were-building","What We're Building",[21,36877,36878],{},"A lightweight TypeScript library that provides:",[383,36880,36881,36887,36893,36899,36905],{},[386,36882,36883,36886],{},[151,36884,36885],{},"Letter grade conversion"," — percentage to A\u002FB\u002FC\u002FD\u002FF",[386,36888,36889,36892],{},[151,36890,36891],{},"Weighted grade calculation"," — combine homework, exams, participation",[386,36894,36895,36898],{},[151,36896,36897],{},"Score curving"," — boost grades based on class highest score",[386,36900,36901,36904],{},[151,36902,36903],{},"GPA conversion"," — letter grades to 4.0 scale",[386,36906,36907,36910],{},[151,36908,36909],{},"Class statistics"," — mean, median, standard deviation",[21,36912,36913],{},"All with full type safety and zero dependencies.",[16,36915,36917],{"id":36916},"step-1-scaffold-the-library","Step 1: Scaffold the Library",[21,36919,36920],{},"Vite+ has a built-in library template. Run:",[48,36922,36924],{"className":839,"code":36923,"language":841,"meta":56,"style":56},"vp create vite:library -- teacher-toolkit\n",[40,36925,36926],{"__ignoreMap":56},[449,36927,36928,36930,36933,36936,36939],{"class":451,"line":452},[449,36929,3637],{"class":721},[449,36931,36932],{"class":691}," create",[449,36934,36935],{"class":691}," vite:library",[449,36937,36938],{"class":714}," --",[449,36940,36941],{"class":691}," teacher-toolkit\n",[48,36943,36945],{"className":839,"code":36944,"language":841,"meta":56,"style":56},"vp install\n",[40,36946,36947],{"__ignoreMap":56},[449,36948,36949,36951],{"class":451,"line":452},[449,36950,3637],{"class":721},[449,36952,4512],{"class":691},[21,36954,36955],{},"This gives us a project structure like:",[48,36957,36959],{"className":443,"code":36958,"language":445,"meta":56,"style":56},"teacher-toolkit\u002F\n  src\u002F\n    index.ts        # Entry point\n  vite.config.ts\n  package.json\n  tsconfig.json\n",[40,36960,36961,36966,36971,36976,36981,36986],{"__ignoreMap":56},[449,36962,36963],{"class":451,"line":452},[449,36964,36965],{},"teacher-toolkit\u002F\n",[449,36967,36968],{"class":451,"line":114},[449,36969,36970],{},"  src\u002F\n",[449,36972,36973],{"class":451,"line":111},[449,36974,36975],{},"    index.ts        # Entry point\n",[449,36977,36978],{"class":451,"line":468},[449,36979,36980],{},"  vite.config.ts\n",[449,36982,36983],{"class":451,"line":474},[449,36984,36985],{},"  package.json\n",[449,36987,36988],{"class":451,"line":480},[449,36989,36990],{},"  tsconfig.json\n",[16,36992,36994],{"id":36993},"step-2-define-the-types","Step 2: Define the Types",[21,36996,4697,36997,3070],{},[40,36998,36999],{},"src\u002Ftypes.ts",[48,37001,37003],{"className":670,"code":37002,"filename":36999,"language":673,"meta":56,"style":56},"export interface GradeScale {\n  letter: string;\n  min: number;\n  max: number;\n  gpa: number;\n}\n\nexport interface WeightedComponent {\n  name: string;\n  score: number;\n  weight: number;\n}\n\nexport interface ClassStats {\n  mean: number;\n  median: number;\n  stdDev: number;\n  highest: number;\n  lowest: number;\n  count: number;\n}\n",[40,37004,37005,37016,37027,37038,37049,37060,37064,37068,37079,37089,37100,37111,37115,37119,37130,37141,37152,37163,37174,37185,37196],{"__ignoreMap":56},[449,37006,37007,37009,37011,37014],{"class":451,"line":452},[449,37008,4629],{"class":680},[449,37010,14991],{"class":680},[449,37012,37013],{"class":721}," GradeScale",[449,37015,1501],{"class":684},[449,37017,37018,37021,37023,37025],{"class":451,"line":114},[449,37019,37020],{"class":1491},"  letter",[449,37022,3070],{"class":680},[449,37024,6081],{"class":714},[449,37026,695],{"class":684},[449,37028,37029,37032,37034,37036],{"class":451,"line":111},[449,37030,37031],{"class":1491},"  min",[449,37033,3070],{"class":680},[449,37035,4975],{"class":714},[449,37037,695],{"class":684},[449,37039,37040,37043,37045,37047],{"class":451,"line":468},[449,37041,37042],{"class":1491},"  max",[449,37044,3070],{"class":680},[449,37046,4975],{"class":714},[449,37048,695],{"class":684},[449,37050,37051,37054,37056,37058],{"class":451,"line":474},[449,37052,37053],{"class":1491},"  gpa",[449,37055,3070],{"class":680},[449,37057,4975],{"class":714},[449,37059,695],{"class":684},[449,37061,37062],{"class":451,"line":480},[449,37063,4604],{"class":684},[449,37065,37066],{"class":451,"line":486},[449,37067,700],{"emptyLinePlaceholder":130},[449,37069,37070,37072,37074,37077],{"class":451,"line":492},[449,37071,4629],{"class":680},[449,37073,14991],{"class":680},[449,37075,37076],{"class":721}," WeightedComponent",[449,37078,1501],{"class":684},[449,37080,37081,37083,37085,37087],{"class":451,"line":498},[449,37082,6076],{"class":1491},[449,37084,3070],{"class":680},[449,37086,6081],{"class":714},[449,37088,695],{"class":684},[449,37090,37091,37094,37096,37098],{"class":451,"line":133},[449,37092,37093],{"class":1491},"  score",[449,37095,3070],{"class":680},[449,37097,4975],{"class":714},[449,37099,695],{"class":684},[449,37101,37102,37105,37107,37109],{"class":451,"line":509},[449,37103,37104],{"class":1491},"  weight",[449,37106,3070],{"class":680},[449,37108,4975],{"class":714},[449,37110,695],{"class":684},[449,37112,37113],{"class":451,"line":318},[449,37114,4604],{"class":684},[449,37116,37117],{"class":451,"line":520},[449,37118,700],{"emptyLinePlaceholder":130},[449,37120,37121,37123,37125,37128],{"class":451,"line":526},[449,37122,4629],{"class":680},[449,37124,14991],{"class":680},[449,37126,37127],{"class":721}," ClassStats",[449,37129,1501],{"class":684},[449,37131,37132,37135,37137,37139],{"class":451,"line":532},[449,37133,37134],{"class":1491},"  mean",[449,37136,3070],{"class":680},[449,37138,4975],{"class":714},[449,37140,695],{"class":684},[449,37142,37143,37146,37148,37150],{"class":451,"line":2790},[449,37144,37145],{"class":1491},"  median",[449,37147,3070],{"class":680},[449,37149,4975],{"class":714},[449,37151,695],{"class":684},[449,37153,37154,37157,37159,37161],{"class":451,"line":3511},[449,37155,37156],{"class":1491},"  stdDev",[449,37158,3070],{"class":680},[449,37160,4975],{"class":714},[449,37162,695],{"class":684},[449,37164,37165,37168,37170,37172],{"class":451,"line":3526},[449,37166,37167],{"class":1491},"  highest",[449,37169,3070],{"class":680},[449,37171,4975],{"class":714},[449,37173,695],{"class":684},[449,37175,37176,37179,37181,37183],{"class":451,"line":3531},[449,37177,37178],{"class":1491},"  lowest",[449,37180,3070],{"class":680},[449,37182,4975],{"class":714},[449,37184,695],{"class":684},[449,37186,37187,37190,37192,37194],{"class":451,"line":3536},[449,37188,37189],{"class":1491},"  count",[449,37191,3070],{"class":680},[449,37193,4975],{"class":714},[449,37195,695],{"class":684},[449,37197,37198],{"class":451,"line":4009},[449,37199,4604],{"class":684},[16,37201,37203],{"id":37202},"step-3-build-the-core-utilities","Step 3: Build the Core Utilities",[32,37205,37207],{"id":37206},"letter-grade-conversion","Letter Grade Conversion",[48,37209,37212],{"className":670,"code":37210,"filename":37211,"language":673,"meta":56,"style":56},"import type { GradeScale } from \".\u002Ftypes\";\n\nconst DEFAULT_SCALE: GradeScale[] = [\n  { letter: \"A\", min: 90, max: 100, gpa: 4.0 },\n  { letter: \"B\", min: 80, max: 89, gpa: 3.0 },\n  { letter: \"C\", min: 70, max: 79, gpa: 2.0 },\n  { letter: \"D\", min: 60, max: 69, gpa: 1.0 },\n  { letter: \"F\", min: 0, max: 59, gpa: 0.0 },\n];\n\nexport function toLetterGrade(percentage: number, scale: GradeScale[] = DEFAULT_SCALE): string {\n  const clamped = Math.max(0, Math.min(100, percentage));\n  const match = scale.find((s) => clamped >= s.min && clamped \u003C= s.max);\n  return match?.letter ?? \"F\";\n}\n\nexport function toGPA(percentage: number, scale: GradeScale[] = DEFAULT_SCALE): number {\n  const letter = toLetterGrade(percentage, scale);\n  const match = scale.find((s) => s.letter === letter);\n  return match?.gpa ?? 0;\n}\n","src\u002Fgrades.ts",[40,37213,37214,37230,37234,37251,37277,37300,37324,37347,37370,37374,37378,37419,37450,37492,37506,37510,37514,37553,37567,37596,37609],{"__ignoreMap":56},[449,37215,37216,37218,37220,37223,37225,37228],{"class":451,"line":452},[449,37217,681],{"class":680},[449,37219,11308],{"class":680},[449,37221,37222],{"class":684}," { GradeScale } ",[449,37224,688],{"class":680},[449,37226,37227],{"class":691}," \".\u002Ftypes\"",[449,37229,695],{"class":684},[449,37231,37232],{"class":451,"line":114},[449,37233,700],{"emptyLinePlaceholder":130},[449,37235,37236,37238,37241,37243,37245,37247,37249],{"class":451,"line":111},[449,37237,711],{"class":680},[449,37239,37240],{"class":714}," DEFAULT_SCALE",[449,37242,3070],{"class":680},[449,37244,37013],{"class":721},[449,37246,5011],{"class":684},[449,37248,5014],{"class":680},[449,37250,4790],{"class":684},[449,37252,37253,37256,37259,37262,37265,37268,37270,37273,37275],{"class":451,"line":468},[449,37254,37255],{"class":684},"  { letter: ",[449,37257,37258],{"class":691},"\"A\"",[449,37260,37261],{"class":684},", min: ",[449,37263,37264],{"class":714},"90",[449,37266,37267],{"class":684},", max: ",[449,37269,5180],{"class":714},[449,37271,37272],{"class":684},", gpa: ",[449,37274,4883],{"class":714},[449,37276,4819],{"class":684},[449,37278,37279,37281,37284,37286,37289,37291,37294,37296,37298],{"class":451,"line":474},[449,37280,37255],{"class":684},[449,37282,37283],{"class":691},"\"B\"",[449,37285,37261],{"class":684},[449,37287,37288],{"class":714},"80",[449,37290,37267],{"class":684},[449,37292,37293],{"class":714},"89",[449,37295,37272],{"class":684},[449,37297,4836],{"class":714},[449,37299,4819],{"class":684},[449,37301,37302,37304,37307,37309,37312,37314,37317,37319,37322],{"class":451,"line":480},[449,37303,37255],{"class":684},[449,37305,37306],{"class":691},"\"C\"",[449,37308,37261],{"class":684},[449,37310,37311],{"class":714},"70",[449,37313,37267],{"class":684},[449,37315,37316],{"class":714},"79",[449,37318,37272],{"class":684},[449,37320,37321],{"class":714},"2.0",[449,37323,4819],{"class":684},[449,37325,37326,37328,37331,37333,37335,37337,37340,37342,37345],{"class":451,"line":486},[449,37327,37255],{"class":684},[449,37329,37330],{"class":691},"\"D\"",[449,37332,37261],{"class":684},[449,37334,25511],{"class":714},[449,37336,37267],{"class":684},[449,37338,37339],{"class":714},"69",[449,37341,37272],{"class":684},[449,37343,37344],{"class":714},"1.0",[449,37346,4819],{"class":684},[449,37348,37349,37351,37354,37356,37358,37360,37363,37365,37368],{"class":451,"line":492},[449,37350,37255],{"class":684},[449,37352,37353],{"class":691},"\"F\"",[449,37355,37261],{"class":684},[449,37357,9899],{"class":714},[449,37359,37267],{"class":684},[449,37361,37362],{"class":714},"59",[449,37364,37272],{"class":684},[449,37366,37367],{"class":714},"0.0",[449,37369,4819],{"class":684},[449,37371,37372],{"class":451,"line":498},[449,37373,4917],{"class":684},[449,37375,37376],{"class":451,"line":133},[449,37377,700],{"emptyLinePlaceholder":130},[449,37379,37380,37382,37384,37387,37389,37392,37394,37396,37398,37401,37403,37405,37407,37409,37411,37413,37415,37417],{"class":451,"line":509},[449,37381,4629],{"class":680},[449,37383,5433],{"class":680},[449,37385,37386],{"class":721}," toLetterGrade",[449,37388,725],{"class":684},[449,37390,37391],{"class":1491},"percentage",[449,37393,3070],{"class":680},[449,37395,4975],{"class":714},[449,37397,349],{"class":684},[449,37399,37400],{"class":1491},"scale",[449,37402,3070],{"class":680},[449,37404,37013],{"class":721},[449,37406,5011],{"class":684},[449,37408,5014],{"class":680},[449,37410,37240],{"class":714},[449,37412,827],{"class":684},[449,37414,3070],{"class":680},[449,37416,6081],{"class":714},[449,37418,1501],{"class":684},[449,37420,37421,37423,37426,37428,37430,37433,37435,37437,37440,37443,37445,37447],{"class":451,"line":318},[449,37422,5048],{"class":680},[449,37424,37425],{"class":714}," clamped",[449,37427,718],{"class":680},[449,37429,5856],{"class":684},[449,37431,37432],{"class":721},"max",[449,37434,725],{"class":684},[449,37436,9899],{"class":714},[449,37438,37439],{"class":684},", Math.",[449,37441,37442],{"class":721},"min",[449,37444,725],{"class":684},[449,37446,5180],{"class":714},[449,37448,37449],{"class":684},", percentage));\n",[449,37451,37452,37454,37457,37459,37462,37465,37467,37470,37472,37474,37477,37479,37482,37484,37486,37489],{"class":451,"line":520},[449,37453,5048],{"class":680},[449,37455,37456],{"class":714}," match",[449,37458,718],{"class":680},[449,37460,37461],{"class":684}," scale.",[449,37463,37464],{"class":721},"find",[449,37466,5164],{"class":684},[449,37468,37469],{"class":1491},"s",[449,37471,1758],{"class":684},[449,37473,1498],{"class":680},[449,37475,37476],{"class":684}," clamped ",[449,37478,5614],{"class":680},[449,37480,37481],{"class":684}," s.min ",[449,37483,16941],{"class":680},[449,37485,37476],{"class":684},[449,37487,37488],{"class":680},"\u003C=",[449,37490,37491],{"class":684}," s.max);\n",[449,37493,37494,37496,37499,37501,37504],{"class":451,"line":526},[449,37495,4726],{"class":680},[449,37497,37498],{"class":684}," match?.letter ",[449,37500,734],{"class":680},[449,37502,37503],{"class":691}," \"F\"",[449,37505,695],{"class":684},[449,37507,37508],{"class":451,"line":532},[449,37509,4604],{"class":684},[449,37511,37512],{"class":451,"line":2790},[449,37513,700],{"emptyLinePlaceholder":130},[449,37515,37516,37518,37520,37523,37525,37527,37529,37531,37533,37535,37537,37539,37541,37543,37545,37547,37549,37551],{"class":451,"line":3511},[449,37517,4629],{"class":680},[449,37519,5433],{"class":680},[449,37521,37522],{"class":721}," toGPA",[449,37524,725],{"class":684},[449,37526,37391],{"class":1491},[449,37528,3070],{"class":680},[449,37530,4975],{"class":714},[449,37532,349],{"class":684},[449,37534,37400],{"class":1491},[449,37536,3070],{"class":680},[449,37538,37013],{"class":721},[449,37540,5011],{"class":684},[449,37542,5014],{"class":680},[449,37544,37240],{"class":714},[449,37546,827],{"class":684},[449,37548,3070],{"class":680},[449,37550,4975],{"class":714},[449,37552,1501],{"class":684},[449,37554,37555,37557,37560,37562,37564],{"class":451,"line":3526},[449,37556,5048],{"class":680},[449,37558,37559],{"class":714}," letter",[449,37561,718],{"class":680},[449,37563,37386],{"class":721},[449,37565,37566],{"class":684},"(percentage, scale);\n",[449,37568,37569,37571,37573,37575,37577,37579,37581,37583,37585,37587,37590,37593],{"class":451,"line":3531},[449,37570,5048],{"class":680},[449,37572,37456],{"class":714},[449,37574,718],{"class":680},[449,37576,37461],{"class":684},[449,37578,37464],{"class":721},[449,37580,5164],{"class":684},[449,37582,37469],{"class":1491},[449,37584,1758],{"class":684},[449,37586,1498],{"class":680},[449,37588,37589],{"class":684}," s.letter ",[449,37591,37592],{"class":680},"===",[449,37594,37595],{"class":684}," letter);\n",[449,37597,37598,37600,37603,37605,37607],{"class":451,"line":3536},[449,37599,4726],{"class":680},[449,37601,37602],{"class":684}," match?.gpa ",[449,37604,734],{"class":680},[449,37606,5103],{"class":714},[449,37608,695],{"class":684},[449,37610,37611],{"class":451,"line":4009},[449,37612,4604],{"class":684},[32,37614,37616],{"id":37615},"weighted-grade-calculation","Weighted Grade Calculation",[48,37618,37621],{"className":670,"code":37619,"filename":37620,"language":673,"meta":56,"style":56},"import type { WeightedComponent } from \".\u002Ftypes\";\n\nexport function weightedAverage(components: WeightedComponent[]): number {\n  if (components.length === 0) return 0;\n\n  const totalWeight = components.reduce((sum, c) => sum + c.weight, 0);\n  if (totalWeight === 0) return 0;\n\n  const weighted = components.reduce((sum, c) => sum + c.score * c.weight, 0);\n\n  return Math.round((weighted \u002F totalWeight) * 100) \u002F 100;\n}\n","src\u002Fweights.ts",[40,37622,37623,37638,37642,37669,37691,37695,37736,37755,37759,37799,37803,37831],{"__ignoreMap":56},[449,37624,37625,37627,37629,37632,37634,37636],{"class":451,"line":452},[449,37626,681],{"class":680},[449,37628,11308],{"class":680},[449,37630,37631],{"class":684}," { WeightedComponent } ",[449,37633,688],{"class":680},[449,37635,37227],{"class":691},[449,37637,695],{"class":684},[449,37639,37640],{"class":451,"line":114},[449,37641,700],{"emptyLinePlaceholder":130},[449,37643,37644,37646,37648,37651,37653,37656,37658,37660,37663,37665,37667],{"class":451,"line":111},[449,37645,4629],{"class":680},[449,37647,5433],{"class":680},[449,37649,37650],{"class":721}," weightedAverage",[449,37652,725],{"class":684},[449,37654,37655],{"class":1491},"components",[449,37657,3070],{"class":680},[449,37659,37076],{"class":721},[449,37661,37662],{"class":684},"[])",[449,37664,3070],{"class":680},[449,37666,4975],{"class":714},[449,37668,1501],{"class":684},[449,37670,37671,37673,37676,37678,37680,37682,37684,37687,37689],{"class":451,"line":468},[449,37672,5080],{"class":680},[449,37674,37675],{"class":684}," (components.",[449,37677,5097],{"class":714},[449,37679,5100],{"class":680},[449,37681,5103],{"class":714},[449,37683,1758],{"class":684},[449,37685,37686],{"class":680},"return",[449,37688,5103],{"class":714},[449,37690,695],{"class":684},[449,37692,37693],{"class":451,"line":474},[449,37694,700],{"emptyLinePlaceholder":130},[449,37696,37697,37699,37702,37704,37707,37710,37712,37715,37717,37720,37722,37724,37727,37729,37732,37734],{"class":451,"line":480},[449,37698,5048],{"class":680},[449,37700,37701],{"class":714}," totalWeight",[449,37703,718],{"class":680},[449,37705,37706],{"class":684}," components.",[449,37708,37709],{"class":721},"reduce",[449,37711,5164],{"class":684},[449,37713,37714],{"class":1491},"sum",[449,37716,349],{"class":684},[449,37718,37719],{"class":1491},"c",[449,37721,1758],{"class":684},[449,37723,1498],{"class":680},[449,37725,37726],{"class":684}," sum ",[449,37728,24063],{"class":680},[449,37730,37731],{"class":684}," c.weight, ",[449,37733,9899],{"class":714},[449,37735,740],{"class":684},[449,37737,37738,37740,37743,37745,37747,37749,37751,37753],{"class":451,"line":486},[449,37739,5080],{"class":680},[449,37741,37742],{"class":684}," (totalWeight ",[449,37744,37592],{"class":680},[449,37746,5103],{"class":714},[449,37748,1758],{"class":684},[449,37750,37686],{"class":680},[449,37752,5103],{"class":714},[449,37754,695],{"class":684},[449,37756,37757],{"class":451,"line":492},[449,37758,700],{"emptyLinePlaceholder":130},[449,37760,37761,37763,37766,37768,37770,37772,37774,37776,37778,37780,37782,37784,37786,37788,37791,37793,37795,37797],{"class":451,"line":498},[449,37762,5048],{"class":680},[449,37764,37765],{"class":714}," weighted",[449,37767,718],{"class":680},[449,37769,37706],{"class":684},[449,37771,37709],{"class":721},[449,37773,5164],{"class":684},[449,37775,37714],{"class":1491},[449,37777,349],{"class":684},[449,37779,37719],{"class":1491},[449,37781,1758],{"class":684},[449,37783,1498],{"class":680},[449,37785,37726],{"class":684},[449,37787,24063],{"class":680},[449,37789,37790],{"class":684}," c.score ",[449,37792,13175],{"class":680},[449,37794,37731],{"class":684},[449,37796,9899],{"class":714},[449,37798,740],{"class":684},[449,37800,37801],{"class":451,"line":133},[449,37802,700],{"emptyLinePlaceholder":130},[449,37804,37805,37807,37809,37811,37814,37816,37819,37821,37823,37825,37827,37829],{"class":451,"line":509},[449,37806,4726],{"class":680},[449,37808,5856],{"class":684},[449,37810,5859],{"class":721},[449,37812,37813],{"class":684},"((weighted ",[449,37815,5872],{"class":680},[449,37817,37818],{"class":684}," totalWeight) ",[449,37820,13175],{"class":680},[449,37822,5420],{"class":714},[449,37824,1758],{"class":684},[449,37826,5872],{"class":680},[449,37828,5420],{"class":714},[449,37830,695],{"class":684},[449,37832,37833],{"class":451,"line":318},[449,37834,4604],{"class":684},[21,37836,37837],{},"A teacher can use this like:",[48,37839,37841],{"className":670,"code":37840,"language":673,"meta":56,"style":56},"const finalGrade = weightedAverage([\n  { name: \"Homework\", score: 88, weight: 0.3 },\n  { name: \"Midterm\", score: 76, weight: 0.3 },\n  { name: \"Final Exam\", score: 82, weight: 0.4 },\n]);\n\u002F\u002F => 81.8\n",[40,37842,37843,37857,37879,37897,37916,37921],{"__ignoreMap":56},[449,37844,37845,37847,37850,37852,37854],{"class":451,"line":452},[449,37846,711],{"class":680},[449,37848,37849],{"class":714}," finalGrade",[449,37851,718],{"class":680},[449,37853,37650],{"class":721},[449,37855,37856],{"class":684},"([\n",[449,37858,37859,37862,37865,37868,37871,37874,37877],{"class":451,"line":114},[449,37860,37861],{"class":684},"  { name: ",[449,37863,37864],{"class":691},"\"Homework\"",[449,37866,37867],{"class":684},", score: ",[449,37869,37870],{"class":714},"88",[449,37872,37873],{"class":684},", weight: ",[449,37875,37876],{"class":714},"0.3",[449,37878,4819],{"class":684},[449,37880,37881,37883,37886,37888,37891,37893,37895],{"class":451,"line":111},[449,37882,37861],{"class":684},[449,37884,37885],{"class":691},"\"Midterm\"",[449,37887,37867],{"class":684},[449,37889,37890],{"class":714},"76",[449,37892,37873],{"class":684},[449,37894,37876],{"class":714},[449,37896,4819],{"class":684},[449,37898,37899,37901,37904,37906,37909,37911,37914],{"class":451,"line":468},[449,37900,37861],{"class":684},[449,37902,37903],{"class":691},"\"Final Exam\"",[449,37905,37867],{"class":684},[449,37907,37908],{"class":714},"82",[449,37910,37873],{"class":684},[449,37912,37913],{"class":714},"0.4",[449,37915,4819],{"class":684},[449,37917,37918],{"class":451,"line":474},[449,37919,37920],{"class":684},"]);\n",[449,37922,37923],{"class":451,"line":480},[449,37924,37925],{"class":705},"\u002F\u002F => 81.8\n",[32,37927,37929],{"id":37928},"score-curving","Score Curving",[48,37931,37934],{"className":670,"code":37932,"filename":37933,"language":673,"meta":56,"style":56},"export function curveByHighest(scores: number[], targetHigh: number = 100): number[] {\n  const highest = Math.max(...scores);\n  if (highest >= targetHigh) return scores;\n\n  const boost = targetHigh - highest;\n  return scores.map((s) => Math.min(100, s + boost));\n}\n\nexport function curveByMean(scores: number[], targetMean: number = 75): number[] {\n  const mean = scores.reduce((a, b) => a + b, 0) \u002F scores.length;\n  const shift = targetMean - mean;\n  return scores.map((s) => Math.max(0, Math.min(100, s + shift)));\n}\n","src\u002Fcurve.ts",[40,37935,37936,37977,37997,38014,38018,38035,38068,38072,38076,38115,38161,38178,38217],{"__ignoreMap":56},[449,37937,37938,37940,37942,37945,37947,37950,37952,37954,37957,37960,37962,37964,37966,37968,37970,37972,37974],{"class":451,"line":452},[449,37939,4629],{"class":680},[449,37941,5433],{"class":680},[449,37943,37944],{"class":721}," curveByHighest",[449,37946,725],{"class":684},[449,37948,37949],{"class":1491},"scores",[449,37951,3070],{"class":680},[449,37953,4975],{"class":714},[449,37955,37956],{"class":684},"[], ",[449,37958,37959],{"class":1491},"targetHigh",[449,37961,3070],{"class":680},[449,37963,4975],{"class":714},[449,37965,718],{"class":680},[449,37967,5420],{"class":714},[449,37969,827],{"class":684},[449,37971,3070],{"class":680},[449,37973,4975],{"class":714},[449,37975,37976],{"class":684},"[] {\n",[449,37978,37979,37981,37984,37986,37988,37990,37992,37994],{"class":451,"line":114},[449,37980,5048],{"class":680},[449,37982,37983],{"class":714}," highest",[449,37985,718],{"class":680},[449,37987,5856],{"class":684},[449,37989,37432],{"class":721},[449,37991,725],{"class":684},[449,37993,14230],{"class":680},[449,37995,37996],{"class":684},"scores);\n",[449,37998,37999,38001,38004,38006,38009,38011],{"class":451,"line":111},[449,38000,5080],{"class":680},[449,38002,38003],{"class":684}," (highest ",[449,38005,5614],{"class":680},[449,38007,38008],{"class":684}," targetHigh) ",[449,38010,37686],{"class":680},[449,38012,38013],{"class":684}," scores;\n",[449,38015,38016],{"class":451,"line":468},[449,38017,700],{"emptyLinePlaceholder":130},[449,38019,38020,38022,38025,38027,38030,38032],{"class":451,"line":474},[449,38021,5048],{"class":680},[449,38023,38024],{"class":714}," boost",[449,38026,718],{"class":680},[449,38028,38029],{"class":684}," targetHigh ",[449,38031,5840],{"class":680},[449,38033,38034],{"class":684}," highest;\n",[449,38036,38037,38039,38042,38044,38046,38048,38050,38052,38054,38056,38058,38060,38063,38065],{"class":451,"line":480},[449,38038,4726],{"class":680},[449,38040,38041],{"class":684}," scores.",[449,38043,6391],{"class":721},[449,38045,5164],{"class":684},[449,38047,37469],{"class":1491},[449,38049,1758],{"class":684},[449,38051,1498],{"class":680},[449,38053,5856],{"class":684},[449,38055,37442],{"class":721},[449,38057,725],{"class":684},[449,38059,5180],{"class":714},[449,38061,38062],{"class":684},", s ",[449,38064,24063],{"class":680},[449,38066,38067],{"class":684}," boost));\n",[449,38069,38070],{"class":451,"line":486},[449,38071,4604],{"class":684},[449,38073,38074],{"class":451,"line":492},[449,38075,700],{"emptyLinePlaceholder":130},[449,38077,38078,38080,38082,38085,38087,38089,38091,38093,38095,38098,38100,38102,38104,38107,38109,38111,38113],{"class":451,"line":498},[449,38079,4629],{"class":680},[449,38081,5433],{"class":680},[449,38083,38084],{"class":721}," curveByMean",[449,38086,725],{"class":684},[449,38088,37949],{"class":1491},[449,38090,3070],{"class":680},[449,38092,4975],{"class":714},[449,38094,37956],{"class":684},[449,38096,38097],{"class":1491},"targetMean",[449,38099,3070],{"class":680},[449,38101,4975],{"class":714},[449,38103,718],{"class":680},[449,38105,38106],{"class":714}," 75",[449,38108,827],{"class":684},[449,38110,3070],{"class":680},[449,38112,4975],{"class":714},[449,38114,37976],{"class":684},[449,38116,38117,38119,38122,38124,38126,38128,38130,38132,38134,38137,38139,38141,38144,38146,38149,38151,38153,38155,38157,38159],{"class":451,"line":133},[449,38118,5048],{"class":680},[449,38120,38121],{"class":714}," mean",[449,38123,718],{"class":680},[449,38125,38041],{"class":684},[449,38127,37709],{"class":721},[449,38129,5164],{"class":684},[449,38131,3861],{"class":1491},[449,38133,349],{"class":684},[449,38135,38136],{"class":1491},"b",[449,38138,1758],{"class":684},[449,38140,1498],{"class":680},[449,38142,38143],{"class":684}," a ",[449,38145,24063],{"class":680},[449,38147,38148],{"class":684}," b, ",[449,38150,9899],{"class":714},[449,38152,1758],{"class":684},[449,38154,5872],{"class":680},[449,38156,38041],{"class":684},[449,38158,5097],{"class":714},[449,38160,695],{"class":684},[449,38162,38163,38165,38168,38170,38173,38175],{"class":451,"line":509},[449,38164,5048],{"class":680},[449,38166,38167],{"class":714}," shift",[449,38169,718],{"class":680},[449,38171,38172],{"class":684}," targetMean ",[449,38174,5840],{"class":680},[449,38176,38177],{"class":684}," mean;\n",[449,38179,38180,38182,38184,38186,38188,38190,38192,38194,38196,38198,38200,38202,38204,38206,38208,38210,38212,38214],{"class":451,"line":318},[449,38181,4726],{"class":680},[449,38183,38041],{"class":684},[449,38185,6391],{"class":721},[449,38187,5164],{"class":684},[449,38189,37469],{"class":1491},[449,38191,1758],{"class":684},[449,38193,1498],{"class":680},[449,38195,5856],{"class":684},[449,38197,37432],{"class":721},[449,38199,725],{"class":684},[449,38201,9899],{"class":714},[449,38203,37439],{"class":684},[449,38205,37442],{"class":721},[449,38207,725],{"class":684},[449,38209,5180],{"class":714},[449,38211,38062],{"class":684},[449,38213,24063],{"class":680},[449,38215,38216],{"class":684}," shift)));\n",[449,38218,38219],{"class":451,"line":520},[449,38220,4604],{"class":684},[32,38222,38224],{"id":38223},"class-statistics","Class Statistics",[48,38226,38229],{"className":670,"code":38227,"filename":38228,"language":673,"meta":56,"style":56},"import type { ClassStats } from \".\u002Ftypes\";\n\nexport function classStats(scores: number[]): ClassStats {\n  if (scores.length === 0) {\n    return { mean: 0, median: 0, stdDev: 0, highest: 0, lowest: 0, count: 0 };\n  }\n\n  const sorted = [...scores].sort((a, b) => a - b);\n  const count = sorted.length;\n  const sum = sorted.reduce((a, b) => a + b, 0);\n  const mean = sum \u002F count;\n\n  const mid = Math.floor(count \u002F 2);\n  const median = count % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) \u002F 2 : sorted[mid];\n\n  const variance = sorted.reduce((acc, s) => acc + (s - mean) ** 2, 0) \u002F count;\n  const stdDev = Math.round(Math.sqrt(variance) * 100) \u002F 100;\n\n  return {\n    mean: Math.round(mean * 100) \u002F 100,\n    median,\n    stdDev,\n    highest: sorted[count - 1],\n    lowest: sorted[0],\n    count,\n  };\n}\n","src\u002Fstats.ts\"",[40,38230,38231,38246,38250,38275,38290,38326,38330,38334,38372,38388,38423,38438,38442,38466,38514,38518,38572,38606,38610,38616,38638,38643,38648,38659,38668,38673,38677],{"__ignoreMap":56},[449,38232,38233,38235,38237,38240,38242,38244],{"class":451,"line":452},[449,38234,681],{"class":680},[449,38236,11308],{"class":680},[449,38238,38239],{"class":684}," { ClassStats } ",[449,38241,688],{"class":680},[449,38243,37227],{"class":691},[449,38245,695],{"class":684},[449,38247,38248],{"class":451,"line":114},[449,38249,700],{"emptyLinePlaceholder":130},[449,38251,38252,38254,38256,38259,38261,38263,38265,38267,38269,38271,38273],{"class":451,"line":111},[449,38253,4629],{"class":680},[449,38255,5433],{"class":680},[449,38257,38258],{"class":721}," classStats",[449,38260,725],{"class":684},[449,38262,37949],{"class":1491},[449,38264,3070],{"class":680},[449,38266,4975],{"class":714},[449,38268,37662],{"class":684},[449,38270,3070],{"class":680},[449,38272,37127],{"class":721},[449,38274,1501],{"class":684},[449,38276,38277,38279,38282,38284,38286,38288],{"class":451,"line":468},[449,38278,5080],{"class":680},[449,38280,38281],{"class":684}," (scores.",[449,38283,5097],{"class":714},[449,38285,5100],{"class":680},[449,38287,5103],{"class":714},[449,38289,3417],{"class":684},[449,38291,38292,38294,38297,38299,38302,38304,38307,38309,38312,38314,38317,38319,38322,38324],{"class":451,"line":474},[449,38293,1506],{"class":680},[449,38295,38296],{"class":684}," { mean: ",[449,38298,9899],{"class":714},[449,38300,38301],{"class":684},", median: ",[449,38303,9899],{"class":714},[449,38305,38306],{"class":684},", stdDev: ",[449,38308,9899],{"class":714},[449,38310,38311],{"class":684},", highest: ",[449,38313,9899],{"class":714},[449,38315,38316],{"class":684},", lowest: ",[449,38318,9899],{"class":714},[449,38320,38321],{"class":684},", count: ",[449,38323,9899],{"class":714},[449,38325,1520],{"class":684},[449,38327,38328],{"class":451,"line":480},[449,38329,4599],{"class":684},[449,38331,38332],{"class":451,"line":486},[449,38333,700],{"emptyLinePlaceholder":130},[449,38335,38336,38338,38341,38343,38345,38347,38350,38353,38355,38357,38359,38361,38363,38365,38367,38369],{"class":451,"line":492},[449,38337,5048],{"class":680},[449,38339,38340],{"class":714}," sorted",[449,38342,718],{"class":680},[449,38344,13639],{"class":684},[449,38346,14230],{"class":680},[449,38348,38349],{"class":684},"scores].",[449,38351,38352],{"class":721},"sort",[449,38354,5164],{"class":684},[449,38356,3861],{"class":1491},[449,38358,349],{"class":684},[449,38360,38136],{"class":1491},[449,38362,1758],{"class":684},[449,38364,1498],{"class":680},[449,38366,38143],{"class":684},[449,38368,5840],{"class":680},[449,38370,38371],{"class":684}," b);\n",[449,38373,38374,38376,38379,38381,38384,38386],{"class":451,"line":498},[449,38375,5048],{"class":680},[449,38377,38378],{"class":714}," count",[449,38380,718],{"class":680},[449,38382,38383],{"class":684}," sorted.",[449,38385,5097],{"class":714},[449,38387,695],{"class":684},[449,38389,38390,38392,38395,38397,38399,38401,38403,38405,38407,38409,38411,38413,38415,38417,38419,38421],{"class":451,"line":133},[449,38391,5048],{"class":680},[449,38393,38394],{"class":714}," sum",[449,38396,718],{"class":680},[449,38398,38383],{"class":684},[449,38400,37709],{"class":721},[449,38402,5164],{"class":684},[449,38404,3861],{"class":1491},[449,38406,349],{"class":684},[449,38408,38136],{"class":1491},[449,38410,1758],{"class":684},[449,38412,1498],{"class":680},[449,38414,38143],{"class":684},[449,38416,24063],{"class":680},[449,38418,38148],{"class":684},[449,38420,9899],{"class":714},[449,38422,740],{"class":684},[449,38424,38425,38427,38429,38431,38433,38435],{"class":451,"line":509},[449,38426,5048],{"class":680},[449,38428,38121],{"class":714},[449,38430,718],{"class":680},[449,38432,37726],{"class":684},[449,38434,5872],{"class":680},[449,38436,38437],{"class":684}," count;\n",[449,38439,38440],{"class":451,"line":318},[449,38441,700],{"emptyLinePlaceholder":130},[449,38443,38444,38446,38449,38451,38453,38456,38459,38461,38464],{"class":451,"line":520},[449,38445,5048],{"class":680},[449,38447,38448],{"class":714}," mid",[449,38450,718],{"class":680},[449,38452,5856],{"class":684},[449,38454,38455],{"class":721},"floor",[449,38457,38458],{"class":684},"(count ",[449,38460,5872],{"class":680},[449,38462,38463],{"class":714}," 2",[449,38465,740],{"class":684},[449,38467,38468,38470,38473,38475,38478,38481,38483,38485,38487,38490,38493,38495,38497,38499,38501,38504,38506,38508,38511],{"class":451,"line":526},[449,38469,5048],{"class":680},[449,38471,38472],{"class":714}," median",[449,38474,718],{"class":680},[449,38476,38477],{"class":684}," count ",[449,38479,38480],{"class":680},"%",[449,38482,38463],{"class":714},[449,38484,5100],{"class":680},[449,38486,5103],{"class":714},[449,38488,38489],{"class":680}," ?",[449,38491,38492],{"class":684}," (sorted[mid ",[449,38494,5840],{"class":680},[449,38496,20024],{"class":714},[449,38498,34451],{"class":684},[449,38500,24063],{"class":680},[449,38502,38503],{"class":684}," sorted[mid]) ",[449,38505,5872],{"class":680},[449,38507,38463],{"class":714},[449,38509,38510],{"class":680}," :",[449,38512,38513],{"class":684}," sorted[mid];\n",[449,38515,38516],{"class":451,"line":532},[449,38517,700],{"emptyLinePlaceholder":130},[449,38519,38520,38522,38525,38527,38529,38531,38533,38536,38538,38540,38542,38544,38547,38549,38552,38554,38557,38560,38562,38564,38566,38568,38570],{"class":451,"line":2790},[449,38521,5048],{"class":680},[449,38523,38524],{"class":714}," variance",[449,38526,718],{"class":680},[449,38528,38383],{"class":684},[449,38530,37709],{"class":721},[449,38532,5164],{"class":684},[449,38534,38535],{"class":1491},"acc",[449,38537,349],{"class":684},[449,38539,37469],{"class":1491},[449,38541,1758],{"class":684},[449,38543,1498],{"class":680},[449,38545,38546],{"class":684}," acc ",[449,38548,24063],{"class":680},[449,38550,38551],{"class":684}," (s ",[449,38553,5840],{"class":680},[449,38555,38556],{"class":684}," mean) ",[449,38558,38559],{"class":680},"**",[449,38561,38463],{"class":714},[449,38563,349],{"class":684},[449,38565,9899],{"class":714},[449,38567,1758],{"class":684},[449,38569,5872],{"class":680},[449,38571,38437],{"class":684},[449,38573,38574,38576,38579,38581,38583,38585,38588,38591,38594,38596,38598,38600,38602,38604],{"class":451,"line":3511},[449,38575,5048],{"class":680},[449,38577,38578],{"class":714}," stdDev",[449,38580,718],{"class":680},[449,38582,5856],{"class":684},[449,38584,5859],{"class":721},[449,38586,38587],{"class":684},"(Math.",[449,38589,38590],{"class":721},"sqrt",[449,38592,38593],{"class":684},"(variance) ",[449,38595,13175],{"class":680},[449,38597,5420],{"class":714},[449,38599,1758],{"class":684},[449,38601,5872],{"class":680},[449,38603,5420],{"class":714},[449,38605,695],{"class":684},[449,38607,38608],{"class":451,"line":3526},[449,38609,700],{"emptyLinePlaceholder":130},[449,38611,38612,38614],{"class":451,"line":3531},[449,38613,4726],{"class":680},[449,38615,1501],{"class":684},[449,38617,38618,38621,38623,38626,38628,38630,38632,38634,38636],{"class":451,"line":3536},[449,38619,38620],{"class":684},"    mean: Math.",[449,38622,5859],{"class":721},[449,38624,38625],{"class":684},"(mean ",[449,38627,13175],{"class":680},[449,38629,5420],{"class":714},[449,38631,1758],{"class":684},[449,38633,5872],{"class":680},[449,38635,5420],{"class":714},[449,38637,779],{"class":684},[449,38639,38640],{"class":451,"line":4009},[449,38641,38642],{"class":684},"    median,\n",[449,38644,38645],{"class":451,"line":4015},[449,38646,38647],{"class":684},"    stdDev,\n",[449,38649,38650,38653,38655,38657],{"class":451,"line":4021},[449,38651,38652],{"class":684},"    highest: sorted[count ",[449,38654,5840],{"class":680},[449,38656,20024],{"class":714},[449,38658,1469],{"class":684},[449,38660,38661,38664,38666],{"class":451,"line":4027},[449,38662,38663],{"class":684},"    lowest: sorted[",[449,38665,9899],{"class":714},[449,38667,1469],{"class":684},[449,38669,38670],{"class":451,"line":4032},[449,38671,38672],{"class":684},"    count,\n",[449,38674,38675],{"class":451,"line":4038},[449,38676,4763],{"class":684},[449,38678,38679],{"class":451,"line":4044},[449,38680,4604],{"class":684},[16,38682,38684],{"id":38683},"step-4-wire-up-the-entry-point","Step 4: Wire Up the Entry Point",[48,38686,38689],{"className":670,"code":38687,"filename":38688,"language":673,"meta":56,"style":56},"export { toLetterGrade, toGPA } from \".\u002Fgrades\";\nexport { weightedAverage } from \".\u002Fweights\";\nexport { curveByHighest, curveByMean } from \".\u002Fcurve\";\nexport { classStats } from \".\u002Fstats\";\nexport type { GradeScale, WeightedComponent, ClassStats } from \".\u002Ftypes\";\n","src\u002Findex.ts",[40,38690,38691,38705,38719,38733,38747],{"__ignoreMap":56},[449,38692,38693,38695,38698,38700,38703],{"class":451,"line":452},[449,38694,4629],{"class":680},[449,38696,38697],{"class":684}," { toLetterGrade, toGPA } ",[449,38699,688],{"class":680},[449,38701,38702],{"class":691}," \".\u002Fgrades\"",[449,38704,695],{"class":684},[449,38706,38707,38709,38712,38714,38717],{"class":451,"line":114},[449,38708,4629],{"class":680},[449,38710,38711],{"class":684}," { weightedAverage } ",[449,38713,688],{"class":680},[449,38715,38716],{"class":691}," \".\u002Fweights\"",[449,38718,695],{"class":684},[449,38720,38721,38723,38726,38728,38731],{"class":451,"line":111},[449,38722,4629],{"class":680},[449,38724,38725],{"class":684}," { curveByHighest, curveByMean } ",[449,38727,688],{"class":680},[449,38729,38730],{"class":691}," \".\u002Fcurve\"",[449,38732,695],{"class":684},[449,38734,38735,38737,38740,38742,38745],{"class":451,"line":468},[449,38736,4629],{"class":680},[449,38738,38739],{"class":684}," { classStats } ",[449,38741,688],{"class":680},[449,38743,38744],{"class":691}," \".\u002Fstats\"",[449,38746,695],{"class":684},[449,38748,38749,38751,38753,38756,38758,38760],{"class":451,"line":474},[449,38750,4629],{"class":680},[449,38752,11308],{"class":680},[449,38754,38755],{"class":684}," { GradeScale, WeightedComponent, ClassStats } ",[449,38757,688],{"class":680},[449,38759,37227],{"class":691},[449,38761,695],{"class":684},[16,38763,38765],{"id":38764},"step-5-write-tests","Step 5: Write Tests",[21,38767,4697,38768,3070],{},[40,38769,38770],{},"src\u002Fgrades.test.ts",[48,38772,38774],{"className":670,"code":38773,"filename":38770,"language":673,"meta":56,"style":56},"import { describe, it, expect } from \"vitest\";\nimport { toLetterGrade, toGPA } from \".\u002Fgrades\";\nimport { weightedAverage } from \".\u002Fweights\";\nimport { curveByHighest, curveByMean } from \".\u002Fcurve\";\nimport { classStats } from \".\u002Fstats\";\n\ndescribe(\"toLetterGrade\", () => {\n  it(\"converts percentages to letter grades\", () => {\n    expect(toLetterGrade(95)).toBe(\"A\");\n    expect(toLetterGrade(83)).toBe(\"B\");\n    expect(toLetterGrade(72)).toBe(\"C\");\n    expect(toLetterGrade(65)).toBe(\"D\");\n    expect(toLetterGrade(40)).toBe(\"F\");\n  });\n\n  it(\"clamps out-of-range values\", () => {\n    expect(toLetterGrade(110)).toBe(\"A\");\n    expect(toLetterGrade(-5)).toBe(\"F\");\n  });\n});\n\ndescribe(\"toGPA\", () => {\n  it(\"converts to 4.0 scale\", () => {\n    expect(toGPA(92)).toBe(4.0);\n    expect(toGPA(85)).toBe(3.0);\n    expect(toGPA(55)).toBe(0.0);\n  });\n});\n\ndescribe(\"weightedAverage\", () => {\n  it(\"calculates weighted grade\", () => {\n    const result = weightedAverage([\n      { name: \"Homework\", score: 90, weight: 0.4 },\n      { name: \"Exam\", score: 80, weight: 0.6 },\n    ]);\n    expect(result).toBe(84);\n  });\n\n  it(\"returns 0 for empty input\", () => {\n    expect(weightedAverage([])).toBe(0);\n  });\n});\n\ndescribe(\"curveByHighest\", () => {\n  it(\"curves scores up to target\", () => {\n    const curved = curveByHighest([70, 80, 90], 100);\n    expect(curved).toEqual([80, 90, 100]);\n  });\n\n  it(\"does not curve if highest already meets target\", () => {\n    const scores = [70, 80, 95];\n    expect(curveByHighest(scores, 100)).toEqual(scores);\n  });\n});\n\ndescribe(\"classStats\", () => {\n  it(\"calculates stats correctly\", () => {\n    const stats = classStats([90, 80, 70, 60, 50]);\n    expect(stats.mean).toBe(70);\n    expect(stats.median).toBe(70);\n    expect(stats.highest).toBe(90);\n    expect(stats.lowest).toBe(50);\n    expect(stats.count).toBe(5);\n  });\n});\n",[40,38775,38776,38790,38802,38814,38826,38838,38842,38858,38874,38901,38924,38947,38970,38993,38997,39001,39016,39039,39063,39067,39071,39075,39090,39105,39129,39152,39175,39179,39183,39187,39202,39217,39229,39246,39264,39269,39285,39289,39293,39308,39328,39332,39336,39340,39355,39370,39400,39424,39428,39432,39447,39470,39491,39495,39499,39503,39518,39533,39567,39582,39597,39612,39627,39642,39646],{"__ignoreMap":56},[449,38777,38778,38780,38783,38785,38788],{"class":451,"line":452},[449,38779,681],{"class":680},[449,38781,38782],{"class":684}," { describe, it, expect } ",[449,38784,688],{"class":680},[449,38786,38787],{"class":691}," \"vitest\"",[449,38789,695],{"class":684},[449,38791,38792,38794,38796,38798,38800],{"class":451,"line":114},[449,38793,681],{"class":680},[449,38795,38697],{"class":684},[449,38797,688],{"class":680},[449,38799,38702],{"class":691},[449,38801,695],{"class":684},[449,38803,38804,38806,38808,38810,38812],{"class":451,"line":111},[449,38805,681],{"class":680},[449,38807,38711],{"class":684},[449,38809,688],{"class":680},[449,38811,38716],{"class":691},[449,38813,695],{"class":684},[449,38815,38816,38818,38820,38822,38824],{"class":451,"line":468},[449,38817,681],{"class":680},[449,38819,38725],{"class":684},[449,38821,688],{"class":680},[449,38823,38730],{"class":691},[449,38825,695],{"class":684},[449,38827,38828,38830,38832,38834,38836],{"class":451,"line":474},[449,38829,681],{"class":680},[449,38831,38739],{"class":684},[449,38833,688],{"class":680},[449,38835,38744],{"class":691},[449,38837,695],{"class":684},[449,38839,38840],{"class":451,"line":480},[449,38841,700],{"emptyLinePlaceholder":130},[449,38843,38844,38847,38849,38852,38854,38856],{"class":451,"line":486},[449,38845,38846],{"class":721},"describe",[449,38848,725],{"class":684},[449,38850,38851],{"class":691},"\"toLetterGrade\"",[449,38853,23167],{"class":684},[449,38855,1498],{"class":680},[449,38857,1501],{"class":684},[449,38859,38860,38863,38865,38868,38870,38872],{"class":451,"line":492},[449,38861,38862],{"class":721},"  it",[449,38864,725],{"class":684},[449,38866,38867],{"class":691},"\"converts percentages to letter grades\"",[449,38869,23167],{"class":684},[449,38871,1498],{"class":680},[449,38873,1501],{"class":684},[449,38875,38876,38879,38881,38884,38886,38889,38892,38895,38897,38899],{"class":451,"line":498},[449,38877,38878],{"class":721},"    expect",[449,38880,725],{"class":684},[449,38882,38883],{"class":721},"toLetterGrade",[449,38885,725],{"class":684},[449,38887,38888],{"class":714},"95",[449,38890,38891],{"class":684},")).",[449,38893,38894],{"class":721},"toBe",[449,38896,725],{"class":684},[449,38898,37258],{"class":691},[449,38900,740],{"class":684},[449,38902,38903,38905,38907,38909,38911,38914,38916,38918,38920,38922],{"class":451,"line":133},[449,38904,38878],{"class":721},[449,38906,725],{"class":684},[449,38908,38883],{"class":721},[449,38910,725],{"class":684},[449,38912,38913],{"class":714},"83",[449,38915,38891],{"class":684},[449,38917,38894],{"class":721},[449,38919,725],{"class":684},[449,38921,37283],{"class":691},[449,38923,740],{"class":684},[449,38925,38926,38928,38930,38932,38934,38937,38939,38941,38943,38945],{"class":451,"line":509},[449,38927,38878],{"class":721},[449,38929,725],{"class":684},[449,38931,38883],{"class":721},[449,38933,725],{"class":684},[449,38935,38936],{"class":714},"72",[449,38938,38891],{"class":684},[449,38940,38894],{"class":721},[449,38942,725],{"class":684},[449,38944,37306],{"class":691},[449,38946,740],{"class":684},[449,38948,38949,38951,38953,38955,38957,38960,38962,38964,38966,38968],{"class":451,"line":318},[449,38950,38878],{"class":721},[449,38952,725],{"class":684},[449,38954,38883],{"class":721},[449,38956,725],{"class":684},[449,38958,38959],{"class":714},"65",[449,38961,38891],{"class":684},[449,38963,38894],{"class":721},[449,38965,725],{"class":684},[449,38967,37330],{"class":691},[449,38969,740],{"class":684},[449,38971,38972,38974,38976,38978,38980,38983,38985,38987,38989,38991],{"class":451,"line":520},[449,38973,38878],{"class":721},[449,38975,725],{"class":684},[449,38977,38883],{"class":721},[449,38979,725],{"class":684},[449,38981,38982],{"class":714},"40",[449,38984,38891],{"class":684},[449,38986,38894],{"class":721},[449,38988,725],{"class":684},[449,38990,37353],{"class":691},[449,38992,740],{"class":684},[449,38994,38995],{"class":451,"line":526},[449,38996,13321],{"class":684},[449,38998,38999],{"class":451,"line":532},[449,39000,700],{"emptyLinePlaceholder":130},[449,39002,39003,39005,39007,39010,39012,39014],{"class":451,"line":2790},[449,39004,38862],{"class":721},[449,39006,725],{"class":684},[449,39008,39009],{"class":691},"\"clamps out-of-range values\"",[449,39011,23167],{"class":684},[449,39013,1498],{"class":680},[449,39015,1501],{"class":684},[449,39017,39018,39020,39022,39024,39026,39029,39031,39033,39035,39037],{"class":451,"line":3511},[449,39019,38878],{"class":721},[449,39021,725],{"class":684},[449,39023,38883],{"class":721},[449,39025,725],{"class":684},[449,39027,39028],{"class":714},"110",[449,39030,38891],{"class":684},[449,39032,38894],{"class":721},[449,39034,725],{"class":684},[449,39036,37258],{"class":691},[449,39038,740],{"class":684},[449,39040,39041,39043,39045,39047,39049,39051,39053,39055,39057,39059,39061],{"class":451,"line":3526},[449,39042,38878],{"class":721},[449,39044,725],{"class":684},[449,39046,38883],{"class":721},[449,39048,725],{"class":684},[449,39050,5840],{"class":680},[449,39052,4897],{"class":714},[449,39054,38891],{"class":684},[449,39056,38894],{"class":721},[449,39058,725],{"class":684},[449,39060,37353],{"class":691},[449,39062,740],{"class":684},[449,39064,39065],{"class":451,"line":3531},[449,39066,13321],{"class":684},[449,39068,39069],{"class":451,"line":3536},[449,39070,784],{"class":684},[449,39072,39073],{"class":451,"line":4009},[449,39074,700],{"emptyLinePlaceholder":130},[449,39076,39077,39079,39081,39084,39086,39088],{"class":451,"line":4015},[449,39078,38846],{"class":721},[449,39080,725],{"class":684},[449,39082,39083],{"class":691},"\"toGPA\"",[449,39085,23167],{"class":684},[449,39087,1498],{"class":680},[449,39089,1501],{"class":684},[449,39091,39092,39094,39096,39099,39101,39103],{"class":451,"line":4021},[449,39093,38862],{"class":721},[449,39095,725],{"class":684},[449,39097,39098],{"class":691},"\"converts to 4.0 scale\"",[449,39100,23167],{"class":684},[449,39102,1498],{"class":680},[449,39104,1501],{"class":684},[449,39106,39107,39109,39111,39114,39116,39119,39121,39123,39125,39127],{"class":451,"line":4027},[449,39108,38878],{"class":721},[449,39110,725],{"class":684},[449,39112,39113],{"class":721},"toGPA",[449,39115,725],{"class":684},[449,39117,39118],{"class":714},"92",[449,39120,38891],{"class":684},[449,39122,38894],{"class":721},[449,39124,725],{"class":684},[449,39126,4883],{"class":714},[449,39128,740],{"class":684},[449,39130,39131,39133,39135,39137,39139,39142,39144,39146,39148,39150],{"class":451,"line":4032},[449,39132,38878],{"class":721},[449,39134,725],{"class":684},[449,39136,39113],{"class":721},[449,39138,725],{"class":684},[449,39140,39141],{"class":714},"85",[449,39143,38891],{"class":684},[449,39145,38894],{"class":721},[449,39147,725],{"class":684},[449,39149,4836],{"class":714},[449,39151,740],{"class":684},[449,39153,39154,39156,39158,39160,39162,39165,39167,39169,39171,39173],{"class":451,"line":4038},[449,39155,38878],{"class":721},[449,39157,725],{"class":684},[449,39159,39113],{"class":721},[449,39161,725],{"class":684},[449,39163,39164],{"class":714},"55",[449,39166,38891],{"class":684},[449,39168,38894],{"class":721},[449,39170,725],{"class":684},[449,39172,37367],{"class":714},[449,39174,740],{"class":684},[449,39176,39177],{"class":451,"line":4044},[449,39178,13321],{"class":684},[449,39180,39181],{"class":451,"line":4049},[449,39182,784],{"class":684},[449,39184,39185],{"class":451,"line":4054},[449,39186,700],{"emptyLinePlaceholder":130},[449,39188,39189,39191,39193,39196,39198,39200],{"class":451,"line":4059},[449,39190,38846],{"class":721},[449,39192,725],{"class":684},[449,39194,39195],{"class":691},"\"weightedAverage\"",[449,39197,23167],{"class":684},[449,39199,1498],{"class":680},[449,39201,1501],{"class":684},[449,39203,39204,39206,39208,39211,39213,39215],{"class":451,"line":4065},[449,39205,38862],{"class":721},[449,39207,725],{"class":684},[449,39209,39210],{"class":691},"\"calculates weighted grade\"",[449,39212,23167],{"class":684},[449,39214,1498],{"class":680},[449,39216,1501],{"class":684},[449,39218,39219,39221,39223,39225,39227],{"class":451,"line":4070},[449,39220,12985],{"class":680},[449,39222,1649],{"class":714},[449,39224,718],{"class":680},[449,39226,37650],{"class":721},[449,39228,37856],{"class":684},[449,39230,39231,39234,39236,39238,39240,39242,39244],{"class":451,"line":4075},[449,39232,39233],{"class":684},"      { name: ",[449,39235,37864],{"class":691},[449,39237,37867],{"class":684},[449,39239,37264],{"class":714},[449,39241,37873],{"class":684},[449,39243,37913],{"class":714},[449,39245,4819],{"class":684},[449,39247,39248,39250,39253,39255,39257,39259,39262],{"class":451,"line":4081},[449,39249,39233],{"class":684},[449,39251,39252],{"class":691},"\"Exam\"",[449,39254,37867],{"class":684},[449,39256,37288],{"class":714},[449,39258,37873],{"class":684},[449,39260,39261],{"class":714},"0.6",[449,39263,4819],{"class":684},[449,39265,39266],{"class":451,"line":4086},[449,39267,39268],{"class":684},"    ]);\n",[449,39270,39271,39273,39276,39278,39280,39283],{"class":451,"line":4092},[449,39272,38878],{"class":721},[449,39274,39275],{"class":684},"(result).",[449,39277,38894],{"class":721},[449,39279,725],{"class":684},[449,39281,39282],{"class":714},"84",[449,39284,740],{"class":684},[449,39286,39287],{"class":451,"line":4098},[449,39288,13321],{"class":684},[449,39290,39291],{"class":451,"line":4104},[449,39292,700],{"emptyLinePlaceholder":130},[449,39294,39295,39297,39299,39302,39304,39306],{"class":451,"line":4110},[449,39296,38862],{"class":721},[449,39298,725],{"class":684},[449,39300,39301],{"class":691},"\"returns 0 for empty input\"",[449,39303,23167],{"class":684},[449,39305,1498],{"class":680},[449,39307,1501],{"class":684},[449,39309,39310,39312,39314,39317,39320,39322,39324,39326],{"class":451,"line":5782},[449,39311,38878],{"class":721},[449,39313,725],{"class":684},[449,39315,39316],{"class":721},"weightedAverage",[449,39318,39319],{"class":684},"([])).",[449,39321,38894],{"class":721},[449,39323,725],{"class":684},[449,39325,9899],{"class":714},[449,39327,740],{"class":684},[449,39329,39330],{"class":451,"line":5788},[449,39331,13321],{"class":684},[449,39333,39334],{"class":451,"line":5794},[449,39335,784],{"class":684},[449,39337,39338],{"class":451,"line":5799},[449,39339,700],{"emptyLinePlaceholder":130},[449,39341,39342,39344,39346,39349,39351,39353],{"class":451,"line":5804},[449,39343,38846],{"class":721},[449,39345,725],{"class":684},[449,39347,39348],{"class":691},"\"curveByHighest\"",[449,39350,23167],{"class":684},[449,39352,1498],{"class":680},[449,39354,1501],{"class":684},[449,39356,39357,39359,39361,39364,39366,39368],{"class":451,"line":5819},[449,39358,38862],{"class":721},[449,39360,725],{"class":684},[449,39362,39363],{"class":691},"\"curves scores up to target\"",[449,39365,23167],{"class":684},[449,39367,1498],{"class":680},[449,39369,1501],{"class":684},[449,39371,39372,39374,39377,39379,39381,39383,39385,39387,39389,39391,39393,39396,39398],{"class":451,"line":5824},[449,39373,12985],{"class":680},[449,39375,39376],{"class":714}," curved",[449,39378,718],{"class":680},[449,39380,37944],{"class":721},[449,39382,25555],{"class":684},[449,39384,37311],{"class":714},[449,39386,349],{"class":684},[449,39388,37288],{"class":714},[449,39390,349],{"class":684},[449,39392,37264],{"class":714},[449,39394,39395],{"class":684},"], ",[449,39397,5180],{"class":714},[449,39399,740],{"class":684},[449,39401,39402,39404,39407,39410,39412,39414,39416,39418,39420,39422],{"class":451,"line":5846},[449,39403,38878],{"class":721},[449,39405,39406],{"class":684},"(curved).",[449,39408,39409],{"class":721},"toEqual",[449,39411,25555],{"class":684},[449,39413,37288],{"class":714},[449,39415,349],{"class":684},[449,39417,37264],{"class":714},[449,39419,349],{"class":684},[449,39421,5180],{"class":714},[449,39423,37920],{"class":684},[449,39425,39426],{"class":451,"line":5880},[449,39427,13321],{"class":684},[449,39429,39430],{"class":451,"line":5885},[449,39431,700],{"emptyLinePlaceholder":130},[449,39433,39434,39436,39438,39441,39443,39445],{"class":451,"line":5899},[449,39435,38862],{"class":721},[449,39437,725],{"class":684},[449,39439,39440],{"class":691},"\"does not curve if highest already meets target\"",[449,39442,23167],{"class":684},[449,39444,1498],{"class":680},[449,39446,1501],{"class":684},[449,39448,39449,39451,39454,39456,39458,39460,39462,39464,39466,39468],{"class":451,"line":5919},[449,39450,12985],{"class":680},[449,39452,39453],{"class":714}," scores",[449,39455,718],{"class":680},[449,39457,13639],{"class":684},[449,39459,37311],{"class":714},[449,39461,349],{"class":684},[449,39463,37288],{"class":714},[449,39465,349],{"class":684},[449,39467,38888],{"class":714},[449,39469,4917],{"class":684},[449,39471,39472,39474,39476,39479,39482,39484,39486,39488],{"class":451,"line":5938},[449,39473,38878],{"class":721},[449,39475,725],{"class":684},[449,39477,39478],{"class":721},"curveByHighest",[449,39480,39481],{"class":684},"(scores, ",[449,39483,5180],{"class":714},[449,39485,38891],{"class":684},[449,39487,39409],{"class":721},[449,39489,39490],{"class":684},"(scores);\n",[449,39492,39493],{"class":451,"line":5973},[449,39494,13321],{"class":684},[449,39496,39497],{"class":451,"line":5978},[449,39498,784],{"class":684},[449,39500,39501],{"class":451,"line":5983},[449,39502,700],{"emptyLinePlaceholder":130},[449,39504,39505,39507,39509,39512,39514,39516],{"class":451,"line":12114},[449,39506,38846],{"class":721},[449,39508,725],{"class":684},[449,39510,39511],{"class":691},"\"classStats\"",[449,39513,23167],{"class":684},[449,39515,1498],{"class":680},[449,39517,1501],{"class":684},[449,39519,39520,39522,39524,39527,39529,39531],{"class":451,"line":12124},[449,39521,38862],{"class":721},[449,39523,725],{"class":684},[449,39525,39526],{"class":691},"\"calculates stats correctly\"",[449,39528,23167],{"class":684},[449,39530,1498],{"class":680},[449,39532,1501],{"class":684},[449,39534,39535,39537,39540,39542,39544,39546,39548,39550,39552,39554,39556,39558,39560,39562,39565],{"class":451,"line":12134},[449,39536,12985],{"class":680},[449,39538,39539],{"class":714}," stats",[449,39541,718],{"class":680},[449,39543,38258],{"class":721},[449,39545,25555],{"class":684},[449,39547,37264],{"class":714},[449,39549,349],{"class":684},[449,39551,37288],{"class":714},[449,39553,349],{"class":684},[449,39555,37311],{"class":714},[449,39557,349],{"class":684},[449,39559,25511],{"class":714},[449,39561,349],{"class":684},[449,39563,39564],{"class":714},"50",[449,39566,37920],{"class":684},[449,39568,39569,39571,39574,39576,39578,39580],{"class":451,"line":12143},[449,39570,38878],{"class":721},[449,39572,39573],{"class":684},"(stats.mean).",[449,39575,38894],{"class":721},[449,39577,725],{"class":684},[449,39579,37311],{"class":714},[449,39581,740],{"class":684},[449,39583,39584,39586,39589,39591,39593,39595],{"class":451,"line":12152},[449,39585,38878],{"class":721},[449,39587,39588],{"class":684},"(stats.median).",[449,39590,38894],{"class":721},[449,39592,725],{"class":684},[449,39594,37311],{"class":714},[449,39596,740],{"class":684},[449,39598,39599,39601,39604,39606,39608,39610],{"class":451,"line":12157},[449,39600,38878],{"class":721},[449,39602,39603],{"class":684},"(stats.highest).",[449,39605,38894],{"class":721},[449,39607,725],{"class":684},[449,39609,37264],{"class":714},[449,39611,740],{"class":684},[449,39613,39614,39616,39619,39621,39623,39625],{"class":451,"line":12162},[449,39615,38878],{"class":721},[449,39617,39618],{"class":684},"(stats.lowest).",[449,39620,38894],{"class":721},[449,39622,725],{"class":684},[449,39624,39564],{"class":714},[449,39626,740],{"class":684},[449,39628,39629,39631,39634,39636,39638,39640],{"class":451,"line":12172},[449,39630,38878],{"class":721},[449,39632,39633],{"class":684},"(stats.count).",[449,39635,38894],{"class":721},[449,39637,725],{"class":684},[449,39639,4897],{"class":714},[449,39641,740],{"class":684},[449,39643,39644],{"class":451,"line":12182},[449,39645,13321],{"class":684},[449,39647,39648],{"class":451,"line":12192},[449,39649,784],{"class":684},[21,39651,39652],{},"Run the tests:",[48,39654,39656],{"className":839,"code":39655,"language":841,"meta":56,"style":56},"vp test\n",[40,39657,39658],{"__ignoreMap":56},[449,39659,39660,39662],{"class":451,"line":452},[449,39661,3637],{"class":721},[449,39663,39664],{"class":691}," test\n",[427,39666,39669],{"icon":39667,"title":39668},"✅","Vitest Is Built In",[21,39670,39671,39672,39675,39676,39679],{},"No extra install or config. ",[40,39673,39674],{},"vp test"," picks up ",[40,39677,39678],{},".test.ts"," files automatically using the same transform pipeline as your source code.",[16,39681,39683],{"id":39682},"step-6-configure-packaging","Step 6: Configure Packaging",[21,39685,4616,39686,3070],{},[40,39687,39688],{},"vite.config.ts",[48,39690,39692],{"className":670,"code":39691,"filename":39688,"language":673,"meta":56,"style":56},"import { defineConfig } from \"vite-plus\";\n\nexport default defineConfig({\n  pack: {\n    entry: [\"src\u002Findex.ts\"],\n    dts: true,\n    format: [\"esm\", \"cjs\"],\n    sourcemap: true,\n  },\n});\n",[40,39693,39694,39707,39711,39721,39726,39736,39745,39760,39769,39773],{"__ignoreMap":56},[449,39695,39696,39698,39700,39702,39705],{"class":451,"line":452},[449,39697,681],{"class":680},[449,39699,10631],{"class":684},[449,39701,688],{"class":680},[449,39703,39704],{"class":691}," \"vite-plus\"",[449,39706,695],{"class":684},[449,39708,39709],{"class":451,"line":114},[449,39710,700],{"emptyLinePlaceholder":130},[449,39712,39713,39715,39717,39719],{"class":451,"line":111},[449,39714,4629],{"class":680},[449,39716,4632],{"class":680},[449,39718,10651],{"class":721},[449,39720,1391],{"class":684},[449,39722,39723],{"class":451,"line":468},[449,39724,39725],{"class":684},"  pack: {\n",[449,39727,39728,39731,39734],{"class":451,"line":474},[449,39729,39730],{"class":684},"    entry: [",[449,39732,39733],{"class":691},"\"src\u002Findex.ts\"",[449,39735,1469],{"class":684},[449,39737,39738,39741,39743],{"class":451,"line":480},[449,39739,39740],{"class":684},"    dts: ",[449,39742,2169],{"class":714},[449,39744,779],{"class":684},[449,39746,39747,39750,39753,39755,39758],{"class":451,"line":486},[449,39748,39749],{"class":684},"    format: [",[449,39751,39752],{"class":691},"\"esm\"",[449,39754,349],{"class":684},[449,39756,39757],{"class":691},"\"cjs\"",[449,39759,1469],{"class":684},[449,39761,39762,39765,39767],{"class":451,"line":492},[449,39763,39764],{"class":684},"    sourcemap: ",[449,39766,2169],{"class":714},[449,39768,779],{"class":684},[449,39770,39771],{"class":451,"line":498},[449,39772,1474],{"class":684},[449,39774,39775],{"class":451,"line":133},[449,39776,784],{"class":684},[21,39778,39779],{},"This tells Vite+ to:",[383,39781,39782,39788,39791],{},[386,39783,39784,39785,827],{},"Generate TypeScript declaration files (",[40,39786,39787],{},".d.ts",[386,39789,39790],{},"Output both ESM and CJS formats",[386,39792,39793],{},"Include source maps for debugging",[16,39795,39797],{"id":39796},"step-7-build-the-package","Step 7: Build the Package",[48,39799,39801],{"className":839,"code":39800,"language":841,"meta":56,"style":56},"vp pack\n",[40,39802,39803],{"__ignoreMap":56},[449,39804,39805,39807],{"class":451,"line":452},[449,39806,3637],{"class":721},[449,39808,39809],{"class":691}," pack\n",[21,39811,39812],{},"You'll see output like:",[48,39814,39816],{"className":443,"code":39815,"language":445,"meta":56,"style":56},"CLI Building entry: src\u002Findex.ts\nESM dist\u002Findex.js     2.1 kB\nCJS dist\u002Findex.cjs    2.2 kB\nDTS dist\u002Findex.d.ts   1.4 kB\n✓ Pack completed in 94ms\n",[40,39817,39818,39823,39828,39833,39838],{"__ignoreMap":56},[449,39819,39820],{"class":451,"line":452},[449,39821,39822],{},"CLI Building entry: src\u002Findex.ts\n",[449,39824,39825],{"class":451,"line":114},[449,39826,39827],{},"ESM dist\u002Findex.js     2.1 kB\n",[449,39829,39830],{"class":451,"line":111},[449,39831,39832],{},"CJS dist\u002Findex.cjs    2.2 kB\n",[449,39834,39835],{"class":451,"line":468},[449,39836,39837],{},"DTS dist\u002Findex.d.ts   1.4 kB\n",[449,39839,39840],{"class":451,"line":474},[449,39841,39842],{},"✓ Pack completed in 94ms\n",[25,39844,39845],{"type":363},[21,39846,39847,39849,39850,39855],{},[40,39848,36861],{}," uses ",[3861,39851,39854],{"href":39852,"rel":39853},"https:\u002F\u002Ftsdown.dev\u002F",[3865],"tsdown"," under the hood — powered by Rolldown, which itself is written in Rust. That's why it's fast.",[16,39857,39859],{"id":39858},"step-8-publish-to-npm","Step 8: Publish to npm",[21,39861,4616,39862,39864],{},[40,39863,4520],{}," with the essentials:",[48,39866,39868],{"className":4518,"code":39867,"filename":4520,"language":4521,"meta":56,"style":56},"{\n  \"name\": \"teacher-toolkit\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Grade calculation utilities for teachers\",\n  \"type\": \"module\",\n  \"main\": \"dist\u002Findex.cjs\",\n  \"module\": \"dist\u002Findex.js\",\n  \"types\": \"dist\u002Findex.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \".\u002Fdist\u002Findex.js\",\n      \"require\": \".\u002Fdist\u002Findex.cjs\",\n      \"types\": \".\u002Fdist\u002Findex.d.ts\"\n    }\n  },\n  \"files\": [\"dist\"],\n  \"license\": \"MIT\"\n}\n",[40,39869,39870,39874,39886,39897,39909,39921,39933,39945,39957,39964,39971,39983,39995,40005,40009,40013,40025,40035],{"__ignoreMap":56},[449,39871,39872],{"class":451,"line":452},[449,39873,4528],{"class":684},[449,39875,39876,39879,39881,39884],{"class":451,"line":114},[449,39877,39878],{"class":714},"  \"name\"",[449,39880,1482],{"class":684},[449,39882,39883],{"class":691},"\"teacher-toolkit\"",[449,39885,779],{"class":684},[449,39887,39888,39891,39893,39895],{"class":451,"line":111},[449,39889,39890],{"class":714},"  \"version\"",[449,39892,1482],{"class":684},[449,39894,3403],{"class":691},[449,39896,779],{"class":684},[449,39898,39899,39902,39904,39907],{"class":451,"line":468},[449,39900,39901],{"class":714},"  \"description\"",[449,39903,1482],{"class":684},[449,39905,39906],{"class":691},"\"Grade calculation utilities for teachers\"",[449,39908,779],{"class":684},[449,39910,39911,39914,39916,39919],{"class":451,"line":474},[449,39912,39913],{"class":714},"  \"type\"",[449,39915,1482],{"class":684},[449,39917,39918],{"class":691},"\"module\"",[449,39920,779],{"class":684},[449,39922,39923,39926,39928,39931],{"class":451,"line":480},[449,39924,39925],{"class":714},"  \"main\"",[449,39927,1482],{"class":684},[449,39929,39930],{"class":691},"\"dist\u002Findex.cjs\"",[449,39932,779],{"class":684},[449,39934,39935,39938,39940,39943],{"class":451,"line":486},[449,39936,39937],{"class":714},"  \"module\"",[449,39939,1482],{"class":684},[449,39941,39942],{"class":691},"\"dist\u002Findex.js\"",[449,39944,779],{"class":684},[449,39946,39947,39950,39952,39955],{"class":451,"line":492},[449,39948,39949],{"class":714},"  \"types\"",[449,39951,1482],{"class":684},[449,39953,39954],{"class":691},"\"dist\u002Findex.d.ts\"",[449,39956,779],{"class":684},[449,39958,39959,39962],{"class":451,"line":498},[449,39960,39961],{"class":714},"  \"exports\"",[449,39963,4548],{"class":684},[449,39965,39966,39969],{"class":451,"line":133},[449,39967,39968],{"class":714},"    \".\"",[449,39970,4548],{"class":684},[449,39972,39973,39976,39978,39981],{"class":451,"line":509},[449,39974,39975],{"class":714},"      \"import\"",[449,39977,1482],{"class":684},[449,39979,39980],{"class":691},"\".\u002Fdist\u002Findex.js\"",[449,39982,779],{"class":684},[449,39984,39985,39988,39990,39993],{"class":451,"line":318},[449,39986,39987],{"class":714},"      \"require\"",[449,39989,1482],{"class":684},[449,39991,39992],{"class":691},"\".\u002Fdist\u002Findex.cjs\"",[449,39994,779],{"class":684},[449,39996,39997,40000,40002],{"class":451,"line":520},[449,39998,39999],{"class":714},"      \"types\"",[449,40001,1482],{"class":684},[449,40003,40004],{"class":691},"\".\u002Fdist\u002Findex.d.ts\"\n",[449,40006,40007],{"class":451,"line":526},[449,40008,7544],{"class":684},[449,40010,40011],{"class":451,"line":532},[449,40012,1474],{"class":684},[449,40014,40015,40018,40020,40023],{"class":451,"line":2790},[449,40016,40017],{"class":714},"  \"files\"",[449,40019,17389],{"class":684},[449,40021,40022],{"class":691},"\"dist\"",[449,40024,1469],{"class":684},[449,40026,40027,40030,40032],{"class":451,"line":3511},[449,40028,40029],{"class":714},"  \"license\"",[449,40031,1482],{"class":684},[449,40033,40034],{"class":691},"\"MIT\"\n",[449,40036,40037],{"class":451,"line":3526},[449,40038,4604],{"class":684},[21,40040,40041],{},"Then publish:",[48,40043,40045],{"className":839,"code":40044,"language":841,"meta":56,"style":56},"npm publish\n",[40,40046,40047],{"__ignoreMap":56},[449,40048,40049,40051],{"class":451,"line":452},[449,40050,3703],{"class":721},[449,40052,40053],{"class":691}," publish\n",[16,40055,40057],{"id":40056},"using-the-package","Using the Package",[21,40059,40060],{},"Once published, any teacher or developer can install it:",[48,40062,40064],{"className":839,"code":40063,"language":841,"meta":56,"style":56},"npm install teacher-toolkit\n",[40,40065,40066],{"__ignoreMap":56},[449,40067,40068,40070,40072],{"class":451,"line":452},[449,40069,3703],{"class":721},[449,40071,3706],{"class":691},[449,40073,36941],{"class":691},[48,40075,40077],{"className":670,"code":40076,"language":673,"meta":56,"style":56},"import { toLetterGrade, weightedAverage, curveByHighest, classStats } from \"teacher-toolkit\";\n\n\u002F\u002F Convert a score\ntoLetterGrade(87); \u002F\u002F => \"B\"\n\n\u002F\u002F Calculate a final grade\nconst final = weightedAverage([\n  { name: \"Quiz\", score: 92, weight: 0.2 },\n  { name: \"Project\", score: 78, weight: 0.3 },\n  { name: \"Final\", score: 85, weight: 0.5 },\n]); \u002F\u002F => 84.2\n\n\u002F\u002F Curve a set of exam scores\nconst curved = curveByHighest([62, 74, 81, 90]); \u002F\u002F => [72, 84, 91, 100]\n\n\u002F\u002F Get class overview\nclassStats([90, 82, 75, 68, 55]);\n\u002F\u002F => { mean: 74, median: 75, stdDev: 12.49, highest: 90, lowest: 55, count: 5 }\n",[40,40078,40079,40093,40097,40102,40117,40121,40126,40139,40157,40175,40192,40200,40204,40209,40243,40247,40252,40281],{"__ignoreMap":56},[449,40080,40081,40083,40086,40088,40091],{"class":451,"line":452},[449,40082,681],{"class":680},[449,40084,40085],{"class":684}," { toLetterGrade, weightedAverage, curveByHighest, classStats } ",[449,40087,688],{"class":680},[449,40089,40090],{"class":691}," \"teacher-toolkit\"",[449,40092,695],{"class":684},[449,40094,40095],{"class":451,"line":114},[449,40096,700],{"emptyLinePlaceholder":130},[449,40098,40099],{"class":451,"line":111},[449,40100,40101],{"class":705},"\u002F\u002F Convert a score\n",[449,40103,40104,40106,40108,40111,40114],{"class":451,"line":468},[449,40105,38883],{"class":721},[449,40107,725],{"class":684},[449,40109,40110],{"class":714},"87",[449,40112,40113],{"class":684},"); ",[449,40115,40116],{"class":705},"\u002F\u002F => \"B\"\n",[449,40118,40119],{"class":451,"line":474},[449,40120,700],{"emptyLinePlaceholder":130},[449,40122,40123],{"class":451,"line":480},[449,40124,40125],{"class":705},"\u002F\u002F Calculate a final grade\n",[449,40127,40128,40130,40133,40135,40137],{"class":451,"line":486},[449,40129,711],{"class":680},[449,40131,40132],{"class":714}," final",[449,40134,718],{"class":680},[449,40136,37650],{"class":721},[449,40138,37856],{"class":684},[449,40140,40141,40143,40146,40148,40150,40152,40155],{"class":451,"line":492},[449,40142,37861],{"class":684},[449,40144,40145],{"class":691},"\"Quiz\"",[449,40147,37867],{"class":684},[449,40149,39118],{"class":714},[449,40151,37873],{"class":684},[449,40153,40154],{"class":714},"0.2",[449,40156,4819],{"class":684},[449,40158,40159,40161,40164,40166,40169,40171,40173],{"class":451,"line":498},[449,40160,37861],{"class":684},[449,40162,40163],{"class":691},"\"Project\"",[449,40165,37867],{"class":684},[449,40167,40168],{"class":714},"78",[449,40170,37873],{"class":684},[449,40172,37876],{"class":714},[449,40174,4819],{"class":684},[449,40176,40177,40179,40182,40184,40186,40188,40190],{"class":451,"line":133},[449,40178,37861],{"class":684},[449,40180,40181],{"class":691},"\"Final\"",[449,40183,37867],{"class":684},[449,40185,39141],{"class":714},[449,40187,37873],{"class":684},[449,40189,31554],{"class":714},[449,40191,4819],{"class":684},[449,40193,40194,40197],{"class":451,"line":509},[449,40195,40196],{"class":684},"]); ",[449,40198,40199],{"class":705},"\u002F\u002F => 84.2\n",[449,40201,40202],{"class":451,"line":318},[449,40203,700],{"emptyLinePlaceholder":130},[449,40205,40206],{"class":451,"line":520},[449,40207,40208],{"class":705},"\u002F\u002F Curve a set of exam scores\n",[449,40210,40211,40213,40215,40217,40219,40221,40224,40226,40229,40231,40234,40236,40238,40240],{"class":451,"line":526},[449,40212,711],{"class":680},[449,40214,39376],{"class":714},[449,40216,718],{"class":680},[449,40218,37944],{"class":721},[449,40220,25555],{"class":684},[449,40222,40223],{"class":714},"62",[449,40225,349],{"class":684},[449,40227,40228],{"class":714},"74",[449,40230,349],{"class":684},[449,40232,40233],{"class":714},"81",[449,40235,349],{"class":684},[449,40237,37264],{"class":714},[449,40239,40196],{"class":684},[449,40241,40242],{"class":705},"\u002F\u002F => [72, 84, 91, 100]\n",[449,40244,40245],{"class":451,"line":532},[449,40246,700],{"emptyLinePlaceholder":130},[449,40248,40249],{"class":451,"line":2790},[449,40250,40251],{"class":705},"\u002F\u002F Get class overview\n",[449,40253,40254,40257,40259,40261,40263,40265,40267,40270,40272,40275,40277,40279],{"class":451,"line":3511},[449,40255,40256],{"class":721},"classStats",[449,40258,25555],{"class":684},[449,40260,37264],{"class":714},[449,40262,349],{"class":684},[449,40264,37908],{"class":714},[449,40266,349],{"class":684},[449,40268,40269],{"class":714},"75",[449,40271,349],{"class":684},[449,40273,40274],{"class":714},"68",[449,40276,349],{"class":684},[449,40278,39164],{"class":714},[449,40280,37920],{"class":684},[449,40282,40283],{"class":451,"line":3526},[449,40284,40285],{"class":705},"\u002F\u002F => { mean: 74, median: 75, stdDev: 12.49, highest: 90, lowest: 55, count: 5 }\n",[16,40287,40289],{"id":40288},"full-workflow-recap","Full Workflow Recap",[48,40291,40293],{"className":839,"code":40292,"language":841,"meta":56,"style":56},"vp create vite:library -- teacher-toolkit   # Scaffold\nvp install                                   # Install deps\nvp check                                     # Format + lint + type-check\nvp test                                      # Run tests\nvp pack                                      # Build for npm\nnpm publish                                  # Ship it\n",[40,40294,40295,40311,40320,40329,40338,40347],{"__ignoreMap":56},[449,40296,40297,40299,40301,40303,40305,40308],{"class":451,"line":452},[449,40298,3637],{"class":721},[449,40300,36932],{"class":691},[449,40302,36935],{"class":691},[449,40304,36938],{"class":714},[449,40306,40307],{"class":691}," teacher-toolkit",[449,40309,40310],{"class":705},"   # Scaffold\n",[449,40312,40313,40315,40317],{"class":451,"line":114},[449,40314,3637],{"class":721},[449,40316,3706],{"class":691},[449,40318,40319],{"class":705},"                                   # Install deps\n",[449,40321,40322,40324,40326],{"class":451,"line":111},[449,40323,3637],{"class":721},[449,40325,3640],{"class":691},[449,40327,40328],{"class":705},"                                     # Format + lint + type-check\n",[449,40330,40331,40333,40335],{"class":451,"line":468},[449,40332,3637],{"class":721},[449,40334,3650],{"class":691},[449,40336,40337],{"class":705},"                                      # Run tests\n",[449,40339,40340,40342,40344],{"class":451,"line":474},[449,40341,3637],{"class":721},[449,40343,3660],{"class":691},[449,40345,40346],{"class":705},"                                      # Build for npm\n",[449,40348,40349,40351,40354],{"class":451,"line":480},[449,40350,3703],{"class":721},[449,40352,40353],{"class":691}," publish",[449,40355,40356],{"class":705},"                                  # Ship it\n",[21,40358,40359,40360,165],{},"Six commands. Zero config files beyond ",[40,40361,39688],{},[2805,40363,40364,40368],{},[2808,40365,40367],{"id":40366},"why-vite-for-libraries","Why Vite+ for Libraries?",[21,40369,25753,40370,40372],{},[40,40371,36861],{},", you get DTS generation, dual ESM\u002FCJS output, and source maps without touching Rollup, tsup, or unbuild configs. The Vitest and Oxc integrations mean testing and linting are already part of the workflow.",[16,40374,40376],{"id":40375},"ideas-to-extend-this-package","Ideas to Extend This Package",[383,40378,40379,40385,40391,40397,40403],{},[386,40380,40381,40384],{},[151,40382,40383],{},"Letter grade with +\u002F-"," — A+, A, A-, B+, etc.",[386,40386,40387,40390],{},[151,40388,40389],{},"Rubric scoring"," — multi-criteria evaluation helpers",[386,40392,40393,40396],{},[151,40394,40395],{},"Attendance percentage"," — days present vs. total",[386,40398,40399,40402],{},[151,40400,40401],{},"Assignment deadline tracker"," — date math utilities",[386,40404,40405,40408],{},[151,40406,40407],{},"Export to CSV"," — grade reports for school systems",[16,40410,3681],{"id":3680},[21,40412,40413,40414,40417,40418,40420],{},"Vite+ makes it trivial to go from idea to published package. The ",[40,40415,40416],{},"vite:library"," template, built-in Vitest, and ",[40,40419,36861],{}," remove the usual friction of library authoring — no build config rabbit holes, no DTS plugin debugging.",[21,40422,40423],{},"For teachers and education developers, this means you can spend your time solving real problems (grade calculations, student analytics) instead of fighting tooling.",[21,40425,40426],{},"Ship the package. Help a teacher.",[3728,40428,40429],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":40431},[40432,40433,40434,40435],{"id":37206,"depth":114,"text":37207},{"id":37615,"depth":114,"text":37616},{"id":37928,"depth":114,"text":37929},{"id":38223,"depth":114,"text":38224,"children":40436},[40437],{"id":40366,"depth":111,"text":40367},"2026-03-30","A hands-on guide to packaging a reusable npm library for educators using Vite+ — covering grade calculations, score curving, and GPA utilities.",{"type":13,"value":40441},[40442,40444,40446,40450],[16,40443,333],{"id":332},[21,40445,36840],{},[21,40447,36843,40448,36847],{},[40,40449,36846],{},[21,40451,36850,40452,36854,40454,36858,40456,36862],{},[151,40453,36853],{},[151,40455,36857],{},[40,40457,36861],{},"https:\u002F\u002Fres.cloudinary.com\u002Fddszyeplg\u002Fimage\u002Fupload\u002Fv1775009589\u002Fviteplus_et4prw.png",[40460,127,40461,3703,40462,40463,40464,3784],"vite+","library","education","teachers","grading",{},"\u002Fblog\u002Fviteplus-teacher-toolkit-package",{"title":36832,"description":40439},"blog\u002Fviteplus-teacher-toolkit-package","XwTtHHs03R8uLy6cqcOEndE9OAE6QcY7Z4gp0Dmd01k",{"id":40471,"title":40472,"author":40473,"body":40474,"canonical":116,"categories":116,"date":40438,"description":41034,"excerpt":41035,"extension":119,"featuredImg":116,"img":40458,"keywords":41050,"language":3788,"meta":41055,"navigation":130,"ogImage":116,"path":41056,"rating":474,"readTime":492,"seo":41057,"stem":41058,"tag":3793,"__hash__":41059},"blog\u002Fblog\u002Fviteplus-unified-toolchain.md","Vite+: The Unified Toolchain That Replaces Your Entire Frontend Setup",{"name":9,"img":17256,"website":327},{"type":13,"value":40475,"toc":41028},[40476,40478,40481,40494,40506,40510,40513,40563,40581,40583,40585,40588,40606,40609,40627,40630,40642,40646,40660,40663,40667,40670,40731,40737,40762,40769,40772,40795,40821,40838,40844,40847,40861,40868,40874,40901,40904,40910,40916,40926,40929,40933,40936,40948,40957,40960,40968,40978,40982,41014,41016,41019,41025],[16,40477,333],{"id":332},[21,40479,40480],{},"If you've been juggling Node version managers, package managers, linters, formatters, test runners, and build tools — you're not alone. The JavaScript tooling landscape has gotten out of hand.",[21,40482,40483,40485,40486,40491,40492,165],{},[151,40484,36857],{}," aims to fix that. Created by ",[3861,40487,40490],{"href":40488,"rel":40489},"https:\u002F\u002Fvoidzero.dev\u002F",[3865],"VoidZero"," — the team behind Vite, Vitest, Oxc, and Rolldown — it unifies your entire development workflow into a single CLI tool called ",[40,40493,3637],{},[25,40495,40496],{"type":363},[21,40497,40498,40499,40501,40502,40505],{},"Vite+ ships in two parts: ",[40,40500,3637],{},", the global command-line tool, and ",[40,40503,40504],{},"vite-plus",", the local package installed in each project.",[16,40507,40509],{"id":40508},"what-is-vite","What Is Vite+?",[21,40511,40512],{},"Vite+ is the unified toolchain and entry point for web development. It manages your runtime, package manager, and frontend stack by combining:",[383,40514,40515,40523,40531,40539,40546,40554,40560],{},[386,40516,40517,40522],{},[3861,40518,40521],{"href":40519,"rel":40520},"https:\u002F\u002Fvite.dev\u002F",[3865],"Vite"," — dev server and builds",[386,40524,40525,40530],{},[3861,40526,40529],{"href":40527,"rel":40528},"https:\u002F\u002Fvitest.dev\u002F",[3865],"Vitest"," — testing",[386,40532,40533,40538],{},[3861,40534,40537],{"href":40535,"rel":40536},"https:\u002F\u002Foxc.rs\u002F",[3865],"Oxlint"," — linting",[386,40540,40541,40545],{},[3861,40542,40544],{"href":40535,"rel":40543},[3865],"Oxfmt"," — formatting",[386,40547,40548,40553],{},[3861,40549,40552],{"href":40550,"rel":40551},"https:\u002F\u002Frolldown.rs\u002F",[3865],"Rolldown"," — bundling",[386,40555,40556,40559],{},[3861,40557,39854],{"href":39852,"rel":40558},[3865]," — library packaging",[386,40561,40562],{},"Vite Task — monorepo task orchestration",[427,40564,40566],{"icon":5303,"title":40565},"Rust-Powered Performance",[21,40567,40568,40569,40572,40573,40576,40577,40580],{},"With low-level components written in Rust, Vite+ delivers up to ",[151,40570,40571],{},"40x faster builds"," than Webpack, ",[151,40574,40575],{},"~50–100x faster linting"," than ESLint, and ",[151,40578,40579],{},"~30x faster formatting"," than Prettier.",[16,40582,33605],{"id":33604},[32,40584,33612],{"id":33611},[21,40586,40587],{},"macOS \u002F Linux:",[48,40589,40591],{"className":839,"code":40590,"language":841,"meta":56,"style":56},"curl -fsSL https:\u002F\u002Fvite.plus | bash\n",[40,40592,40593],{"__ignoreMap":56},[449,40594,40595,40597,40599,40602,40604],{"class":451,"line":452},[449,40596,4396],{"class":721},[449,40598,4399],{"class":714},[449,40600,40601],{"class":691}," https:\u002F\u002Fvite.plus",[449,40603,4405],{"class":680},[449,40605,4408],{"class":721},[21,40607,40608],{},"Windows (PowerShell):",[48,40610,40612],{"className":839,"code":40611,"language":841,"meta":56,"style":56},"irm https:\u002F\u002Fvite.plus\u002Fps1 | iex\n",[40,40613,40614],{"__ignoreMap":56},[449,40615,40616,40619,40622,40624],{"class":451,"line":452},[449,40617,40618],{"class":721},"irm",[449,40620,40621],{"class":691}," https:\u002F\u002Fvite.plus\u002Fps1",[449,40623,4405],{"class":680},[449,40625,40626],{"class":721}," iex\n",[21,40628,40629],{},"Open a new terminal session and verify:",[48,40631,40633],{"className":839,"code":40632,"language":841,"meta":56,"style":56},"vp help\n",[40,40634,40635],{"__ignoreMap":56},[449,40636,40637,40639],{"class":451,"line":452},[449,40638,3637],{"class":721},[449,40640,40641],{"class":691}," help\n",[32,40643,40645],{"id":40644},"create-a-new-project","Create a New Project",[48,40647,40649],{"className":839,"code":40648,"language":841,"meta":56,"style":56},"vp create my-app\n",[40,40650,40651],{"__ignoreMap":56},[449,40652,40653,40655,40657],{"class":451,"line":452},[449,40654,3637],{"class":721},[449,40656,36932],{"class":691},[449,40658,40659],{"class":691}," my-app\n",[21,40661,40662],{},"Vite+ supports every framework built on Vite — React, Vue, Svelte, Solid, and 20+ more.",[16,40664,40666],{"id":40665},"core-commands","Core Commands",[21,40668,40669],{},"Vite+ handles the entire local frontend development cycle. Here's the workflow:",[48,40671,40673],{"className":839,"code":40672,"language":841,"meta":56,"style":56},"vp create        # Scaffold a new project\nvp install       # Install dependencies (auto-detects pnpm\u002Fnpm\u002Fyarn)\nvp dev           # Start the dev server\nvp check         # Format, lint, and type-check in one pass\nvp test          # Run tests with Vitest\nvp build         # Build for production\n",[40,40674,40675,40684,40693,40703,40712,40721],{"__ignoreMap":56},[449,40676,40677,40679,40681],{"class":451,"line":452},[449,40678,3637],{"class":721},[449,40680,36932],{"class":691},[449,40682,40683],{"class":705},"        # Scaffold a new project\n",[449,40685,40686,40688,40690],{"class":451,"line":114},[449,40687,3637],{"class":721},[449,40689,3706],{"class":691},[449,40691,40692],{"class":705},"       # Install dependencies (auto-detects pnpm\u002Fnpm\u002Fyarn)\n",[449,40694,40695,40697,40700],{"class":451,"line":111},[449,40696,3637],{"class":721},[449,40698,40699],{"class":691}," dev",[449,40701,40702],{"class":705},"           # Start the dev server\n",[449,40704,40705,40707,40709],{"class":451,"line":468},[449,40706,3637],{"class":721},[449,40708,3640],{"class":691},[449,40710,40711],{"class":705},"         # Format, lint, and type-check in one pass\n",[449,40713,40714,40716,40718],{"class":451,"line":474},[449,40715,3637],{"class":721},[449,40717,3650],{"class":691},[449,40719,40720],{"class":705},"          # Run tests with Vitest\n",[449,40722,40723,40725,40728],{"class":451,"line":480},[449,40724,3637],{"class":721},[449,40726,40727],{"class":691}," build",[449,40729,40730],{"class":705},"         # Build for production\n",[21,40732,40733,40734,40736],{},"You can also run ",[40,40735,3637],{}," on its own for an interactive command picker.",[2805,40738,40739,40741],{},[2808,40740,22914],{"id":22913},[21,40742,40743,40744,349,40747,349,40749,349,40752,349,40755,40758,40759,40761],{},"Instead of configuring ",[40,40745,40746],{},"nvm",[40,40748,3703],{},[40,40750,40751],{},"vitest",[40,40753,40754],{},"eslint",[40,40756,40757],{},"prettier",", and build scripts separately, ",[40,40760,3637],{}," handles all of it with a consistent interface across every project.",[16,40763,40765,40766],{"id":40764},"format-lint-and-type-check-with-vp-check","Format, Lint, and Type-Check with ",[40,40767,40768],{},"vp check",[21,40770,40771],{},"One command runs all three — powered by Oxc under the hood:",[383,40773,40774,40780,40786],{},[386,40775,40776,40779],{},[151,40777,40778],{},"Prettier-compatible"," formatting via Oxfmt",[386,40781,40782,40785],{},[151,40783,40784],{},"600+ ESLint-compatible"," rules via Oxlint",[386,40787,40788,40791,40792],{},[151,40789,40790],{},"Type-aware linting"," and fast type checks via ",[40,40793,40794],{},"tsgo",[48,40796,40798],{"className":839,"code":40797,"language":841,"meta":56,"style":56},"vp check         # Run all checks\nvp check --fix   # Auto-fix where possible\n",[40,40799,40800,40809],{"__ignoreMap":56},[449,40801,40802,40804,40806],{"class":451,"line":452},[449,40803,3637],{"class":721},[449,40805,3640],{"class":691},[449,40807,40808],{"class":705},"         # Run all checks\n",[449,40810,40811,40813,40815,40818],{"class":451,"line":114},[449,40812,3637],{"class":721},[449,40814,3640],{"class":691},[449,40816,40817],{"class":714}," --fix",[449,40819,40820],{"class":705},"   # Auto-fix where possible\n",[25,40822,40823],{"type":27},[21,40824,40825,40827,40828,349,40831,40834,40835,40837],{},[40,40826,40768],{}," runs format, lint, and type checks together in a single pass. To run them individually, use ",[40,40829,40830],{},"vp fmt",[40,40832,40833],{},"vp lint",", or invoke ",[40,40836,40794],{}," directly.",[16,40839,40841,40842],{"id":40840},"testing-with-vp-test","Testing with ",[40,40843,39674],{},[21,40845,40846],{},"Vitest is built in — no separate install or config needed. It reuses the same resolve and transform config from your application.",[383,40848,40849,40852,40855,40858],{},[386,40850,40851],{},"Jest-compatible API",[386,40853,40854],{},"Test isolation by default",[386,40856,40857],{},"Browser Mode: run unit tests in actual browsers",[386,40859,40860],{},"Coverage, snapshots, type tests, visual regression",[16,40862,40864,40865],{"id":40863},"monorepo-task-caching-with-vp-run","Monorepo Task Caching with ",[40,40866,40867],{},"vp run",[21,40869,40870,40871,40873],{},"For monorepos, ",[40,40872,40867],{}," provides automated caching and dependency-aware execution:",[48,40875,40877],{"className":839,"code":40876,"language":841,"meta":56,"style":56},"vp run build     # Run build across workspaces with caching\nvp run test      # Run tests with input tracking\n",[40,40878,40879,40890],{"__ignoreMap":56},[449,40880,40881,40883,40885,40887],{"class":451,"line":452},[449,40882,3637],{"class":721},[449,40884,5297],{"class":691},[449,40886,40727],{"class":691},[449,40888,40889],{"class":705},"     # Run build across workspaces with caching\n",[449,40891,40892,40894,40896,40898],{"class":451,"line":114},[449,40893,3637],{"class":721},[449,40895,5297],{"class":691},[449,40897,3650],{"class":691},[449,40899,40900],{"class":705},"      # Run tests with input tracking\n",[21,40902,40903],{},"Tasks are cached automatically based on input files — no Turborepo config needed.",[16,40905,40907,40908],{"id":40906},"library-packaging-with-vp-pack","Library Packaging with ",[40,40909,36861],{},[21,40911,40912,40913,40915],{},"Publishing a library? ",[40,40914,36861],{}," handles DTS generation, bundling, and automatic package exports:",[48,40917,40918],{"className":839,"code":39800,"language":841,"meta":56,"style":56},[40,40919,40920],{"__ignoreMap":56},[449,40921,40922,40924],{"class":451,"line":452},[449,40923,3637],{"class":721},[449,40925,39809],{"class":691},[21,40927,40928],{},"Powered by Rolldown \u002F tsdown, it outputs ESM, CJS, and declaration files.",[16,40930,40932],{"id":40931},"migrating-an-existing-vite-project","Migrating an Existing Vite Project",[21,40934,40935],{},"Already have a Vite project? Migrate it with:",[48,40937,40939],{"className":839,"code":40938,"language":841,"meta":56,"style":56},"vp migrate\n",[40,40940,40941],{"__ignoreMap":56},[449,40942,40943,40945],{"class":451,"line":452},[449,40944,3637],{"class":721},[449,40946,40947],{"class":691}," migrate\n",[21,40949,40950,40951,40956],{},"Or paste the ",[3861,40952,40955],{"href":40953,"rel":40954},"https:\u002F\u002Fviteplus.dev\u002Fguide\u002Fmigrate#migration-prompt",[3865],"migration prompt"," into your coding agent.",[16,40958,40959],{"id":8297},"Deployment",[21,40961,40962,40963,40967],{},"Vite+ pairs with ",[3861,40964,4189],{"href":40965,"rel":40966},"https:\u002F\u002Fnitro.unjs.io\u002F",[3865]," for platform-agnostic deployment. First-class support for Vercel, Netlify, Cloudflare Workers, and Render.",[427,40969,40971],{"icon":429,"title":40970},"Platform Agnostic",[21,40972,40973,40974,40977],{},"Build once with ",[40,40975,40976],{},"vp build"," and deploy anywhere — Nitro handles the server runtime transformation.",[16,40979,40981],{"id":40980},"why-vite","Why Vite+?",[383,40983,40984,40990,40996,41002,41008],{},[386,40985,40986,40989],{},[151,40987,40988],{},"Stop wasting time on tooling maintenance"," — one CLI, one config, one workflow",[386,40991,40992,40995],{},[151,40993,40994],{},"Improve cross-team mobility"," — consistent DX across every project",[386,40997,40998,41001],{},[151,40999,41000],{},"Stay fast at scale"," — Rust-powered internals, enterprise-grade performance",[386,41003,41004,41007],{},[151,41005,41006],{},"Supply chain security"," — rigorous dependency vetting across the unified toolchain",[386,41009,41010,41013],{},[151,41011,41012],{},"Free and open source"," — MIT license, maintained by VoidZero and community contributors",[73,41015],{},[21,41017,41018],{},"Vite+ isn't reinventing the wheel — it's putting high-performance tires on it. By unifying your runtime, package manager, linter, formatter, test runner, and bundler into a single CLI, it removes the tooling tax that slows down every new project.",[21,41020,41021,41022,165],{},"If Vite was the upgrade from Webpack, Vite+ is the upgrade from ",[156,41023,41024],{},"tool fatigue",[3728,41026,41027],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}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 .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":41029},[41030,41031],{"id":33611,"depth":114,"text":33612},{"id":40644,"depth":114,"text":40645,"children":41032},[41033],{"id":22913,"depth":111,"text":22914},"Vite+ combines Vite, Vitest, Oxlint, Oxfmt, and Rolldown into a single CLI — managing your runtime, package manager, and toolchain in one place.",{"type":13,"value":41036},[41037,41039,41041],[16,41038,333],{"id":332},[21,41040,40480],{},[21,41042,41043,40485,41045,40491,41048,165],{},[151,41044,36857],{},[3861,41046,40490],{"href":40488,"rel":41047},[3865],[40,41049,3637],{},[40460,127,41051,41052,7069,3784,41053,40751,41054],"frontend","toolchain","oxc","rolldown",{},"\u002Fblog\u002Fviteplus-unified-toolchain",{"title":40472,"description":41034},"blog\u002Fviteplus-unified-toolchain","00R0beYyTBASBIooO-oPKrm2mEEs-hxF0utg6Q2PkU8",{"id":41061,"title":41062,"author":41063,"body":41064,"canonical":116,"categories":116,"date":42434,"description":42435,"excerpt":42436,"extension":119,"featuredImg":116,"img":40458,"keywords":42457,"language":3788,"meta":42462,"navigation":130,"ogImage":116,"path":42463,"rating":474,"readTime":133,"seo":42464,"stem":42465,"tag":3793,"__hash__":42466},"blog\u002Fblog\u002Fvoid-ship-vite-apps-at-warp-speed.md","Void: Ship Vite Apps at Warp Speed — The Deployment Platform Built for Vite",{"name":9,"img":17256,"website":327},{"type":13,"value":41065,"toc":42430},[41066,41068,41075,41090,41096,41105,41109,41112,41147,41208,41225,41238,41242,41245,41248,41283,41294,41350,41395,41401,41403,41406,41461,41464,41522,41549,41556,41576,41579,41583,41599,41619,41625,41662,41668,41684,41688,41694,41758,41821,41903,41915,41919,41928,42014,42044,42047,42120,42133,42136,42140,42238,42244,42248,42280,42295,42299,42309,42325,42330,42404,42411,42419,42421,42427],[16,41067,333],{"id":332},[21,41069,41070,41071,41074],{},"If Vite changed how we build frontends, ",[151,41072,41073],{},"Void"," wants to change how we ship them.",[21,41076,41077,41078,41082,41083,41086,41087,41089],{},"Built by ",[3861,41079,40490],{"href":41080,"rel":41081},"https:\u002F\u002Fvoidzero.dev",[3865]," — the team behind Vite, Vitest, Rolldown, and Oxc, led by Evan You — Void is a deployment platform designed specifically for Vite apps. Not a generic host with Vite support bolted on. A platform where ",[40,41084,41085],{},"vite dev"," and production share the same runtime, and your source code ",[156,41088,15245],{}," your infrastructure config.",[21,41091,41092,41093,165],{},"One plugin. One command. Live at ",[40,41094,41095],{},"your-app.void.app",[25,41097,41098],{"type":363},[21,41099,41100,41101,41104],{},"Void is in ",[151,41102,41103],{},"Private Beta"," as of August 2026. Not recommended for mission-critical production yet — but perfect for prototyping, learning, and early adoption. Back up your data if you deploy.",[16,41106,41108],{"id":41107},"what-is-void","What Is Void?",[21,41110,41111],{},"Void combines three things:",[816,41113,41114,41123,41141],{},[386,41115,41116,1110,41119,41122],{},[151,41117,41118],{},"A Vite plugin",[40,41120,41121],{},"voidPlugin()"," — that scans your code and wires up the platform",[386,41124,41125,1110,41128,349,41131,349,41134,349,41137,41140],{},[151,41126,41127],{},"A backend SDK",[40,41129,41130],{},"void\u002Fdb",[40,41132,41133],{},"void\u002Fkv",[40,41135,41136],{},"void\u002Fstorage",[40,41138,41139],{},"void\u002Fai",", queues, crons, auth — built for the edge",[386,41142,41143,41146],{},[151,41144,41145],{},"A deployment platform"," — built on Cloudflare Workers, global from day one",[48,41148,41150],{"className":670,"code":41149,"filename":39688,"language":673,"meta":56,"style":56},"import { defineConfig } from \"vite\";\nimport { voidPlugin } from \"void\";\n\nexport default defineConfig({\n  plugins: [voidPlugin()],\n});\n",[40,41151,41152,41165,41179,41183,41193,41204],{"__ignoreMap":56},[449,41153,41154,41156,41158,41160,41163],{"class":451,"line":452},[449,41155,681],{"class":680},[449,41157,10631],{"class":684},[449,41159,688],{"class":680},[449,41161,41162],{"class":691}," \"vite\"",[449,41164,695],{"class":684},[449,41166,41167,41169,41172,41174,41177],{"class":451,"line":114},[449,41168,681],{"class":680},[449,41170,41171],{"class":684}," { voidPlugin } ",[449,41173,688],{"class":680},[449,41175,41176],{"class":691}," \"void\"",[449,41178,695],{"class":684},[449,41180,41181],{"class":451,"line":111},[449,41182,700],{"emptyLinePlaceholder":130},[449,41184,41185,41187,41189,41191],{"class":451,"line":468},[449,41186,4629],{"class":680},[449,41188,4632],{"class":680},[449,41190,10651],{"class":721},[449,41192,1391],{"class":684},[449,41194,41195,41198,41201],{"class":451,"line":474},[449,41196,41197],{"class":684},"  plugins: [",[449,41199,41200],{"class":721},"voidPlugin",[449,41202,41203],{"class":684},"()],\n",[449,41205,41206],{"class":451,"line":480},[449,41207,784],{"class":684},[48,41209,41211],{"className":839,"code":41210,"language":841,"meta":56,"style":56},"void deploy\n# → https:\u002F\u002Fyour-app.void.app\n",[40,41212,41213,41220],{"__ignoreMap":56},[449,41214,41215,41218],{"class":451,"line":452},[449,41216,41217],{"class":721},"void",[449,41219,6653],{"class":691},[449,41221,41222],{"class":451,"line":114},[449,41223,41224],{"class":705},"# → https:\u002F\u002Fyour-app.void.app\n",[21,41226,41227,41228,41233,41234,41237],{},"That's the pitch from ",[3861,41229,41232],{"href":41230,"rel":41231},"https:\u002F\u002Fvoid.cloud",[3865],"void.cloud",": write code, not config. Import what you need, skip what you don't, and ",[40,41235,41236],{},"void deploy"," handles builds, migrations, resource provisioning, and edge deployment.",[16,41239,41241],{"id":41240},"the-idea-your-code-is-your-infra","The Idea: Your Code Is Your Infra",[21,41243,41244],{},"Most stacks split your app and its platform into two worlds. You write code in one place, then stitch it to infrastructure with config files, dashboard clicks, and deployment scripts. Caching, scaling, and limits live somewhere else entirely.",[21,41246,41247],{},"Void closes that gap:",[383,41249,41250,41256,41262,41268,41274],{},[386,41251,41252,41255],{},[40,41253,41254],{},"import { db } from 'void\u002Fdb'"," → local D1 database in dev + provisioned D1 in production",[386,41257,41258,41261],{},[40,41259,41260],{},"import { kv } from 'void\u002Fkv'"," → local KV + provisioned KV",[386,41263,41264,41267],{},[40,41265,41266],{},"import { storage } from 'void\u002Fstorage'"," → local R2 + provisioned R2",[386,41269,41270,41273],{},[40,41271,41272],{},"import { ai } from 'void\u002Fai'"," → Workers AI inference, metered",[386,41275,41276,1124,41279,41282],{},[40,41277,41278],{},"import { queues } from 'void\u002Fqueues'",[40,41280,41281],{},"defineScheduled"," → queues and cron jobs",[21,41284,41285,41286,41289,41290,41293],{},"No ",[40,41287,41288],{},"wrangler.toml"," dance. No manual binding declarations. The plugin's ",[151,41291,41292],{},"resource inference"," scans your source at build time and provisions what you actually use.",[427,41295,41297],{"icon":5303,"title":41296},"Resource Inference = Zero Config",[21,41298,41299,41300,349,41303,349,41306,349,41309,349,41312,25757,41315,5872,41318,5872,41321,41324,41325,41328,41329,41331,41332,41335,41336,41331,41339,41342,41343,25398,41346,41349],{},"Void scans ",[40,41301,41302],{},"routes\u002F",[40,41304,41305],{},"pages\u002F",[40,41307,41308],{},"middleware\u002F",[40,41310,41311],{},"crons\u002F",[40,41313,41314],{},"queues\u002F",[40,41316,41317],{},"src\u002F",[40,41319,41320],{},"app\u002F",[40,41322,41323],{},"server\u002F"," in framework mode) using ",[40,41326,41327],{},"es-module-lexer"," + regex + AST. If it sees ",[40,41330,41130],{},", you get ",[40,41333,41334],{},"DB",". If it sees ",[40,41337,41338],{},"env.KV",[40,41340,41341],{},"KV",". Override with ",[40,41344,41345],{},"void.json",[40,41347,41348],{},"inference.bindings"," if needed.",[48,41351,41353],{"className":443,"code":41352,"language":445,"meta":56,"style":56},"vite.config.ts          → voidPlugin() (works with any Vite app)\nimport { db }           → D1 database (auto-provisioned)\nimport { kv }           → KV namespace (auto-provisioned)\nimport { storage }      → R2 bucket (auto-provisioned)\nimport { ai }           → Workers AI inference (metered)\ndb\u002Fschema.ts            → Drizzle schema (source of truth for DB types)\ndb\u002Fmigrations\u002F*.sql     → Applied to D1 on deploy\nvoid deploy             → Live at https:\u002F\u002F\u003Cslug>.void.app\n",[40,41354,41355,41360,41365,41370,41375,41380,41385,41390],{"__ignoreMap":56},[449,41356,41357],{"class":451,"line":452},[449,41358,41359],{},"vite.config.ts          → voidPlugin() (works with any Vite app)\n",[449,41361,41362],{"class":451,"line":114},[449,41363,41364],{},"import { db }           → D1 database (auto-provisioned)\n",[449,41366,41367],{"class":451,"line":111},[449,41368,41369],{},"import { kv }           → KV namespace (auto-provisioned)\n",[449,41371,41372],{"class":451,"line":468},[449,41373,41374],{},"import { storage }      → R2 bucket (auto-provisioned)\n",[449,41376,41377],{"class":451,"line":474},[449,41378,41379],{},"import { ai }           → Workers AI inference (metered)\n",[449,41381,41382],{"class":451,"line":480},[449,41383,41384],{},"db\u002Fschema.ts            → Drizzle schema (source of truth for DB types)\n",[449,41386,41387],{"class":451,"line":486},[449,41388,41389],{},"db\u002Fmigrations\u002F*.sql     → Applied to D1 on deploy\n",[449,41391,41392],{"class":451,"line":492},[449,41393,41394],{},"void deploy             → Live at https:\u002F\u002F\u003Cslug>.void.app\n",[21,41396,41397,41398,41400],{},"Same runtime locally and in production — ",[40,41399,41085],{}," runs your server code in the Workers runtime, with local D1\u002FKV\u002FR2 ready.",[16,41402,7243],{"id":7242},[21,41404,41405],{},"Void is file-based and convention-driven. Every directory is optional — you only add what you use:",[48,41407,41409],{"className":443,"code":41408,"language":445,"meta":56,"style":56},"routes\u002F          # API endpoints (Hono, file-based)\npages\u002F           # Full-stack pages (React\u002FVue\u002FSvelte\u002FSolid)\nmiddleware\u002F      # Global middleware (01.logger.ts, 02.auth.ts)\ndb\u002F              # Drizzle schema + SQL migrations\ncrons\u002F           # Scheduled jobs (defineScheduled)\nqueues\u002F          # Queue consumers (defineQueue)\nsrc\u002F             # Shared components\u002Futils\npublic\u002F          # Static assets (served as-is)\nvoid.json        # Optional Void config (routing, inference, worker)\nvite.config.ts   # Must include voidPlugin()\n",[40,41410,41411,41416,41421,41426,41431,41436,41441,41446,41451,41456],{"__ignoreMap":56},[449,41412,41413],{"class":451,"line":452},[449,41414,41415],{},"routes\u002F          # API endpoints (Hono, file-based)\n",[449,41417,41418],{"class":451,"line":114},[449,41419,41420],{},"pages\u002F           # Full-stack pages (React\u002FVue\u002FSvelte\u002FSolid)\n",[449,41422,41423],{"class":451,"line":111},[449,41424,41425],{},"middleware\u002F      # Global middleware (01.logger.ts, 02.auth.ts)\n",[449,41427,41428],{"class":451,"line":468},[449,41429,41430],{},"db\u002F              # Drizzle schema + SQL migrations\n",[449,41432,41433],{"class":451,"line":474},[449,41434,41435],{},"crons\u002F           # Scheduled jobs (defineScheduled)\n",[449,41437,41438],{"class":451,"line":480},[449,41439,41440],{},"queues\u002F          # Queue consumers (defineQueue)\n",[449,41442,41443],{"class":451,"line":486},[449,41444,41445],{},"src\u002F             # Shared components\u002Futils\n",[449,41447,41448],{"class":451,"line":492},[449,41449,41450],{},"public\u002F          # Static assets (served as-is)\n",[449,41452,41453],{"class":451,"line":498},[449,41454,41455],{},"void.json        # Optional Void config (routing, inference, worker)\n",[449,41457,41458],{"class":451,"line":133},[449,41459,41460],{},"vite.config.ts   # Must include voidPlugin()\n",[21,41462,41463],{},"Routes are method exports:",[48,41465,41468],{"className":670,"code":41466,"filename":41467,"language":673,"meta":56,"style":56},"import { defineHandler } from \"void\";\n\nexport const GET = defineHandler(() => {\n  return { message: \"Hello from Void\" };\n});\n","routes\u002Fapi\u002Fhello.ts",[40,41469,41470,41483,41487,41507,41518],{"__ignoreMap":56},[449,41471,41472,41474,41477,41479,41481],{"class":451,"line":452},[449,41473,681],{"class":680},[449,41475,41476],{"class":684}," { defineHandler } ",[449,41478,688],{"class":680},[449,41480,41176],{"class":691},[449,41482,695],{"class":684},[449,41484,41485],{"class":451,"line":114},[449,41486,700],{"emptyLinePlaceholder":130},[449,41488,41489,41491,41493,41496,41498,41501,41503,41505],{"class":451,"line":111},[449,41490,4629],{"class":680},[449,41492,10789],{"class":680},[449,41494,41495],{"class":714}," GET",[449,41497,718],{"class":680},[449,41499,41500],{"class":721}," defineHandler",[449,41502,4717],{"class":684},[449,41504,1498],{"class":680},[449,41506,1501],{"class":684},[449,41508,41509,41511,41513,41516],{"class":451,"line":468},[449,41510,4726],{"class":680},[449,41512,12355],{"class":684},[449,41514,41515],{"class":691},"\"Hello from Void\"",[449,41517,1520],{"class":684},[449,41519,41520],{"class":451,"line":474},[449,41521,784],{"class":684},[383,41523,41524,41533,41542],{},[386,41525,41526,41527,2429,41530],{},"Dynamic segments: ",[40,41528,41529],{},"routes\u002Fusers\u002F[id].ts",[40,41531,41532],{},"\u002Fapi\u002Fusers\u002F:id",[386,41534,41535,41536,2429,41539],{},"Catch-all: ",[40,41537,41538],{},"routes\u002Fsearch\u002F[...query].ts",[40,41540,41541],{},"\u002Fapi\u002Fsearch\u002F*",[386,41543,41544,41545,41548],{},"Route groups: ",[40,41546,41547],{},"(admin)\u002F"," organizes without affecting URL",[21,41550,41551,41552,41555],{},"Pages pair a component with a ",[40,41553,41554],{},".server.ts"," loader\u002Faction:",[48,41557,41559],{"className":443,"code":41558,"language":445,"meta":56,"style":56},"pages\u002Findex.tsx         → \u002F\npages\u002Findex.server.ts   → loader + action for \u002F\npages\u002Fusers\u002F[id].tsx    → \u002Fusers\u002F:id\n",[40,41560,41561,41566,41571],{"__ignoreMap":56},[449,41562,41563],{"class":451,"line":452},[449,41564,41565],{},"pages\u002Findex.tsx         → \u002F\n",[449,41567,41568],{"class":451,"line":114},[449,41569,41570],{},"pages\u002Findex.server.ts   → loader + action for \u002F\n",[449,41572,41573],{"class":451,"line":111},[449,41574,41575],{},"pages\u002Fusers\u002F[id].tsx    → \u002Fusers\u002F:id\n",[21,41577,41578],{},"Layouts nest automatically. Markdown pages with frontmatter work out of the box.",[16,41580,41582],{"id":41581},"quickstart-in-4-steps","Quickstart in 4 Steps",[48,41584,41586],{"className":839,"code":41585,"language":841,"meta":56,"style":56},"npm install -D void\n",[40,41587,41588],{"__ignoreMap":56},[449,41589,41590,41592,41594,41596],{"class":451,"line":452},[449,41591,3703],{"class":721},[449,41593,3706],{"class":691},[449,41595,10594],{"class":714},[449,41597,41598],{"class":691}," void\n",[48,41600,41602],{"className":839,"code":41601,"language":841,"meta":56,"style":56},"npx void init\n# Choose Vite+ or Vite, framework, D1 vs PostgreSQL vs Static\n",[40,41603,41604,41614],{"__ignoreMap":56},[449,41605,41606,41608,41611],{"class":451,"line":452},[449,41607,8887],{"class":721},[449,41609,41610],{"class":691}," void",[449,41612,41613],{"class":691}," init\n",[449,41615,41616],{"class":451,"line":114},[449,41617,41618],{"class":705},"# Choose Vite+ or Vite, framework, D1 vs PostgreSQL vs Static\n",[21,41620,41621,41622,41624],{},"Edit the generated route at ",[40,41623,41467],{},", then:",[48,41626,41628],{"className":839,"code":41627,"language":841,"meta":56,"style":56},"npm run dev        # → http:\u002F\u002Flocalhost:5173\nvoid auth login    # first time only\nvoid deploy        # → https:\u002F\u002F\u003Cslug>.void.app\n",[40,41629,41630,41641,41652],{"__ignoreMap":56},[449,41631,41632,41634,41636,41638],{"class":451,"line":452},[449,41633,3703],{"class":721},[449,41635,5297],{"class":691},[449,41637,40699],{"class":691},[449,41639,41640],{"class":705},"        # → http:\u002F\u002Flocalhost:5173\n",[449,41642,41643,41645,41647,41649],{"class":451,"line":114},[449,41644,41217],{"class":721},[449,41646,850],{"class":691},[449,41648,31942],{"class":691},[449,41650,41651],{"class":705},"    # first time only\n",[449,41653,41654,41656,41659],{"class":451,"line":111},[449,41655,41217],{"class":721},[449,41657,41658],{"class":691}," deploy",[449,41660,41661],{"class":705},"        # → https:\u002F\u002F\u003Cslug>.void.app\n",[21,41663,41664,41665,165],{},"On deploy Void will build, detect migrations, provision resources you actually import, upload assets (cached), and ship to the edge. Add GitHub push-to-deploy with ",[40,41666,41667],{},"void init --github",[25,41669,41670],{"type":27},[21,41671,41672,41673,41676,41677,41680,41681,165],{},"Local dev for framework apps (Nuxt, SvelteKit, Astro) still needs ",[40,41674,41675],{},"wrangler"," installed — Void syncs inferred bindings into ",[40,41678,41679],{},"wrangler.jsonc"," so the Nitro\u002FCloudflare dev proxy and Void share ",[40,41682,41683],{},".wrangler\u002Fstate\u002Fv3",[16,41685,41687],{"id":41686},"the-platform-what-you-get","The Platform: What You Get",[21,41689,41690,41693],{},[151,41691,41692],{},"Edge-native."," Deployed to Cloudflare Workers — your server runs close to users, scales without extra config, static assets served from the edge with proper cache headers.",[383,41695,41696,41706,41716,41727,41737,41743],{},[386,41697,41698,41701,41702,41705],{},[151,41699,41700],{},"Database:"," D1 (SQLite) with read replication + Drizzle schema as source of truth, or PostgreSQL when you need heavier writes. ",[40,41703,41704],{},"void db generate"," handles migrations.",[386,41707,41708,25398,41711,23841,41713,41715],{},[151,41709,41710],{},"KV & Object Storage:",[40,41712,41133],{},[40,41714,41136],{}," (R2) — both typed, both local in dev.",[386,41717,41718,25398,41721,2429,41723,41726],{},[151,41719,41720],{},"AI:",[40,41722,41139],{},[40,41724,41725],{},"ai.run('@cf\u002Fmeta\u002Fllama-3.1-8b-instruct', { prompt })"," on Workers AI.",[386,41728,41729,41732,41733,41736],{},[151,41730,41731],{},"Typed end-to-end:"," Drizzle schema types → route handler inference → ",[40,41734,41735],{},"typed fetch"," client checks calls at the usage site. One Standard Schema validator drives runtime + compile-time types.",[386,41738,41739,41742],{},[151,41740,41741],{},"Platform primitives:"," Cron jobs, queues, WebSockets, SSE, Live event streams, sandboxes, auth, ISR\u002Frevalidation, prerendering, redirects\u002Frewrites, custom headers.",[386,41744,41745,25398,41748,349,41751,41753,41754,41757],{},[151,41746,41747],{},"Secrets & env:",[40,41749,41750],{},"void secret put KEY=value",[40,41752,41345],{}," + ",[40,41755,41756],{},"env.ts"," with build-time validation and a client-leak guard that fails the build if a server-only key reaches the browser.",[48,41759,41762],{"className":670,"code":41760,"filename":41761,"language":673,"meta":56,"style":56},"import { defineScheduled } from \"void\";\nexport const cron = \"*\u002F5 * * * *\";\nexport default defineScheduled(async () => {\n  \u002F\u002F runs every 5 minutes\n});\n","crons\u002Fheartbeat.ts",[40,41763,41764,41777,41793,41812,41817],{"__ignoreMap":56},[449,41765,41766,41768,41771,41773,41775],{"class":451,"line":452},[449,41767,681],{"class":680},[449,41769,41770],{"class":684}," { defineScheduled } ",[449,41772,688],{"class":680},[449,41774,41176],{"class":691},[449,41776,695],{"class":684},[449,41778,41779,41781,41783,41786,41788,41791],{"class":451,"line":114},[449,41780,4629],{"class":680},[449,41782,10789],{"class":680},[449,41784,41785],{"class":714}," cron",[449,41787,718],{"class":680},[449,41789,41790],{"class":691}," \"*\u002F5 * * * *\"",[449,41792,695],{"class":684},[449,41794,41795,41797,41799,41802,41804,41806,41808,41810],{"class":451,"line":111},[449,41796,4629],{"class":680},[449,41798,4632],{"class":680},[449,41800,41801],{"class":721}," defineScheduled",[449,41803,725],{"class":684},[449,41805,1485],{"class":680},[449,41807,2090],{"class":684},[449,41809,1498],{"class":680},[449,41811,1501],{"class":684},[449,41813,41814],{"class":451,"line":468},[449,41815,41816],{"class":705},"  \u002F\u002F runs every 5 minutes\n",[449,41818,41819],{"class":451,"line":474},[449,41820,784],{"class":684},[48,41822,41825],{"className":670,"code":41823,"filename":41824,"language":673,"meta":56,"style":56},"import { defineQueue } from \"void\";\nexport default defineQueue(async (batch) => {\n  for (const msg of batch.messages) {\n    \u002F\u002F process message\n    msg.ack();\n  }\n});\n","queues\u002Femail.ts",[40,41826,41827,41840,41864,41880,41885,41895,41899],{"__ignoreMap":56},[449,41828,41829,41831,41834,41836,41838],{"class":451,"line":452},[449,41830,681],{"class":680},[449,41832,41833],{"class":684}," { defineQueue } ",[449,41835,688],{"class":680},[449,41837,41176],{"class":691},[449,41839,695],{"class":684},[449,41841,41842,41844,41846,41849,41851,41853,41855,41858,41860,41862],{"class":451,"line":114},[449,41843,4629],{"class":680},[449,41845,4632],{"class":680},[449,41847,41848],{"class":721}," defineQueue",[449,41850,725],{"class":684},[449,41852,1485],{"class":680},[449,41854,1913],{"class":684},[449,41856,41857],{"class":1491},"batch",[449,41859,1758],{"class":684},[449,41861,1498],{"class":680},[449,41863,1501],{"class":684},[449,41865,41866,41868,41870,41872,41875,41877],{"class":451,"line":111},[449,41867,5529],{"class":680},[449,41869,1913],{"class":684},[449,41871,711],{"class":680},[449,41873,41874],{"class":714}," msg",[449,41876,12292],{"class":680},[449,41878,41879],{"class":684}," batch.messages) {\n",[449,41881,41882],{"class":451,"line":468},[449,41883,41884],{"class":705},"    \u002F\u002F process message\n",[449,41886,41887,41890,41893],{"class":451,"line":474},[449,41888,41889],{"class":684},"    msg.",[449,41891,41892],{"class":721},"ack",[449,41894,1322],{"class":684},[449,41896,41897],{"class":451,"line":480},[449,41898,4599],{"class":684},[449,41900,41901],{"class":451,"line":486},[449,41902,784],{"class":684},[21,41904,41905,41906,41909,41910,165],{},"You don't need a Cloudflare account to start. Every build still outputs a standard Cloudflare Worker, so you can self-host with your own ",[40,41907,41908],{},"wrangler.json"," later via the ",[3861,41911,41914],{"href":41912,"rel":41913},"https:\u002F\u002Fvoid.cloud\u002Fintegrations\u002Fcloudflare",[3865],"Cloudflare integration",[16,41916,41918],{"id":41917},"nuxt-integration-why-this-matters-for-the-web-app","Nuxt Integration — Why This Matters for the Web App",[21,41920,41921,41922,1913,41924,41927],{},"This portfolio runs on ",[151,41923,23019],{},[40,41925,41926],{},"apps\u002Fweb"," in this monorepo) — currently on Vercel + Firebase (Auth + Realtime Database for views, presence, comments, newsletter, guestbook). Void supports Nuxt directly:",[48,41929,41931],{"className":670,"code":41930,"filename":4619,"language":673,"meta":56,"style":56},"import { resolve } from \"node:path\";\nimport { voidPlugin } from \"void\";\n\nexport default defineNuxtConfig({\n  nitro: { preset: \"cloudflare-module\", alias: { \"@schema\": resolve(__dirname, \"db\u002Fschema.ts\") } },\n  vite: { plugins: [voidPlugin()] },\n});\n",[40,41932,41933,41947,41959,41963,41973,42000,42010],{"__ignoreMap":56},[449,41934,41935,41937,41940,41942,41945],{"class":451,"line":452},[449,41936,681],{"class":680},[449,41938,41939],{"class":684}," { resolve } ",[449,41941,688],{"class":680},[449,41943,41944],{"class":691}," \"node:path\"",[449,41946,695],{"class":684},[449,41948,41949,41951,41953,41955,41957],{"class":451,"line":114},[449,41950,681],{"class":680},[449,41952,41171],{"class":684},[449,41954,688],{"class":680},[449,41956,41176],{"class":691},[449,41958,695],{"class":684},[449,41960,41961],{"class":451,"line":111},[449,41962,700],{"emptyLinePlaceholder":130},[449,41964,41965,41967,41969,41971],{"class":451,"line":468},[449,41966,4629],{"class":680},[449,41968,4632],{"class":680},[449,41970,4635],{"class":721},[449,41972,1391],{"class":684},[449,41974,41975,41978,41981,41984,41987,41989,41991,41994,41997],{"class":451,"line":474},[449,41976,41977],{"class":684},"  nitro: { preset: ",[449,41979,41980],{"class":691},"\"cloudflare-module\"",[449,41982,41983],{"class":684},", alias: { ",[449,41985,41986],{"class":691},"\"@schema\"",[449,41988,1482],{"class":684},[449,41990,5167],{"class":721},[449,41992,41993],{"class":684},"(__dirname, ",[449,41995,41996],{"class":691},"\"db\u002Fschema.ts\"",[449,41998,41999],{"class":684},") } },\n",[449,42001,42002,42005,42007],{"class":451,"line":480},[449,42003,42004],{"class":684},"  vite: { plugins: [",[449,42006,41200],{"class":721},[449,42008,42009],{"class":684},"()] },\n",[449,42011,42012],{"class":451,"line":486},[449,42013,784],{"class":684},[48,42015,42019],{"className":42016,"code":42017,"filename":41679,"language":42018,"meta":56,"style":56},"language-jsonc shiki shiki-themes github-light github-dark","{\n  \"name\": \"my-app\",\n  \"compatibility_date\": \"2026-02-24\",\n  \"compatibility_flags\": [\"nodejs_compat\", \"nodejs_als\"],\n}\n","jsonc",[40,42020,42021,42025,42030,42035,42040],{"__ignoreMap":56},[449,42022,42023],{"class":451,"line":452},[449,42024,4528],{},[449,42026,42027],{"class":451,"line":114},[449,42028,42029],{},"  \"name\": \"my-app\",\n",[449,42031,42032],{"class":451,"line":111},[449,42033,42034],{},"  \"compatibility_date\": \"2026-02-24\",\n",[449,42036,42037],{"class":451,"line":468},[449,42038,42039],{},"  \"compatibility_flags\": [\"nodejs_compat\", \"nodejs_als\"],\n",[449,42041,42042],{"class":451,"line":474},[449,42043,4604],{},[21,42045,42046],{},"Then in any Nitro route:",[48,42048,42051],{"className":670,"code":42049,"filename":42050,"language":673,"meta":56,"style":56},"import { db } from \"void\u002Fdb\";\nimport { users } from \"@schema\";\n\nexport default defineEventHandler(async () => {\n  return db.select().from(users);\n});\n","server\u002Fapi\u002Fusers.get.ts",[40,42052,42053,42066,42079,42083,42101,42116],{"__ignoreMap":56},[449,42054,42055,42057,42059,42061,42064],{"class":451,"line":452},[449,42056,681],{"class":680},[449,42058,11703],{"class":684},[449,42060,688],{"class":680},[449,42062,42063],{"class":691}," \"void\u002Fdb\"",[449,42065,695],{"class":684},[449,42067,42068,42070,42072,42074,42077],{"class":451,"line":114},[449,42069,681],{"class":680},[449,42071,27147],{"class":684},[449,42073,688],{"class":680},[449,42075,42076],{"class":691}," \"@schema\"",[449,42078,695],{"class":684},[449,42080,42081],{"class":451,"line":111},[449,42082,700],{"emptyLinePlaceholder":130},[449,42084,42085,42087,42089,42091,42093,42095,42097,42099],{"class":451,"line":468},[449,42086,4629],{"class":680},[449,42088,4632],{"class":680},[449,42090,4714],{"class":721},[449,42092,725],{"class":684},[449,42094,1485],{"class":680},[449,42096,2090],{"class":684},[449,42098,1498],{"class":680},[449,42100,1501],{"class":684},[449,42102,42103,42105,42107,42109,42111,42113],{"class":451,"line":474},[449,42104,4726],{"class":680},[449,42106,12255],{"class":684},[449,42108,12452],{"class":721},[449,42110,5237],{"class":684},[449,42112,688],{"class":721},[449,42114,42115],{"class":684},"(users);\n",[449,42117,42118],{"class":451,"line":480},[449,42119,784],{"class":684},[25,42121,42122],{"type":363},[21,42123,42124,42125,42128,42129,42132],{},"Nuxt caveat: Nitro bundles server routes outside Vite's pipeline, so ",[40,42126,42127],{},"db.query.*"," relational helpers aren't available — use ",[40,42130,42131],{},"db.select().from(table)"," instead. KV, R2, and AI work the same.",[21,42134,42135],{},"Void also works with TanStack Start, SvelteKit, Astro, React Router, Analog, and full Hono apps. For a Nuxt + Nuxt Content blog like this one, D1 + KV could replace Firebase for views\u002Flikes\u002Fcomments with zero client SDKs, all at the edge.",[16,42137,42139],{"id":42138},"void-vs-where-we-are-now","Void vs. Where We Are Now",[547,42141,42142,42155],{},[550,42143,42144],{},[553,42145,42146,42149,42152],{},[556,42147,42148],{},"Concern",[556,42150,42151],{},"Current (Vercel + Firebase)",[556,42153,42154],{},"Void (Cloudflare edge)",[569,42156,42157,42173,42184,42195,42208,42222],{},[553,42158,42159,42162,42167],{},[574,42160,42161],{},"Hosting",[574,42163,42164,42165,827],{},"Vercel (Nitro preset ",[40,42166,6635],{},[574,42168,42169,42170,827],{},"Cloudflare Workers (",[40,42171,42172],{},"cloudflare-module",[553,42174,42175,42178,42181],{},[574,42176,42177],{},"Data",[574,42179,42180],{},"Firebase RTDB, client-direct + rules",[574,42182,42183],{},"D1\u002FKV\u002FR2, server-side, Drizzle-typed",[553,42185,42186,42189,42192],{},[574,42187,42188],{},"Auth",[574,42190,42191],{},"Firebase Google OAuth",[574,42193,42194],{},"Void auth (framework mode: bring Better Auth)",[553,42196,42197,42200,42203],{},[574,42198,42199],{},"Dev parity",[574,42201,42202],{},"Vite dev + Firebase emulator (separate)",[574,42204,42205,42207],{},[40,42206,41085],{}," = Workers runtime + local D1\u002FKV\u002FR2",[553,42209,42210,42213,42219],{},[574,42211,42212],{},"Infra config",[574,42214,42215,42218],{},[40,42216,42217],{},"firebase.json"," + Vercel dashboard + env vars",[574,42220,42221],{},"Imports are infra — no extra files",[553,42223,42224,42227,42233],{},[574,42225,42226],{},"Deploy",[574,42228,42229,42232],{},[40,42230,42231],{},"vercel --prod"," \u002F git push",[574,42234,42235,42237],{},[40,42236,41236],{}," (migrations + provisioning auto)",[21,42239,42240,42241,42243],{},"Migrating this blog to Void wouldn't be about chasing hype — it would be about collapsing three systems (Vercel, Firebase, Cloudinary) into one typed, file-based surface that ",[40,42242,3637],{}," already understands.",[16,42245,42247],{"id":42246},"why-void","Why Void?",[383,42249,42250,42256,42262,42268,42274],{},[386,42251,42252,42255],{},[151,42253,42254],{},"Stop bridging app and platform"," — one plugin connects Vite directly to the edge",[386,42257,42258,42261],{},[151,42259,42260],{},"Real runtime in dev"," — no \"works locally, breaks on deploy\" mismatch",[386,42263,42264,42267],{},[151,42265,42266],{},"Types everywhere"," — DB schema → server handlers → fetch client, all inferred",[386,42269,42270,42273],{},[151,42271,42272],{},"AI-native"," — skills + MCP so coding agents can scaffold and ship in one prompt",[386,42275,42276,42279],{},[151,42277,42278],{},"Same Vite you know"," — Void is from the VoidZero team that ships Vite, Vite+, Vitest, Rolldown, Oxc",[2805,42281,42282,42286],{},[2808,42283,42285],{"id":42284},"the-voidzero-stack","The VoidZero Stack",[21,42287,42288,42289,42291,42292,42294],{},"Vite → Vitest → Oxlint\u002FOxfmt → Rolldown → Vite+ (",[40,42290,3637],{},") → ",[151,42293,41073],{},". One team, one toolchain, from editor to edge. If Vite was the upgrade from Webpack, Void is the upgrade from gluing Vite to a host.",[16,42296,42298],{"id":42297},"whats-next-build-jumble-on-void","What's Next: Build Jumble on Void",[21,42300,42301,42302,42305,42306,165],{},"This post is the overview. Next we go hands-on with a real product: ",[151,42303,42304],{},"Jumble Cookies",", a Jamaican cookie storefront built as a standalone Void + Vue app in ",[40,42307,42308],{},"apps\u002Fjumble",[2805,42310,42311,42315],{},[2808,42312,42314],{"id":42313},"the-interactive-series-is-live","The Interactive Series Is Live",[21,42316,42317,42318,42324],{},"Start here: ",[151,42319,42320],{},[3861,42321,42323],{"href":42322},"\u002Flearn\u002Fvoid","Void in Practice: Build Jumble Cookies"," — an eight-stage build where every lesson embeds the actual app at that stage, not a screenshot.",[21,42326,42327],{},[151,42328,42329],{},"The eight stages:",[816,42331,42332,42344,42350,42359,42368,42377,42386,42395],{},[386,42333,42334,42340,42341],{},[151,42335,42336],{},[3861,42337,42339],{"href":42338},"\u002Flearn\u002Fvoid\u002F01-the-jumble-foundation","The Jumble Foundation"," — Void + Vue, the branded shell, and ",[40,42342,42343],{},"\u002Fpreview\u002F:stage",[386,42345,42346,42349],{},[151,42347,42348],{},"Weekly menu"," — D1 + Drizzle, a seeded rotating menu, and typed loaders",[386,42351,42352,42358],{},[151,42353,42354],{},[3861,42355,42357],{"href":42356},"\u002Flearn\u002Fvoid\u002F03-the-storefront","Storefront"," — cookie pages, box sizes, and typed page props",[386,42360,42361,42367],{},[151,42362,42363],{},[3861,42364,42366],{"href":42365},"\u002Flearn\u002Fvoid\u002F04-box-and-cart","Box + cart"," — KV sessions, the cart API, and a live drawer",[386,42369,42370,42376],{},[151,42371,42372],{},[3861,42373,42375],{"href":42374},"\u002Flearn\u002Fvoid\u002F05-pickup-and-checkout","Pickup + checkout"," — locations, pickup slots, validation, and orders in D1",[386,42378,42379,42385],{},[151,42380,42381],{},[3861,42382,42384],{"href":42383},"\u002Flearn\u002Fvoid\u002F06-order-status","Order status"," — polling, a confirmation queue, and a weekly menu cron",[386,42387,42388,42394],{},[151,42389,42390],{},[3861,42391,42393],{"href":42392},"\u002Flearn\u002Fvoid\u002F07-admin-and-auth","Admin + auth"," — protected menu and order operations",[386,42396,42397,42403],{},[151,42398,42399],{},[3861,42400,42402],{"href":42401},"\u002Flearn\u002Fvoid\u002F08-ship","Ship"," — R2 images, GitHub Actions, and the production domain",[21,42405,42406,42407,42410],{},"Stages 1–8 are live now. The blog reads the app URL from ",[40,42408,42409],{},"NUXT_PUBLIC_JUMBLE_URL","; the app reads the stage from the lesson preview. One codebase, one deploy, eight real stages.",[21,42412,42413,42414,2429,42416,42418],{},"Each tutorial ships real code — no slides, just ",[40,42415,41085],{},[40,42417,41236],{}," → live URL.",[73,42420],{},[21,42422,42423,42424,42426],{},"Void is betting that the future of full-stack Vite isn't \"pick a database, pick a host, wire them together\" — it's \"import it and ship.\" If they pull it off, ",[40,42425,3637],{}," + Void could be the most boringly productive way to build for the web in a long time. And boring, in tooling, is a compliment.",[3728,42428,42429],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":56,"searchDepth":111,"depth":111,"links":42431},[42432,42433],{"id":42284,"depth":111,"text":42285},{"id":42313,"depth":111,"text":42314},"2026-08-28","Void is VoidZero's new deployment platform for Vite — a Vite plugin + backend SDK + edge runtime that turns your imports into infrastructure. Here's what it is, how it works, and why it matters for Nuxt apps like this one.",{"type":13,"value":42437},[42438,42440,42444,42453],[16,42439,333],{"id":332},[21,42441,41070,42442,41074],{},[151,42443,41073],{},[21,42445,41077,42446,41082,42449,41086,42451,41089],{},[3861,42447,40490],{"href":41080,"rel":42448},[3865],[40,42450,41085],{},[156,42452,15245],{},[21,42454,41092,42455,165],{},[40,42456,41095],{},[41217,42458,127,40504,8297,42459,24246,42460,42461,10426],"voidzero","cloudflare","d1","edge",{},"\u002Fblog\u002Fvoid-ship-vite-apps-at-warp-speed",{"title":41062,"description":42435},"blog\u002Fvoid-ship-vite-apps-at-warp-speed","FoQk36OWAaMrAP8EeGMZm9x1yYcVPQzOLKzV2veKhkE",{"id":42468,"title":42469,"author":42470,"body":42471,"canonical":116,"categories":116,"date":21345,"description":42481,"excerpt":116,"extension":119,"featuredImg":116,"img":120,"keywords":116,"language":116,"meta":42482,"navigation":130,"ogImage":116,"path":42483,"rating":116,"readTime":116,"seo":42484,"stem":42485,"tag":42486,"__hash__":42487},"blog\u002Fblog\u002Fwork-in-progress.md","Work in Progress",{"name":9,"img":11},{"type":13,"value":42472,"toc":42479},[42473,42476],[16,42474,42469],{"id":42475},"work-in-progress",[21,42477,42478],{},"This post is currently under construction. Check back soon!",{"title":56,"searchDepth":111,"depth":111,"links":42480},[],"A placeholder for an upcoming post.",{},"\u002Fblog\u002Fwork-in-progress",{"title":42469,"description":42481},"blog\u002Fwork-in-progress","General","1sHW0mnHLDI0l5zAuCybTU2hzvwgGpZDagmOMJ53Q3Q",{"id":42489,"title":42323,"author":42490,"body":42492,"description":42700,"difficulty":42701,"estMinutes":42702,"extension":119,"feature":116,"img":42703,"meta":42704,"navigation":130,"nuxtVersion":116,"order":116,"path":42322,"releaseDate":42705,"seo":42706,"series":41217,"sourcePRs":116,"sourceUrl":42707,"stem":42708,"__hash__":42709},"tutorials\u002Flearn\u002Fvoid\u002Findex.md",{"name":9,"img":17256,"website":42491},"https:\u002F\u002Fvantolbennett.vercel.app",{"type":13,"value":42493,"toc":42694},[42494,42497,42503,42507,42511,42514,42557,42566,42570,42573,42578,42590,42593,42597,42617,42641,42645,42689],[21,42495,42496],{},"Most framework tutorials hand you a counter, a to-do list, or a weather card. This one hands you a cookie shop.",[21,42498,42499,42502],{},[151,42500,42501],{},"Jumble"," is a small-batch Jamaican cookie storefront built on Void and Vue. It has a rotating weekly menu, a box builder, a cart, pickup, checkout, orders, and an admin view. You build it one real stage at a time — and every lesson embeds the actual app at that stage.",[42504,42505],"jumble-preview",{"height":42506,"stage":33463},760,[32,42508,42510],{"id":42509},"what-you-will-build","What you will build",[21,42512,42513],{},"Eight stages, one codebase:",[816,42515,42516,42522,42527,42532,42537,42542,42547,42552],{},[386,42517,42518,42521],{},[151,42519,42520],{},"Foundation"," — Void + Vue, the branded shell, and the stage route. Live now.",[386,42523,42524,42526],{},[151,42525,42348],{}," — D1, Drizzle, and a seeded rotating menu. Live now.",[386,42528,42529,42531],{},[151,42530,42357],{}," — Cookie pages, box sizes, and typed page props. Live now.",[386,42533,42534,42536],{},[151,42535,42366],{}," — KV sessions, the cart API, and a live drawer. Live now.",[386,42538,42539,42541],{},[151,42540,42375],{}," — Locations, pickup slots, validation, and orders in D1. Live now.",[386,42543,42544,42546],{},[151,42545,42384],{}," — A status page, background confirmation, and a weekly menu cron. Live now.",[386,42548,42549,42551],{},[151,42550,42393],{}," — Protected menu and order operations. Live now.",[386,42553,42554,42556],{},[151,42555,42402],{}," — R2 images, CI, the production deploy, and the final storefront. Live now.",[21,42558,42559,42560,42562,42563,42565],{},"The final app is ",[40,42561,5872],{},". Until each stage ships, ",[40,42564,42343],{}," shows the app with only the features that exist at that point. The live preview above is the real stage 8 app, not a video or a screenshot.",[32,42567,42569],{"id":42568},"how-this-series-works","How this series works",[21,42571,42572],{},"Each lesson follows the same shape:",[21,42574,42575],{},[151,42576,42577],{},"What it is → Why you'd care → What we're building → Before\u002FAfter → Do it yourself → Live stage → Gotchas → Recap.",[21,42579,42580,42581,42583,42584,42586,42587,42589],{},"The live stage is part of the lesson. It is a real iframe pointing at ",[40,42582,42343],{}," on the Jumble deployment. The blog passes ",[40,42585,42409],{}," and the stage number; the app does the rest. The code shown in the lesson is the code in ",[40,42588,42308],{},", so the preview and the source cannot drift.",[21,42591,42592],{},"The app is its own brand. Jumble is an original Jamaican bakery identity with original cookie names, copy, and art; the ordering flow is inspired by modern cookie stores, not copied from their assets or trade dress.",[32,42594,42596],{"id":42595},"before-you-start","Before you start",[383,42598,42599,42606,42611,42614],{},[386,42600,42601,42602,42605],{},"Node ",[151,42603,42604],{},"24.21+"," (Void 1.2.1 requires it).",[386,42607,42608,42610],{},[40,42609,24321],{}," and the Void CLI.",[386,42612,42613],{},"Vue 3 and TypeScript basics.",[386,42615,42616],{},"A Cloudflare account for the final deploy. Local dev only needs Node.",[21,42618,42619,42620,349,42625,349,42630,42634,42635,165],{},"Void gives us the pieces the app needs: ",[3861,42621,42624],{"href":42622,"rel":42623},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fpages-routing\u002Foverview",[3865],"Vue pages with typed loaders",[3861,42626,42629],{"href":42627,"rel":42628},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fdatabase",[3865],"D1 with Drizzle",[3861,42631,41341],{"href":42632,"rel":42633},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fkv",[3865],", queues and crons, and ",[3861,42636,42639],{"href":42637,"rel":42638},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fdeployment",[3865],[40,42640,41236],{},[32,42642,42644],{"id":42643},"start-here","Start here",[21,42646,42647,42648,42652,42653,349,42659,349,42664,349,42669,349,42674,1542,42679,42684,42685,165],{},"All eight stages are live. Start with ",[151,42649,42650],{},[3861,42651,42339],{"href":42338},", continue through ",[151,42654,42655],{},[3861,42656,42658],{"href":42657},"\u002Flearn\u002Fvoid\u002F02-the-weekly-menu","The Weekly Menu",[151,42660,42661],{},[3861,42662,42663],{"href":42356},"The Storefront",[151,42665,42666],{},[3861,42667,42668],{"href":42365},"Box + Cart",[151,42670,42671],{},[3861,42672,42673],{"href":42374},"Pickup + Checkout",[151,42675,42676],{},[3861,42677,42678],{"href":42383},"Order Status",[151,42680,42681],{},[3861,42682,42683],{"href":42392},"Admin + Auth",", then ship with ",[151,42686,42687],{},[3861,42688,42402],{"href":42401},[21,42690,42691,42692,165],{},"The final storefront is ",[40,42693,5872],{},{"title":56,"searchDepth":111,"depth":111,"links":42695},[42696,42697,42698,42699],{"id":42509,"depth":114,"text":42510},{"id":42568,"depth":114,"text":42569},{"id":42595,"depth":114,"text":42596},{"id":42643,"depth":114,"text":42644},"Build Jumble, a real Jamaican cookie storefront, across eight stages on Void, Vue, D1, and the edge. Every lesson embeds the actual stage of the app as a live preview.","Advanced",480,"\u002Fjumble-stage-1.png",{},"2026-10-26",{"title":42323,"description":42700},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002F","learn\u002Fvoid\u002Findex","MCvLLRQWoWriMaTrwS0PP7PdH-zSW9Ce3Ry87CgkN-M",[42711,43687,45047,46547,48540,50009,51069,52313],{"id":42712,"title":42713,"author":42714,"body":42715,"description":43681,"difficulty":42701,"estMinutes":3536,"extension":119,"feature":43682,"img":42703,"meta":43683,"navigation":130,"nuxtVersion":116,"order":452,"path":42338,"releaseDate":116,"seo":43684,"series":41217,"sourcePRs":116,"sourceUrl":42622,"stem":43685,"__hash__":43686},"tutorials\u002Flearn\u002Fvoid\u002F01-the-jumble-foundation.md","The Jumble Foundation: One Void App, One Deploy",{"name":9,"img":17256,"website":42491},{"type":13,"value":42716,"toc":43670},[42717,42720,42723,42727,42738,42755,42759,42762,42765,42768,42786,42789,42793,42796,42800,42803,42888,42962,43073,43194,43382,43386,43389,43406,43409,43470,43473,43487,43490,43514,43517,43528,43531,43556,43559,43574,43580,43584,43599,43602,43606,43652,43656,43659,43667],[21,42718,42719],{},"Jumble starts as a brand, a loader, and one route that can render any stage of the app. No menu yet. No cart. Just the foundation the other seven lessons will build on.",[42504,42721],{"height":42722,"stage":4798},680,[32,42724,42726],{"id":42725},"what-it-is","What it is",[21,42728,42729,42730,42733,42734,42737],{},"A Void app is a Vite app with a server. In Pages mode, ",[40,42731,42732],{},"pages\u002Findex.vue"," is the UI, and ",[40,42735,42736],{},"pages\u002Findex.server.ts"," is its server-side loader. Void renders the page on the server, sends typed props to the Vue component, and hydrates it in the browser.",[21,42739,42740,42741,23841,42744,42747,42748,349,42751,42754],{},"The stage route is the same idea with a parameter: ",[40,42742,42743],{},"pages\u002Fpreview\u002F[stage].vue",[40,42745,42746],{},"pages\u002Fpreview\u002F[stage].server.ts",". It becomes ",[40,42749,42750],{},"\u002Fpreview\u002F1",[40,42752,42753],{},"\u002Fpreview\u002F2",", and so on. The blog iframe always loads a real stage URL.",[32,42756,42758],{"id":42757},"why-youd-care","Why you'd care",[21,42760,42761],{},"A tutorial that shows screenshots rots the moment the code changes. A tutorial that embeds the app at each stage stays honest: if the menu breaks, the lesson preview breaks. The stage route also forces the app to be decomposed by feature instead of by lesson. Stage 1 is not a separate demo; it is the final app with later features not enabled yet.",[32,42763,42764],{"id":36874},"What we're building",[21,42766,42767],{},"Stage 1 is the Jumble foundation:",[383,42769,42770,42773,42776,42783],{},[386,42771,42772],{},"A warm brand shell with the Jumble wordmark and stage map.",[386,42774,42775],{},"A typed loader that returns the current stage.",[386,42777,42778,42780,42781,165],{},[40,42779,42343],{},", rendered by the same Vue component as ",[40,42782,5872],{},[386,42784,42785],{},"A deployable Void project with D1 ready for stage 2.",[21,42787,42788],{},"The branded shell matters. The app should feel like a place, not a scaffold. We use Fraunces for the display voice, DM Sans for UI, and a cream, cocoa, guava, and lime palette. The blog stays monochrome; Jumble gets to be warm.",[32,42790,42792],{"id":42791},"before","Before",[21,42794,42795],{},"A new Void Pages starter is a form and a message list. It is useful for proving the stack works, but it has no identity and no stage boundary.",[32,42797,42799],{"id":42798},"after","After",[21,42801,42802],{},"The same Void project now has:",[48,42804,42806],{"className":443,"code":42805,"language":445,"meta":56,"style":56},"apps\u002Fjumble\u002F\n├─ pages\u002F\n│  ├─ index.vue\n│  ├─ index.server.ts\n│  └─ preview\u002F\n│     ├─ [stage].vue\n│     └─ [stage].server.ts\n├─ src\u002F\n│  ├─ JumbleLanding.vue\n│  ├─ stages.ts\n│  └─ style.css\n├─ db\u002F\n│  ├─ schema.ts\n│  └─ seed.ts\n├─ vite.config.ts\n└─ void.config.ts\n",[40,42807,42808,42813,42818,42823,42828,42833,42838,42843,42848,42853,42858,42863,42868,42873,42878,42883],{"__ignoreMap":56},[449,42809,42810],{"class":451,"line":452},[449,42811,42812],{},"apps\u002Fjumble\u002F\n",[449,42814,42815],{"class":451,"line":114},[449,42816,42817],{},"├─ pages\u002F\n",[449,42819,42820],{"class":451,"line":111},[449,42821,42822],{},"│  ├─ index.vue\n",[449,42824,42825],{"class":451,"line":468},[449,42826,42827],{},"│  ├─ index.server.ts\n",[449,42829,42830],{"class":451,"line":474},[449,42831,42832],{},"│  └─ preview\u002F\n",[449,42834,42835],{"class":451,"line":480},[449,42836,42837],{},"│     ├─ [stage].vue\n",[449,42839,42840],{"class":451,"line":486},[449,42841,42842],{},"│     └─ [stage].server.ts\n",[449,42844,42845],{"class":451,"line":492},[449,42846,42847],{},"├─ src\u002F\n",[449,42849,42850],{"class":451,"line":498},[449,42851,42852],{},"│  ├─ JumbleLanding.vue\n",[449,42854,42855],{"class":451,"line":133},[449,42856,42857],{},"│  ├─ stages.ts\n",[449,42859,42860],{"class":451,"line":509},[449,42861,42862],{},"│  └─ style.css\n",[449,42864,42865],{"class":451,"line":318},[449,42866,42867],{},"├─ db\u002F\n",[449,42869,42870],{"class":451,"line":520},[449,42871,42872],{},"│  ├─ schema.ts\n",[449,42874,42875],{"class":451,"line":526},[449,42876,42877],{},"│  └─ seed.ts\n",[449,42879,42880],{"class":451,"line":532},[449,42881,42882],{},"├─ vite.config.ts\n",[449,42884,42885],{"class":451,"line":2790},[449,42886,42887],{},"└─ void.config.ts\n",[48,42889,42891],{"className":670,"code":42890,"filename":39688,"language":673,"meta":56,"style":56},"import { defineConfig } from \"vite\";\nimport { voidPlugin } from \"void\";\nimport { voidVue } from \"@void\u002Fvue\u002Fplugin\";\n\nexport default defineConfig({\n  plugins: [voidPlugin(), voidVue()],\n});\n",[40,42892,42893,42905,42917,42931,42935,42945,42958],{"__ignoreMap":56},[449,42894,42895,42897,42899,42901,42903],{"class":451,"line":452},[449,42896,681],{"class":680},[449,42898,10631],{"class":684},[449,42900,688],{"class":680},[449,42902,41162],{"class":691},[449,42904,695],{"class":684},[449,42906,42907,42909,42911,42913,42915],{"class":451,"line":114},[449,42908,681],{"class":680},[449,42910,41171],{"class":684},[449,42912,688],{"class":680},[449,42914,41176],{"class":691},[449,42916,695],{"class":684},[449,42918,42919,42921,42924,42926,42929],{"class":451,"line":111},[449,42920,681],{"class":680},[449,42922,42923],{"class":684}," { voidVue } ",[449,42925,688],{"class":680},[449,42927,42928],{"class":691}," \"@void\u002Fvue\u002Fplugin\"",[449,42930,695],{"class":684},[449,42932,42933],{"class":451,"line":468},[449,42934,700],{"emptyLinePlaceholder":130},[449,42936,42937,42939,42941,42943],{"class":451,"line":474},[449,42938,4629],{"class":680},[449,42940,4632],{"class":680},[449,42942,10651],{"class":721},[449,42944,1391],{"class":684},[449,42946,42947,42949,42951,42953,42956],{"class":451,"line":480},[449,42948,41197],{"class":684},[449,42950,41200],{"class":721},[449,42952,10892],{"class":684},[449,42954,42955],{"class":721},"voidVue",[449,42957,41203],{"class":684},[449,42959,42960],{"class":451,"line":486},[449,42961,784],{"class":684},[48,42963,42965],{"className":670,"code":42964,"filename":42736,"language":673,"meta":56,"style":56},"import { defineHandler, type InferProps } from \"void\";\nimport { LIVE_STAGE } from \"..\u002Fsrc\u002Fstages\";\n\nexport type Props = InferProps\u003Ctypeof loader>;\n\nexport const loader = defineHandler(async () => {\n  return { stage: LIVE_STAGE, embed: false };\n});\n",[40,42966,42967,42985,42999,43003,43025,43029,43052,43069],{"__ignoreMap":56},[449,42968,42969,42971,42974,42976,42979,42981,42983],{"class":451,"line":452},[449,42970,681],{"class":680},[449,42972,42973],{"class":684}," { defineHandler, ",[449,42975,3016],{"class":680},[449,42977,42978],{"class":684}," InferProps } ",[449,42980,688],{"class":680},[449,42982,41176],{"class":691},[449,42984,695],{"class":684},[449,42986,42987,42989,42992,42994,42997],{"class":451,"line":114},[449,42988,681],{"class":680},[449,42990,42991],{"class":684}," { LIVE_STAGE } ",[449,42993,688],{"class":680},[449,42995,42996],{"class":691}," \"..\u002Fsrc\u002Fstages\"",[449,42998,695],{"class":684},[449,43000,43001],{"class":451,"line":111},[449,43002,700],{"emptyLinePlaceholder":130},[449,43004,43005,43007,43009,43012,43014,43017,43019,43022],{"class":451,"line":468},[449,43006,4629],{"class":680},[449,43008,11308],{"class":680},[449,43010,43011],{"class":721}," Props",[449,43013,718],{"class":680},[449,43015,43016],{"class":721}," InferProps",[449,43018,5547],{"class":684},[449,43020,43021],{"class":680},"typeof",[449,43023,43024],{"class":684}," loader>;\n",[449,43026,43027],{"class":451,"line":474},[449,43028,700],{"emptyLinePlaceholder":130},[449,43030,43031,43033,43035,43038,43040,43042,43044,43046,43048,43050],{"class":451,"line":480},[449,43032,4629],{"class":680},[449,43034,10789],{"class":680},[449,43036,43037],{"class":714}," loader",[449,43039,718],{"class":680},[449,43041,41500],{"class":721},[449,43043,725],{"class":684},[449,43045,1485],{"class":680},[449,43047,2090],{"class":684},[449,43049,1498],{"class":680},[449,43051,1501],{"class":684},[449,43053,43054,43056,43059,43062,43065,43067],{"class":451,"line":486},[449,43055,4726],{"class":680},[449,43057,43058],{"class":684}," { stage: ",[449,43060,43061],{"class":714},"LIVE_STAGE",[449,43063,43064],{"class":684},", embed: ",[449,43066,24415],{"class":714},[449,43068,1520],{"class":684},[449,43070,43071],{"class":451,"line":492},[449,43072,784],{"class":684},[48,43074,43076],{"className":24546,"code":43075,"filename":42732,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nimport type { Props } from \".\u002Findex.server\";\nimport JumbleLanding from \"..\u002Fsrc\u002FJumbleLanding.vue\";\n\ndefineProps\u003CProps>();\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CJumbleLanding :stage=\"stage\" :embed=\"embed\" \u002F>\n\u003C\u002Ftemplate>\n",[40,43077,43078,43094,43110,43124,43128,43141,43149,43153,43161,43186],{"__ignoreMap":56},[449,43079,43080,43082,43084,43086,43088,43090,43092],{"class":451,"line":452},[449,43081,5547],{"class":684},[449,43083,23223],{"class":17370},[449,43085,24559],{"class":721},[449,43087,24562],{"class":721},[449,43089,5014],{"class":684},[449,43091,23119],{"class":691},[449,43093,23122],{"class":684},[449,43095,43096,43098,43100,43103,43105,43108],{"class":451,"line":114},[449,43097,681],{"class":680},[449,43099,11308],{"class":680},[449,43101,43102],{"class":684}," { Props } ",[449,43104,688],{"class":680},[449,43106,43107],{"class":691}," \".\u002Findex.server\"",[449,43109,695],{"class":684},[449,43111,43112,43114,43117,43119,43122],{"class":451,"line":111},[449,43113,681],{"class":680},[449,43115,43116],{"class":684}," JumbleLanding ",[449,43118,688],{"class":680},[449,43120,43121],{"class":691}," \"..\u002Fsrc\u002FJumbleLanding.vue\"",[449,43123,695],{"class":684},[449,43125,43126],{"class":451,"line":468},[449,43127,700],{"emptyLinePlaceholder":130},[449,43129,43130,43133,43135,43138],{"class":451,"line":474},[449,43131,43132],{"class":721},"defineProps",[449,43134,5547],{"class":684},[449,43136,43137],{"class":721},"Props",[449,43139,43140],{"class":684},">();\n",[449,43142,43143,43145,43147],{"class":451,"line":480},[449,43144,23220],{"class":684},[449,43146,23223],{"class":17370},[449,43148,23122],{"class":684},[449,43150,43151],{"class":451,"line":486},[449,43152,700],{"emptyLinePlaceholder":130},[449,43154,43155,43157,43159],{"class":451,"line":492},[449,43156,5547],{"class":684},[449,43158,24690],{"class":17370},[449,43160,23122],{"class":684},[449,43162,43163,43165,43168,43171,43173,43176,43179,43181,43184],{"class":451,"line":498},[449,43164,24697],{"class":684},[449,43166,43167],{"class":17370},"JumbleLanding",[449,43169,43170],{"class":721}," :stage",[449,43172,5014],{"class":684},[449,43174,43175],{"class":691},"\"stage\"",[449,43177,43178],{"class":721}," :embed",[449,43180,5014],{"class":684},[449,43182,43183],{"class":691},"\"embed\"",[449,43185,25268],{"class":684},[449,43187,43188,43190,43192],{"class":451,"line":133},[449,43189,23220],{"class":684},[449,43191,24690],{"class":17370},[449,43193,23122],{"class":684},[48,43195,43197],{"className":670,"code":43196,"filename":42746,"language":673,"meta":56,"style":56},"import { defineHandler, type InferProps } from \"void\";\nimport { LIVE_STAGE, STAGE_COUNT } from \"..\u002F..\u002Fsrc\u002Fstages\";\n\nexport type Props = InferProps\u003Ctypeof loader>;\n\nexport const loader = defineHandler(async (c) => {\n  const raw = Number(c.req.param(\"stage\"));\n  const stage = Number.isFinite(raw)\n    ? Math.min(Math.max(Math.trunc(raw), 1), STAGE_COUNT)\n    : LIVE_STAGE;\n\n  return { stage, embed: true };\n});\n",[40,43198,43199,43215,43229,43233,43251,43255,43281,43305,43323,43353,43363,43367,43378],{"__ignoreMap":56},[449,43200,43201,43203,43205,43207,43209,43211,43213],{"class":451,"line":452},[449,43202,681],{"class":680},[449,43204,42973],{"class":684},[449,43206,3016],{"class":680},[449,43208,42978],{"class":684},[449,43210,688],{"class":680},[449,43212,41176],{"class":691},[449,43214,695],{"class":684},[449,43216,43217,43219,43222,43224,43227],{"class":451,"line":114},[449,43218,681],{"class":680},[449,43220,43221],{"class":684}," { LIVE_STAGE, STAGE_COUNT } ",[449,43223,688],{"class":680},[449,43225,43226],{"class":691}," \"..\u002F..\u002Fsrc\u002Fstages\"",[449,43228,695],{"class":684},[449,43230,43231],{"class":451,"line":111},[449,43232,700],{"emptyLinePlaceholder":130},[449,43234,43235,43237,43239,43241,43243,43245,43247,43249],{"class":451,"line":468},[449,43236,4629],{"class":680},[449,43238,11308],{"class":680},[449,43240,43011],{"class":721},[449,43242,718],{"class":680},[449,43244,43016],{"class":721},[449,43246,5547],{"class":684},[449,43248,43021],{"class":680},[449,43250,43024],{"class":684},[449,43252,43253],{"class":451,"line":474},[449,43254,700],{"emptyLinePlaceholder":130},[449,43256,43257,43259,43261,43263,43265,43267,43269,43271,43273,43275,43277,43279],{"class":451,"line":480},[449,43258,4629],{"class":680},[449,43260,10789],{"class":680},[449,43262,43037],{"class":714},[449,43264,718],{"class":680},[449,43266,41500],{"class":721},[449,43268,725],{"class":684},[449,43270,1485],{"class":680},[449,43272,1913],{"class":684},[449,43274,37719],{"class":1491},[449,43276,1758],{"class":684},[449,43278,1498],{"class":680},[449,43280,1501],{"class":684},[449,43282,43283,43285,43288,43290,43293,43296,43299,43301,43303],{"class":451,"line":486},[449,43284,5048],{"class":680},[449,43286,43287],{"class":714}," raw",[449,43289,718],{"class":680},[449,43291,43292],{"class":721}," Number",[449,43294,43295],{"class":684},"(c.req.",[449,43297,43298],{"class":721},"param",[449,43300,725],{"class":684},[449,43302,43175],{"class":691},[449,43304,5183],{"class":684},[449,43306,43307,43309,43312,43314,43317,43320],{"class":451,"line":492},[449,43308,5048],{"class":680},[449,43310,43311],{"class":714}," stage",[449,43313,718],{"class":680},[449,43315,43316],{"class":684}," Number.",[449,43318,43319],{"class":721},"isFinite",[449,43321,43322],{"class":684},"(raw)\n",[449,43324,43325,43328,43330,43332,43334,43336,43338,43341,43344,43346,43348,43351],{"class":451,"line":498},[449,43326,43327],{"class":680},"    ?",[449,43329,5856],{"class":684},[449,43331,37442],{"class":721},[449,43333,38587],{"class":684},[449,43335,37432],{"class":721},[449,43337,38587],{"class":684},[449,43339,43340],{"class":721},"trunc",[449,43342,43343],{"class":684},"(raw), ",[449,43345,4798],{"class":714},[449,43347,11032],{"class":684},[449,43349,43350],{"class":714},"STAGE_COUNT",[449,43352,11185],{"class":684},[449,43354,43355,43358,43361],{"class":451,"line":133},[449,43356,43357],{"class":680},"    :",[449,43359,43360],{"class":714}," LIVE_STAGE",[449,43362,695],{"class":684},[449,43364,43365],{"class":451,"line":509},[449,43366,700],{"emptyLinePlaceholder":130},[449,43368,43369,43371,43374,43376],{"class":451,"line":318},[449,43370,4726],{"class":680},[449,43372,43373],{"class":684}," { stage, embed: ",[449,43375,2169],{"class":714},[449,43377,1520],{"class":684},[449,43379,43380],{"class":451,"line":520},[449,43381,784],{"class":684},[32,43383,43385],{"id":43384},"do-it-yourself","Do it yourself",[21,43387,43388],{},"Void 1.2.1 requires Node 24.21 or newer. Check it first:",[48,43390,43392],{"className":839,"code":43391,"language":841,"meta":56,"style":56},"node -v\n# v24.21.0 or later\n",[40,43393,43394,43401],{"__ignoreMap":56},[449,43395,43396,43398],{"class":451,"line":452},[449,43397,17076],{"class":721},[449,43399,43400],{"class":714}," -v\n",[449,43402,43403],{"class":451,"line":114},[449,43404,43405],{"class":705},"# v24.21.0 or later\n",[21,43407,43408],{},"Create the workspace app and initialise Void:",[48,43410,43412],{"className":839,"code":43411,"language":841,"meta":56,"style":56},"mkdir -p apps\u002Fjumble\ncd apps\u002Fjumble\npnpm add -D void\npnpm exec void init --toolchain vite-plus --framework vue --starter sqlite\n",[40,43413,43414,43425,43431,43441],{"__ignoreMap":56},[449,43415,43416,43419,43422],{"class":451,"line":452},[449,43417,43418],{"class":721},"mkdir",[449,43420,43421],{"class":714}," -p",[449,43423,43424],{"class":691}," apps\u002Fjumble\n",[449,43426,43427,43429],{"class":451,"line":114},[449,43428,4490],{"class":714},[449,43430,43424],{"class":691},[449,43432,43433,43435,43437,43439],{"class":451,"line":111},[449,43434,24321],{"class":721},[449,43436,2478],{"class":691},[449,43438,10594],{"class":714},[449,43440,41598],{"class":691},[449,43442,43443,43445,43448,43450,43452,43455,43458,43461,43464,43467],{"class":451,"line":468},[449,43444,24321],{"class":721},[449,43446,43447],{"class":691}," exec",[449,43449,41610],{"class":691},[449,43451,4478],{"class":691},[449,43453,43454],{"class":714}," --toolchain",[449,43456,43457],{"class":691}," vite-plus",[449,43459,43460],{"class":714}," --framework",[449,43462,43463],{"class":691}," vue",[449,43465,43466],{"class":714}," --starter",[449,43468,43469],{"class":691}," sqlite\n",[21,43471,43472],{},"Then, from the repository root:",[48,43474,43476],{"className":839,"code":43475,"language":841,"meta":56,"style":56},"pnpm install --no-frozen-lockfile\n",[40,43477,43478],{"__ignoreMap":56},[449,43479,43480,43482,43484],{"class":451,"line":452},[449,43481,24321],{"class":721},[449,43483,3706],{"class":691},[449,43485,43486],{"class":714}," --no-frozen-lockfile\n",[21,43488,43489],{},"Generate the initial D1 migration now, even though stage 1 does not query the database yet:",[48,43491,43493],{"className":839,"code":43492,"language":841,"meta":56,"style":56},"cd apps\u002Fjumble\npnpm exec void db generate\n",[40,43494,43495,43501],{"__ignoreMap":56},[449,43496,43497,43499],{"class":451,"line":452},[449,43498,4490],{"class":714},[449,43500,43424],{"class":691},[449,43502,43503,43505,43507,43509,43511],{"class":451,"line":114},[449,43504,24321],{"class":721},[449,43506,43447],{"class":691},[449,43508,41610],{"class":691},[449,43510,11475],{"class":691},[449,43512,43513],{"class":691}," generate\n",[21,43515,43516],{},"Run the app:",[48,43518,43520],{"className":839,"code":43519,"language":841,"meta":56,"style":56},"pnpm dev\n",[40,43521,43522],{"__ignoreMap":56},[449,43523,43524,43526],{"class":451,"line":452},[449,43525,24321],{"class":721},[449,43527,5300],{"class":691},[21,43529,43530],{},"Vite prints the local URL. If port 5173 is busy, it picks the next free port. Point the blog at it with:",[48,43532,43534],{"className":839,"code":43533,"language":841,"meta":56,"style":56},"NUXT_PUBLIC_JUMBLE_URL=http:\u002F\u002Flocalhost:5173 pnpm --filter @vvantol2000\u002Fweb dev\n",[40,43535,43536],{"__ignoreMap":56},[449,43537,43538,43540,43542,43545,43548,43551,43554],{"class":451,"line":452},[449,43539,42409],{"class":684},[449,43541,5014],{"class":680},[449,43543,43544],{"class":691},"http:\u002F\u002Flocalhost:5173",[449,43546,43547],{"class":721}," pnpm",[449,43549,43550],{"class":714}," --filter",[449,43552,43553],{"class":691}," @vvantol2000\u002Fweb",[449,43555,5300],{"class":691},[21,43557,43558],{},"When you are ready to deploy:",[48,43560,43562],{"className":839,"code":43561,"language":841,"meta":56,"style":56},"pnpm exec void deploy\n",[40,43563,43564],{"__ignoreMap":56},[449,43565,43566,43568,43570,43572],{"class":451,"line":452},[449,43567,24321],{"class":721},[449,43569,43447],{"class":691},[449,43571,41610],{"class":691},[449,43573,6653],{"class":691},[21,43575,43576,43577,43579],{},"Void builds the app, provisions the D1 resources it detects, applies migrations, and prints the deployment URL. Set ",[40,43578,42409],{}," to that URL in the blog environment.",[32,43581,43583],{"id":43582},"the-live-stage","The live stage",[21,43585,43586,43587,43590,43591,43594,43595,43598],{},"The preview at the top of this lesson is ",[40,43588,43589],{},"http:\u002F\u002Flocalhost:5173\u002Fpreview\u002F1?embed=1"," in development and ",[40,43592,43593],{},"https:\u002F\u002Fjumble.vantolbennett.com\u002Fpreview\u002F1?embed=1"," in production. The ",[40,43596,43597],{},"embed=1"," flag lets the app use a compact shell inside the blog.",[21,43600,43601],{},"The blog component renders the browser frame, the stage label, and the “Open app” link. The app never needs to know it is inside an iframe.",[32,43603,43605],{"id":43604},"gotchas","Gotchas",[383,43607,43608,43614,43627,43633,43642],{},[386,43609,43610,43613],{},[151,43611,43612],{},"Node version."," Void 1.2.1 wants Node 24.21+. A Node 22 runtime will install, warn, and eventually fail at the native worker layer.",[386,43615,43616,43619,43620,43623,43624,43626],{},[151,43617,43618],{},"Build scripts."," Approve ",[40,43621,43622],{},"workerd"," builds in the workspace. Without it, ",[40,43625,43622],{}," can install without its binary and the dev server will not start.",[386,43628,43629,43632],{},[151,43630,43631],{},"Stage routing."," Do not create eight apps. One app with a stage parameter keeps the data, components, and deploy in one place.",[386,43634,43635,43638,43639,43641],{},[151,43636,43637],{},"Migration warnings."," Stage 1 does not query D1, so the dev server may warn that migrations are missing. Run ",[40,43640,41704],{}," before stage 2.",[386,43643,43644,43647,43648,43651],{},[151,43645,43646],{},"Iframe limits."," Stage routes should be ",[40,43649,43650],{},"noindex",", and the deployment should allow framing only from the blog. Do that before the series is public.",[32,43653,43655],{"id":43654},"recap","Recap",[21,43657,43658],{},"You now have the smallest real version of Jumble: a branded Void + Vue app, a typed loader, a stage route, and a deployment path. Stage 2 gives it a menu.",[21,43660,43661,43662,165],{},"Next: ",[151,43663,43664],{},[3861,43665,43666],{"href":42657},"The Weekly Menu in D1",[3728,43668,43669],{},"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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":43671},[43672,43673,43674,43675,43676,43677,43678,43679,43680],{"id":42725,"depth":114,"text":42726},{"id":42757,"depth":114,"text":42758},{"id":36874,"depth":114,"text":42764},{"id":42791,"depth":114,"text":42792},{"id":42798,"depth":114,"text":42799},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Scaffold Jumble as a Void + Vue app, wire the stage route that every future lesson embeds, and ship the branded foundation of the cookie storefront.","voidPlugin + Vue Pages",{},{"title":42713,"description":43681},"learn\u002Fvoid\u002F01-the-jumble-foundation","DtCnpULLnvU9dSkc0NahibMvKDe9m81qdtF5BQtqInE",{"id":43688,"title":43689,"author":43690,"body":43691,"description":45041,"difficulty":42701,"estMinutes":4032,"extension":119,"feature":45042,"img":42703,"meta":45043,"navigation":130,"nuxtVersion":116,"order":114,"path":42657,"releaseDate":116,"seo":45044,"series":41217,"sourcePRs":116,"sourceUrl":42627,"stem":45045,"__hash__":45046},"tutorials\u002Flearn\u002Fvoid\u002F02-the-weekly-menu.md","The Weekly Menu: D1 + Drizzle in the Real Storefront",{"name":9,"img":17256,"website":42491},{"type":13,"value":43692,"toc":45027},[43693,43696,43699,43702,43704,43720,43723,43743,43746,43748,43751,43754,44023,44026,44160,44288,44292,44301,44310,44312,44316,44756,44760,44773,44793,44797,44800,44855,44858,44861,44878,44883,44886,44902,44914,44918,44933,44936,44938,44944,44950,44952,45012,45014,45017,45024],[21,43694,43695],{},"Stage 1 gave Jumble a body. Stage 2 gives it a menu.",[21,43697,43698],{},"The weekly menu is the first real data in the product: an active week, eight rotating cookie flavors, prices, descriptions, and the join table that keeps the order. All of it lives in D1 and reaches the page through a typed loader.",[42504,43700],{"height":43701,"stage":4826},720,[32,43703,42726],{"id":42725},[21,43705,43706,43707,43709,43710,1546,43713,43715,43716,43719],{},"D1 is Cloudflare's SQLite database. Void gives you a local D1 database in development and provisions the deployed one when you run ",[40,43708,41236],{},". Drizzle is the schema and query layer. Import ",[40,43711,43712],{},"db",[40,43714,41130],{},", define tables in ",[40,43717,43718],{},"db\u002Fschema.ts",", and the types flow into the loader and the page.",[21,43721,43722],{},"The menu uses three tables:",[383,43724,43725,43731,43737],{},[386,43726,43727,43730],{},[40,43728,43729],{},"weeks"," — one active week, with a label and a start\u002Fend date.",[386,43732,43733,43736],{},[40,43734,43735],{},"flavors"," — the reusable cookie catalog: slug, name, description, price, and the two colors used by the menu art.",[386,43738,43739,43742],{},[40,43740,43741],{},"week_flavors"," — the ordered join between a week and its flavors.",[21,43744,43745],{},"That join table is the part that makes the menu rotate. Next week, insert a new week and eight new join rows; the flavor catalog stays intact.",[32,43747,42758],{"id":42757},[21,43749,43750],{},"A hard-coded menu is a marketing page. A menu in the database is a product. You can change the lineup without a deploy, schedule the next week, and add a box builder against the same data later. The loader also means the menu is server-rendered: the first paint has the cookies, not a loading skeleton.",[21,43752,43753],{},"The query is one active week plus one ordered join:",[48,43755,43758],{"className":670,"code":43756,"filename":43757,"language":673,"meta":56,"style":56},"import { asc, db, eq } from \"void\u002Fdb\";\nimport { flavors, weekFlavors, weeks } from \"@schema\";\n\nexport async function getActiveMenu() {\n  const [week] = await db\n    .select()\n    .from(weeks)\n    .where(eq(weeks.isActive, 1))\n    .limit(1);\n\n  if (!week) return { week: null, flavors: [] };\n\n  const items = await db\n    .select({\n      id: flavors.id,\n      slug: flavors.slug,\n      name: flavors.name,\n      description: flavors.description,\n      priceCents: flavors.priceCents,\n      color: flavors.color,\n      accent: flavors.accent,\n    })\n    .from(weekFlavors)\n    .innerJoin(flavors, eq(weekFlavors.flavorId, flavors.id))\n    .where(eq(weekFlavors.weekId, week.id))\n    .orderBy(asc(weekFlavors.sortOrder));\n\n  return { week, flavors: items };\n}\n","src\u002Fserver\u002Fmenu.ts",[40,43759,43760,43773,43786,43790,43803,43820,43828,43837,43855,43868,43872,43894,43898,43910,43918,43923,43928,43933,43938,43943,43948,43953,43957,43966,43981,43994,44008,44012,44019],{"__ignoreMap":56},[449,43761,43762,43764,43767,43769,43771],{"class":451,"line":452},[449,43763,681],{"class":680},[449,43765,43766],{"class":684}," { asc, db, eq } ",[449,43768,688],{"class":680},[449,43770,42063],{"class":691},[449,43772,695],{"class":684},[449,43774,43775,43777,43780,43782,43784],{"class":451,"line":114},[449,43776,681],{"class":680},[449,43778,43779],{"class":684}," { flavors, weekFlavors, weeks } ",[449,43781,688],{"class":680},[449,43783,42076],{"class":691},[449,43785,695],{"class":684},[449,43787,43788],{"class":451,"line":111},[449,43789,700],{"emptyLinePlaceholder":130},[449,43791,43792,43794,43796,43798,43801],{"class":451,"line":468},[449,43793,4629],{"class":680},[449,43795,5597],{"class":680},[449,43797,5433],{"class":680},[449,43799,43800],{"class":721}," getActiveMenu",[449,43802,5439],{"class":684},[449,43804,43805,43807,43809,43812,43814,43816,43818],{"class":451,"line":474},[449,43806,5048],{"class":680},[449,43808,13639],{"class":684},[449,43810,43811],{"class":714},"week",[449,43813,34451],{"class":684},[449,43815,5014],{"class":680},[449,43817,1654],{"class":680},[449,43819,12995],{"class":684},[449,43821,43822,43824,43826],{"class":451,"line":480},[449,43823,11190],{"class":684},[449,43825,12452],{"class":721},[449,43827,11195],{"class":684},[449,43829,43830,43832,43834],{"class":451,"line":486},[449,43831,11190],{"class":684},[449,43833,688],{"class":721},[449,43835,43836],{"class":684},"(weeks)\n",[449,43838,43839,43841,43843,43845,43847,43850,43852],{"class":451,"line":492},[449,43840,11190],{"class":684},[449,43842,12461],{"class":721},[449,43844,725],{"class":684},[449,43846,13024],{"class":721},[449,43848,43849],{"class":684},"(weeks.isActive, ",[449,43851,4798],{"class":714},[449,43853,43854],{"class":684},"))\n",[449,43856,43857,43859,43862,43864,43866],{"class":451,"line":498},[449,43858,11190],{"class":684},[449,43860,43861],{"class":721},"limit",[449,43863,725],{"class":684},[449,43865,4798],{"class":714},[449,43867,740],{"class":684},[449,43869,43870],{"class":451,"line":133},[449,43871,700],{"emptyLinePlaceholder":130},[449,43873,43874,43876,43878,43880,43883,43885,43888,43891],{"class":451,"line":509},[449,43875,5080],{"class":680},[449,43877,1913],{"class":684},[449,43879,5085],{"class":680},[449,43881,43882],{"class":684},"week) ",[449,43884,37686],{"class":680},[449,43886,43887],{"class":684}," { week: ",[449,43889,43890],{"class":714},"null",[449,43892,43893],{"class":684},", flavors: [] };\n",[449,43895,43896],{"class":451,"line":318},[449,43897,700],{"emptyLinePlaceholder":130},[449,43899,43900,43902,43904,43906,43908],{"class":451,"line":520},[449,43901,5048],{"class":680},[449,43903,12443],{"class":714},[449,43905,718],{"class":680},[449,43907,1654],{"class":680},[449,43909,12995],{"class":684},[449,43911,43912,43914,43916],{"class":451,"line":526},[449,43913,11190],{"class":684},[449,43915,12452],{"class":721},[449,43917,1391],{"class":684},[449,43919,43920],{"class":451,"line":532},[449,43921,43922],{"class":684},"      id: flavors.id,\n",[449,43924,43925],{"class":451,"line":2790},[449,43926,43927],{"class":684},"      slug: flavors.slug,\n",[449,43929,43930],{"class":451,"line":3511},[449,43931,43932],{"class":684},"      name: flavors.name,\n",[449,43934,43935],{"class":451,"line":3526},[449,43936,43937],{"class":684},"      description: flavors.description,\n",[449,43939,43940],{"class":451,"line":3531},[449,43941,43942],{"class":684},"      priceCents: flavors.priceCents,\n",[449,43944,43945],{"class":451,"line":3536},[449,43946,43947],{"class":684},"      color: flavors.color,\n",[449,43949,43950],{"class":451,"line":4009},[449,43951,43952],{"class":684},"      accent: flavors.accent,\n",[449,43954,43955],{"class":451,"line":4015},[449,43956,13985],{"class":684},[449,43958,43959,43961,43963],{"class":451,"line":4021},[449,43960,11190],{"class":684},[449,43962,688],{"class":721},[449,43964,43965],{"class":684},"(weekFlavors)\n",[449,43967,43968,43970,43973,43976,43978],{"class":451,"line":4027},[449,43969,11190],{"class":684},[449,43971,43972],{"class":721},"innerJoin",[449,43974,43975],{"class":684},"(flavors, ",[449,43977,13024],{"class":721},[449,43979,43980],{"class":684},"(weekFlavors.flavorId, flavors.id))\n",[449,43982,43983,43985,43987,43989,43991],{"class":451,"line":4032},[449,43984,11190],{"class":684},[449,43986,12461],{"class":721},[449,43988,725],{"class":684},[449,43990,13024],{"class":721},[449,43992,43993],{"class":684},"(weekFlavors.weekId, week.id))\n",[449,43995,43996,43998,44000,44002,44005],{"class":451,"line":4038},[449,43997,11190],{"class":684},[449,43999,14135],{"class":721},[449,44001,725],{"class":684},[449,44003,44004],{"class":721},"asc",[449,44006,44007],{"class":684},"(weekFlavors.sortOrder));\n",[449,44009,44010],{"class":451,"line":4044},[449,44011,700],{"emptyLinePlaceholder":130},[449,44013,44014,44016],{"class":451,"line":4049},[449,44015,4726],{"class":680},[449,44017,44018],{"class":684}," { week, flavors: items };\n",[449,44020,44021],{"class":451,"line":4054},[449,44022,4604],{"class":684},[21,44024,44025],{},"The page loader returns the result as props:",[48,44027,44029],{"className":670,"code":44028,"filename":42736,"language":673,"meta":56,"style":56},"import { defineHandler, type InferProps } from \"void\";\nimport { CURRENT_STAGE } from \"..\u002Fsrc\u002Fstages\";\nimport { getActiveMenu } from \"..\u002Fsrc\u002Fserver\u002Fmenu\";\n\nexport type Props = InferProps\u003Ctypeof loader>;\n\nexport const loader = defineHandler(async () => {\n  const menu = await getActiveMenu();\n  return { stage: CURRENT_STAGE, embed: false, ...menu };\n});\n",[40,44030,44031,44047,44060,44074,44078,44096,44100,44122,44136,44156],{"__ignoreMap":56},[449,44032,44033,44035,44037,44039,44041,44043,44045],{"class":451,"line":452},[449,44034,681],{"class":680},[449,44036,42973],{"class":684},[449,44038,3016],{"class":680},[449,44040,42978],{"class":684},[449,44042,688],{"class":680},[449,44044,41176],{"class":691},[449,44046,695],{"class":684},[449,44048,44049,44051,44054,44056,44058],{"class":451,"line":114},[449,44050,681],{"class":680},[449,44052,44053],{"class":684}," { CURRENT_STAGE } ",[449,44055,688],{"class":680},[449,44057,42996],{"class":691},[449,44059,695],{"class":684},[449,44061,44062,44064,44067,44069,44072],{"class":451,"line":111},[449,44063,681],{"class":680},[449,44065,44066],{"class":684}," { getActiveMenu } ",[449,44068,688],{"class":680},[449,44070,44071],{"class":691}," \"..\u002Fsrc\u002Fserver\u002Fmenu\"",[449,44073,695],{"class":684},[449,44075,44076],{"class":451,"line":468},[449,44077,700],{"emptyLinePlaceholder":130},[449,44079,44080,44082,44084,44086,44088,44090,44092,44094],{"class":451,"line":474},[449,44081,4629],{"class":680},[449,44083,11308],{"class":680},[449,44085,43011],{"class":721},[449,44087,718],{"class":680},[449,44089,43016],{"class":721},[449,44091,5547],{"class":684},[449,44093,43021],{"class":680},[449,44095,43024],{"class":684},[449,44097,44098],{"class":451,"line":480},[449,44099,700],{"emptyLinePlaceholder":130},[449,44101,44102,44104,44106,44108,44110,44112,44114,44116,44118,44120],{"class":451,"line":486},[449,44103,4629],{"class":680},[449,44105,10789],{"class":680},[449,44107,43037],{"class":714},[449,44109,718],{"class":680},[449,44111,41500],{"class":721},[449,44113,725],{"class":684},[449,44115,1485],{"class":680},[449,44117,2090],{"class":684},[449,44119,1498],{"class":680},[449,44121,1501],{"class":684},[449,44123,44124,44126,44128,44130,44132,44134],{"class":451,"line":492},[449,44125,5048],{"class":680},[449,44127,15064],{"class":714},[449,44129,718],{"class":680},[449,44131,1654],{"class":680},[449,44133,43800],{"class":721},[449,44135,1322],{"class":684},[449,44137,44138,44140,44142,44145,44147,44149,44151,44153],{"class":451,"line":498},[449,44139,4726],{"class":680},[449,44141,43058],{"class":684},[449,44143,44144],{"class":714},"CURRENT_STAGE",[449,44146,43064],{"class":684},[449,44148,24415],{"class":714},[449,44150,349],{"class":684},[449,44152,14230],{"class":680},[449,44154,44155],{"class":684},"menu };\n",[449,44157,44158],{"class":451,"line":133},[449,44159,784],{"class":684},[48,44161,44163],{"className":24546,"code":44162,"filename":42732,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nimport type { Props } from \".\u002Findex.server\";\nimport JumbleMenu from \"..\u002Fsrc\u002FJumbleMenu.vue\";\n\ndefineProps\u003CProps>();\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CJumbleMenu :stage=\"stage\" :embed=\"embed\" :week=\"week\" :flavors=\"flavors\" \u002F>\n\u003C\u002Ftemplate>\n",[40,44164,44165,44181,44195,44209,44213,44223,44231,44235,44243,44280],{"__ignoreMap":56},[449,44166,44167,44169,44171,44173,44175,44177,44179],{"class":451,"line":452},[449,44168,5547],{"class":684},[449,44170,23223],{"class":17370},[449,44172,24559],{"class":721},[449,44174,24562],{"class":721},[449,44176,5014],{"class":684},[449,44178,23119],{"class":691},[449,44180,23122],{"class":684},[449,44182,44183,44185,44187,44189,44191,44193],{"class":451,"line":114},[449,44184,681],{"class":680},[449,44186,11308],{"class":680},[449,44188,43102],{"class":684},[449,44190,688],{"class":680},[449,44192,43107],{"class":691},[449,44194,695],{"class":684},[449,44196,44197,44199,44202,44204,44207],{"class":451,"line":111},[449,44198,681],{"class":680},[449,44200,44201],{"class":684}," JumbleMenu ",[449,44203,688],{"class":680},[449,44205,44206],{"class":691}," \"..\u002Fsrc\u002FJumbleMenu.vue\"",[449,44208,695],{"class":684},[449,44210,44211],{"class":451,"line":468},[449,44212,700],{"emptyLinePlaceholder":130},[449,44214,44215,44217,44219,44221],{"class":451,"line":474},[449,44216,43132],{"class":721},[449,44218,5547],{"class":684},[449,44220,43137],{"class":721},[449,44222,43140],{"class":684},[449,44224,44225,44227,44229],{"class":451,"line":480},[449,44226,23220],{"class":684},[449,44228,23223],{"class":17370},[449,44230,23122],{"class":684},[449,44232,44233],{"class":451,"line":486},[449,44234,700],{"emptyLinePlaceholder":130},[449,44236,44237,44239,44241],{"class":451,"line":492},[449,44238,5547],{"class":684},[449,44240,24690],{"class":17370},[449,44242,23122],{"class":684},[449,44244,44245,44247,44250,44252,44254,44256,44258,44260,44262,44265,44267,44270,44273,44275,44278],{"class":451,"line":498},[449,44246,24697],{"class":684},[449,44248,44249],{"class":17370},"JumbleMenu",[449,44251,43170],{"class":721},[449,44253,5014],{"class":684},[449,44255,43175],{"class":691},[449,44257,43178],{"class":721},[449,44259,5014],{"class":684},[449,44261,43183],{"class":691},[449,44263,44264],{"class":721}," :week",[449,44266,5014],{"class":684},[449,44268,44269],{"class":691},"\"week\"",[449,44271,44272],{"class":721}," :flavors",[449,44274,5014],{"class":684},[449,44276,44277],{"class":691},"\"flavors\"",[449,44279,25268],{"class":684},[449,44281,44282,44284,44286],{"class":451,"line":133},[449,44283,23220],{"class":684},[449,44285,24690],{"class":17370},[449,44287,23122],{"class":684},[32,44289,44291],{"id":44290},"before-after","Before \u002F after",[21,44293,44294,44295,44297,44298,44300],{},"Before stage 2, ",[40,44296,5872],{}," was the foundation page: brand, roadmap, and no data. ",[40,44299,42750],{}," still is that page, preserved for lesson 1.",[21,44302,44303,44304,44306,44307,44309],{},"After stage 2, ",[40,44305,5872],{}," is the menu. ",[40,44308,42753],{}," is the same menu in embed mode for this lesson. The stage 1 preview still works because the preview route branches on the stage number before it touches D1.",[32,44311,43385],{"id":43384},[2808,44313,44315],{"id":44314},"_1-define-the-tables","1. Define the tables",[48,44317,44319],{"className":670,"code":44318,"filename":43718,"language":673,"meta":56,"style":56},"import { integer, sqliteTable, text } from \"void\u002Fschema-d1\";\n\nexport const weeks = sqliteTable(\"weeks\", {\n  id: integer(\"id\").primaryKey({ autoIncrement: true }),\n  label: text(\"label\").notNull(),\n  startsOn: text(\"starts_on\").notNull(),\n  endsOn: text(\"ends_on\").notNull(),\n  isActive: integer(\"is_active\").notNull().default(0),\n});\n\nexport const flavors = sqliteTable(\"flavors\", {\n  id: integer(\"id\").primaryKey({ autoIncrement: true }),\n  slug: text(\"slug\").notNull().unique(),\n  name: text(\"name\").notNull(),\n  description: text(\"description\").notNull(),\n  priceCents: integer(\"price_cents\").notNull(),\n  color: text(\"color\").notNull(),\n  accent: text(\"accent\").notNull(),\n});\n\nexport const weekFlavors = sqliteTable(\"week_flavors\", {\n  id: integer(\"id\").primaryKey({ autoIncrement: true }),\n  weekId: integer(\"week_id\").notNull().references(() => weeks.id, { onDelete: \"cascade\" }),\n  flavorId: integer(\"flavor_id\").notNull().references(() => flavors.id, { onDelete: \"cascade\" }),\n  sortOrder: integer(\"sort_order\").notNull().default(0),\n});\n",[40,44320,44321,44335,44339,44359,44380,44398,44416,44434,44460,44464,44468,44487,44507,44529,44545,44561,44579,44597,44615,44619,44623,44643,44663,44695,44726,44752],{"__ignoreMap":56},[449,44322,44323,44325,44328,44330,44333],{"class":451,"line":452},[449,44324,681],{"class":680},[449,44326,44327],{"class":684}," { integer, sqliteTable, text } ",[449,44329,688],{"class":680},[449,44331,44332],{"class":691}," \"void\u002Fschema-d1\"",[449,44334,695],{"class":684},[449,44336,44337],{"class":451,"line":114},[449,44338,700],{"emptyLinePlaceholder":130},[449,44340,44341,44343,44345,44348,44350,44352,44354,44357],{"class":451,"line":111},[449,44342,4629],{"class":680},[449,44344,10789],{"class":680},[449,44346,44347],{"class":714}," weeks",[449,44349,718],{"class":680},[449,44351,10797],{"class":721},[449,44353,725],{"class":684},[449,44355,44356],{"class":691},"\"weeks\"",[449,44358,768],{"class":684},[449,44360,44361,44363,44365,44367,44369,44371,44373,44376,44378],{"class":451,"line":468},[449,44362,10809],{"class":684},[449,44364,10903],{"class":721},[449,44366,725],{"class":684},[449,44368,10816],{"class":691},[449,44370,374],{"class":684},[449,44372,10821],{"class":721},[449,44374,44375],{"class":684},"({ autoIncrement: ",[449,44377,2169],{"class":714},[449,44379,3479],{"class":684},[449,44381,44382,44385,44387,44389,44392,44394,44396],{"class":451,"line":474},[449,44383,44384],{"class":684},"  label: ",[449,44386,53],{"class":721},[449,44388,725],{"class":684},[449,44390,44391],{"class":691},"\"label\"",[449,44393,374],{"class":684},[449,44395,10839],{"class":721},[449,44397,1624],{"class":684},[449,44399,44400,44403,44405,44407,44410,44412,44414],{"class":451,"line":480},[449,44401,44402],{"class":684},"  startsOn: ",[449,44404,53],{"class":721},[449,44406,725],{"class":684},[449,44408,44409],{"class":691},"\"starts_on\"",[449,44411,374],{"class":684},[449,44413,10839],{"class":721},[449,44415,1624],{"class":684},[449,44417,44418,44421,44423,44425,44428,44430,44432],{"class":451,"line":486},[449,44419,44420],{"class":684},"  endsOn: ",[449,44422,53],{"class":721},[449,44424,725],{"class":684},[449,44426,44427],{"class":691},"\"ends_on\"",[449,44429,374],{"class":684},[449,44431,10839],{"class":721},[449,44433,1624],{"class":684},[449,44435,44436,44439,44441,44443,44446,44448,44450,44452,44454,44456,44458],{"class":451,"line":492},[449,44437,44438],{"class":684},"  isActive: ",[449,44440,10903],{"class":721},[449,44442,725],{"class":684},[449,44444,44445],{"class":691},"\"is_active\"",[449,44447,374],{"class":684},[449,44449,10839],{"class":721},[449,44451,5237],{"class":684},[449,44453,10920],{"class":721},[449,44455,725],{"class":684},[449,44457,9899],{"class":714},[449,44459,1613],{"class":684},[449,44461,44462],{"class":451,"line":498},[449,44463,784],{"class":684},[449,44465,44466],{"class":451,"line":133},[449,44467,700],{"emptyLinePlaceholder":130},[449,44469,44470,44472,44474,44477,44479,44481,44483,44485],{"class":451,"line":509},[449,44471,4629],{"class":680},[449,44473,10789],{"class":680},[449,44475,44476],{"class":714}," flavors",[449,44478,718],{"class":680},[449,44480,10797],{"class":721},[449,44482,725],{"class":684},[449,44484,44277],{"class":691},[449,44486,768],{"class":684},[449,44488,44489,44491,44493,44495,44497,44499,44501,44503,44505],{"class":451,"line":318},[449,44490,10809],{"class":684},[449,44492,10903],{"class":721},[449,44494,725],{"class":684},[449,44496,10816],{"class":691},[449,44498,374],{"class":684},[449,44500,10821],{"class":721},[449,44502,44375],{"class":684},[449,44504,2169],{"class":714},[449,44506,3479],{"class":684},[449,44508,44509,44512,44514,44516,44519,44521,44523,44525,44527],{"class":451,"line":520},[449,44510,44511],{"class":684},"  slug: ",[449,44513,53],{"class":721},[449,44515,725],{"class":684},[449,44517,44518],{"class":691},"\"slug\"",[449,44520,374],{"class":684},[449,44522,10839],{"class":721},[449,44524,5237],{"class":684},[449,44526,27598],{"class":721},[449,44528,1624],{"class":684},[449,44530,44531,44533,44535,44537,44539,44541,44543],{"class":451,"line":526},[449,44532,1396],{"class":684},[449,44534,53],{"class":721},[449,44536,725],{"class":684},[449,44538,10834],{"class":691},[449,44540,374],{"class":684},[449,44542,10839],{"class":721},[449,44544,1624],{"class":684},[449,44546,44547,44549,44551,44553,44555,44557,44559],{"class":451,"line":532},[449,44548,1406],{"class":684},[449,44550,53],{"class":721},[449,44552,725],{"class":684},[449,44554,10852],{"class":691},[449,44556,374],{"class":684},[449,44558,10839],{"class":721},[449,44560,1624],{"class":684},[449,44562,44563,44566,44568,44570,44573,44575,44577],{"class":451,"line":2790},[449,44564,44565],{"class":684},"  priceCents: ",[449,44567,10903],{"class":721},[449,44569,725],{"class":684},[449,44571,44572],{"class":691},"\"price_cents\"",[449,44574,374],{"class":684},[449,44576,10839],{"class":721},[449,44578,1624],{"class":684},[449,44580,44581,44584,44586,44588,44591,44593,44595],{"class":451,"line":3511},[449,44582,44583],{"class":684},"  color: ",[449,44585,53],{"class":721},[449,44587,725],{"class":684},[449,44589,44590],{"class":691},"\"color\"",[449,44592,374],{"class":684},[449,44594,10839],{"class":721},[449,44596,1624],{"class":684},[449,44598,44599,44602,44604,44606,44609,44611,44613],{"class":451,"line":3526},[449,44600,44601],{"class":684},"  accent: ",[449,44603,53],{"class":721},[449,44605,725],{"class":684},[449,44607,44608],{"class":691},"\"accent\"",[449,44610,374],{"class":684},[449,44612,10839],{"class":721},[449,44614,1624],{"class":684},[449,44616,44617],{"class":451,"line":3531},[449,44618,784],{"class":684},[449,44620,44621],{"class":451,"line":3536},[449,44622,700],{"emptyLinePlaceholder":130},[449,44624,44625,44627,44629,44632,44634,44636,44638,44641],{"class":451,"line":4009},[449,44626,4629],{"class":680},[449,44628,10789],{"class":680},[449,44630,44631],{"class":714}," weekFlavors",[449,44633,718],{"class":680},[449,44635,10797],{"class":721},[449,44637,725],{"class":684},[449,44639,44640],{"class":691},"\"week_flavors\"",[449,44642,768],{"class":684},[449,44644,44645,44647,44649,44651,44653,44655,44657,44659,44661],{"class":451,"line":4015},[449,44646,10809],{"class":684},[449,44648,10903],{"class":721},[449,44650,725],{"class":684},[449,44652,10816],{"class":691},[449,44654,374],{"class":684},[449,44656,10821],{"class":721},[449,44658,44375],{"class":684},[449,44660,2169],{"class":714},[449,44662,3479],{"class":684},[449,44664,44665,44668,44670,44672,44675,44677,44679,44681,44683,44685,44687,44690,44693],{"class":451,"line":4021},[449,44666,44667],{"class":684},"  weekId: ",[449,44669,10903],{"class":721},[449,44671,725],{"class":684},[449,44673,44674],{"class":691},"\"week_id\"",[449,44676,374],{"class":684},[449,44678,10839],{"class":721},[449,44680,5237],{"class":684},[449,44682,11202],{"class":721},[449,44684,4717],{"class":684},[449,44686,1498],{"class":680},[449,44688,44689],{"class":684}," weeks.id, { onDelete: ",[449,44691,44692],{"class":691},"\"cascade\"",[449,44694,3479],{"class":684},[449,44696,44697,44700,44702,44704,44707,44709,44711,44713,44715,44717,44719,44722,44724],{"class":451,"line":4027},[449,44698,44699],{"class":684},"  flavorId: ",[449,44701,10903],{"class":721},[449,44703,725],{"class":684},[449,44705,44706],{"class":691},"\"flavor_id\"",[449,44708,374],{"class":684},[449,44710,10839],{"class":721},[449,44712,5237],{"class":684},[449,44714,11202],{"class":721},[449,44716,4717],{"class":684},[449,44718,1498],{"class":680},[449,44720,44721],{"class":684}," flavors.id, { onDelete: ",[449,44723,44692],{"class":691},[449,44725,3479],{"class":684},[449,44727,44728,44731,44733,44735,44738,44740,44742,44744,44746,44748,44750],{"class":451,"line":4032},[449,44729,44730],{"class":684},"  sortOrder: ",[449,44732,10903],{"class":721},[449,44734,725],{"class":684},[449,44736,44737],{"class":691},"\"sort_order\"",[449,44739,374],{"class":684},[449,44741,10839],{"class":721},[449,44743,5237],{"class":684},[449,44745,10920],{"class":721},[449,44747,725],{"class":684},[449,44749,9899],{"class":714},[449,44751,1613],{"class":684},[449,44753,44754],{"class":451,"line":4038},[449,44755,784],{"class":684},[2808,44757,44759],{"id":44758},"_2-generate-the-migration","2. Generate the migration",[48,44761,44763],{"className":839,"code":44762,"language":841,"meta":56,"style":56},"void db generate\n",[40,44764,44765],{"__ignoreMap":56},[449,44766,44767,44769,44771],{"class":451,"line":452},[449,44768,41217],{"class":721},[449,44770,11475],{"class":691},[449,44772,43513],{"class":691},[21,44774,44775,44776,44779,44780,44783,44784,349,44786,1542,44788,44790,44791,165],{},"Because we removed the starter ",[40,44777,44778],{},"messages"," table, Drizzle may ask whether the new tables are renames. Choose ",[151,44781,44782],{},"create table"," for ",[40,44785,43735],{},[40,44787,43741],{},[40,44789,43729],{},". The generated SQL creates the three tables and drops ",[40,44792,44778],{},[2808,44794,44796],{"id":44795},"_3-seed-the-menu","3. Seed the menu",[21,44798,44799],{},"Keep the seed in SQL so the same file runs locally and against the deployed database:",[48,44801,44805],{"className":44802,"code":44803,"filename":44804,"language":10952,"meta":56,"style":56},"language-sql shiki shiki-themes github-light github-dark","INSERT OR REPLACE INTO weeks (id, label, starts_on, ends_on, is_active) VALUES\n  (1, 'Week of October 26', '2026-10-26', '2026-11-01', 1);\n\nINSERT OR REPLACE INTO flavors (id, slug, name, description, price_cents, color, accent) VALUES\n  (1, 'sorrel-snickerdoodle', 'Sorrel Snickerdoodle', 'Cinnamon sugar cookie with a bright sorrel glaze.', 425, '#C94C3D', '#F3D9D2'),\n  (2, 'coconut-drops', 'Coconut Drops', 'Toasted coconut, brown sugar, and a chewy center.', 400, '#E8D5B5', '#7A4B2A');\n\nINSERT OR REPLACE INTO week_flavors (id, week_id, flavor_id, sort_order) VALUES\n  (1, 1, 1, 1),\n  (2, 1, 2, 2);\n","db\u002Fseed.sql",[40,44806,44807,44812,44817,44821,44826,44831,44836,44840,44845,44850],{"__ignoreMap":56},[449,44808,44809],{"class":451,"line":452},[449,44810,44811],{},"INSERT OR REPLACE INTO weeks (id, label, starts_on, ends_on, is_active) VALUES\n",[449,44813,44814],{"class":451,"line":114},[449,44815,44816],{},"  (1, 'Week of October 26', '2026-10-26', '2026-11-01', 1);\n",[449,44818,44819],{"class":451,"line":111},[449,44820,700],{"emptyLinePlaceholder":130},[449,44822,44823],{"class":451,"line":468},[449,44824,44825],{},"INSERT OR REPLACE INTO flavors (id, slug, name, description, price_cents, color, accent) VALUES\n",[449,44827,44828],{"class":451,"line":474},[449,44829,44830],{},"  (1, 'sorrel-snickerdoodle', 'Sorrel Snickerdoodle', 'Cinnamon sugar cookie with a bright sorrel glaze.', 425, '#C94C3D', '#F3D9D2'),\n",[449,44832,44833],{"class":451,"line":480},[449,44834,44835],{},"  (2, 'coconut-drops', 'Coconut Drops', 'Toasted coconut, brown sugar, and a chewy center.', 400, '#E8D5B5', '#7A4B2A');\n",[449,44837,44838],{"class":451,"line":486},[449,44839,700],{"emptyLinePlaceholder":130},[449,44841,44842],{"class":451,"line":492},[449,44843,44844],{},"INSERT OR REPLACE INTO week_flavors (id, week_id, flavor_id, sort_order) VALUES\n",[449,44846,44847],{"class":451,"line":498},[449,44848,44849],{},"  (1, 1, 1, 1),\n",[449,44851,44852],{"class":451,"line":133},[449,44853,44854],{},"  (2, 1, 2, 2);\n",[21,44856,44857],{},"The real file has all eight cookies.",[21,44859,44860],{},"Local:",[48,44862,44864],{"className":839,"code":44863,"language":841,"meta":56,"style":56},"void db seed --yes\n",[40,44865,44866],{"__ignoreMap":56},[449,44867,44868,44870,44872,44875],{"class":451,"line":452},[449,44869,41217],{"class":721},[449,44871,11475],{"class":691},[449,44873,44874],{"class":691}," seed",[449,44876,44877],{"class":714}," --yes\n",[21,44879,44880,44881,165],{},"This resets the local D1 database, applies migrations, and runs ",[40,44882,44804],{},[21,44884,44885],{},"Deployed:",[48,44887,44889],{"className":839,"code":44888,"language":841,"meta":56,"style":56},"void deploy --platform cloudflare\n",[40,44890,44891],{"__ignoreMap":56},[449,44892,44893,44895,44897,44899],{"class":451,"line":452},[449,44894,41217],{"class":721},[449,44896,41658],{"class":691},[449,44898,8896],{"class":714},[449,44900,44901],{"class":691}," cloudflare\n",[21,44903,44904,44905,44908,44909,2425,44911,44913],{},"The production seed is a ",[151,44906,44907],{},"data migration"," that mirrors ",[40,44910,44804],{},[40,44912,41236],{}," applies it with the schema migration, so the deployed database has the active week and the eight flavors without a second command. Keeping it in a migration means every environment starts from the same menu.",[2808,44915,44917],{"id":44916},"_4-visit-the-menu","4. Visit the menu",[48,44919,44921],{"className":443,"code":44920,"language":445,"meta":56,"style":56},"http:\u002F\u002Flocalhost:5173\u002F\nhttp:\u002F\u002Flocalhost:5173\u002Fpreview\u002F2\n",[40,44922,44923,44928],{"__ignoreMap":56},[449,44924,44925],{"class":451,"line":452},[449,44926,44927],{},"http:\u002F\u002Flocalhost:5173\u002F\n",[449,44929,44930],{"class":451,"line":114},[449,44931,44932],{},"http:\u002F\u002Flocalhost:5173\u002Fpreview\u002F2\n",[21,44934,44935],{},"The full app and the stage preview use the same loader and the same component.",[32,44937,43583],{"id":43582},[21,44939,44940,44941,44943],{},"The preview above points at ",[40,44942,42753],{}," on the deployed app. The menu is rendered from D1, not from a hard-coded array. If a flavor is missing from the join table, it disappears from the menu; if a new week is active, the page follows it.",[21,44945,44946,44947,44949],{},"Stage 1 remains available at ",[40,44948,42750],{}," for lesson 1.",[32,44951,43605],{"id":43604},[383,44953,44954,44966,44972,44982,44992,45006],{},[386,44955,44956,44962,44963,44965],{},[151,44957,44958,44961],{},[40,44959,44960],{},"void db seed"," is local."," Production uses the seed migration. If you change the menu, update ",[40,44964,44804],{}," and add a new migration with the same inserts; do not rely on hand-editing the deployed database.",[386,44967,44968,44971],{},[151,44969,44970],{},"The migration prompt is real."," When tables are removed and added, Drizzle asks whether they are renames. A new menu table is a create, not a rename.",[386,44973,44974,44977,44978,44981],{},[151,44975,44976],{},"Use cents."," Store money as integers (",[40,44979,44980],{},"price_cents",") and format at the edge of the UI. Floating-point prices become a bad time later.",[386,44983,44984,44987,44988,44991],{},[151,44985,44986],{},"One active week."," The loader takes the first row where ",[40,44989,44990],{},"is_active = 1",". Stage 6 adds the automation that flips the active week on a cron.",[386,44993,44994,44997,44998,45001,45002,45005],{},[151,44995,44996],{},"Destructive migrations need a pragma."," If a migration drops the starter table or seeds with ",[40,44999,45000],{},"INSERT OR REPLACE",", add ",[40,45003,45004],{},"-- void:allow-destructive"," at the top. Void blocks it otherwise.",[386,45007,45008,45011],{},[151,45009,45010],{},"The stage 1 preview must stay data-free."," It does not query D1, so lesson 1 keeps working even when the menu changes.",[32,45013,43655],{"id":43654},[21,45015,45016],{},"Jumble now has a real catalog in D1, a typed query, and a menu that renders on the server. The stage route proves the same code can show a historical state of the product.",[21,45018,43661,45019,45023],{},[151,45020,45021],{},[3861,45022,42663],{"href":42356}," — cookie pages, box sizes, and the first add-to-box controls.",[3728,45025,45026],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":56,"searchDepth":111,"depth":111,"links":45028},[45029,45030,45031,45032,45038,45039,45040],{"id":42725,"depth":114,"text":42726},{"id":42757,"depth":114,"text":42758},{"id":44290,"depth":114,"text":44291},{"id":43384,"depth":114,"text":43385,"children":45033},[45034,45035,45036,45037],{"id":44314,"depth":111,"text":44315},{"id":44758,"depth":111,"text":44759},{"id":44795,"depth":111,"text":44796},{"id":44916,"depth":111,"text":44917},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Model Jumble's rotating menu in D1, seed it locally and remotely, and render the first real cookie storefront through a typed Void loader.","D1 + Drizzle + typed loader",{},{"title":43689,"description":45041},"learn\u002Fvoid\u002F02-the-weekly-menu","QJE5N4gD5lgS-r_18AUIoZREYAdoE7ZsRTKbqyhOgvE",{"id":45048,"title":45049,"author":45050,"body":45051,"description":46541,"difficulty":42701,"estMinutes":4032,"extension":119,"feature":46542,"img":42703,"meta":46543,"navigation":130,"nuxtVersion":116,"order":111,"path":42356,"releaseDate":116,"seo":46544,"series":41217,"sourcePRs":116,"sourceUrl":42622,"stem":46545,"__hash__":46546},"tutorials\u002Flearn\u002Fvoid\u002F03-the-storefront.md","The Storefront: Cookie Pages and Box Sizes",{"name":9,"img":17256,"website":42491},{"type":13,"value":45052,"toc":46529},[45053,45056,45063,45065,45067,45070,45088,45091,45093,45096,45107,45111,45114,45282,45285,45289,45567,45731,45740,45744,45747,46197,46200,46204,46207,46385,46395,46397,46400,46410,46413,46432,46442,46445,46459,46462,46464,46470,46473,46475,46514,46516,46519,46526],[21,45054,45055],{},"Stage 2 put the menu on the page. Stage 3 makes each cookie a destination.",[21,45057,45058,45059,45062],{},"Every card in the menu now links to ",[40,45060,45061],{},"\u002Fcookies\u002F:slug",". The cookie page gets its data from the same active week, shows the description and price, and lets the reader choose a 4, 6, or 12-pack. The box selection is client state for now; stage 4 turns it into a KV-backed cart.",[42504,45064],{"height":42506,"stage":4849},[32,45066,42726],{"id":42725},[21,45068,45069],{},"Three pieces make the storefront:",[816,45071,45072,45082,45085],{},[386,45073,45074,45075,45078,45079,165],{},"A dynamic page: ",[40,45076,45077],{},"pages\u002Fcookies\u002F[slug].vue"," plus ",[40,45080,45081],{},"pages\u002Fcookies\u002F[slug].server.ts",[386,45083,45084],{},"A loader that reads the active menu, finds the flavor by slug, and returns the cookie, the week, and the box sizes as typed props.",[386,45086,45087],{},"A client-side box selector that updates the selected box and total without navigating.",[21,45089,45090],{},"There is no schema change in this stage. The cookie page is a different view of the data you already seeded.",[32,45092,42758],{"id":42757},[21,45094,45095],{},"A menu card is a teaser. A cookie page is where the product becomes real: the description, the price, the box math, and the eventual add-to-cart action. It also gives every cookie a shareable URL and a real server-rendered page.",[21,45097,45098,45099,45102,45103,45106],{},"The loader returns the same ",[40,45100,45101],{},"MenuFlavor"," shape used by the menu, plus the ",[40,45104,45105],{},"BoxSize"," options. The page component does not import the database, and the database does not know the page exists.",[32,45108,45110],{"id":45109},"box-sizes","Box sizes",[21,45112,45113],{},"Keep the box offer in one typed place. It is product configuration, not a database row yet:",[48,45115,45118],{"className":670,"code":45116,"filename":45117,"language":673,"meta":56,"style":56},"export type BoxSize = {\n  size: number;\n  label: string;\n  priceCents: number;\n  note: string;\n};\n\nexport const BOX_SIZES: BoxSize[] = [\n  { size: 4, label: \"4-pack\", priceCents: 1600, note: \"A small box for a quiet afternoon.\" },\n  { size: 6, label: \"6-pack\", priceCents: 2250, note: \"The table box.\" },\n  { size: 12, label: \"12-pack\", priceCents: 4200, note: \"The party box.\" },\n];\n","src\u002Fboxes.ts",[40,45119,45120,45133,45144,45155,45166,45177,45181,45185,45204,45231,45254,45278],{"__ignoreMap":56},[449,45121,45122,45124,45126,45129,45131],{"class":451,"line":452},[449,45123,4629],{"class":680},[449,45125,11308],{"class":680},[449,45127,45128],{"class":721}," BoxSize",[449,45130,718],{"class":680},[449,45132,1501],{"class":684},[449,45134,45135,45138,45140,45142],{"class":451,"line":114},[449,45136,45137],{"class":1491},"  size",[449,45139,3070],{"class":680},[449,45141,4975],{"class":714},[449,45143,695],{"class":684},[449,45145,45146,45149,45151,45153],{"class":451,"line":111},[449,45147,45148],{"class":1491},"  label",[449,45150,3070],{"class":680},[449,45152,6081],{"class":714},[449,45154,695],{"class":684},[449,45156,45157,45160,45162,45164],{"class":451,"line":468},[449,45158,45159],{"class":1491},"  priceCents",[449,45161,3070],{"class":680},[449,45163,4975],{"class":714},[449,45165,695],{"class":684},[449,45167,45168,45171,45173,45175],{"class":451,"line":474},[449,45169,45170],{"class":1491},"  note",[449,45172,3070],{"class":680},[449,45174,6081],{"class":714},[449,45176,695],{"class":684},[449,45178,45179],{"class":451,"line":480},[449,45180,20963],{"class":684},[449,45182,45183],{"class":451,"line":486},[449,45184,700],{"emptyLinePlaceholder":130},[449,45186,45187,45189,45191,45194,45196,45198,45200,45202],{"class":451,"line":492},[449,45188,4629],{"class":680},[449,45190,10789],{"class":680},[449,45192,45193],{"class":714}," BOX_SIZES",[449,45195,3070],{"class":680},[449,45197,45128],{"class":721},[449,45199,5011],{"class":684},[449,45201,5014],{"class":680},[449,45203,4790],{"class":684},[449,45205,45206,45209,45211,45214,45217,45220,45223,45226,45229],{"class":451,"line":498},[449,45207,45208],{"class":684},"  { size: ",[449,45210,4873],{"class":714},[449,45212,45213],{"class":684},", label: ",[449,45215,45216],{"class":691},"\"4-pack\"",[449,45218,45219],{"class":684},", priceCents: ",[449,45221,45222],{"class":714},"1600",[449,45224,45225],{"class":684},", note: ",[449,45227,45228],{"class":691},"\"A small box for a quiet afternoon.\"",[449,45230,4819],{"class":684},[449,45232,45233,45235,45237,45239,45242,45244,45247,45249,45252],{"class":451,"line":133},[449,45234,45208],{"class":684},[449,45236,33432],{"class":714},[449,45238,45213],{"class":684},[449,45240,45241],{"class":691},"\"6-pack\"",[449,45243,45219],{"class":684},[449,45245,45246],{"class":714},"2250",[449,45248,45225],{"class":684},[449,45250,45251],{"class":691},"\"The table box.\"",[449,45253,4819],{"class":684},[449,45255,45256,45258,45261,45263,45266,45268,45271,45273,45276],{"class":451,"line":509},[449,45257,45208],{"class":684},[449,45259,45260],{"class":714},"12",[449,45262,45213],{"class":684},[449,45264,45265],{"class":691},"\"12-pack\"",[449,45267,45219],{"class":684},[449,45269,45270],{"class":714},"4200",[449,45272,45225],{"class":684},[449,45274,45275],{"class":691},"\"The party box.\"",[449,45277,4819],{"class":684},[449,45279,45280],{"class":451,"line":318},[449,45281,4917],{"class":684},[21,45283,45284],{},"When boxes need per-store pricing or promotions, this moves into D1. For the storefront stage, a typed constant is the honest amount of complexity.",[32,45286,45288],{"id":45287},"the-dynamic-route","The dynamic route",[48,45290,45292],{"className":670,"code":45291,"filename":45081,"language":673,"meta":56,"style":56},"import { defineHandler, type InferProps } from \"void\";\nimport { BOX_SIZES } from \"..\u002F..\u002Fsrc\u002Fboxes\";\nimport { CURRENT_STAGE } from \"..\u002F..\u002Fsrc\u002Fstages\";\nimport { getActiveMenu } from \"..\u002F..\u002Fsrc\u002Fserver\u002Fmenu\";\n\nexport type Props = InferProps\u003Ctypeof loader>;\n\nexport const loader = defineHandler(async (c) => {\n  const slug = c.req.param(\"slug\");\n  const embed = c.req.query(\"embed\") === \"1\";\n  const menu = await getActiveMenu();\n  const flavor = menu.flavors.find((item) => item.slug === slug) ?? null;\n\n  return {\n    stage: CURRENT_STAGE,\n    embed,\n    week: menu.week,\n    flavor,\n    boxes: BOX_SIZES,\n    backHref: embed ? \"\u002Fmenu?embed=1\" : \"\u002Fmenu\",\n  };\n});\n",[40,45293,45294,45310,45324,45336,45349,45353,45371,45375,45401,45421,45447,45461,45497,45501,45507,45516,45521,45526,45531,45541,45559,45563],{"__ignoreMap":56},[449,45295,45296,45298,45300,45302,45304,45306,45308],{"class":451,"line":452},[449,45297,681],{"class":680},[449,45299,42973],{"class":684},[449,45301,3016],{"class":680},[449,45303,42978],{"class":684},[449,45305,688],{"class":680},[449,45307,41176],{"class":691},[449,45309,695],{"class":684},[449,45311,45312,45314,45317,45319,45322],{"class":451,"line":114},[449,45313,681],{"class":680},[449,45315,45316],{"class":684}," { BOX_SIZES } ",[449,45318,688],{"class":680},[449,45320,45321],{"class":691}," \"..\u002F..\u002Fsrc\u002Fboxes\"",[449,45323,695],{"class":684},[449,45325,45326,45328,45330,45332,45334],{"class":451,"line":111},[449,45327,681],{"class":680},[449,45329,44053],{"class":684},[449,45331,688],{"class":680},[449,45333,43226],{"class":691},[449,45335,695],{"class":684},[449,45337,45338,45340,45342,45344,45347],{"class":451,"line":468},[449,45339,681],{"class":680},[449,45341,44066],{"class":684},[449,45343,688],{"class":680},[449,45345,45346],{"class":691}," \"..\u002F..\u002Fsrc\u002Fserver\u002Fmenu\"",[449,45348,695],{"class":684},[449,45350,45351],{"class":451,"line":474},[449,45352,700],{"emptyLinePlaceholder":130},[449,45354,45355,45357,45359,45361,45363,45365,45367,45369],{"class":451,"line":480},[449,45356,4629],{"class":680},[449,45358,11308],{"class":680},[449,45360,43011],{"class":721},[449,45362,718],{"class":680},[449,45364,43016],{"class":721},[449,45366,5547],{"class":684},[449,45368,43021],{"class":680},[449,45370,43024],{"class":684},[449,45372,45373],{"class":451,"line":486},[449,45374,700],{"emptyLinePlaceholder":130},[449,45376,45377,45379,45381,45383,45385,45387,45389,45391,45393,45395,45397,45399],{"class":451,"line":492},[449,45378,4629],{"class":680},[449,45380,10789],{"class":680},[449,45382,43037],{"class":714},[449,45384,718],{"class":680},[449,45386,41500],{"class":721},[449,45388,725],{"class":684},[449,45390,1485],{"class":680},[449,45392,1913],{"class":684},[449,45394,37719],{"class":1491},[449,45396,1758],{"class":684},[449,45398,1498],{"class":680},[449,45400,1501],{"class":684},[449,45402,45403,45405,45408,45410,45413,45415,45417,45419],{"class":451,"line":498},[449,45404,5048],{"class":680},[449,45406,45407],{"class":714}," slug",[449,45409,718],{"class":680},[449,45411,45412],{"class":684}," c.req.",[449,45414,43298],{"class":721},[449,45416,725],{"class":684},[449,45418,44518],{"class":691},[449,45420,740],{"class":684},[449,45422,45423,45425,45428,45430,45432,45434,45436,45438,45440,45442,45445],{"class":451,"line":133},[449,45424,5048],{"class":680},[449,45426,45427],{"class":714}," embed",[449,45429,718],{"class":680},[449,45431,45412],{"class":684},[449,45433,23617],{"class":721},[449,45435,725],{"class":684},[449,45437,43183],{"class":691},[449,45439,1758],{"class":684},[449,45441,37592],{"class":680},[449,45443,45444],{"class":691}," \"1\"",[449,45446,695],{"class":684},[449,45448,45449,45451,45453,45455,45457,45459],{"class":451,"line":509},[449,45450,5048],{"class":680},[449,45452,15064],{"class":714},[449,45454,718],{"class":680},[449,45456,1654],{"class":680},[449,45458,43800],{"class":721},[449,45460,1322],{"class":684},[449,45462,45463,45465,45468,45470,45473,45475,45477,45479,45481,45483,45486,45488,45491,45493,45495],{"class":451,"line":318},[449,45464,5048],{"class":680},[449,45466,45467],{"class":714}," flavor",[449,45469,718],{"class":680},[449,45471,45472],{"class":684}," menu.flavors.",[449,45474,37464],{"class":721},[449,45476,5164],{"class":684},[449,45478,13080],{"class":1491},[449,45480,1758],{"class":684},[449,45482,1498],{"class":680},[449,45484,45485],{"class":684}," item.slug ",[449,45487,37592],{"class":680},[449,45489,45490],{"class":684}," slug) ",[449,45492,734],{"class":680},[449,45494,27020],{"class":714},[449,45496,695],{"class":684},[449,45498,45499],{"class":451,"line":520},[449,45500,700],{"emptyLinePlaceholder":130},[449,45502,45503,45505],{"class":451,"line":526},[449,45504,4726],{"class":680},[449,45506,1501],{"class":684},[449,45508,45509,45512,45514],{"class":451,"line":532},[449,45510,45511],{"class":684},"    stage: ",[449,45513,44144],{"class":714},[449,45515,779],{"class":684},[449,45517,45518],{"class":451,"line":2790},[449,45519,45520],{"class":684},"    embed,\n",[449,45522,45523],{"class":451,"line":3511},[449,45524,45525],{"class":684},"    week: menu.week,\n",[449,45527,45528],{"class":451,"line":3526},[449,45529,45530],{"class":684},"    flavor,\n",[449,45532,45533,45536,45539],{"class":451,"line":3531},[449,45534,45535],{"class":684},"    boxes: ",[449,45537,45538],{"class":714},"BOX_SIZES",[449,45540,779],{"class":684},[449,45542,45543,45546,45549,45552,45554,45557],{"class":451,"line":3536},[449,45544,45545],{"class":684},"    backHref: embed ",[449,45547,45548],{"class":680},"?",[449,45550,45551],{"class":691}," \"\u002Fmenu?embed=1\"",[449,45553,38510],{"class":680},[449,45555,45556],{"class":691}," \"\u002Fmenu\"",[449,45558,779],{"class":684},[449,45560,45561],{"class":451,"line":4009},[449,45562,4763],{"class":684},[449,45564,45565],{"class":451,"line":4015},[449,45566,784],{"class":684},[48,45568,45570],{"className":24546,"code":45569,"filename":45077,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nimport type { Props } from \".\u002F[slug].server\";\nimport JumbleCookie from \"..\u002F..\u002Fsrc\u002FJumbleCookie.vue\";\n\ndefineProps\u003CProps>();\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CJumbleCookie\n    :stage=\"stage\"\n    :embed=\"embed\"\n    :week=\"week\"\n    :flavor=\"flavor\"\n    :boxes=\"boxes\"\n    :back-href=\"backHref\"\n  \u002F>\n\u003C\u002Ftemplate>\n",[40,45571,45572,45588,45603,45617,45621,45631,45639,45643,45651,45658,45668,45678,45688,45698,45708,45718,45723],{"__ignoreMap":56},[449,45573,45574,45576,45578,45580,45582,45584,45586],{"class":451,"line":452},[449,45575,5547],{"class":684},[449,45577,23223],{"class":17370},[449,45579,24559],{"class":721},[449,45581,24562],{"class":721},[449,45583,5014],{"class":684},[449,45585,23119],{"class":691},[449,45587,23122],{"class":684},[449,45589,45590,45592,45594,45596,45598,45601],{"class":451,"line":114},[449,45591,681],{"class":680},[449,45593,11308],{"class":680},[449,45595,43102],{"class":684},[449,45597,688],{"class":680},[449,45599,45600],{"class":691}," \".\u002F[slug].server\"",[449,45602,695],{"class":684},[449,45604,45605,45607,45610,45612,45615],{"class":451,"line":111},[449,45606,681],{"class":680},[449,45608,45609],{"class":684}," JumbleCookie ",[449,45611,688],{"class":680},[449,45613,45614],{"class":691}," \"..\u002F..\u002Fsrc\u002FJumbleCookie.vue\"",[449,45616,695],{"class":684},[449,45618,45619],{"class":451,"line":468},[449,45620,700],{"emptyLinePlaceholder":130},[449,45622,45623,45625,45627,45629],{"class":451,"line":474},[449,45624,43132],{"class":721},[449,45626,5547],{"class":684},[449,45628,43137],{"class":721},[449,45630,43140],{"class":684},[449,45632,45633,45635,45637],{"class":451,"line":480},[449,45634,23220],{"class":684},[449,45636,23223],{"class":17370},[449,45638,23122],{"class":684},[449,45640,45641],{"class":451,"line":486},[449,45642,700],{"emptyLinePlaceholder":130},[449,45644,45645,45647,45649],{"class":451,"line":492},[449,45646,5547],{"class":684},[449,45648,24690],{"class":17370},[449,45650,23122],{"class":684},[449,45652,45653,45655],{"class":451,"line":498},[449,45654,24697],{"class":684},[449,45656,45657],{"class":17370},"JumbleCookie\n",[449,45659,45660,45663,45665],{"class":451,"line":133},[449,45661,45662],{"class":721},"    :stage",[449,45664,5014],{"class":684},[449,45666,45667],{"class":691},"\"stage\"\n",[449,45669,45670,45673,45675],{"class":451,"line":509},[449,45671,45672],{"class":721},"    :embed",[449,45674,5014],{"class":684},[449,45676,45677],{"class":691},"\"embed\"\n",[449,45679,45680,45683,45685],{"class":451,"line":318},[449,45681,45682],{"class":721},"    :week",[449,45684,5014],{"class":684},[449,45686,45687],{"class":691},"\"week\"\n",[449,45689,45690,45693,45695],{"class":451,"line":520},[449,45691,45692],{"class":721},"    :flavor",[449,45694,5014],{"class":684},[449,45696,45697],{"class":691},"\"flavor\"\n",[449,45699,45700,45703,45705],{"class":451,"line":526},[449,45701,45702],{"class":721},"    :boxes",[449,45704,5014],{"class":684},[449,45706,45707],{"class":691},"\"boxes\"\n",[449,45709,45710,45713,45715],{"class":451,"line":532},[449,45711,45712],{"class":721},"    :back-href",[449,45714,5014],{"class":684},[449,45716,45717],{"class":691},"\"backHref\"\n",[449,45719,45720],{"class":451,"line":2790},[449,45721,45722],{"class":684},"  \u002F>\n",[449,45724,45725,45727,45729],{"class":451,"line":3511},[449,45726,23220],{"class":684},[449,45728,24690],{"class":17370},[449,45730,23122],{"class":684},[21,45732,1556,45733,45736,45737,165],{},[40,45734,45735],{},"embed"," query is only for the lesson preview. The real route uses the normal storefront shell and the back link goes to ",[40,45738,45739],{},"\u002Fmenu",[32,45741,45743],{"id":45742},"the-box-selector","The box selector",[21,45745,45746],{},"The selector is local component state. It changes the selected box and the displayed total; the add button stays disabled until stage 4 gives it a cart to write to.",[48,45748,45750],{"className":24546,"code":45749,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\nconst props = defineProps\u003C{ boxes: BoxSize[] }>();\n\nconst selectedSize = ref(props.boxes[1]?.size ?? 4);\nconst selectedBox = computed(\n  () => props.boxes.find((box) => box.size === selectedSize.value) ?? props.boxes[0] ?? null,\n);\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cfieldset class=\"box-picker\">\n    \u003Clegend>Choose a box\u003C\u002Flegend>\n    \u003Cdiv class=\"box-options\">\n      \u003Cbutton\n        v-for=\"box in boxes\"\n        :key=\"box.size\"\n        type=\"button\"\n        class=\"box-option\"\n        :class=\"{ 'is-selected': selectedSize === box.size }\"\n        :aria-pressed=\"selectedSize === box.size\"\n        @click=\"selectedSize = box.size\"\n      >\n        \u003Cspan class=\"box-label\">{{ box.label }}\u003C\u002Fspan>\n        \u003Cspan class=\"box-size\">{{ box.size }} cookies\u003C\u002Fspan>\n        \u003Cspan class=\"box-price\">{{ price(box.priceCents) }}\u003C\u002Fspan>\n      \u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  \u003C\u002Ffieldset>\n\n  \u003Cp v-if=\"selectedBox\">Selected: {{ selectedBox.label }} · {{ price(selectedBox.priceCents) }}\u003C\u002Fp>\n\n  \u003Cbutton type=\"button\" class=\"btn\" disabled>Add to box — stage 4\u003C\u002Fbutton>\n\u003C\u002Ftemplate>\n",[40,45751,45752,45768,45782,45786,45810,45814,45840,45854,45898,45902,45910,45914,45922,45938,45952,45967,45974,45984,45994,46004,46014,46024,46034,46044,46048,46068,46088,46108,46116,46124,46132,46136,46156,46160,46189],{"__ignoreMap":56},[449,45753,45754,45756,45758,45760,45762,45764,45766],{"class":451,"line":452},[449,45755,5547],{"class":684},[449,45757,23223],{"class":17370},[449,45759,24559],{"class":721},[449,45761,24562],{"class":721},[449,45763,5014],{"class":684},[449,45765,23119],{"class":691},[449,45767,23122],{"class":684},[449,45769,45770,45772,45775,45777,45780],{"class":451,"line":114},[449,45771,681],{"class":680},[449,45773,45774],{"class":684}," { computed, ref } ",[449,45776,688],{"class":680},[449,45778,45779],{"class":691}," \"vue\"",[449,45781,695],{"class":684},[449,45783,45784],{"class":451,"line":111},[449,45785,700],{"emptyLinePlaceholder":130},[449,45787,45788,45790,45793,45795,45798,45800,45803,45805,45807],{"class":451,"line":468},[449,45789,711],{"class":680},[449,45791,45792],{"class":714}," props",[449,45794,718],{"class":680},[449,45796,45797],{"class":721}," defineProps",[449,45799,23909],{"class":684},[449,45801,45802],{"class":1491},"boxes",[449,45804,3070],{"class":680},[449,45806,45128],{"class":721},[449,45808,45809],{"class":684},"[] }>();\n",[449,45811,45812],{"class":451,"line":474},[449,45813,700],{"emptyLinePlaceholder":130},[449,45815,45816,45818,45821,45823,45825,45828,45830,45833,45835,45838],{"class":451,"line":480},[449,45817,711],{"class":680},[449,45819,45820],{"class":714}," selectedSize",[449,45822,718],{"class":680},[449,45824,23510],{"class":721},[449,45826,45827],{"class":684},"(props.boxes[",[449,45829,4798],{"class":714},[449,45831,45832],{"class":684},"]?.size ",[449,45834,734],{"class":680},[449,45836,45837],{"class":714}," 4",[449,45839,740],{"class":684},[449,45841,45842,45844,45847,45849,45852],{"class":451,"line":486},[449,45843,711],{"class":680},[449,45845,45846],{"class":714}," selectedBox",[449,45848,718],{"class":680},[449,45850,45851],{"class":721}," computed",[449,45853,5567],{"class":684},[449,45855,45856,45859,45861,45864,45866,45868,45871,45873,45875,45878,45880,45883,45885,45888,45890,45892,45894,45896],{"class":451,"line":492},[449,45857,45858],{"class":684},"  () ",[449,45860,1498],{"class":680},[449,45862,45863],{"class":684}," props.boxes.",[449,45865,37464],{"class":721},[449,45867,5164],{"class":684},[449,45869,45870],{"class":1491},"box",[449,45872,1758],{"class":684},[449,45874,1498],{"class":680},[449,45876,45877],{"class":684}," box.size ",[449,45879,37592],{"class":680},[449,45881,45882],{"class":684}," selectedSize.value) ",[449,45884,734],{"class":680},[449,45886,45887],{"class":684}," props.boxes[",[449,45889,9899],{"class":714},[449,45891,34451],{"class":684},[449,45893,734],{"class":680},[449,45895,27020],{"class":714},[449,45897,779],{"class":684},[449,45899,45900],{"class":451,"line":498},[449,45901,740],{"class":684},[449,45903,45904,45906,45908],{"class":451,"line":133},[449,45905,23220],{"class":684},[449,45907,23223],{"class":17370},[449,45909,23122],{"class":684},[449,45911,45912],{"class":451,"line":509},[449,45913,700],{"emptyLinePlaceholder":130},[449,45915,45916,45918,45920],{"class":451,"line":318},[449,45917,5547],{"class":684},[449,45919,24690],{"class":17370},[449,45921,23122],{"class":684},[449,45923,45924,45926,45929,45931,45933,45936],{"class":451,"line":520},[449,45925,24697],{"class":684},[449,45927,45928],{"class":17370},"fieldset",[449,45930,29391],{"class":721},[449,45932,5014],{"class":684},[449,45934,45935],{"class":691},"\"box-picker\"",[449,45937,23122],{"class":684},[449,45939,45940,45942,45945,45948,45950],{"class":451,"line":526},[449,45941,24706],{"class":684},[449,45943,45944],{"class":17370},"legend",[449,45946,45947],{"class":684},">Choose a box\u003C\u002F",[449,45949,45944],{"class":17370},[449,45951,23122],{"class":684},[449,45953,45954,45956,45958,45960,45962,45965],{"class":451,"line":532},[449,45955,24706],{"class":684},[449,45957,29388],{"class":17370},[449,45959,29391],{"class":721},[449,45961,5014],{"class":684},[449,45963,45964],{"class":691},"\"box-options\"",[449,45966,23122],{"class":684},[449,45968,45969,45971],{"class":451,"line":2790},[449,45970,24736],{"class":684},[449,45972,45973],{"class":17370},"button\n",[449,45975,45976,45979,45981],{"class":451,"line":3511},[449,45977,45978],{"class":721},"        v-for",[449,45980,5014],{"class":684},[449,45982,45983],{"class":691},"\"box in boxes\"\n",[449,45985,45986,45989,45991],{"class":451,"line":3526},[449,45987,45988],{"class":721},"        :key",[449,45990,5014],{"class":684},[449,45992,45993],{"class":691},"\"box.size\"\n",[449,45995,45996,45999,46001],{"class":451,"line":3531},[449,45997,45998],{"class":721},"        type",[449,46000,5014],{"class":684},[449,46002,46003],{"class":691},"\"button\"\n",[449,46005,46006,46009,46011],{"class":451,"line":3536},[449,46007,46008],{"class":721},"        class",[449,46010,5014],{"class":684},[449,46012,46013],{"class":691},"\"box-option\"\n",[449,46015,46016,46019,46021],{"class":451,"line":4009},[449,46017,46018],{"class":721},"        :class",[449,46020,5014],{"class":684},[449,46022,46023],{"class":691},"\"{ 'is-selected': selectedSize === box.size }\"\n",[449,46025,46026,46029,46031],{"class":451,"line":4015},[449,46027,46028],{"class":721},"        :aria-pressed",[449,46030,5014],{"class":684},[449,46032,46033],{"class":691},"\"selectedSize === box.size\"\n",[449,46035,46036,46039,46041],{"class":451,"line":4021},[449,46037,46038],{"class":721},"        @click",[449,46040,5014],{"class":684},[449,46042,46043],{"class":691},"\"selectedSize = box.size\"\n",[449,46045,46046],{"class":451,"line":4027},[449,46047,34325],{"class":684},[449,46049,46050,46052,46054,46056,46058,46061,46064,46066],{"class":451,"line":4032},[449,46051,29452],{"class":684},[449,46053,449],{"class":17370},[449,46055,29391],{"class":721},[449,46057,5014],{"class":684},[449,46059,46060],{"class":691},"\"box-label\"",[449,46062,46063],{"class":684},">{{ box.label }}\u003C\u002F",[449,46065,449],{"class":17370},[449,46067,23122],{"class":684},[449,46069,46070,46072,46074,46076,46078,46081,46084,46086],{"class":451,"line":4038},[449,46071,29452],{"class":684},[449,46073,449],{"class":17370},[449,46075,29391],{"class":721},[449,46077,5014],{"class":684},[449,46079,46080],{"class":691},"\"box-size\"",[449,46082,46083],{"class":684},">{{ box.size }} cookies\u003C\u002F",[449,46085,449],{"class":17370},[449,46087,23122],{"class":684},[449,46089,46090,46092,46094,46096,46098,46101,46104,46106],{"class":451,"line":4044},[449,46091,29452],{"class":684},[449,46093,449],{"class":17370},[449,46095,29391],{"class":721},[449,46097,5014],{"class":684},[449,46099,46100],{"class":691},"\"box-price\"",[449,46102,46103],{"class":684},">{{ price(box.priceCents) }}\u003C\u002F",[449,46105,449],{"class":17370},[449,46107,23122],{"class":684},[449,46109,46110,46112,46114],{"class":451,"line":4049},[449,46111,24767],{"class":684},[449,46113,24739],{"class":17370},[449,46115,23122],{"class":684},[449,46117,46118,46120,46122],{"class":451,"line":4054},[449,46119,24776],{"class":684},[449,46121,29388],{"class":17370},[449,46123,23122],{"class":684},[449,46125,46126,46128,46130],{"class":451,"line":4059},[449,46127,24785],{"class":684},[449,46129,45928],{"class":17370},[449,46131,23122],{"class":684},[449,46133,46134],{"class":451,"line":4065},[449,46135,700],{"emptyLinePlaceholder":130},[449,46137,46138,46140,46142,46144,46146,46149,46152,46154],{"class":451,"line":4070},[449,46139,24697],{"class":684},[449,46141,21],{"class":17370},[449,46143,24998],{"class":721},[449,46145,5014],{"class":684},[449,46147,46148],{"class":691},"\"selectedBox\"",[449,46150,46151],{"class":684},">Selected: {{ selectedBox.label }} · {{ price(selectedBox.priceCents) }}\u003C\u002F",[449,46153,21],{"class":17370},[449,46155,23122],{"class":684},[449,46157,46158],{"class":451,"line":4075},[449,46159,700],{"emptyLinePlaceholder":130},[449,46161,46162,46164,46166,46168,46170,46173,46175,46177,46179,46182,46185,46187],{"class":451,"line":4081},[449,46163,24697],{"class":684},[449,46165,24739],{"class":17370},[449,46167,11308],{"class":721},[449,46169,5014],{"class":684},[449,46171,46172],{"class":691},"\"button\"",[449,46174,29391],{"class":721},[449,46176,5014],{"class":684},[449,46178,31472],{"class":691},[449,46180,46181],{"class":721}," disabled",[449,46183,46184],{"class":684},">Add to box — stage 4\u003C\u002F",[449,46186,24739],{"class":17370},[449,46188,23122],{"class":684},[449,46190,46191,46193,46195],{"class":451,"line":4086},[449,46192,23220],{"class":684},[449,46194,24690],{"class":17370},[449,46196,23122],{"class":684},[21,46198,46199],{},"The actual component also renders the cookie art, the breadcrumb, the price, and the stage footnote.",[32,46201,46203],{"id":46202},"wiring-the-menu","Wiring the menu",[21,46205,46206],{},"The full app links each menu card to its cookie page. The stage 2 preview deliberately keeps the cards inert, because the storefront is a stage 3 feature:",[48,46208,46210],{"className":24546,"code":46209,"language":23763,"meta":56,"style":56},"\u003Cscript setup lang=\"ts\">\nimport { Link } from \"@void\u002Fvue\";\n\nconst cardComponent = computed(() => (displayStage >= 3 ? Link : \"div\"));\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Ccomponent\n    :is=\"cardComponent\"\n    v-for=\"flavor in flavors\"\n    :key=\"flavor.slug\"\n    :href=\"displayStage >= 3 ? `\u002Fcookies\u002F${flavor.slug}` : undefined\"\n    class=\"menu-card\"\n  >\n    \u003C!-- cookie art + card body -->\n  \u003C\u002Fcomponent>\n\u003C\u002Ftemplate>\n",[40,46211,46212,46228,46242,46246,46281,46289,46293,46301,46308,46318,46328,46338,46348,46358,46363,46368,46377],{"__ignoreMap":56},[449,46213,46214,46216,46218,46220,46222,46224,46226],{"class":451,"line":452},[449,46215,5547],{"class":684},[449,46217,23223],{"class":17370},[449,46219,24559],{"class":721},[449,46221,24562],{"class":721},[449,46223,5014],{"class":684},[449,46225,23119],{"class":691},[449,46227,23122],{"class":684},[449,46229,46230,46232,46235,46237,46240],{"class":451,"line":114},[449,46231,681],{"class":680},[449,46233,46234],{"class":684}," { Link } ",[449,46236,688],{"class":680},[449,46238,46239],{"class":691}," \"@void\u002Fvue\"",[449,46241,695],{"class":684},[449,46243,46244],{"class":451,"line":111},[449,46245,700],{"emptyLinePlaceholder":130},[449,46247,46248,46250,46253,46255,46257,46259,46261,46264,46266,46269,46271,46274,46276,46279],{"class":451,"line":468},[449,46249,711],{"class":680},[449,46251,46252],{"class":714}," cardComponent",[449,46254,718],{"class":680},[449,46256,45851],{"class":721},[449,46258,4717],{"class":684},[449,46260,1498],{"class":680},[449,46262,46263],{"class":684}," (displayStage ",[449,46265,5614],{"class":680},[449,46267,46268],{"class":714}," 3",[449,46270,38489],{"class":680},[449,46272,46273],{"class":684}," Link ",[449,46275,3070],{"class":680},[449,46277,46278],{"class":691}," \"div\"",[449,46280,5183],{"class":684},[449,46282,46283,46285,46287],{"class":451,"line":474},[449,46284,23220],{"class":684},[449,46286,23223],{"class":17370},[449,46288,23122],{"class":684},[449,46290,46291],{"class":451,"line":480},[449,46292,700],{"emptyLinePlaceholder":130},[449,46294,46295,46297,46299],{"class":451,"line":486},[449,46296,5547],{"class":684},[449,46298,24690],{"class":17370},[449,46300,23122],{"class":684},[449,46302,46303,46305],{"class":451,"line":492},[449,46304,24697],{"class":684},[449,46306,46307],{"class":17370},"component\n",[449,46309,46310,46313,46315],{"class":451,"line":498},[449,46311,46312],{"class":721},"    :is",[449,46314,5014],{"class":684},[449,46316,46317],{"class":691},"\"cardComponent\"\n",[449,46319,46320,46323,46325],{"class":451,"line":133},[449,46321,46322],{"class":721},"    v-for",[449,46324,5014],{"class":684},[449,46326,46327],{"class":691},"\"flavor in flavors\"\n",[449,46329,46330,46333,46335],{"class":451,"line":509},[449,46331,46332],{"class":721},"    :key",[449,46334,5014],{"class":684},[449,46336,46337],{"class":691},"\"flavor.slug\"\n",[449,46339,46340,46343,46345],{"class":451,"line":318},[449,46341,46342],{"class":721},"    :href",[449,46344,5014],{"class":684},[449,46346,46347],{"class":691},"\"displayStage >= 3 ? `\u002Fcookies\u002F${flavor.slug}` : undefined\"\n",[449,46349,46350,46353,46355],{"class":451,"line":520},[449,46351,46352],{"class":721},"    class",[449,46354,5014],{"class":684},[449,46356,46357],{"class":691},"\"menu-card\"\n",[449,46359,46360],{"class":451,"line":526},[449,46361,46362],{"class":684},"  >\n",[449,46364,46365],{"class":451,"line":532},[449,46366,46367],{"class":705},"    \u003C!-- cookie art + card body -->\n",[449,46369,46370,46372,46375],{"class":451,"line":2790},[449,46371,24785],{"class":684},[449,46373,46374],{"class":17370},"component",[449,46376,23122],{"class":684},[449,46378,46379,46381,46383],{"class":451,"line":3511},[449,46380,23220],{"class":684},[449,46382,24690],{"class":17370},[449,46384,23122],{"class":684},[21,46386,46387,46390,46391,46394],{},[40,46388,46389],{},"Link"," comes from ",[40,46392,46393],{},"@void\u002Fvue"," and keeps page navigation inside the Void app.",[32,46396,43385],{"id":43384},[21,46398,46399],{},"No migration is needed. The table from stage 2 already has everything.",[48,46401,46402],{"className":839,"code":43519,"language":841,"meta":56,"style":56},[40,46403,46404],{"__ignoreMap":56},[449,46405,46406,46408],{"class":451,"line":452},[449,46407,24321],{"class":721},[449,46409,5300],{"class":691},[21,46411,46412],{},"Open:",[48,46414,46416],{"className":443,"code":46415,"language":445,"meta":56,"style":56},"http:\u002F\u002Flocalhost:5173\u002F\nhttp:\u002F\u002Flocalhost:5173\u002Fcookies\u002Fsorrel-snickerdoodle\nhttp:\u002F\u002Flocalhost:5173\u002Fpreview\u002F3\n",[40,46417,46418,46422,46427],{"__ignoreMap":56},[449,46419,46420],{"class":451,"line":452},[449,46421,44927],{},[449,46423,46424],{"class":451,"line":114},[449,46425,46426],{},"http:\u002F\u002Flocalhost:5173\u002Fcookies\u002Fsorrel-snickerdoodle\n",[449,46428,46429],{"class":451,"line":111},[449,46430,46431],{},"http:\u002F\u002Flocalhost:5173\u002Fpreview\u002F3\n",[21,46433,46434,46435,46437,46438,46441],{},"The full app at ",[40,46436,5872],{}," is the menu with live links. ",[40,46439,46440],{},"\u002Fpreview\u002F3"," is the cookie page in embed mode for this lesson.",[21,46443,46444],{},"Deploy:",[48,46446,46447],{"className":839,"code":44888,"language":841,"meta":56,"style":56},[40,46448,46449],{"__ignoreMap":56},[449,46450,46451,46453,46455,46457],{"class":451,"line":452},[449,46452,41217],{"class":721},[449,46454,41658],{"class":691},[449,46456,8896],{"class":714},[449,46458,44901],{"class":691},[21,46460,46461],{},"The deploy applies no new migrations; it just ships the new routes and components.",[32,46463,43583],{"id":43582},[21,46465,46466,46467,46469],{},"The preview above is ",[40,46468,46440],{},", rendered from the active week and the first flavor. The full app lets you open any of the eight cookies, change the box, and see the total update.",[21,46471,46472],{},"The box selection is intentionally not persisted. Stage 4 adds the KV session and the cart; the disabled button becomes real.",[32,46474,43605],{"id":43604},[383,46476,46477,46486,46492,46502,46508],{},[386,46478,46479,25398,46482,46485],{},[151,46480,46481],{},"Dynamic params are server data.",[40,46483,46484],{},"c.req.param(\"slug\")"," is the source of truth, not the client route. A flavor that is not in the active week gets the not-found state.",[386,46487,46488,46491],{},[151,46489,46490],{},"No schema change means no migration guilt."," Stage 3 is routes and UI; do not invent a table for three constants.",[386,46493,46494,46497,46498,46501],{},[151,46495,46496],{},"Cents, not floats."," The box total is ",[40,46499,46500],{},"priceCents"," all the way to the formatter.",[386,46503,46504,46507],{},[151,46505,46506],{},"Do not fake the cart."," The disabled button is deliberate. Stage 4 earns the interaction with KV persistence.",[386,46509,46510,46513],{},[151,46511,46512],{},"The stage 2 menu stays inert in preview."," If you link the cards at stage 2, the preview jumps into a stage 3 route and the stage boundary becomes a lie.",[32,46515,43655],{"id":43654},[21,46517,46518],{},"Jumble now has a real storefront: the menu, shareable cookie pages, typed props, and a box selector. The only missing piece is persistence.",[21,46520,43661,46521,46525],{},[151,46522,46523],{},[3861,46524,42668],{"href":42365}," — KV sessions, a real cart drawer, and a box that survives a refresh.",[3728,46527,46528],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":46530},[46531,46532,46533,46534,46535,46536,46537,46538,46539,46540],{"id":42725,"depth":114,"text":42726},{"id":42757,"depth":114,"text":42758},{"id":45109,"depth":114,"text":45110},{"id":45287,"depth":114,"text":45288},{"id":45742,"depth":114,"text":45743},{"id":46202,"depth":114,"text":46203},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Turn the weekly menu into a real storefront with dynamic cookie pages, typed page props, and a working 4\u002F6\u002F12 box selector.","Dynamic routes + box sizes",{},{"title":45049,"description":46541},"learn\u002Fvoid\u002F03-the-storefront","pvQx5kiGThfThej7A2AV1pxVoWicigoxVnxb_2_0IHM",{"id":46548,"title":46549,"author":46550,"body":46551,"description":48534,"difficulty":42701,"estMinutes":4032,"extension":119,"feature":48535,"img":42703,"meta":48536,"navigation":130,"nuxtVersion":116,"order":468,"path":42365,"releaseDate":116,"seo":48537,"series":41217,"sourcePRs":116,"sourceUrl":42632,"stem":48538,"__hash__":48539},"tutorials\u002Flearn\u002Fvoid\u002F04-box-and-cart.md","Box + Cart: KV Sessions That Survive a Refresh",{"name":9,"img":17256,"website":42491},{"type":13,"value":46552,"toc":48522},[46553,46556,46559,46562,46564,46567,46611,46614,46616,46619,46640,46643,46647,46656,46790,47027,47033,47036,47040,47125,47485,47499,47503,47509,48007,48015,48021,48162,48165,48169,48172,48238,48244,48379,48382,48384,48387,48397,48399,48417,48420,48422,48436,48442,48444,48453,48459,48461,48507,48509,48512,48519],[21,46554,46555],{},"Stage 3 ended with a box selector that only knew about the current page. Stage 4 gives it somewhere to live.",[21,46557,46558],{},"The cart is a KV-backed session, not a database table. The browser keeps an anonymous session token, every request sends it in a header, and the Worker stores the lines under that token. Adding a box, changing a quantity, removing a line, and refreshing the page all hit the same Worker route.",[42504,46560],{"height":46561,"stage":4873},780,[32,46563,42726],{"id":42725},[21,46565,46566],{},"Four moving parts:",[816,46568,46569,46578,46589,46605],{},[386,46570,46571,21921,46574,46577],{},[151,46572,46573],{},"A session token",[40,46575,46576],{},"localStorage",", generated by the client.",[386,46579,46580,46583,46584,1546,46587,165],{},[151,46581,46582],{},"A KV record"," per token, written with ",[40,46585,46586],{},"kv",[40,46588,41133],{},[386,46590,46591,21263,46596,349,46598,349,46600,1542,46602,165],{},[151,46592,46593],{},[40,46594,46595],{},"\u002Fapi\u002Fcart",[40,46597,14531],{},[40,46599,14556],{},[40,46601,14579],{},[40,46603,46604],{},"DELETE",[386,46606,46607,46610],{},[151,46608,46609],{},"A cart drawer"," that reads the view returned by the API and renders the lines, quantities, and subtotal.",[21,46612,46613],{},"There is no D1 migration in this stage. The cart is intentionally ephemeral. D1 gets involved when the cart becomes an order in stage 5.",[32,46615,42758],{"id":42757},[21,46617,46618],{},"A storefront that loses the box on refresh is a demo. A cart needs four guarantees:",[383,46620,46621,46631,46634,46637],{},[386,46622,46623,46624,46627,46628,165],{},"The server owns the price. A client can send ",[40,46625,46626],{},"size: 6",", but it cannot send ",[40,46629,46630],{},"$1.00",[386,46632,46633],{},"The line is validated against the current menu and the known box sizes.",[386,46635,46636],{},"The same flavor and box size merge into one line with a quantity.",[386,46638,46639],{},"The selection survives a reload, a second tab, and a return tomorrow.",[21,46641,46642],{},"KV is the right shape for this data: small JSON values, keyed by an anonymous token, with a TTL. Checkout is the transaction that needs D1.",[32,46644,46646],{"id":46645},"the-session","The session",[21,46648,46649,46650,46652,46653,165],{},"The token is a UUID. The client creates it once, stores it in ",[40,46651,46576],{},", and sends it as ",[40,46654,46655],{},"x-jumble-cart",[48,46657,46660],{"className":670,"code":46658,"filename":46659,"language":673,"meta":56,"style":56},"export const CART_HEADER = \"x-jumble-cart\";\nexport const CART_STORAGE_KEY = \"jumble.cart.session\";\nexport const CART_TTL_SECONDS = 60 * 60 * 24 * 30;\n\nexport function isCartToken(value: unknown): value is string {\n  return typeof value === \"string\" && CART_TOKEN_PATTERN.test(value);\n}\n","src\u002Fcart.ts",[40,46661,46662,46678,46694,46722,46726,46758,46786],{"__ignoreMap":56},[449,46663,46664,46666,46668,46671,46673,46676],{"class":451,"line":452},[449,46665,4629],{"class":680},[449,46667,10789],{"class":680},[449,46669,46670],{"class":714}," CART_HEADER",[449,46672,718],{"class":680},[449,46674,46675],{"class":691}," \"x-jumble-cart\"",[449,46677,695],{"class":684},[449,46679,46680,46682,46684,46687,46689,46692],{"class":451,"line":114},[449,46681,4629],{"class":680},[449,46683,10789],{"class":680},[449,46685,46686],{"class":714}," CART_STORAGE_KEY",[449,46688,718],{"class":680},[449,46690,46691],{"class":691}," \"jumble.cart.session\"",[449,46693,695],{"class":684},[449,46695,46696,46698,46700,46703,46705,46707,46709,46711,46713,46715,46717,46720],{"class":451,"line":111},[449,46697,4629],{"class":680},[449,46699,10789],{"class":680},[449,46701,46702],{"class":714}," CART_TTL_SECONDS",[449,46704,718],{"class":680},[449,46706,25516],{"class":714},[449,46708,11428],{"class":680},[449,46710,25516],{"class":714},[449,46712,11428],{"class":680},[449,46714,28028],{"class":714},[449,46716,11428],{"class":680},[449,46718,46719],{"class":714}," 30",[449,46721,695],{"class":684},[449,46723,46724],{"class":451,"line":468},[449,46725,700],{"emptyLinePlaceholder":130},[449,46727,46728,46730,46732,46735,46737,46739,46741,46744,46746,46748,46751,46754,46756],{"class":451,"line":474},[449,46729,4629],{"class":680},[449,46731,5433],{"class":680},[449,46733,46734],{"class":721}," isCartToken",[449,46736,725],{"class":684},[449,46738,23622],{"class":1491},[449,46740,3070],{"class":680},[449,46742,46743],{"class":714}," unknown",[449,46745,827],{"class":684},[449,46747,3070],{"class":680},[449,46749,46750],{"class":1491}," value",[449,46752,46753],{"class":680}," is",[449,46755,6081],{"class":714},[449,46757,1501],{"class":684},[449,46759,46760,46762,46764,46767,46769,46772,46775,46778,46780,46783],{"class":451,"line":480},[449,46761,4726],{"class":680},[449,46763,11316],{"class":680},[449,46765,46766],{"class":684}," value ",[449,46768,37592],{"class":680},[449,46770,46771],{"class":691}," \"string\"",[449,46773,46774],{"class":680}," &&",[449,46776,46777],{"class":714}," CART_TOKEN_PATTERN",[449,46779,165],{"class":684},[449,46781,46782],{"class":721},"test",[449,46784,46785],{"class":684},"(value);\n",[449,46787,46788],{"class":451,"line":486},[449,46789,4604],{"class":684},[48,46791,46794],{"className":670,"code":46792,"filename":46793,"language":673,"meta":56,"style":56},"function ensureCartToken(): string {\n  const stored = window.localStorage.getItem(CART_STORAGE_KEY);\n  if (isCartToken(stored)) return stored;\n\n  const token = createCartToken();\n  window.localStorage.setItem(CART_STORAGE_KEY, token);\n  return token;\n}\n\nasync function requestCart(token: string, init?: RequestInit): Promise\u003CCartView> {\n  const response = await fetch(\"\u002Fapi\u002Fcart\", {\n    ...init,\n    credentials: \"same-origin\",\n    headers: {\n      \"content-type\": \"application\u002Fjson\",\n      [CART_HEADER]: token,\n    },\n  });\n\n  return response.json();\n}\n","src\u002FuseCart.ts",[40,46795,46796,46811,46832,46849,46853,46866,46880,46887,46891,46895,46935,46955,46962,46972,46977,46989,47000,47004,47008,47012,47023],{"__ignoreMap":56},[449,46797,46798,46800,46803,46805,46807,46809],{"class":451,"line":452},[449,46799,24643],{"class":680},[449,46801,46802],{"class":721}," ensureCartToken",[449,46804,16797],{"class":684},[449,46806,3070],{"class":680},[449,46808,6081],{"class":714},[449,46810,1501],{"class":684},[449,46812,46813,46815,46818,46820,46823,46825,46827,46830],{"class":451,"line":114},[449,46814,5048],{"class":680},[449,46816,46817],{"class":714}," stored",[449,46819,718],{"class":680},[449,46821,46822],{"class":684}," window.localStorage.",[449,46824,16504],{"class":721},[449,46826,725],{"class":684},[449,46828,46829],{"class":714},"CART_STORAGE_KEY",[449,46831,740],{"class":684},[449,46833,46834,46836,46838,46841,46844,46846],{"class":451,"line":111},[449,46835,5080],{"class":680},[449,46837,1913],{"class":684},[449,46839,46840],{"class":721},"isCartToken",[449,46842,46843],{"class":684},"(stored)) ",[449,46845,37686],{"class":680},[449,46847,46848],{"class":684}," stored;\n",[449,46850,46851],{"class":451,"line":468},[449,46852,700],{"emptyLinePlaceholder":130},[449,46854,46855,46857,46859,46861,46864],{"class":451,"line":474},[449,46856,5048],{"class":680},[449,46858,27952],{"class":714},[449,46860,718],{"class":680},[449,46862,46863],{"class":721}," createCartToken",[449,46865,1322],{"class":684},[449,46867,46868,46871,46873,46875,46877],{"class":451,"line":480},[449,46869,46870],{"class":684},"  window.localStorage.",[449,46872,16185],{"class":721},[449,46874,725],{"class":684},[449,46876,46829],{"class":714},[449,46878,46879],{"class":684},", token);\n",[449,46881,46882,46884],{"class":451,"line":486},[449,46883,4726],{"class":680},[449,46885,46886],{"class":684}," token;\n",[449,46888,46889],{"class":451,"line":492},[449,46890,4604],{"class":684},[449,46892,46893],{"class":451,"line":498},[449,46894,700],{"emptyLinePlaceholder":130},[449,46896,46897,46899,46901,46904,46906,46909,46911,46913,46915,46917,46919,46922,46924,46926,46928,46930,46933],{"class":451,"line":133},[449,46898,1485],{"class":680},[449,46900,5433],{"class":680},[449,46902,46903],{"class":721}," requestCart",[449,46905,725],{"class":684},[449,46907,46908],{"class":1491},"token",[449,46910,3070],{"class":680},[449,46912,6081],{"class":714},[449,46914,349],{"class":684},[449,46916,2654],{"class":1491},[449,46918,23914],{"class":680},[449,46920,46921],{"class":721}," RequestInit",[449,46923,827],{"class":684},[449,46925,3070],{"class":680},[449,46927,5161],{"class":721},[449,46929,5547],{"class":684},[449,46931,46932],{"class":721},"CartView",[449,46934,26735],{"class":684},[449,46936,46937,46939,46942,46944,46946,46948,46950,46953],{"class":451,"line":509},[449,46938,5048],{"class":680},[449,46940,46941],{"class":714}," response",[449,46943,718],{"class":680},[449,46945,1654],{"class":680},[449,46947,5660],{"class":721},[449,46949,725],{"class":684},[449,46951,46952],{"class":691},"\"\u002Fapi\u002Fcart\"",[449,46954,768],{"class":684},[449,46956,46957,46959],{"class":451,"line":318},[449,46958,13553],{"class":680},[449,46960,46961],{"class":684},"init,\n",[449,46963,46964,46967,46970],{"class":451,"line":520},[449,46965,46966],{"class":684},"    credentials: ",[449,46968,46969],{"class":691},"\"same-origin\"",[449,46971,779],{"class":684},[449,46973,46974],{"class":451,"line":526},[449,46975,46976],{"class":684},"    headers: {\n",[449,46978,46979,46982,46984,46987],{"class":451,"line":532},[449,46980,46981],{"class":691},"      \"content-type\"",[449,46983,1482],{"class":684},[449,46985,46986],{"class":691},"\"application\u002Fjson\"",[449,46988,779],{"class":684},[449,46990,46991,46994,46997],{"class":451,"line":2790},[449,46992,46993],{"class":684},"      [",[449,46995,46996],{"class":714},"CART_HEADER",[449,46998,46999],{"class":684},"]: token,\n",[449,47001,47002],{"class":451,"line":3511},[449,47003,1458],{"class":684},[449,47005,47006],{"class":451,"line":3526},[449,47007,13321],{"class":684},[449,47009,47010],{"class":451,"line":3531},[449,47011,700],{"emptyLinePlaceholder":130},[449,47013,47014,47016,47019,47021],{"class":451,"line":3536},[449,47015,4726],{"class":680},[449,47017,47018],{"class":684}," response.",[449,47020,4521],{"class":721},[449,47022,1322],{"class":684},[449,47024,47025],{"class":451,"line":4009},[449,47026,4604],{"class":684},[21,47028,47029,47030,47032],{},"This is why the embedded preview works without relying on a third-party cookie. ",[40,47031,46576],{}," belongs to the Jumble origin; the API is on the same origin. A cookie would be simpler in a first-party app, but it is the wrong dependency for a lesson that has to run inside an iframe.",[21,47034,47035],{},"The token is a capability, not authentication. Anyone who knows it can change that cart. That is acceptable for an anonymous box; stage 7 adds the account boundary.",[32,47037,47039],{"id":47038},"the-kv-record","The KV record",[48,47041,47043],{"className":670,"code":47042,"filename":46659,"language":673,"meta":56,"style":56},"export type CartLine = {\n  slug: string;\n  size: number;\n  quantity: number;\n};\n\nexport type CartRecord = {\n  lines: CartLine[];\n};\n",[40,47044,47045,47058,47069,47079,47089,47093,47097,47110,47121],{"__ignoreMap":56},[449,47046,47047,47049,47051,47054,47056],{"class":451,"line":452},[449,47048,4629],{"class":680},[449,47050,11308],{"class":680},[449,47052,47053],{"class":721}," CartLine",[449,47055,718],{"class":680},[449,47057,1501],{"class":684},[449,47059,47060,47063,47065,47067],{"class":451,"line":114},[449,47061,47062],{"class":1491},"  slug",[449,47064,3070],{"class":680},[449,47066,6081],{"class":714},[449,47068,695],{"class":684},[449,47070,47071,47073,47075,47077],{"class":451,"line":111},[449,47072,45137],{"class":1491},[449,47074,3070],{"class":680},[449,47076,4975],{"class":714},[449,47078,695],{"class":684},[449,47080,47081,47083,47085,47087],{"class":451,"line":468},[449,47082,4982],{"class":1491},[449,47084,3070],{"class":680},[449,47086,4975],{"class":714},[449,47088,695],{"class":684},[449,47090,47091],{"class":451,"line":474},[449,47092,20963],{"class":684},[449,47094,47095],{"class":451,"line":480},[449,47096,700],{"emptyLinePlaceholder":130},[449,47098,47099,47101,47103,47106,47108],{"class":451,"line":486},[449,47100,4629],{"class":680},[449,47102,11308],{"class":680},[449,47104,47105],{"class":721}," CartRecord",[449,47107,718],{"class":680},[449,47109,1501],{"class":684},[449,47111,47112,47115,47117,47119],{"class":451,"line":492},[449,47113,47114],{"class":1491},"  lines",[449,47116,3070],{"class":680},[449,47118,47053],{"class":721},[449,47120,5071],{"class":684},[449,47122,47123],{"class":451,"line":498},[449,47124,20963],{"class":684},[48,47126,47129],{"className":670,"code":47127,"filename":47128,"language":673,"meta":56,"style":56},"import { kv } from \"void\u002Fkv\";\nimport { z } from \"zod\";\n\nconst carts = kv.map\u003Cunknown>(\"carts\");\n\nconst cartRecordSchema = z.object({\n  lines: z\n    .array(\n      z.object({\n        slug: z.string().min(1).max(120),\n        size: z.number().int().positive(),\n        quantity: z.number().int().min(1).max(12),\n      }),\n    )\n    .max(24),\n});\n\nexport async function readCart(token: string): Promise\u003CCartRecord> {\n  const parsed = cartRecordSchema.safeParse(await carts.get(token));\n  return parsed.success ? normalizeLines(parsed.data.lines) : emptyCartRecord();\n}\n\nexport async function writeCart(token: string, record: CartRecord) {\n  await carts.put(token, record, { ttl: 60 * 60 * 24 * 30 });\n}\n","src\u002Fserver\u002Fcart.ts",[40,47130,47131,47145,47158,47162,47189,47193,47209,47214,47223,47232,47258,47276,47305,47309,47313,47326,47330,47334,47366,47393,47415,47419,47423,47453,47481],{"__ignoreMap":56},[449,47132,47133,47135,47138,47140,47143],{"class":451,"line":452},[449,47134,681],{"class":680},[449,47136,47137],{"class":684}," { kv } ",[449,47139,688],{"class":680},[449,47141,47142],{"class":691}," \"void\u002Fkv\"",[449,47144,695],{"class":684},[449,47146,47147,47149,47151,47153,47156],{"class":451,"line":114},[449,47148,681],{"class":680},[449,47150,25443],{"class":684},[449,47152,688],{"class":680},[449,47154,47155],{"class":691}," \"zod\"",[449,47157,695],{"class":684},[449,47159,47160],{"class":451,"line":111},[449,47161,700],{"emptyLinePlaceholder":130},[449,47163,47164,47166,47169,47171,47174,47176,47178,47181,47184,47187],{"class":451,"line":468},[449,47165,711],{"class":680},[449,47167,47168],{"class":714}," carts",[449,47170,718],{"class":680},[449,47172,47173],{"class":684}," kv.",[449,47175,6391],{"class":721},[449,47177,5547],{"class":684},[449,47179,47180],{"class":714},"unknown",[449,47182,47183],{"class":684},">(",[449,47185,47186],{"class":691},"\"carts\"",[449,47188,740],{"class":684},[449,47190,47191],{"class":451,"line":474},[449,47192,700],{"emptyLinePlaceholder":130},[449,47194,47195,47197,47200,47202,47205,47207],{"class":451,"line":480},[449,47196,711],{"class":680},[449,47198,47199],{"class":714}," cartRecordSchema",[449,47201,718],{"class":680},[449,47203,47204],{"class":684}," z.",[449,47206,25487],{"class":721},[449,47208,1391],{"class":684},[449,47210,47211],{"class":451,"line":486},[449,47212,47213],{"class":684},"  lines: z\n",[449,47215,47216,47218,47221],{"class":451,"line":492},[449,47217,11190],{"class":684},[449,47219,47220],{"class":721},"array",[449,47222,5567],{"class":684},[449,47224,47225,47228,47230],{"class":451,"line":498},[449,47226,47227],{"class":684},"      z.",[449,47229,25487],{"class":721},[449,47231,1391],{"class":684},[449,47233,47234,47237,47239,47241,47243,47245,47247,47249,47251,47253,47256],{"class":451,"line":133},[449,47235,47236],{"class":684},"        slug: z.",[449,47238,25474],{"class":721},[449,47240,5237],{"class":684},[449,47242,37442],{"class":721},[449,47244,725],{"class":684},[449,47246,4798],{"class":714},[449,47248,374],{"class":684},[449,47250,37432],{"class":721},[449,47252,725],{"class":684},[449,47254,47255],{"class":714},"120",[449,47257,1613],{"class":684},[449,47259,47260,47263,47265,47267,47269,47271,47274],{"class":451,"line":509},[449,47261,47262],{"class":684},"        size: z.",[449,47264,25497],{"class":721},[449,47266,5237],{"class":684},[449,47268,25502],{"class":721},[449,47270,5237],{"class":684},[449,47272,47273],{"class":721},"positive",[449,47275,1624],{"class":684},[449,47277,47278,47281,47283,47285,47287,47289,47291,47293,47295,47297,47299,47301,47303],{"class":451,"line":318},[449,47279,47280],{"class":684},"        quantity: z.",[449,47282,25497],{"class":721},[449,47284,5237],{"class":684},[449,47286,25502],{"class":721},[449,47288,5237],{"class":684},[449,47290,37442],{"class":721},[449,47292,725],{"class":684},[449,47294,4798],{"class":714},[449,47296,374],{"class":684},[449,47298,37432],{"class":721},[449,47300,725],{"class":684},[449,47302,45260],{"class":714},[449,47304,1613],{"class":684},[449,47306,47307],{"class":451,"line":520},[449,47308,5785],{"class":684},[449,47310,47311],{"class":451,"line":526},[449,47312,19898],{"class":684},[449,47314,47315,47317,47319,47321,47324],{"class":451,"line":532},[449,47316,11190],{"class":684},[449,47318,37432],{"class":721},[449,47320,725],{"class":684},[449,47322,47323],{"class":714},"24",[449,47325,1613],{"class":684},[449,47327,47328],{"class":451,"line":2790},[449,47329,784],{"class":684},[449,47331,47332],{"class":451,"line":3511},[449,47333,700],{"emptyLinePlaceholder":130},[449,47335,47336,47338,47340,47342,47345,47347,47349,47351,47353,47355,47357,47359,47361,47364],{"class":451,"line":3526},[449,47337,4629],{"class":680},[449,47339,5597],{"class":680},[449,47341,5433],{"class":680},[449,47343,47344],{"class":721}," readCart",[449,47346,725],{"class":684},[449,47348,46908],{"class":1491},[449,47350,3070],{"class":680},[449,47352,6081],{"class":714},[449,47354,827],{"class":684},[449,47356,3070],{"class":680},[449,47358,5161],{"class":721},[449,47360,5547],{"class":684},[449,47362,47363],{"class":721},"CartRecord",[449,47365,26735],{"class":684},[449,47367,47368,47370,47373,47375,47378,47381,47383,47385,47388,47390],{"class":451,"line":3531},[449,47369,5048],{"class":680},[449,47371,47372],{"class":714}," parsed",[449,47374,718],{"class":680},[449,47376,47377],{"class":684}," cartRecordSchema.",[449,47379,47380],{"class":721},"safeParse",[449,47382,725],{"class":684},[449,47384,2056],{"class":680},[449,47386,47387],{"class":684}," carts.",[449,47389,12644],{"class":721},[449,47391,47392],{"class":684},"(token));\n",[449,47394,47395,47397,47400,47402,47405,47408,47410,47413],{"class":451,"line":3536},[449,47396,4726],{"class":680},[449,47398,47399],{"class":684}," parsed.success ",[449,47401,45548],{"class":680},[449,47403,47404],{"class":721}," normalizeLines",[449,47406,47407],{"class":684},"(parsed.data.lines) ",[449,47409,3070],{"class":680},[449,47411,47412],{"class":721}," emptyCartRecord",[449,47414,1322],{"class":684},[449,47416,47417],{"class":451,"line":4009},[449,47418,4604],{"class":684},[449,47420,47421],{"class":451,"line":4015},[449,47422,700],{"emptyLinePlaceholder":130},[449,47424,47425,47427,47429,47431,47434,47436,47438,47440,47442,47444,47447,47449,47451],{"class":451,"line":4021},[449,47426,4629],{"class":680},[449,47428,5597],{"class":680},[449,47430,5433],{"class":680},[449,47432,47433],{"class":721}," writeCart",[449,47435,725],{"class":684},[449,47437,46908],{"class":1491},[449,47439,3070],{"class":680},[449,47441,6081],{"class":714},[449,47443,349],{"class":684},[449,47445,47446],{"class":1491},"record",[449,47448,3070],{"class":680},[449,47450,47105],{"class":721},[449,47452,3417],{"class":684},[449,47454,47455,47457,47459,47462,47465,47467,47469,47471,47473,47475,47477,47479],{"class":451,"line":4027},[449,47456,2099],{"class":680},[449,47458,47387],{"class":684},[449,47460,47461],{"class":721},"put",[449,47463,47464],{"class":684},"(token, record, { ttl: ",[449,47466,25511],{"class":714},[449,47468,11428],{"class":680},[449,47470,25516],{"class":714},[449,47472,11428],{"class":680},[449,47474,28028],{"class":714},[449,47476,11428],{"class":680},[449,47478,46719],{"class":714},[449,47480,2051],{"class":684},[449,47482,47483],{"class":451,"line":4032},[449,47484,4604],{"class":684},[21,47486,47487,47488,1546,47490,47492,47493,47495,47496,47498],{},"Importing ",[40,47489,46586],{},[40,47491,41133],{}," is enough for Void to infer and provision the ",[40,47494,41341],{}," binding. Local dev gets a file-backed namespace; ",[40,47497,41236],{}," creates the production namespace.",[32,47500,47502],{"id":47501},"the-api","The API",[21,47504,47505,47508],{},[40,47506,47507],{},"routes\u002Fapi\u002Fcart.ts"," exports one handler per method. The GET path returns the enriched view. The write paths validate the body, load the record, mutate it, and return the same view.",[48,47510,47512],{"className":670,"code":47511,"filename":47507,"language":673,"meta":56,"style":56},"export const GET = defineHandler(async (c) => {\n  const token = cartToken(c);\n  if (!token) return emptyCartView();\n\n  const menu = await getActiveMenu();\n  return present(token, await readCart(token), menu);\n});\n\nexport const POST = defineHandler(async (c) => {\n  const token = cartToken(c);\n  if (!token) return c.json({ error: \"Start a cart session first.\" }, 400);\n\n  const body = await readBody(() => c.req.json(), addSchema);\n  if (!body) return c.json({ error: \"Invalid cart item.\" }, 400);\n\n  const menu = await getActiveMenu();\n  const flavor = menu.flavors.find((item) => item.slug === body.slug);\n  const box = BOX_SIZES.find((item) => item.size === body.size);\n\n  if (!flavor || !box) {\n    return c.json({ error: \"That cookie or box is not on this week's menu.\" }, 409);\n  }\n\n  const record = await readCart(token);\n  const line = record.lines.find(\n    (item) => item.slug === flavor.slug && item.size === box.size,\n  );\n\n  if (line) {\n    line.quantity = Math.min(line.quantity + body.quantity, 12);\n  } else {\n    record.lines.push({ slug: flavor.slug, size: box.size, quantity: body.quantity });\n  }\n\n  await writeCart(token, record);\n  return present(token, record, menu);\n});\n",[40,47513,47514,47540,47554,47572,47576,47590,47607,47611,47615,47641,47653,47682,47686,47709,47737,47741,47755,47782,47813,47817,47835,47855,47859,47863,47878,47894,47921,47925,47929,47936,47959,47967,47977,47981,47985,47994,48003],{"__ignoreMap":56},[449,47515,47516,47518,47520,47522,47524,47526,47528,47530,47532,47534,47536,47538],{"class":451,"line":452},[449,47517,4629],{"class":680},[449,47519,10789],{"class":680},[449,47521,41495],{"class":714},[449,47523,718],{"class":680},[449,47525,41500],{"class":721},[449,47527,725],{"class":684},[449,47529,1485],{"class":680},[449,47531,1913],{"class":684},[449,47533,37719],{"class":1491},[449,47535,1758],{"class":684},[449,47537,1498],{"class":680},[449,47539,1501],{"class":684},[449,47541,47542,47544,47546,47548,47551],{"class":451,"line":114},[449,47543,5048],{"class":680},[449,47545,27952],{"class":714},[449,47547,718],{"class":680},[449,47549,47550],{"class":721}," cartToken",[449,47552,47553],{"class":684},"(c);\n",[449,47555,47556,47558,47560,47562,47565,47567,47570],{"class":451,"line":111},[449,47557,5080],{"class":680},[449,47559,1913],{"class":684},[449,47561,5085],{"class":680},[449,47563,47564],{"class":684},"token) ",[449,47566,37686],{"class":680},[449,47568,47569],{"class":721}," emptyCartView",[449,47571,1322],{"class":684},[449,47573,47574],{"class":451,"line":468},[449,47575,700],{"emptyLinePlaceholder":130},[449,47577,47578,47580,47582,47584,47586,47588],{"class":451,"line":474},[449,47579,5048],{"class":680},[449,47581,15064],{"class":714},[449,47583,718],{"class":680},[449,47585,1654],{"class":680},[449,47587,43800],{"class":721},[449,47589,1322],{"class":684},[449,47591,47592,47594,47597,47600,47602,47604],{"class":451,"line":480},[449,47593,4726],{"class":680},[449,47595,47596],{"class":721}," present",[449,47598,47599],{"class":684},"(token, ",[449,47601,2056],{"class":680},[449,47603,47344],{"class":721},[449,47605,47606],{"class":684},"(token), menu);\n",[449,47608,47609],{"class":451,"line":486},[449,47610,784],{"class":684},[449,47612,47613],{"class":451,"line":492},[449,47614,700],{"emptyLinePlaceholder":130},[449,47616,47617,47619,47621,47623,47625,47627,47629,47631,47633,47635,47637,47639],{"class":451,"line":498},[449,47618,4629],{"class":680},[449,47620,10789],{"class":680},[449,47622,14358],{"class":714},[449,47624,718],{"class":680},[449,47626,41500],{"class":721},[449,47628,725],{"class":684},[449,47630,1485],{"class":680},[449,47632,1913],{"class":684},[449,47634,37719],{"class":1491},[449,47636,1758],{"class":684},[449,47638,1498],{"class":680},[449,47640,1501],{"class":684},[449,47642,47643,47645,47647,47649,47651],{"class":451,"line":133},[449,47644,5048],{"class":680},[449,47646,27952],{"class":714},[449,47648,718],{"class":680},[449,47650,47550],{"class":721},[449,47652,47553],{"class":684},[449,47654,47655,47657,47659,47661,47663,47665,47668,47670,47673,47676,47678,47680],{"class":451,"line":509},[449,47656,5080],{"class":680},[449,47658,1913],{"class":684},[449,47660,5085],{"class":680},[449,47662,47564],{"class":684},[449,47664,37686],{"class":680},[449,47666,47667],{"class":684}," c.",[449,47669,4521],{"class":721},[449,47671,47672],{"class":684},"({ error: ",[449,47674,47675],{"class":691},"\"Start a cart session first.\"",[449,47677,2737],{"class":684},[449,47679,5123],{"class":714},[449,47681,740],{"class":684},[449,47683,47684],{"class":451,"line":318},[449,47685,700],{"emptyLinePlaceholder":130},[449,47687,47688,47690,47692,47694,47696,47698,47700,47702,47704,47706],{"class":451,"line":520},[449,47689,5048],{"class":680},[449,47691,5051],{"class":714},[449,47693,718],{"class":680},[449,47695,1654],{"class":680},[449,47697,5060],{"class":721},[449,47699,4717],{"class":684},[449,47701,1498],{"class":680},[449,47703,45412],{"class":684},[449,47705,4521],{"class":721},[449,47707,47708],{"class":684},"(), addSchema);\n",[449,47710,47711,47713,47715,47717,47720,47722,47724,47726,47728,47731,47733,47735],{"class":451,"line":526},[449,47712,5080],{"class":680},[449,47714,1913],{"class":684},[449,47716,5085],{"class":680},[449,47718,47719],{"class":684},"body) ",[449,47721,37686],{"class":680},[449,47723,47667],{"class":684},[449,47725,4521],{"class":721},[449,47727,47672],{"class":684},[449,47729,47730],{"class":691},"\"Invalid cart item.\"",[449,47732,2737],{"class":684},[449,47734,5123],{"class":714},[449,47736,740],{"class":684},[449,47738,47739],{"class":451,"line":532},[449,47740,700],{"emptyLinePlaceholder":130},[449,47742,47743,47745,47747,47749,47751,47753],{"class":451,"line":2790},[449,47744,5048],{"class":680},[449,47746,15064],{"class":714},[449,47748,718],{"class":680},[449,47750,1654],{"class":680},[449,47752,43800],{"class":721},[449,47754,1322],{"class":684},[449,47756,47757,47759,47761,47763,47765,47767,47769,47771,47773,47775,47777,47779],{"class":451,"line":3511},[449,47758,5048],{"class":680},[449,47760,45467],{"class":714},[449,47762,718],{"class":680},[449,47764,45472],{"class":684},[449,47766,37464],{"class":721},[449,47768,5164],{"class":684},[449,47770,13080],{"class":1491},[449,47772,1758],{"class":684},[449,47774,1498],{"class":680},[449,47776,45485],{"class":684},[449,47778,37592],{"class":680},[449,47780,47781],{"class":684}," body.slug);\n",[449,47783,47784,47786,47789,47791,47793,47795,47797,47799,47801,47803,47805,47808,47810],{"class":451,"line":3526},[449,47785,5048],{"class":680},[449,47787,47788],{"class":714}," box",[449,47790,718],{"class":680},[449,47792,45193],{"class":714},[449,47794,165],{"class":684},[449,47796,37464],{"class":721},[449,47798,5164],{"class":684},[449,47800,13080],{"class":1491},[449,47802,1758],{"class":684},[449,47804,1498],{"class":680},[449,47806,47807],{"class":684}," item.size ",[449,47809,37592],{"class":680},[449,47811,47812],{"class":684}," body.size);\n",[449,47814,47815],{"class":451,"line":3531},[449,47816,700],{"emptyLinePlaceholder":130},[449,47818,47819,47821,47823,47825,47828,47830,47832],{"class":451,"line":3536},[449,47820,5080],{"class":680},[449,47822,1913],{"class":684},[449,47824,5085],{"class":680},[449,47826,47827],{"class":684},"flavor ",[449,47829,5091],{"class":680},[449,47831,12868],{"class":680},[449,47833,47834],{"class":684},"box) {\n",[449,47836,47837,47839,47841,47843,47845,47848,47850,47853],{"class":451,"line":4009},[449,47838,1506],{"class":680},[449,47840,47667],{"class":684},[449,47842,4521],{"class":721},[449,47844,47672],{"class":684},[449,47846,47847],{"class":691},"\"That cookie or box is not on this week's menu.\"",[449,47849,2737],{"class":684},[449,47851,47852],{"class":714},"409",[449,47854,740],{"class":684},[449,47856,47857],{"class":451,"line":4015},[449,47858,4599],{"class":684},[449,47860,47861],{"class":451,"line":4021},[449,47862,700],{"emptyLinePlaceholder":130},[449,47864,47865,47867,47870,47872,47874,47876],{"class":451,"line":4027},[449,47866,5048],{"class":680},[449,47868,47869],{"class":714}," record",[449,47871,718],{"class":680},[449,47873,1654],{"class":680},[449,47875,47344],{"class":721},[449,47877,28579],{"class":684},[449,47879,47880,47882,47885,47887,47890,47892],{"class":451,"line":4032},[449,47881,5048],{"class":680},[449,47883,47884],{"class":714}," line",[449,47886,718],{"class":680},[449,47888,47889],{"class":684}," record.lines.",[449,47891,37464],{"class":721},[449,47893,5567],{"class":684},[449,47895,47896,47899,47901,47903,47905,47907,47909,47912,47914,47916,47918],{"class":451,"line":4038},[449,47897,47898],{"class":684},"    (",[449,47900,13080],{"class":1491},[449,47902,1758],{"class":684},[449,47904,1498],{"class":680},[449,47906,45485],{"class":684},[449,47908,37592],{"class":680},[449,47910,47911],{"class":684}," flavor.slug ",[449,47913,16941],{"class":680},[449,47915,47807],{"class":684},[449,47917,37592],{"class":680},[449,47919,47920],{"class":684}," box.size,\n",[449,47922,47923],{"class":451,"line":4044},[449,47924,14242],{"class":684},[449,47926,47927],{"class":451,"line":4049},[449,47928,700],{"emptyLinePlaceholder":130},[449,47930,47931,47933],{"class":451,"line":4054},[449,47932,5080],{"class":680},[449,47934,47935],{"class":684}," (line) {\n",[449,47937,47938,47941,47943,47945,47947,47950,47952,47955,47957],{"class":451,"line":4059},[449,47939,47940],{"class":684},"    line.quantity ",[449,47942,5014],{"class":680},[449,47944,5856],{"class":684},[449,47946,37442],{"class":721},[449,47948,47949],{"class":684},"(line.quantity ",[449,47951,24063],{"class":680},[449,47953,47954],{"class":684}," body.quantity, ",[449,47956,45260],{"class":714},[449,47958,740],{"class":684},[449,47960,47961,47963,47965],{"class":451,"line":4065},[449,47962,27082],{"class":684},[449,47964,5720],{"class":680},[449,47966,1501],{"class":684},[449,47968,47969,47972,47974],{"class":451,"line":4070},[449,47970,47971],{"class":684},"    record.lines.",[449,47973,5258],{"class":721},[449,47975,47976],{"class":684},"({ slug: flavor.slug, size: box.size, quantity: body.quantity });\n",[449,47978,47979],{"class":451,"line":4075},[449,47980,4599],{"class":684},[449,47982,47983],{"class":451,"line":4081},[449,47984,700],{"emptyLinePlaceholder":130},[449,47986,47987,47989,47991],{"class":451,"line":4086},[449,47988,2099],{"class":680},[449,47990,47433],{"class":721},[449,47992,47993],{"class":684},"(token, record);\n",[449,47995,47996,47998,48000],{"class":451,"line":4092},[449,47997,4726],{"class":680},[449,47999,47596],{"class":721},[449,48001,48002],{"class":684},"(token, record, menu);\n",[449,48004,48005],{"class":451,"line":4098},[449,48006,784],{"class":684},[21,48008,48009,48011,48012,48014],{},[40,48010,14579],{}," replaces a quantity; ",[40,48013,46604],{}," removes a line. Both return the fresh cart. The client never renders a price it invented.",[21,48016,1556,48017,48020],{},[40,48018,48019],{},"present()"," helper turns stored lines into display lines:",[48,48022,48024],{"className":670,"code":48023,"filename":46659,"language":673,"meta":56,"style":56},"const flavor = flavorsBySlug.get(line.slug);\nconst box = boxesBySize.get(line.size);\n\nif (!flavor || !box) continue;\n\nlines.push({\n  key: cartLineKey(line.slug, line.size),\n  slug: flavor.slug,\n  name: flavor.name,\n  size: box.size,\n  boxLabel: box.label,\n  quantity: line.quantity,\n  priceCents: box.priceCents,\n  lineTotalCents: box.priceCents * line.quantity,\n  color: flavor.color,\n  accent: flavor.accent,\n});\n",[40,48025,48026,48042,48058,48062,48084,48088,48097,48108,48113,48118,48123,48128,48133,48138,48148,48153,48158],{"__ignoreMap":56},[449,48027,48028,48030,48032,48034,48037,48039],{"class":451,"line":452},[449,48029,711],{"class":680},[449,48031,45467],{"class":714},[449,48033,718],{"class":680},[449,48035,48036],{"class":684}," flavorsBySlug.",[449,48038,12644],{"class":721},[449,48040,48041],{"class":684},"(line.slug);\n",[449,48043,48044,48046,48048,48050,48053,48055],{"class":451,"line":114},[449,48045,711],{"class":680},[449,48047,47788],{"class":714},[449,48049,718],{"class":680},[449,48051,48052],{"class":684}," boxesBySize.",[449,48054,12644],{"class":721},[449,48056,48057],{"class":684},"(line.size);\n",[449,48059,48060],{"class":451,"line":111},[449,48061,700],{"emptyLinePlaceholder":130},[449,48063,48064,48066,48068,48070,48072,48074,48076,48079,48082],{"class":451,"line":468},[449,48065,17337],{"class":680},[449,48067,1913],{"class":684},[449,48069,5085],{"class":680},[449,48071,47827],{"class":684},[449,48073,5091],{"class":680},[449,48075,12868],{"class":680},[449,48077,48078],{"class":684},"box) ",[449,48080,48081],{"class":680},"continue",[449,48083,695],{"class":684},[449,48085,48086],{"class":451,"line":474},[449,48087,700],{"emptyLinePlaceholder":130},[449,48089,48090,48093,48095],{"class":451,"line":480},[449,48091,48092],{"class":684},"lines.",[449,48094,5258],{"class":721},[449,48096,1391],{"class":684},[449,48098,48099,48102,48105],{"class":451,"line":486},[449,48100,48101],{"class":684},"  key: ",[449,48103,48104],{"class":721},"cartLineKey",[449,48106,48107],{"class":684},"(line.slug, line.size),\n",[449,48109,48110],{"class":451,"line":492},[449,48111,48112],{"class":684},"  slug: flavor.slug,\n",[449,48114,48115],{"class":451,"line":498},[449,48116,48117],{"class":684},"  name: flavor.name,\n",[449,48119,48120],{"class":451,"line":133},[449,48121,48122],{"class":684},"  size: box.size,\n",[449,48124,48125],{"class":451,"line":509},[449,48126,48127],{"class":684},"  boxLabel: box.label,\n",[449,48129,48130],{"class":451,"line":318},[449,48131,48132],{"class":684},"  quantity: line.quantity,\n",[449,48134,48135],{"class":451,"line":520},[449,48136,48137],{"class":684},"  priceCents: box.priceCents,\n",[449,48139,48140,48143,48145],{"class":451,"line":526},[449,48141,48142],{"class":684},"  lineTotalCents: box.priceCents ",[449,48144,13175],{"class":680},[449,48146,48147],{"class":684}," line.quantity,\n",[449,48149,48150],{"class":451,"line":532},[449,48151,48152],{"class":684},"  color: flavor.color,\n",[449,48154,48155],{"class":451,"line":2790},[449,48156,48157],{"class":684},"  accent: flavor.accent,\n",[449,48159,48160],{"class":451,"line":3511},[449,48161,784],{"class":684},[21,48163,48164],{},"That is also the prune step. A cookie that leaves the menu disappears from the cart instead of becoming an unpriced ghost.",[32,48166,48168],{"id":48167},"the-drawer","The drawer",[21,48170,48171],{},"The cookie page's button changes from a disabled stage-3 placeholder to a real action:",[48,48173,48176],{"className":24546,"code":48174,"filename":48175,"language":23763,"meta":56,"style":56},"async function addToBox(): Promise\u003Cvoid> {\n  if (!props.flavor || !selectedBox.value || adding.value) return;\n\n  adding.value = true;\n  const success = await add(props.flavor.slug, selectedBox.value.size);\n  adding.value = false;\n\n  if (success) {\n    added.value = true;\n    openCart();\n  }\n}\n","src\u002FJumbleCookie.vue",[40,48177,48178,48187,48192,48196,48201,48206,48211,48215,48220,48225,48230,48234],{"__ignoreMap":56},[449,48179,48180,48183,48185],{"class":451,"line":452},[449,48181,48182],{"class":684},"async function addToBox(): Promise\u003C",[449,48184,41217],{"class":17370},[449,48186,26735],{"class":684},[449,48188,48189],{"class":451,"line":114},[449,48190,48191],{"class":684},"  if (!props.flavor || !selectedBox.value || adding.value) return;\n",[449,48193,48194],{"class":451,"line":111},[449,48195,700],{"emptyLinePlaceholder":130},[449,48197,48198],{"class":451,"line":468},[449,48199,48200],{"class":684},"  adding.value = true;\n",[449,48202,48203],{"class":451,"line":474},[449,48204,48205],{"class":684},"  const success = await add(props.flavor.slug, selectedBox.value.size);\n",[449,48207,48208],{"class":451,"line":480},[449,48209,48210],{"class":684},"  adding.value = false;\n",[449,48212,48213],{"class":451,"line":486},[449,48214,700],{"emptyLinePlaceholder":130},[449,48216,48217],{"class":451,"line":492},[449,48218,48219],{"class":684},"  if (success) {\n",[449,48221,48222],{"class":451,"line":498},[449,48223,48224],{"class":684},"    added.value = true;\n",[449,48226,48227],{"class":451,"line":133},[449,48228,48229],{"class":684},"    openCart();\n",[449,48231,48232],{"class":451,"line":509},[449,48233,4599],{"class":684},[449,48235,48236],{"class":451,"line":318},[449,48237,4604],{"class":684},[21,48239,48240,48241,48243],{},"The drawer is a single client component teleported to ",[40,48242,16248],{},". It is rendered only after mount so its modal markup does not fight SSR hydration.",[48,48245,48248],{"className":24546,"code":48246,"filename":48247,"language":23763,"meta":56,"style":56},"\u003Carticle v-for=\"line in cart.lines\" :key=\"line.key\" class=\"cart-line\">\n  \u003Cspan class=\"cart-swatch\" :style=\"{ background: line.color }\" \u002F>\n\n  \u003Cdiv class=\"cart-line-info\">\n    \u003Ch3>{{ line.name }}\u003C\u002Fh3>\n    \u003Cp>{{ line.boxLabel }} · {{ line.size }} cookies\u003C\u002Fp>\n    \u003Cbutton :disabled=\"busy\" @click=\"emit('remove', line)\">Remove\u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n\n  \u003Cdiv class=\"cart-line-side\">\n    \u003Cp>{{ price(line.lineTotalCents) }}\u003C\u002Fp>\n    \u003Cdiv class=\"cart-qty\">\n      \u003Cbutton :disabled=\"busy || line.quantity \u003C= 1\" @click=\"emit('update', line, line.quantity - 1)\">−\u003C\u002Fbutton>\n      \u003Cspan>{{ line.quantity }}\u003C\u002Fspan>\n      \u003Cbutton :disabled=\"busy || line.quantity >= 12\" @click=\"emit('update', line, line.quantity + 1)\">+\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Farticle>\n","src\u002FCartDrawer.vue",[40,48249,48250,48295,48300,48304,48309,48314,48319,48324,48329,48333,48338,48343,48348,48353,48358,48363,48367,48371],{"__ignoreMap":56},[449,48251,48252,48254,48257,48259,48261,48263,48266,48268,48271,48273,48275,48277,48279,48281,48284,48286,48288,48290,48293],{"class":451,"line":452},[449,48253,5547],{"class":684},[449,48255,48256],{"class":17370},"article",[449,48258,24711],{"class":680},[449,48260,5014],{"class":684},[449,48262,25284],{"class":691},[449,48264,48265],{"class":684},"line ",[449,48267,20172],{"class":680},[449,48269,48270],{"class":684}," cart.lines",[449,48272,25284],{"class":691},[449,48274,38510],{"class":684},[449,48276,16495],{"class":721},[449,48278,5014],{"class":684},[449,48280,25284],{"class":691},[449,48282,48283],{"class":684},"line.key",[449,48285,25284],{"class":691},[449,48287,29391],{"class":721},[449,48289,5014],{"class":684},[449,48291,48292],{"class":691},"\"cart-line\"",[449,48294,23122],{"class":684},[449,48296,48297],{"class":451,"line":114},[449,48298,48299],{"class":684},"  \u003Cspan class=\"cart-swatch\" :style=\"{ background: line.color }\" \u002F>\n",[449,48301,48302],{"class":451,"line":111},[449,48303,700],{"emptyLinePlaceholder":130},[449,48305,48306],{"class":451,"line":468},[449,48307,48308],{"class":684},"  \u003Cdiv class=\"cart-line-info\">\n",[449,48310,48311],{"class":451,"line":474},[449,48312,48313],{"class":684},"    \u003Ch3>{{ line.name }}\u003C\u002Fh3>\n",[449,48315,48316],{"class":451,"line":480},[449,48317,48318],{"class":684},"    \u003Cp>{{ line.boxLabel }} · {{ line.size }} cookies\u003C\u002Fp>\n",[449,48320,48321],{"class":451,"line":486},[449,48322,48323],{"class":684},"    \u003Cbutton :disabled=\"busy\" @click=\"emit('remove', line)\">Remove\u003C\u002Fbutton>\n",[449,48325,48326],{"class":451,"line":492},[449,48327,48328],{"class":684},"  \u003C\u002Fdiv>\n",[449,48330,48331],{"class":451,"line":498},[449,48332,700],{"emptyLinePlaceholder":130},[449,48334,48335],{"class":451,"line":133},[449,48336,48337],{"class":684},"  \u003Cdiv class=\"cart-line-side\">\n",[449,48339,48340],{"class":451,"line":509},[449,48341,48342],{"class":684},"    \u003Cp>{{ price(line.lineTotalCents) }}\u003C\u002Fp>\n",[449,48344,48345],{"class":451,"line":318},[449,48346,48347],{"class":684},"    \u003Cdiv class=\"cart-qty\">\n",[449,48349,48350],{"class":451,"line":520},[449,48351,48352],{"class":684},"      \u003Cbutton :disabled=\"busy || line.quantity \u003C= 1\" @click=\"emit('update', line, line.quantity - 1)\">−\u003C\u002Fbutton>\n",[449,48354,48355],{"class":451,"line":526},[449,48356,48357],{"class":684},"      \u003Cspan>{{ line.quantity }}\u003C\u002Fspan>\n",[449,48359,48360],{"class":451,"line":532},[449,48361,48362],{"class":684},"      \u003Cbutton :disabled=\"busy || line.quantity >= 12\" @click=\"emit('update', line, line.quantity + 1)\">+\u003C\u002Fbutton>\n",[449,48364,48365],{"class":451,"line":2790},[449,48366,33848],{"class":684},[449,48368,48369],{"class":451,"line":3511},[449,48370,48328],{"class":684},[449,48372,48373,48375,48377],{"class":451,"line":3526},[449,48374,23220],{"class":684},[449,48376,48256],{"class":17370},[449,48378,23122],{"class":684},[21,48380,48381],{},"The current app shows the cart trigger in the menu and cookie headers, opens the drawer after an add, and keeps the count live. Checkout stays disabled. That is the next stage's problem.",[32,48383,43385],{"id":43384},[21,48385,48386],{},"No migration.",[48,48388,48389],{"className":839,"code":43519,"language":841,"meta":56,"style":56},[40,48390,48391],{"__ignoreMap":56},[449,48392,48393,48395],{"class":451,"line":452},[449,48394,24321],{"class":721},[449,48396,5300],{"class":691},[21,48398,46412],{},[48,48400,48402],{"className":443,"code":48401,"language":445,"meta":56,"style":56},"http:\u002F\u002Flocalhost:5173\u002F\nhttp:\u002F\u002Flocalhost:5173\u002Fcookies\u002Fsorrel-snickerdoodle\nhttp:\u002F\u002Flocalhost:5173\u002Fpreview\u002F4\n",[40,48403,48404,48408,48412],{"__ignoreMap":56},[449,48405,48406],{"class":451,"line":452},[449,48407,44927],{},[449,48409,48410],{"class":451,"line":114},[449,48411,46426],{},[449,48413,48414],{"class":451,"line":111},[449,48415,48416],{},"http:\u002F\u002Flocalhost:5173\u002Fpreview\u002F4\n",[21,48418,48419],{},"Add a box, raise the quantity, close the drawer, and refresh. The line should still be there. Remove it and the empty state returns.",[21,48421,46444],{},[48,48423,48424],{"className":839,"code":44888,"language":841,"meta":56,"style":56},[40,48425,48426],{"__ignoreMap":56},[449,48427,48428,48430,48432,48434],{"class":451,"line":452},[449,48429,41217],{"class":721},[449,48431,41658],{"class":691},[449,48433,8896],{"class":714},[449,48435,44901],{"class":691},[21,48437,48438,48439,48441],{},"Void provisions the ",[40,48440,41341],{}," namespace and writes the binding during deploy. The D1 migrations are still up to date.",[32,48443,43583],{"id":43582},[21,48445,46466,48446,48449,48450,48452],{},[40,48447,48448],{},"\u002Fpreview\u002F4",", embed mode, first cookie. Add a box and the drawer opens inside the iframe. The full app at ",[40,48451,5872],{}," shows the cart trigger in the menu header and the same cart on every cookie page.",[21,48454,48455,48456,48458],{},"Stage 3 is still available at ",[40,48457,46440],{}," with no cart and the add button disabled. That is the point of the stage route: the old stage does not receive later features.",[32,48460,43605],{"id":43604},[383,48462,48463,48471,48477,48483,48489,48495,48501],{},[386,48464,48465,48468,48469,165],{},[151,48466,48467],{},"Never trust a client price."," The API accepts a slug, size, and quantity; the price comes from ",[40,48470,45538],{},[386,48472,48473,48476],{},[151,48474,48475],{},"Validate against the active menu."," A cookie that is no longer on the menu fails the add and is pruned from stored carts.",[386,48478,48479,48482],{},[151,48480,48481],{},"KV is eventually consistent."," Two tabs can overwrite each other if they mutate at the same instant. For a single-user, low-stakes cart this is fine; an order transaction belongs in D1.",[386,48484,48485,48488],{},[151,48486,48487],{},"The token is not auth."," Anyone with the token can edit the cart. Do not put personal data in KV under it.",[386,48490,48491,48494],{},[151,48492,48493],{},"localStorage is the session here."," Cookies would be more conventional first-party, but third-party cookie blocking makes them unreliable inside the lesson iframe. The token-in-header approach works in both places.",[386,48496,48497,48500],{},[151,48498,48499],{},"The drawer is client-only."," Teleporting during SSR causes hydration noise; mount it first.",[386,48502,48503,48506],{},[151,48504,48505],{},"Do not build checkout early."," Stage 5 adds pickup slots, validation, and the D1 order. The disabled checkout button is honest.",[32,48508,43655],{"id":43654},[21,48510,48511],{},"The box now survives: a KV session, a validated API, server-owned prices, and a live drawer. The app has a cart but not an order.",[21,48513,43661,48514,48518],{},[151,48515,48516],{},[3861,48517,42673],{"href":42374}," — pickup locations and slots, form validation, and the first D1 order.",[3728,48520,48521],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}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 .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":56,"searchDepth":111,"depth":111,"links":48523},[48524,48525,48526,48527,48528,48529,48530,48531,48532,48533],{"id":42725,"depth":114,"text":42726},{"id":42757,"depth":114,"text":42758},{"id":46645,"depth":114,"text":46646},{"id":47038,"depth":114,"text":47039},{"id":47501,"depth":114,"text":47502},{"id":48167,"depth":114,"text":48168},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Add a working cart: an anonymous KV session, a validated \u002Fapi\u002Fcart, and a drawer that keeps the box across reloads.","KV sessions + cart drawer",{},{"title":46549,"description":48534},"learn\u002Fvoid\u002F04-box-and-cart","7nzWwbek53XCiC1_tZk6JL1UJztoto_qzeam02WyInc",{"id":48541,"title":48542,"author":48543,"body":48544,"description":50003,"difficulty":42701,"estMinutes":4059,"extension":119,"feature":50004,"img":42703,"meta":50005,"navigation":130,"nuxtVersion":116,"order":474,"path":42374,"releaseDate":116,"seo":50006,"series":41217,"sourcePRs":116,"sourceUrl":42627,"stem":50007,"__hash__":50008},"tutorials\u002Flearn\u002Fvoid\u002F05-pickup-and-checkout.md","Pickup + Checkout: Turn the Cart into a D1 Order",{"name":9,"img":17256,"website":42491},{"type":13,"value":48545,"toc":49992},[48546,48549,48552,48554,48557,48559,48562,48588,48591,48595,49007,49012,49015,49019,49022,49217,49220,49224,49739,49745,49751,49755,49758,49848,49859,49861,49864,49891,49904,49906,49920,49922,49931,49937,49939,49977,49979,49982,49989],[21,48547,48548],{},"The cart is a KV session. An order is a database record.",[21,48550,48551],{},"Stage 5 is where those two ideas meet. The customer picks a pickup window, the Worker validates the cart against the current menu, and Jumble writes an order plus line-item snapshots into D1. The KV cart is deleted only after the order exists.",[42504,48553],{"height":46561,"stage":4897},[21,48555,48556],{},"The preview above seeds one demo cart so the checkout form is visible. The full app uses the same flow with the cart you built in stage 4.",[32,48558,42726],{"id":42725},[21,48560,48561],{},"Three tables and one route:",[383,48563,48564,48570,48576,48582],{},[386,48565,48566,48569],{},[40,48567,48568],{},"pickup_locations"," — where the box can be collected.",[386,48571,48572,48575],{},[40,48573,48574],{},"orders"," — the customer, pickup window, total, status, and public order code.",[386,48577,48578,48581],{},[40,48579,48580],{},"order_items"," — a snapshot of each flavor, box size, quantity, and price at purchase.",[386,48583,48584,48587],{},[40,48585,48586],{},"POST \u002Fapi\u002Fcheckout"," — validates the cart and form, creates the order, and clears the KV cart.",[21,48589,48590],{},"The checkout page is a normal Void page with a server loader for locations. The form and summary are Vue; the server remains the source of truth.",[32,48592,48594],{"id":48593},"the-schema","The schema",[48,48596,48598],{"className":670,"code":48597,"filename":43718,"language":673,"meta":56,"style":56},"export const pickupLocations = sqliteTable(\"pickup_locations\", {\n  id: integer(\"id\").primaryKey({ autoIncrement: true }),\n  slug: text(\"slug\").notNull().unique(),\n  name: text(\"name\").notNull(),\n  address: text(\"address\").notNull(),\n  hours: text(\"hours\").notNull(),\n  isActive: integer(\"is_active\").notNull().default(1),\n});\n\nexport const orders = sqliteTable(\"orders\", {\n  id: integer(\"id\").primaryKey({ autoIncrement: true }),\n  publicId: text(\"public_id\").notNull().unique(),\n  customerName: text(\"customer_name\").notNull(),\n  customerEmail: text(\"customer_email\").notNull(),\n  customerPhone: text(\"customer_phone\").notNull(),\n  locationId: integer(\"location_id\").notNull().references(() => pickupLocations.id),\n  pickupDate: text(\"pickup_date\").notNull(),\n  pickupWindow: text(\"pickup_window\").notNull(),\n  notes: text(\"notes\").notNull().default(\"\"),\n  subtotalCents: integer(\"subtotal_cents\").notNull(),\n  status: text(\"status\").notNull().default(\"pending\"),\n  createdAt: text(\"created_at\").notNull(),\n});\n",[40,48599,48600,48620,48640,48660,48676,48694,48712,48736,48740,48744,48762,48782,48804,48820,48838,48856,48883,48901,48919,48945,48963,48987,49003],{"__ignoreMap":56},[449,48601,48602,48604,48606,48609,48611,48613,48615,48618],{"class":451,"line":452},[449,48603,4629],{"class":680},[449,48605,10789],{"class":680},[449,48607,48608],{"class":714}," pickupLocations",[449,48610,718],{"class":680},[449,48612,10797],{"class":721},[449,48614,725],{"class":684},[449,48616,48617],{"class":691},"\"pickup_locations\"",[449,48619,768],{"class":684},[449,48621,48622,48624,48626,48628,48630,48632,48634,48636,48638],{"class":451,"line":114},[449,48623,10809],{"class":684},[449,48625,10903],{"class":721},[449,48627,725],{"class":684},[449,48629,10816],{"class":691},[449,48631,374],{"class":684},[449,48633,10821],{"class":721},[449,48635,44375],{"class":684},[449,48637,2169],{"class":714},[449,48639,3479],{"class":684},[449,48641,48642,48644,48646,48648,48650,48652,48654,48656,48658],{"class":451,"line":111},[449,48643,44511],{"class":684},[449,48645,53],{"class":721},[449,48647,725],{"class":684},[449,48649,44518],{"class":691},[449,48651,374],{"class":684},[449,48653,10839],{"class":721},[449,48655,5237],{"class":684},[449,48657,27598],{"class":721},[449,48659,1624],{"class":684},[449,48661,48662,48664,48666,48668,48670,48672,48674],{"class":451,"line":468},[449,48663,1396],{"class":684},[449,48665,53],{"class":721},[449,48667,725],{"class":684},[449,48669,10834],{"class":691},[449,48671,374],{"class":684},[449,48673,10839],{"class":721},[449,48675,1624],{"class":684},[449,48677,48678,48681,48683,48685,48688,48690,48692],{"class":451,"line":474},[449,48679,48680],{"class":684},"  address: ",[449,48682,53],{"class":721},[449,48684,725],{"class":684},[449,48686,48687],{"class":691},"\"address\"",[449,48689,374],{"class":684},[449,48691,10839],{"class":721},[449,48693,1624],{"class":684},[449,48695,48696,48699,48701,48703,48706,48708,48710],{"class":451,"line":480},[449,48697,48698],{"class":684},"  hours: ",[449,48700,53],{"class":721},[449,48702,725],{"class":684},[449,48704,48705],{"class":691},"\"hours\"",[449,48707,374],{"class":684},[449,48709,10839],{"class":721},[449,48711,1624],{"class":684},[449,48713,48714,48716,48718,48720,48722,48724,48726,48728,48730,48732,48734],{"class":451,"line":486},[449,48715,44438],{"class":684},[449,48717,10903],{"class":721},[449,48719,725],{"class":684},[449,48721,44445],{"class":691},[449,48723,374],{"class":684},[449,48725,10839],{"class":721},[449,48727,5237],{"class":684},[449,48729,10920],{"class":721},[449,48731,725],{"class":684},[449,48733,4798],{"class":714},[449,48735,1613],{"class":684},[449,48737,48738],{"class":451,"line":492},[449,48739,784],{"class":684},[449,48741,48742],{"class":451,"line":498},[449,48743,700],{"emptyLinePlaceholder":130},[449,48745,48746,48748,48750,48752,48754,48756,48758,48760],{"class":451,"line":133},[449,48747,4629],{"class":680},[449,48749,10789],{"class":680},[449,48751,5003],{"class":714},[449,48753,718],{"class":680},[449,48755,10797],{"class":721},[449,48757,725],{"class":684},[449,48759,10987],{"class":691},[449,48761,768],{"class":684},[449,48763,48764,48766,48768,48770,48772,48774,48776,48778,48780],{"class":451,"line":509},[449,48765,10809],{"class":684},[449,48767,10903],{"class":721},[449,48769,725],{"class":684},[449,48771,10816],{"class":691},[449,48773,374],{"class":684},[449,48775,10821],{"class":721},[449,48777,44375],{"class":684},[449,48779,2169],{"class":714},[449,48781,3479],{"class":684},[449,48783,48784,48787,48789,48791,48794,48796,48798,48800,48802],{"class":451,"line":318},[449,48785,48786],{"class":684},"  publicId: ",[449,48788,53],{"class":721},[449,48790,725],{"class":684},[449,48792,48793],{"class":691},"\"public_id\"",[449,48795,374],{"class":684},[449,48797,10839],{"class":721},[449,48799,5237],{"class":684},[449,48801,27598],{"class":721},[449,48803,1624],{"class":684},[449,48805,48806,48808,48810,48812,48814,48816,48818],{"class":451,"line":520},[449,48807,11040],{"class":684},[449,48809,53],{"class":721},[449,48811,725],{"class":684},[449,48813,11047],{"class":691},[449,48815,374],{"class":684},[449,48817,10839],{"class":721},[449,48819,1624],{"class":684},[449,48821,48822,48825,48827,48829,48832,48834,48836],{"class":451,"line":526},[449,48823,48824],{"class":684},"  customerEmail: ",[449,48826,53],{"class":721},[449,48828,725],{"class":684},[449,48830,48831],{"class":691},"\"customer_email\"",[449,48833,374],{"class":684},[449,48835,10839],{"class":721},[449,48837,1624],{"class":684},[449,48839,48840,48843,48845,48847,48850,48852,48854],{"class":451,"line":532},[449,48841,48842],{"class":684},"  customerPhone: ",[449,48844,53],{"class":721},[449,48846,725],{"class":684},[449,48848,48849],{"class":691},"\"customer_phone\"",[449,48851,374],{"class":684},[449,48853,10839],{"class":721},[449,48855,1624],{"class":684},[449,48857,48858,48861,48863,48865,48868,48870,48872,48874,48876,48878,48880],{"class":451,"line":2790},[449,48859,48860],{"class":684},"  locationId: ",[449,48862,10903],{"class":721},[449,48864,725],{"class":684},[449,48866,48867],{"class":691},"\"location_id\"",[449,48869,374],{"class":684},[449,48871,10839],{"class":721},[449,48873,5237],{"class":684},[449,48875,11202],{"class":721},[449,48877,4717],{"class":684},[449,48879,1498],{"class":680},[449,48881,48882],{"class":684}," pickupLocations.id),\n",[449,48884,48885,48888,48890,48892,48895,48897,48899],{"class":451,"line":3511},[449,48886,48887],{"class":684},"  pickupDate: ",[449,48889,53],{"class":721},[449,48891,725],{"class":684},[449,48893,48894],{"class":691},"\"pickup_date\"",[449,48896,374],{"class":684},[449,48898,10839],{"class":721},[449,48900,1624],{"class":684},[449,48902,48903,48906,48908,48910,48913,48915,48917],{"class":451,"line":3526},[449,48904,48905],{"class":684},"  pickupWindow: ",[449,48907,53],{"class":721},[449,48909,725],{"class":684},[449,48911,48912],{"class":691},"\"pickup_window\"",[449,48914,374],{"class":684},[449,48916,10839],{"class":721},[449,48918,1624],{"class":684},[449,48920,48921,48924,48926,48928,48931,48933,48935,48937,48939,48941,48943],{"class":451,"line":3531},[449,48922,48923],{"class":684},"  notes: ",[449,48925,53],{"class":721},[449,48927,725],{"class":684},[449,48929,48930],{"class":691},"\"notes\"",[449,48932,374],{"class":684},[449,48934,10839],{"class":721},[449,48936,5237],{"class":684},[449,48938,10920],{"class":721},[449,48940,725],{"class":684},[449,48942,29738],{"class":691},[449,48944,1613],{"class":684},[449,48946,48947,48950,48952,48954,48957,48959,48961],{"class":451,"line":3536},[449,48948,48949],{"class":684},"  subtotalCents: ",[449,48951,10903],{"class":721},[449,48953,725],{"class":684},[449,48955,48956],{"class":691},"\"subtotal_cents\"",[449,48958,374],{"class":684},[449,48960,10839],{"class":721},[449,48962,1624],{"class":684},[449,48964,48965,48967,48969,48971,48973,48975,48977,48979,48981,48983,48985],{"class":451,"line":4009},[449,48966,11010],{"class":684},[449,48968,53],{"class":721},[449,48970,725],{"class":684},[449,48972,11017],{"class":691},[449,48974,374],{"class":684},[449,48976,10839],{"class":721},[449,48978,5237],{"class":684},[449,48980,10920],{"class":721},[449,48982,725],{"class":684},[449,48984,5221],{"class":691},[449,48986,1613],{"class":684},[449,48988,48989,48991,48993,48995,48997,48999,49001],{"class":451,"line":4015},[449,48990,10931],{"class":684},[449,48992,53],{"class":721},[449,48994,725],{"class":684},[449,48996,10938],{"class":691},[449,48998,374],{"class":684},[449,49000,10839],{"class":721},[449,49002,1624],{"class":684},[449,49004,49005],{"class":451,"line":4021},[449,49006,784],{"class":684},[21,49008,49009,49011],{},[40,49010,48580],{}," copies the name, box label, and price. A menu edit next week must not rewrite an old receipt.",[21,49013,49014],{},"The migration also seeds the Kingston pickup location and next week's menu.",[32,49016,49018],{"id":49017},"pickup-slots","Pickup slots",[21,49020,49021],{},"Pickup windows are product rules, not arbitrary strings. Keep the same list on the server and client:",[48,49023,49026],{"className":670,"code":49024,"filename":49025,"language":673,"meta":56,"style":56},"export const PICKUP_WINDOWS = [\"11:00–12:00\", \"12:00–13:00\", \"15:00–16:00\"] as const;\n\nexport function pickupDateOptions(now = new Date(), days = 14) {\n  \u002F\u002F next 14 days, Tuesday through Saturday\n}\n\nexport function isPickupDateAvailable(value: string, now = new Date()): boolean {\n  \u002F\u002F YYYY-MM-DD, 1–14 days out, Tuesday through Saturday\n}\n\nexport function isPickupWindow(value: string): value is PickupWindow {\n  return (PICKUP_WINDOWS as readonly string[]).includes(value);\n}\n","src\u002Fpickup.ts",[40,49027,49028,49062,49066,49097,49102,49106,49110,49147,49152,49156,49160,49190,49213],{"__ignoreMap":56},[449,49029,49030,49032,49034,49037,49039,49041,49044,49046,49049,49051,49054,49056,49058,49060],{"class":451,"line":452},[449,49031,4629],{"class":680},[449,49033,10789],{"class":680},[449,49035,49036],{"class":714}," PICKUP_WINDOWS",[449,49038,718],{"class":680},[449,49040,13639],{"class":684},[449,49042,49043],{"class":691},"\"11:00–12:00\"",[449,49045,349],{"class":684},[449,49047,49048],{"class":691},"\"12:00–13:00\"",[449,49050,349],{"class":684},[449,49052,49053],{"class":691},"\"15:00–16:00\"",[449,49055,34451],{"class":684},[449,49057,5066],{"class":680},[449,49059,10789],{"class":680},[449,49061,695],{"class":684},[449,49063,49064],{"class":451,"line":114},[449,49065,700],{"emptyLinePlaceholder":130},[449,49067,49068,49070,49072,49075,49077,49079,49081,49083,49085,49087,49090,49092,49095],{"class":451,"line":111},[449,49069,4629],{"class":680},[449,49071,5433],{"class":680},[449,49073,49074],{"class":721}," pickupDateOptions",[449,49076,725],{"class":684},[449,49078,4756],{"class":1491},[449,49080,718],{"class":680},[449,49082,1343],{"class":680},[449,49084,5234],{"class":721},[449,49086,10892],{"class":684},[449,49088,49089],{"class":1491},"days",[449,49091,718],{"class":680},[449,49093,49094],{"class":714}," 14",[449,49096,3417],{"class":684},[449,49098,49099],{"class":451,"line":468},[449,49100,49101],{"class":705},"  \u002F\u002F next 14 days, Tuesday through Saturday\n",[449,49103,49104],{"class":451,"line":474},[449,49105,4604],{"class":684},[449,49107,49108],{"class":451,"line":480},[449,49109,700],{"emptyLinePlaceholder":130},[449,49111,49112,49114,49116,49119,49121,49123,49125,49127,49129,49131,49133,49135,49137,49140,49142,49145],{"class":451,"line":486},[449,49113,4629],{"class":680},[449,49115,5433],{"class":680},[449,49117,49118],{"class":721}," isPickupDateAvailable",[449,49120,725],{"class":684},[449,49122,23622],{"class":1491},[449,49124,3070],{"class":680},[449,49126,6081],{"class":714},[449,49128,349],{"class":684},[449,49130,4756],{"class":1491},[449,49132,718],{"class":680},[449,49134,1343],{"class":680},[449,49136,5234],{"class":721},[449,49138,49139],{"class":684},"())",[449,49141,3070],{"class":680},[449,49143,49144],{"class":714}," boolean",[449,49146,1501],{"class":684},[449,49148,49149],{"class":451,"line":492},[449,49150,49151],{"class":705},"  \u002F\u002F YYYY-MM-DD, 1–14 days out, Tuesday through Saturday\n",[449,49153,49154],{"class":451,"line":498},[449,49155,4604],{"class":684},[449,49157,49158],{"class":451,"line":133},[449,49159,700],{"emptyLinePlaceholder":130},[449,49161,49162,49164,49166,49169,49171,49173,49175,49177,49179,49181,49183,49185,49188],{"class":451,"line":509},[449,49163,4629],{"class":680},[449,49165,5433],{"class":680},[449,49167,49168],{"class":721}," isPickupWindow",[449,49170,725],{"class":684},[449,49172,23622],{"class":1491},[449,49174,3070],{"class":680},[449,49176,6081],{"class":714},[449,49178,827],{"class":684},[449,49180,3070],{"class":680},[449,49182,46750],{"class":1491},[449,49184,46753],{"class":680},[449,49186,49187],{"class":721}," PickupWindow",[449,49189,1501],{"class":684},[449,49191,49192,49194,49196,49199,49201,49204,49206,49209,49211],{"class":451,"line":318},[449,49193,4726],{"class":680},[449,49195,1913],{"class":684},[449,49197,49198],{"class":714},"PICKUP_WINDOWS",[449,49200,11431],{"class":680},[449,49202,49203],{"class":680}," readonly",[449,49205,6081],{"class":714},[449,49207,49208],{"class":684},"[]).",[449,49210,13791],{"class":721},[449,49212,46785],{"class":684},[449,49214,49215],{"class":451,"line":520},[449,49216,4604],{"class":684},[21,49218,49219],{},"The server re-runs the date and window checks. The browser controls are convenience; they are not validation.",[32,49221,49223],{"id":49222},"the-checkout-route","The checkout route",[48,49225,49228],{"className":670,"code":49226,"filename":49227,"language":673,"meta":56,"style":56},"export const POST = defineHandler(async (c) => {\n  const token = c.req.header(CART_HEADER);\n  if (!isCartToken(token)) return c.json({ error: \"Start a cart session first.\" }, 400);\n\n  const body = await readBody(c, checkoutSchema);\n  if (!body) return c.json({ error: \"Check the pickup details and try again.\" }, 400);\n\n  if (!isPickupDateAvailable(body.pickupDate) || !isPickupWindow(body.pickupWindow)) {\n    return c.json({ error: \"Choose an available pickup date and window.\" }, 400);\n  }\n\n  const [menu, location, record] = await Promise.all([\n    getActiveMenu(),\n    getPickupLocationBySlug(body.locationSlug),\n    readCart(token),\n  ]);\n\n  if (!location) return c.json({ error: \"That pickup location is not available.\" }, 400);\n\n  const { view, pruned } = buildCartView(record, menu.flavors, BOX_SIZES);\n  if (pruned.lines.length !== record.lines.length) await writeCart(token, pruned);\n  if (view.lines.length === 0) return c.json({ error: \"Your box is empty.\" }, 409);\n\n  const order = await createOrder({\n    publicId: makePublicId(),\n    customerName: body.customerName,\n    customerEmail: body.customerEmail,\n    customerPhone: body.customerPhone,\n    locationId: location.id,\n    pickupDate: body.pickupDate,\n    pickupWindow: body.pickupWindow,\n    notes: body.notes,\n    subtotalCents: view.subtotalCents,\n    items: view.lines.map((line) => ({\n      flavorSlug: line.slug,\n      flavorName: line.name,\n      boxSize: line.size,\n      boxLabel: line.boxLabel,\n      quantity: line.quantity,\n      priceCents: line.priceCents,\n      lineTotalCents: line.lineTotalCents,\n    })),\n  });\n\n  await deleteCart(token);\n  return { order: { publicId: order.publicId, status: order.status } };\n});\n","routes\u002Fapi\u002Fcheckout.ts",[40,49229,49230,49256,49274,49303,49307,49322,49349,49353,49377,49396,49400,49404,49436,49443,49451,49459,49464,49468,49496,49500,49528,49553,49585,49589,49604,49614,49619,49624,49629,49634,49639,49644,49649,49654,49671,49676,49681,49686,49691,49696,49701,49706,49711,49715,49719,49728,49735],{"__ignoreMap":56},[449,49231,49232,49234,49236,49238,49240,49242,49244,49246,49248,49250,49252,49254],{"class":451,"line":452},[449,49233,4629],{"class":680},[449,49235,10789],{"class":680},[449,49237,14358],{"class":714},[449,49239,718],{"class":680},[449,49241,41500],{"class":721},[449,49243,725],{"class":684},[449,49245,1485],{"class":680},[449,49247,1913],{"class":684},[449,49249,37719],{"class":1491},[449,49251,1758],{"class":684},[449,49253,1498],{"class":680},[449,49255,1501],{"class":684},[449,49257,49258,49260,49262,49264,49266,49268,49270,49272],{"class":451,"line":114},[449,49259,5048],{"class":680},[449,49261,27952],{"class":714},[449,49263,718],{"class":680},[449,49265,45412],{"class":684},[449,49267,31838],{"class":721},[449,49269,725],{"class":684},[449,49271,46996],{"class":714},[449,49273,740],{"class":684},[449,49275,49276,49278,49280,49282,49284,49287,49289,49291,49293,49295,49297,49299,49301],{"class":451,"line":111},[449,49277,5080],{"class":680},[449,49279,1913],{"class":684},[449,49281,5085],{"class":680},[449,49283,46840],{"class":721},[449,49285,49286],{"class":684},"(token)) ",[449,49288,37686],{"class":680},[449,49290,47667],{"class":684},[449,49292,4521],{"class":721},[449,49294,47672],{"class":684},[449,49296,47675],{"class":691},[449,49298,2737],{"class":684},[449,49300,5123],{"class":714},[449,49302,740],{"class":684},[449,49304,49305],{"class":451,"line":468},[449,49306,700],{"emptyLinePlaceholder":130},[449,49308,49309,49311,49313,49315,49317,49319],{"class":451,"line":474},[449,49310,5048],{"class":680},[449,49312,5051],{"class":714},[449,49314,718],{"class":680},[449,49316,1654],{"class":680},[449,49318,5060],{"class":721},[449,49320,49321],{"class":684},"(c, checkoutSchema);\n",[449,49323,49324,49326,49328,49330,49332,49334,49336,49338,49340,49343,49345,49347],{"class":451,"line":480},[449,49325,5080],{"class":680},[449,49327,1913],{"class":684},[449,49329,5085],{"class":680},[449,49331,47719],{"class":684},[449,49333,37686],{"class":680},[449,49335,47667],{"class":684},[449,49337,4521],{"class":721},[449,49339,47672],{"class":684},[449,49341,49342],{"class":691},"\"Check the pickup details and try again.\"",[449,49344,2737],{"class":684},[449,49346,5123],{"class":714},[449,49348,740],{"class":684},[449,49350,49351],{"class":451,"line":486},[449,49352,700],{"emptyLinePlaceholder":130},[449,49354,49355,49357,49359,49361,49364,49367,49369,49371,49374],{"class":451,"line":492},[449,49356,5080],{"class":680},[449,49358,1913],{"class":684},[449,49360,5085],{"class":680},[449,49362,49363],{"class":721},"isPickupDateAvailable",[449,49365,49366],{"class":684},"(body.pickupDate) ",[449,49368,5091],{"class":680},[449,49370,12868],{"class":680},[449,49372,49373],{"class":721},"isPickupWindow",[449,49375,49376],{"class":684},"(body.pickupWindow)) {\n",[449,49378,49379,49381,49383,49385,49387,49390,49392,49394],{"class":451,"line":498},[449,49380,1506],{"class":680},[449,49382,47667],{"class":684},[449,49384,4521],{"class":721},[449,49386,47672],{"class":684},[449,49388,49389],{"class":691},"\"Choose an available pickup date and window.\"",[449,49391,2737],{"class":684},[449,49393,5123],{"class":714},[449,49395,740],{"class":684},[449,49397,49398],{"class":451,"line":133},[449,49399,4599],{"class":684},[449,49401,49402],{"class":451,"line":509},[449,49403,700],{"emptyLinePlaceholder":130},[449,49405,49406,49408,49410,49413,49415,49418,49420,49422,49424,49426,49428,49430,49432,49434],{"class":451,"line":318},[449,49407,5048],{"class":680},[449,49409,13639],{"class":684},[449,49411,49412],{"class":714},"menu",[449,49414,349],{"class":684},[449,49416,49417],{"class":714},"location",[449,49419,349],{"class":684},[449,49421,47446],{"class":714},[449,49423,34451],{"class":684},[449,49425,5014],{"class":680},[449,49427,1654],{"class":680},[449,49429,5161],{"class":714},[449,49431,165],{"class":684},[449,49433,5813],{"class":721},[449,49435,37856],{"class":684},[449,49437,49438,49441],{"class":451,"line":520},[449,49439,49440],{"class":721},"    getActiveMenu",[449,49442,1624],{"class":684},[449,49444,49445,49448],{"class":451,"line":526},[449,49446,49447],{"class":721},"    getPickupLocationBySlug",[449,49449,49450],{"class":684},"(body.locationSlug),\n",[449,49452,49453,49456],{"class":451,"line":532},[449,49454,49455],{"class":721},"    readCart",[449,49457,49458],{"class":684},"(token),\n",[449,49460,49461],{"class":451,"line":2790},[449,49462,49463],{"class":684},"  ]);\n",[449,49465,49466],{"class":451,"line":3511},[449,49467,700],{"emptyLinePlaceholder":130},[449,49469,49470,49472,49474,49476,49479,49481,49483,49485,49487,49490,49492,49494],{"class":451,"line":3526},[449,49471,5080],{"class":680},[449,49473,1913],{"class":684},[449,49475,5085],{"class":680},[449,49477,49478],{"class":684},"location) ",[449,49480,37686],{"class":680},[449,49482,47667],{"class":684},[449,49484,4521],{"class":721},[449,49486,47672],{"class":684},[449,49488,49489],{"class":691},"\"That pickup location is not available.\"",[449,49491,2737],{"class":684},[449,49493,5123],{"class":714},[449,49495,740],{"class":684},[449,49497,49498],{"class":451,"line":3531},[449,49499,700],{"emptyLinePlaceholder":130},[449,49501,49502,49504,49506,49509,49511,49514,49516,49518,49521,49524,49526],{"class":451,"line":3536},[449,49503,5048],{"class":680},[449,49505,14227],{"class":684},[449,49507,49508],{"class":714},"view",[449,49510,349],{"class":684},[449,49512,49513],{"class":714},"pruned",[449,49515,21656],{"class":684},[449,49517,5014],{"class":680},[449,49519,49520],{"class":721}," buildCartView",[449,49522,49523],{"class":684},"(record, menu.flavors, ",[449,49525,45538],{"class":714},[449,49527,740],{"class":684},[449,49529,49530,49532,49535,49537,49540,49542,49544,49546,49548,49550],{"class":451,"line":4009},[449,49531,5080],{"class":680},[449,49533,49534],{"class":684}," (pruned.lines.",[449,49536,5097],{"class":714},[449,49538,49539],{"class":680}," !==",[449,49541,47889],{"class":684},[449,49543,5097],{"class":714},[449,49545,1758],{"class":684},[449,49547,2056],{"class":680},[449,49549,47433],{"class":721},[449,49551,49552],{"class":684},"(token, pruned);\n",[449,49554,49555,49557,49560,49562,49564,49566,49568,49570,49572,49574,49576,49579,49581,49583],{"class":451,"line":4015},[449,49556,5080],{"class":680},[449,49558,49559],{"class":684}," (view.lines.",[449,49561,5097],{"class":714},[449,49563,5100],{"class":680},[449,49565,5103],{"class":714},[449,49567,1758],{"class":684},[449,49569,37686],{"class":680},[449,49571,47667],{"class":684},[449,49573,4521],{"class":721},[449,49575,47672],{"class":684},[449,49577,49578],{"class":691},"\"Your box is empty.\"",[449,49580,2737],{"class":684},[449,49582,47852],{"class":714},[449,49584,740],{"class":684},[449,49586,49587],{"class":451,"line":4021},[449,49588,700],{"emptyLinePlaceholder":130},[449,49590,49591,49593,49595,49597,49599,49602],{"class":451,"line":4027},[449,49592,5048],{"class":680},[449,49594,5194],{"class":714},[449,49596,718],{"class":680},[449,49598,1654],{"class":680},[449,49600,49601],{"class":721}," createOrder",[449,49603,1391],{"class":684},[449,49605,49606,49609,49612],{"class":451,"line":4032},[449,49607,49608],{"class":684},"    publicId: ",[449,49610,49611],{"class":721},"makePublicId",[449,49613,1624],{"class":684},[449,49615,49616],{"class":451,"line":4038},[449,49617,49618],{"class":684},"    customerName: body.customerName,\n",[449,49620,49621],{"class":451,"line":4044},[449,49622,49623],{"class":684},"    customerEmail: body.customerEmail,\n",[449,49625,49626],{"class":451,"line":4049},[449,49627,49628],{"class":684},"    customerPhone: body.customerPhone,\n",[449,49630,49631],{"class":451,"line":4054},[449,49632,49633],{"class":684},"    locationId: location.id,\n",[449,49635,49636],{"class":451,"line":4059},[449,49637,49638],{"class":684},"    pickupDate: body.pickupDate,\n",[449,49640,49641],{"class":451,"line":4065},[449,49642,49643],{"class":684},"    pickupWindow: body.pickupWindow,\n",[449,49645,49646],{"class":451,"line":4070},[449,49647,49648],{"class":684},"    notes: body.notes,\n",[449,49650,49651],{"class":451,"line":4075},[449,49652,49653],{"class":684},"    subtotalCents: view.subtotalCents,\n",[449,49655,49656,49659,49661,49663,49665,49667,49669],{"class":451,"line":4081},[449,49657,49658],{"class":684},"    items: view.lines.",[449,49660,6391],{"class":721},[449,49662,5164],{"class":684},[449,49664,451],{"class":1491},[449,49666,1758],{"class":684},[449,49668,1498],{"class":680},[449,49670,36071],{"class":684},[449,49672,49673],{"class":451,"line":4086},[449,49674,49675],{"class":684},"      flavorSlug: line.slug,\n",[449,49677,49678],{"class":451,"line":4092},[449,49679,49680],{"class":684},"      flavorName: line.name,\n",[449,49682,49683],{"class":451,"line":4098},[449,49684,49685],{"class":684},"      boxSize: line.size,\n",[449,49687,49688],{"class":451,"line":4104},[449,49689,49690],{"class":684},"      boxLabel: line.boxLabel,\n",[449,49692,49693],{"class":451,"line":4110},[449,49694,49695],{"class":684},"      quantity: line.quantity,\n",[449,49697,49698],{"class":451,"line":5782},[449,49699,49700],{"class":684},"      priceCents: line.priceCents,\n",[449,49702,49703],{"class":451,"line":5788},[449,49704,49705],{"class":684},"      lineTotalCents: line.lineTotalCents,\n",[449,49707,49708],{"class":451,"line":5794},[449,49709,49710],{"class":684},"    })),\n",[449,49712,49713],{"class":451,"line":5799},[449,49714,13321],{"class":684},[449,49716,49717],{"class":451,"line":5804},[449,49718,700],{"emptyLinePlaceholder":130},[449,49720,49721,49723,49726],{"class":451,"line":5819},[449,49722,2099],{"class":680},[449,49724,49725],{"class":721}," deleteCart",[449,49727,28579],{"class":684},[449,49729,49730,49732],{"class":451,"line":5824},[449,49731,4726],{"class":680},[449,49733,49734],{"class":684}," { order: { publicId: order.publicId, status: order.status } };\n",[449,49736,49737],{"class":451,"line":5846},[449,49738,784],{"class":684},[21,49740,49741,49744],{},[40,49742,49743],{},"buildCartView"," is the same function that prices the cart. The client can choose a box size, but it cannot choose the price.",[21,49746,49747,49750],{},[40,49748,49749],{},"createOrder"," inserts the order, its line items, and the first timeline event. If line-item insertion fails, it deletes the order so a half-written receipt is not left behind.",[32,49752,49754],{"id":49753},"the-checkout-page","The checkout page",[21,49756,49757],{},"The form is a normal Vue form. The only special part is that it sends the cart token in the same header as the cart API:",[48,49759,49762],{"className":670,"code":49760,"filename":49761,"language":673,"meta":56,"style":56},"const response = await fetch(\"\u002Fapi\u002Fcheckout\", {\n  method: \"POST\",\n  credentials: \"same-origin\",\n  headers: {\n    \"content-type\": \"application\u002Fjson\",\n    [CART_HEADER]: sessionToken.value,\n  },\n  body: JSON.stringify(form),\n});\n","src\u002FJumbleCheckout.vue",[40,49763,49764,49783,49792,49801,49806,49817,49826,49830,49844],{"__ignoreMap":56},[449,49765,49766,49768,49770,49772,49774,49776,49778,49781],{"class":451,"line":452},[449,49767,711],{"class":680},[449,49769,46941],{"class":714},[449,49771,718],{"class":680},[449,49773,1654],{"class":680},[449,49775,5660],{"class":721},[449,49777,725],{"class":684},[449,49779,49780],{"class":691},"\"\u002Fapi\u002Fcheckout\"",[449,49782,768],{"class":684},[449,49784,49785,49788,49790],{"class":451,"line":114},[449,49786,49787],{"class":684},"  method: ",[449,49789,29862],{"class":691},[449,49791,779],{"class":684},[449,49793,49794,49797,49799],{"class":451,"line":111},[449,49795,49796],{"class":684},"  credentials: ",[449,49798,46969],{"class":691},[449,49800,779],{"class":684},[449,49802,49803],{"class":451,"line":468},[449,49804,49805],{"class":684},"  headers: {\n",[449,49807,49808,49811,49813,49815],{"class":451,"line":474},[449,49809,49810],{"class":691},"    \"content-type\"",[449,49812,1482],{"class":684},[449,49814,46986],{"class":691},[449,49816,779],{"class":684},[449,49818,49819,49821,49823],{"class":451,"line":480},[449,49820,23591],{"class":684},[449,49822,46996],{"class":714},[449,49824,49825],{"class":684},"]: sessionToken.value,\n",[449,49827,49828],{"class":451,"line":486},[449,49829,1474],{"class":684},[449,49831,49832,49835,49837,49839,49841],{"class":451,"line":492},[449,49833,49834],{"class":684},"  body: ",[449,49836,36119],{"class":714},[449,49838,165],{"class":684},[449,49840,36124],{"class":721},[449,49842,49843],{"class":684},"(form),\n",[449,49845,49846],{"class":451,"line":498},[449,49847,784],{"class":684},[21,49849,49850,49851,49854,49855,49858],{},"On success the server returns ",[40,49852,49853],{},"publicId","; the browser goes to ",[40,49856,49857],{},"\u002Forders\u002F:publicId",". That page is the receipt and the beginning of the status flow.",[32,49860,43385],{"id":43384},[21,49862,49863],{},"Generate and apply the migration, then run the app:",[48,49865,49867],{"className":839,"code":49866,"language":841,"meta":56,"style":56},"void db generate\nvoid db migrate\npnpm dev\n",[40,49868,49869,49877,49885],{"__ignoreMap":56},[449,49870,49871,49873,49875],{"class":451,"line":452},[449,49872,41217],{"class":721},[449,49874,11475],{"class":691},[449,49876,43513],{"class":691},[449,49878,49879,49881,49883],{"class":451,"line":114},[449,49880,41217],{"class":721},[449,49882,11475],{"class":691},[449,49884,40947],{"class":691},[449,49886,49887,49889],{"class":451,"line":111},[449,49888,24321],{"class":721},[449,49890,5300],{"class":691},[21,49892,49893,49894,49896,49897,49900,49901,165],{},"Open ",[40,49895,5872],{},", add a box, open the cart, and choose ",[151,49898,49899],{},"Checkout",". Fill the form and place the order. You should land on an order page with a real code such as ",[40,49902,49903],{},"JMB-KBZ47D",[21,49905,46444],{},[48,49907,49908],{"className":839,"code":44888,"language":841,"meta":56,"style":56},[40,49909,49910],{"__ignoreMap":56},[449,49911,49912,49914,49916,49918],{"class":451,"line":452},[449,49913,41217],{"class":721},[449,49915,41658],{"class":691},[449,49917,8896],{"class":714},[449,49919,44901],{"class":691},[32,49921,43583],{"id":43582},[21,49923,49924,49927,49928,49930],{},[40,49925,49926],{},"\u002Fpreview\u002F5"," uses a seeded demo cart. The full app at ",[40,49929,5872],{}," uses your real cart. The order page is public by unguessable order code; it contains the customer's contact details, so do not enumerate order IDs.",[21,49932,49933,49934,49936],{},"Stage 4 remains available at ",[40,49935,48448],{}," with the cart but no checkout.",[32,49938,43605],{"id":43604},[383,49940,49941,49947,49953,49959,49965,49971],{},[386,49942,49943,49946],{},[151,49944,49945],{},"The cart is deleted after the order, not before."," A failed insert must not lose the box.",[386,49948,49949,49952],{},[151,49950,49951],{},"Snapshot the line items."," Menu prices and names change; receipts must not.",[386,49954,49955,49958],{},[151,49956,49957],{},"Validate the pickup slot on the server."," A date select is not a security boundary.",[386,49960,49961,49964],{},[151,49962,49963],{},"Orders are not payments."," Jumble is pickup-only and pay-at-collection in this stage.",[386,49966,49967,49970],{},[151,49968,49969],{},"The public order code is a capability."," It is random and single-order; stage 7 protects the admin list.",[386,49972,49973,49976],{},[151,49974,49975],{},"The checkout can race the menu."," Re-read the active menu during checkout and prune unavailable lines.",[32,49978,43655],{"id":43654},[21,49980,49981],{},"The cart can now become a real D1 order with a pickup window, a public code, and line-item history.",[21,49983,43661,49984,49988],{},[151,49985,49986],{},[3861,49987,42678],{"href":42383}," — a queue confirms the order, the page polls, and a cron rotates the weekly menu.",[3728,49990,49991],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":111,"depth":111,"links":49993},[49994,49995,49996,49997,49998,49999,50000,50001,50002],{"id":42725,"depth":114,"text":42726},{"id":48593,"depth":114,"text":48594},{"id":49017,"depth":114,"text":49018},{"id":49222,"depth":114,"text":49223},{"id":49753,"depth":114,"text":49754},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Take the KV cart through pickup slots, validation, and the first real order in D1.","Pickup + D1 orders",{},{"title":48542,"description":50003},"learn\u002Fvoid\u002F05-pickup-and-checkout","9ovPDaJH5LtZfCPjIMInUOlHk7m3QXqBvJahv616rrU",{"id":50010,"title":50011,"author":50012,"body":50013,"description":51062,"difficulty":42701,"estMinutes":4059,"extension":119,"feature":51063,"img":42703,"meta":51064,"navigation":130,"nuxtVersion":116,"order":480,"path":42383,"releaseDate":116,"seo":51065,"series":41217,"sourcePRs":116,"sourceUrl":51066,"stem":51067,"__hash__":51068},"tutorials\u002Flearn\u002Fvoid\u002F06-order-status.md","Order Status: Queue, Polling, and the Weekly Cron",{"name":9,"img":17256,"website":42491},{"type":13,"value":50014,"toc":51052},[50015,50018,50021,50023,50026,50028,50060,50063,50067,50252,50255,50313,50327,50330,50334,50337,50532,50541,50544,50569,50573,50576,50855,50858,50860,50866,50892,50901,50904,50958,50960,50974,50976,50986,50992,50994,51038,51040,51043,51050],[21,50016,50017],{},"Checkout writes the order. The confirmation should not block the request.",[21,50019,50020],{},"Stage 6 puts a queue between checkout and the confirmation side effects, adds a polling status page, and schedules the Monday menu rotation.",[42504,50022],{"height":46561,"stage":33432},[21,50024,50025],{},"The preview is a real demo order in D1 with its timeline. The full app shows the same page after a checkout.",[32,50027,42726],{"id":42725},[383,50029,50030,50036,50042,50048,50054],{},[386,50031,50032,50035],{},[40,50033,50034],{},"order_events"," — the append-only timeline you already see on the order page.",[386,50037,50038,50041],{},[40,50039,50040],{},"queues\u002Forder-confirmation.ts"," — a typed consumer that confirms a pending order.",[386,50043,50044,50047],{},[40,50045,50046],{},"queues[\"order-confirmation\"].send()"," — enqueued after the D1 order is written.",[386,50049,50050,50053],{},[40,50051,50052],{},"GET \u002Fapi\u002Forders\u002F:publicId"," — the status endpoint the page polls.",[386,50055,50056,50059],{},[40,50057,50058],{},"crons\u002Fweekly-menu.ts"," — activates the week whose dates contain today.",[21,50061,50062],{},"The order status page stays public by order code. It reveals only that order.",[32,50064,50066],{"id":50065},"the-queue","The queue",[48,50068,50070],{"className":670,"code":50069,"filename":50040,"language":673,"meta":56,"style":56},"import { defineQueue } from \"void\";\nimport { confirmOrder } from \"..\u002Fsrc\u002Fserver\u002Forders\";\n\nexport type OrderConfirmationMessage = {\n  publicId: string;\n};\n\nexport default defineQueue\u003COrderConfirmationMessage>(async (batch) => {\n  for (const message of batch.messages) {\n    try {\n      await confirmOrder(message.body.publicId);\n      message.ack();\n    } catch (cause) {\n      console.error(\"Could not confirm order\", message.body.publicId, cause);\n      message.retry({ delaySeconds: 30 });\n    }\n  }\n});\n",[40,50071,50072,50084,50098,50102,50115,50126,50130,50134,50161,50176,50182,50193,50202,50211,50225,50240,50244,50248],{"__ignoreMap":56},[449,50073,50074,50076,50078,50080,50082],{"class":451,"line":452},[449,50075,681],{"class":680},[449,50077,41833],{"class":684},[449,50079,688],{"class":680},[449,50081,41176],{"class":691},[449,50083,695],{"class":684},[449,50085,50086,50088,50091,50093,50096],{"class":451,"line":114},[449,50087,681],{"class":680},[449,50089,50090],{"class":684}," { confirmOrder } ",[449,50092,688],{"class":680},[449,50094,50095],{"class":691}," \"..\u002Fsrc\u002Fserver\u002Forders\"",[449,50097,695],{"class":684},[449,50099,50100],{"class":451,"line":111},[449,50101,700],{"emptyLinePlaceholder":130},[449,50103,50104,50106,50108,50111,50113],{"class":451,"line":468},[449,50105,4629],{"class":680},[449,50107,11308],{"class":680},[449,50109,50110],{"class":721}," OrderConfirmationMessage",[449,50112,718],{"class":680},[449,50114,1501],{"class":684},[449,50116,50117,50120,50122,50124],{"class":451,"line":474},[449,50118,50119],{"class":1491},"  publicId",[449,50121,3070],{"class":680},[449,50123,6081],{"class":714},[449,50125,695],{"class":684},[449,50127,50128],{"class":451,"line":480},[449,50129,20963],{"class":684},[449,50131,50132],{"class":451,"line":486},[449,50133,700],{"emptyLinePlaceholder":130},[449,50135,50136,50138,50140,50142,50144,50147,50149,50151,50153,50155,50157,50159],{"class":451,"line":492},[449,50137,4629],{"class":680},[449,50139,4632],{"class":680},[449,50141,41848],{"class":721},[449,50143,5547],{"class":684},[449,50145,50146],{"class":721},"OrderConfirmationMessage",[449,50148,47183],{"class":684},[449,50150,1485],{"class":680},[449,50152,1913],{"class":684},[449,50154,41857],{"class":1491},[449,50156,1758],{"class":684},[449,50158,1498],{"class":680},[449,50160,1501],{"class":684},[449,50162,50163,50165,50167,50169,50172,50174],{"class":451,"line":498},[449,50164,5529],{"class":680},[449,50166,1913],{"class":684},[449,50168,711],{"class":680},[449,50170,50171],{"class":714}," message",[449,50173,12292],{"class":680},[449,50175,41879],{"class":684},[449,50177,50178,50180],{"class":451,"line":133},[449,50179,30698],{"class":680},[449,50181,1501],{"class":684},[449,50183,50184,50187,50190],{"class":451,"line":509},[449,50185,50186],{"class":680},"      await",[449,50188,50189],{"class":721}," confirmOrder",[449,50191,50192],{"class":684},"(message.body.publicId);\n",[449,50194,50195,50198,50200],{"class":451,"line":318},[449,50196,50197],{"class":684},"      message.",[449,50199,41892],{"class":721},[449,50201,1322],{"class":684},[449,50203,50204,50206,50208],{"class":451,"line":520},[449,50205,30723],{"class":684},[449,50207,5746],{"class":680},[449,50209,50210],{"class":684}," (cause) {\n",[449,50212,50213,50215,50217,50219,50222],{"class":451,"line":526},[449,50214,1927],{"class":684},[449,50216,17495],{"class":721},[449,50218,725],{"class":684},[449,50220,50221],{"class":691},"\"Could not confirm order\"",[449,50223,50224],{"class":684},", message.body.publicId, cause);\n",[449,50226,50227,50229,50232,50235,50238],{"class":451,"line":532},[449,50228,50197],{"class":684},[449,50230,50231],{"class":721},"retry",[449,50233,50234],{"class":684},"({ delaySeconds: ",[449,50236,50237],{"class":714},"30",[449,50239,2051],{"class":684},[449,50241,50242],{"class":451,"line":2790},[449,50243,7544],{"class":684},[449,50245,50246],{"class":451,"line":3511},[449,50247,4599],{"class":684},[449,50249,50250],{"class":451,"line":3526},[449,50251,784],{"class":684},[21,50253,50254],{},"The producer is one line in checkout:",[48,50256,50258],{"className":670,"code":50257,"filename":49227,"language":673,"meta":56,"style":56},"try {\n  await queues[\"order-confirmation\"].send({ publicId: order.publicId });\n} catch (cause) {\n  console.error(\"Could not enqueue order confirmation\", order.publicId, cause);\n}\n",[40,50259,50260,50267,50286,50295,50309],{"__ignoreMap":56},[449,50261,50262,50265],{"class":451,"line":452},[449,50263,50264],{"class":680},"try",[449,50266,1501],{"class":684},[449,50268,50269,50271,50274,50277,50280,50283],{"class":451,"line":114},[449,50270,2099],{"class":680},[449,50272,50273],{"class":684}," queues[",[449,50275,50276],{"class":691},"\"order-confirmation\"",[449,50278,50279],{"class":684},"].",[449,50281,50282],{"class":721},"send",[449,50284,50285],{"class":684},"({ publicId: order.publicId });\n",[449,50287,50288,50291,50293],{"class":451,"line":111},[449,50289,50290],{"class":684},"} ",[449,50292,5746],{"class":680},[449,50294,50210],{"class":684},[449,50296,50297,50299,50301,50303,50306],{"class":451,"line":468},[449,50298,5444],{"class":684},[449,50300,17495],{"class":721},[449,50302,725],{"class":684},[449,50304,50305],{"class":691},"\"Could not enqueue order confirmation\"",[449,50307,50308],{"class":684},", order.publicId, cause);\n",[449,50310,50311],{"class":451,"line":474},[449,50312,4604],{"class":684},[21,50314,50315,50316,50319,50320,26018,50323,50326],{},"The order is already committed at that point. A queue outage leaves it pending; it does not lose the sale. The consumer's ",[40,50317,50318],{},"confirmOrder"," is idempotent: it only moves ",[40,50321,50322],{},"pending",[40,50324,50325],{},"confirmed"," and appends the confirmation event.",[21,50328,50329],{},"Void provisions the queue and connects the producer to the consumer at deploy. Locally, sending to the queue invokes the consumer through Miniflare.",[32,50331,50333],{"id":50332},"the-status-page","The status page",[21,50335,50336],{},"The page takes an order from the loader, then polls while the order is still moving:",[48,50338,50341],{"className":670,"code":50339,"filename":50340,"language":673,"meta":56,"style":56},"async function refresh() {\n  const response = await fetch(`\u002Fapi\u002Forders\u002F${current.value.publicId}`);\n  if (!response.ok) return;\n\n  const payload = await response.json();\n  current.value = payload;\n\n  if (ORDER_FINAL_STATUSES.includes(payload.status)) {\n    stopPolling();\n  }\n}\n\nonMounted(() => {\n  if (displayStage.value >= 6 && !finalStatus.value) {\n    timer = setInterval(() => void refresh(), 4000);\n  }\n});\n","src\u002FJumbleOrder.vue",[40,50342,50343,50354,50385,50400,50404,50420,50430,50434,50450,50457,50461,50465,50469,50480,50499,50524,50528],{"__ignoreMap":56},[449,50344,50345,50347,50349,50352],{"class":451,"line":452},[449,50346,1485],{"class":680},[449,50348,5433],{"class":680},[449,50350,50351],{"class":721}," refresh",[449,50353,5439],{"class":684},[449,50355,50356,50358,50360,50362,50364,50366,50368,50371,50373,50375,50377,50379,50381,50383],{"class":451,"line":114},[449,50357,5048],{"class":680},[449,50359,46941],{"class":714},[449,50361,718],{"class":680},[449,50363,1654],{"class":680},[449,50365,5660],{"class":721},[449,50367,725],{"class":684},[449,50369,50370],{"class":691},"`\u002Fapi\u002Forders\u002F${",[449,50372,24955],{"class":684},[449,50374,165],{"class":691},[449,50376,23622],{"class":684},[449,50378,165],{"class":691},[449,50380,49853],{"class":684},[449,50382,1517],{"class":691},[449,50384,740],{"class":684},[449,50386,50387,50389,50391,50393,50396,50398],{"class":451,"line":111},[449,50388,5080],{"class":680},[449,50390,1913],{"class":684},[449,50392,5085],{"class":680},[449,50394,50395],{"class":684},"response.ok) ",[449,50397,37686],{"class":680},[449,50399,695],{"class":684},[449,50401,50402],{"class":451,"line":468},[449,50403,700],{"emptyLinePlaceholder":130},[449,50405,50406,50408,50410,50412,50414,50416,50418],{"class":451,"line":474},[449,50407,5048],{"class":680},[449,50409,28570],{"class":714},[449,50411,718],{"class":680},[449,50413,1654],{"class":680},[449,50415,47018],{"class":684},[449,50417,4521],{"class":721},[449,50419,1322],{"class":684},[449,50421,50422,50425,50427],{"class":451,"line":480},[449,50423,50424],{"class":684},"  current.value ",[449,50426,5014],{"class":680},[449,50428,50429],{"class":684}," payload;\n",[449,50431,50432],{"class":451,"line":486},[449,50433,700],{"emptyLinePlaceholder":130},[449,50435,50436,50438,50440,50443,50445,50447],{"class":451,"line":492},[449,50437,5080],{"class":680},[449,50439,1913],{"class":684},[449,50441,50442],{"class":714},"ORDER_FINAL_STATUSES",[449,50444,165],{"class":684},[449,50446,13791],{"class":721},[449,50448,50449],{"class":684},"(payload.status)) {\n",[449,50451,50452,50455],{"class":451,"line":498},[449,50453,50454],{"class":721},"    stopPolling",[449,50456,1322],{"class":684},[449,50458,50459],{"class":451,"line":133},[449,50460,4599],{"class":684},[449,50462,50463],{"class":451,"line":509},[449,50464,4604],{"class":684},[449,50466,50467],{"class":451,"line":318},[449,50468,700],{"emptyLinePlaceholder":130},[449,50470,50471,50474,50476,50478],{"class":451,"line":520},[449,50472,50473],{"class":721},"onMounted",[449,50475,4717],{"class":684},[449,50477,1498],{"class":680},[449,50479,1501],{"class":684},[449,50481,50482,50484,50487,50489,50492,50494,50496],{"class":451,"line":526},[449,50483,5080],{"class":680},[449,50485,50486],{"class":684}," (displayStage.value ",[449,50488,5614],{"class":680},[449,50490,50491],{"class":714}," 6",[449,50493,46774],{"class":680},[449,50495,12868],{"class":680},[449,50497,50498],{"class":684},"finalStatus.value) {\n",[449,50500,50501,50504,50506,50509,50511,50513,50515,50517,50519,50522],{"class":451,"line":532},[449,50502,50503],{"class":684},"    timer ",[449,50505,5014],{"class":680},[449,50507,50508],{"class":721}," setInterval",[449,50510,4717],{"class":684},[449,50512,1498],{"class":680},[449,50514,41610],{"class":680},[449,50516,50351],{"class":721},[449,50518,10892],{"class":684},[449,50520,50521],{"class":714},"4000",[449,50523,740],{"class":684},[449,50525,50526],{"class":451,"line":2790},[449,50527,4599],{"class":684},[449,50529,50530],{"class":451,"line":3511},[449,50531,784],{"class":684},[21,50533,50534,50536,50537,50540],{},[40,50535,50052],{}," reads the order, its items, and its events. It sets ",[40,50538,50539],{},"Cache-Control: no-store","; a status page must not be cached.",[21,50542,50543],{},"The event timeline is the real state transition log:",[48,50545,50547],{"className":443,"code":50546,"language":445,"meta":56,"style":56},"Order placed.\nPickup confirmed. We will have the box ready.\nStatus changed to Preparing.\nStatus changed to Ready for pickup.\n",[40,50548,50549,50554,50559,50564],{"__ignoreMap":56},[449,50550,50551],{"class":451,"line":452},[449,50552,50553],{},"Order placed.\n",[449,50555,50556],{"class":451,"line":114},[449,50557,50558],{},"Pickup confirmed. We will have the box ready.\n",[449,50560,50561],{"class":451,"line":111},[449,50562,50563],{},"Status changed to Preparing.\n",[449,50565,50566],{"class":451,"line":468},[449,50567,50568],{},"Status changed to Ready for pickup.\n",[32,50570,50572],{"id":50571},"the-weekly-menu-cron","The weekly menu cron",[21,50574,50575],{},"The menu is a row; the active week is a flag. A cron makes the flag follow the calendar:",[48,50577,50579],{"className":670,"code":50578,"filename":50058,"language":673,"meta":56,"style":56},"export const cron = \"0 6 * * 1\";\n\nexport default defineScheduled(async (controller) => {\n  const today = new Date(controller.scheduledTime).toISOString().slice(0, 10);\n  const allWeeks = await db.select().from(weeks).orderBy(asc(weeks.startsOn));\n\n  const current =\n    allWeeks.find((week) => week.startsOn \u003C= today && week.endsOn >= today) ??\n    allWeeks.filter((week) => week.startsOn \u003C= today).at(-1);\n\n  if (!current || current.isActive === 1) return;\n\n  await db.update(weeks).set({ isActive: 0 });\n  await db.update(weeks).set({ isActive: 1 }).where(eq(weeks.id, current.id));\n});\n",[40,50580,50581,50596,50600,50623,50657,50688,50692,50702,50738,50771,50775,50801,50805,50824,50851],{"__ignoreMap":56},[449,50582,50583,50585,50587,50589,50591,50594],{"class":451,"line":452},[449,50584,4629],{"class":680},[449,50586,10789],{"class":680},[449,50588,41785],{"class":714},[449,50590,718],{"class":680},[449,50592,50593],{"class":691}," \"0 6 * * 1\"",[449,50595,695],{"class":684},[449,50597,50598],{"class":451,"line":114},[449,50599,700],{"emptyLinePlaceholder":130},[449,50601,50602,50604,50606,50608,50610,50612,50614,50617,50619,50621],{"class":451,"line":111},[449,50603,4629],{"class":680},[449,50605,4632],{"class":680},[449,50607,41801],{"class":721},[449,50609,725],{"class":684},[449,50611,1485],{"class":680},[449,50613,1913],{"class":684},[449,50615,50616],{"class":1491},"controller",[449,50618,1758],{"class":684},[449,50620,1498],{"class":680},[449,50622,1501],{"class":684},[449,50624,50625,50627,50630,50632,50634,50636,50639,50641,50643,50646,50648,50650,50652,50655],{"class":451,"line":468},[449,50626,5048],{"class":680},[449,50628,50629],{"class":714}," today",[449,50631,718],{"class":680},[449,50633,1343],{"class":680},[449,50635,5234],{"class":721},[449,50637,50638],{"class":684},"(controller.scheduledTime).",[449,50640,5240],{"class":721},[449,50642,5237],{"class":684},[449,50644,50645],{"class":721},"slice",[449,50647,725],{"class":684},[449,50649,9899],{"class":714},[449,50651,349],{"class":684},[449,50653,50654],{"class":714},"10",[449,50656,740],{"class":684},[449,50658,50659,50661,50664,50666,50668,50670,50672,50674,50676,50679,50681,50683,50685],{"class":451,"line":474},[449,50660,5048],{"class":680},[449,50662,50663],{"class":714}," allWeeks",[449,50665,718],{"class":680},[449,50667,1654],{"class":680},[449,50669,12255],{"class":684},[449,50671,12452],{"class":721},[449,50673,5237],{"class":684},[449,50675,688],{"class":721},[449,50677,50678],{"class":684},"(weeks).",[449,50680,14135],{"class":721},[449,50682,725],{"class":684},[449,50684,44004],{"class":721},[449,50686,50687],{"class":684},"(weeks.startsOn));\n",[449,50689,50690],{"class":451,"line":480},[449,50691,700],{"emptyLinePlaceholder":130},[449,50693,50694,50696,50699],{"class":451,"line":486},[449,50695,5048],{"class":680},[449,50697,50698],{"class":714}," current",[449,50700,50701],{"class":680}," =\n",[449,50703,50704,50707,50709,50711,50713,50715,50717,50720,50722,50725,50727,50730,50732,50735],{"class":451,"line":492},[449,50705,50706],{"class":684},"    allWeeks.",[449,50708,37464],{"class":721},[449,50710,5164],{"class":684},[449,50712,43811],{"class":1491},[449,50714,1758],{"class":684},[449,50716,1498],{"class":680},[449,50718,50719],{"class":684}," week.startsOn ",[449,50721,37488],{"class":680},[449,50723,50724],{"class":684}," today ",[449,50726,16941],{"class":680},[449,50728,50729],{"class":684}," week.endsOn ",[449,50731,5614],{"class":680},[449,50733,50734],{"class":684}," today) ",[449,50736,50737],{"class":680},"??\n",[449,50739,50740,50742,50745,50747,50749,50751,50753,50755,50757,50760,50763,50765,50767,50769],{"class":451,"line":498},[449,50741,50706],{"class":684},[449,50743,50744],{"class":721},"filter",[449,50746,5164],{"class":684},[449,50748,43811],{"class":1491},[449,50750,1758],{"class":684},[449,50752,1498],{"class":680},[449,50754,50719],{"class":684},[449,50756,37488],{"class":680},[449,50758,50759],{"class":684}," today).",[449,50761,50762],{"class":721},"at",[449,50764,725],{"class":684},[449,50766,5840],{"class":680},[449,50768,4798],{"class":714},[449,50770,740],{"class":684},[449,50772,50773],{"class":451,"line":133},[449,50774,700],{"emptyLinePlaceholder":130},[449,50776,50777,50779,50781,50783,50786,50788,50791,50793,50795,50797,50799],{"class":451,"line":509},[449,50778,5080],{"class":680},[449,50780,1913],{"class":684},[449,50782,5085],{"class":680},[449,50784,50785],{"class":684},"current ",[449,50787,5091],{"class":680},[449,50789,50790],{"class":684}," current.isActive ",[449,50792,37592],{"class":680},[449,50794,20024],{"class":714},[449,50796,1758],{"class":684},[449,50798,37686],{"class":680},[449,50800,695],{"class":684},[449,50802,50803],{"class":451,"line":318},[449,50804,700],{"emptyLinePlaceholder":130},[449,50806,50807,50809,50811,50813,50815,50817,50820,50822],{"class":451,"line":520},[449,50808,2099],{"class":680},[449,50810,12255],{"class":684},[449,50812,13952],{"class":721},[449,50814,50678],{"class":684},[449,50816,13962],{"class":721},[449,50818,50819],{"class":684},"({ isActive: ",[449,50821,9899],{"class":714},[449,50823,2051],{"class":684},[449,50825,50826,50828,50830,50832,50834,50836,50838,50840,50842,50844,50846,50848],{"class":451,"line":526},[449,50827,2099],{"class":680},[449,50829,12255],{"class":684},[449,50831,13952],{"class":721},[449,50833,50678],{"class":684},[449,50835,13962],{"class":721},[449,50837,50819],{"class":684},[449,50839,4798],{"class":714},[449,50841,10917],{"class":684},[449,50843,12461],{"class":721},[449,50845,725],{"class":684},[449,50847,13024],{"class":721},[449,50849,50850],{"class":684},"(weeks.id, current.id));\n",[449,50852,50853],{"class":451,"line":532},[449,50854,784],{"class":684},[21,50856,50857],{},"The stage 6 migration seeds a second week starting November 2. When the cron runs on a Monday, the storefront moves to that week's flavors without a deploy.",[32,50859,43385],{"id":43384},[21,50861,50862,50863,50865],{},"The migration adds ",[40,50864,50034],{}," and the second menu week:",[48,50867,50868],{"className":839,"code":49866,"language":841,"meta":56,"style":56},[40,50869,50870,50878,50886],{"__ignoreMap":56},[449,50871,50872,50874,50876],{"class":451,"line":452},[449,50873,41217],{"class":721},[449,50875,11475],{"class":691},[449,50877,43513],{"class":691},[449,50879,50880,50882,50884],{"class":451,"line":114},[449,50881,41217],{"class":721},[449,50883,11475],{"class":691},[449,50885,40947],{"class":691},[449,50887,50888,50890],{"class":451,"line":111},[449,50889,24321],{"class":721},[449,50891,5300],{"class":691},[21,50893,50894,50895,50897,50898,50900],{},"Place an order through checkout. The checkout response is ",[40,50896,50322],{},"; within a second or two the order page should become ",[40,50899,50325],{}," as the local queue consumer runs.",[21,50902,50903],{},"Test the cron locally with Void's development endpoint:",[48,50905,50907],{"className":839,"code":50906,"language":841,"meta":56,"style":56},"curl -X POST http:\u002F\u002Flocalhost:5173\u002F__void\u002Fscheduled \\\n  -H \"x-void-dev-trigger: \u003Cprinted-token>\" \\\n  -d '{\"cron\":\"0 6 * * 1\",\"scheduledTime\":'$(date -d 'next monday' +%s000)'}'\n",[40,50908,50909,50922,50931],{"__ignoreMap":56},[449,50910,50911,50913,50915,50917,50920],{"class":451,"line":452},[449,50912,4396],{"class":721},[449,50914,14355],{"class":714},[449,50916,14358],{"class":691},[449,50918,50919],{"class":691}," http:\u002F\u002Flocalhost:5173\u002F__void\u002Fscheduled",[449,50921,14400],{"class":714},[449,50923,50924,50926,50929],{"class":451,"line":114},[449,50925,14405],{"class":714},[449,50927,50928],{"class":691}," \"x-void-dev-trigger: \u003Cprinted-token>\"",[449,50930,14400],{"class":714},[449,50932,50933,50935,50938,50941,50944,50947,50950,50953,50955],{"class":451,"line":111},[449,50934,14415],{"class":714},[449,50936,50937],{"class":691}," '{\"cron\":\"0 6 * * 1\",\"scheduledTime\":'",[449,50939,50940],{"class":684},"$(",[449,50942,50943],{"class":721},"date",[449,50945,50946],{"class":714}," -d",[449,50948,50949],{"class":691}," 'next monday'",[449,50951,50952],{"class":691}," +%s000",[449,50954,827],{"class":684},[449,50956,50957],{"class":691},"'}'\n",[21,50959,46444],{},[48,50961,50962],{"className":839,"code":44888,"language":841,"meta":56,"style":56},[40,50963,50964],{"__ignoreMap":56},[449,50965,50966,50968,50970,50972],{"class":451,"line":452},[449,50967,41217],{"class":721},[449,50969,41658],{"class":691},[449,50971,8896],{"class":714},[449,50973,44901],{"class":691},[32,50975,43583],{"id":43582},[21,50977,50978,50981,50982,50985],{},[40,50979,50980],{},"\u002Fpreview\u002F6"," is ",[40,50983,50984],{},"JMB-DEMO-001",", a real confirmed order with a timeline. The full app shows the page after checkout. The status pill moves through Pending, Confirmed, Preparing, Ready, and Picked up as the admin advances it.",[21,50987,50988,50989,50991],{},"Stage 5 remains at ",[40,50990,49926],{}," with checkout and no confirmation queue.",[32,50993,43605],{"id":43604},[383,50995,50996,51002,51008,51014,51020,51026,51032],{},[386,50997,50998,51001],{},[151,50999,51000],{},"Acknowledge per message."," One bad order should not retry the rest of the batch forever.",[386,51003,51004,51007],{},[151,51005,51006],{},"Make confirmation idempotent."," Queues deliver at least once; a retry must not duplicate events or reset a later status.",[386,51009,51010,51013],{},[151,51011,51012],{},"Poll, then stop."," Clear the interval on unmount and when the order reaches a final status.",[386,51015,51016,51019],{},[151,51017,51018],{},"Keep the public code unguessable."," It is the capability for the status page.",[386,51021,51022,51025],{},[151,51023,51024],{},"Cron expressions run in UTC."," The menu week dates are date-only strings; compare them consistently.",[386,51027,51028,51031],{},[151,51029,51030],{},"A queue is not a transaction."," Enqueue after the order is committed. A failed enqueue leaves an order for a retry or an admin, not a phantom sale.",[386,51033,51034,51037],{},[151,51035,51036],{},"Stage 5 does not have the queue."," The stage routes are how you see that boundary in the app.",[32,51039,43655],{"id":43654},[21,51041,51042],{},"Orders now confirm in the background, the receipt updates itself, and the menu changes on schedule.",[21,51044,43661,51045,51049],{},[151,51046,51047],{},[3861,51048,42683],{"href":42392}," — a password-gated dashboard for orders and the weekly menu.",[3728,51051,24219],{},{"title":56,"searchDepth":111,"depth":111,"links":51053},[51054,51055,51056,51057,51058,51059,51060,51061],{"id":42725,"depth":114,"text":42726},{"id":50065,"depth":114,"text":50066},{"id":50332,"depth":114,"text":50333},{"id":50571,"depth":114,"text":50572},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Move order confirmation into a queue, poll the status page, and rotate the menu on a schedule.","Queue + polling + cron",{},{"title":50011,"description":51062},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fqueues","learn\u002Fvoid\u002F06-order-status","DShv1k89aUr5vyz47fBcigz1q67rAw0l9hWAyZ2ZM3o",{"id":51070,"title":51071,"author":51072,"body":51073,"description":52306,"difficulty":42701,"estMinutes":4059,"extension":119,"feature":52307,"img":42703,"meta":52308,"navigation":130,"nuxtVersion":116,"order":486,"path":42392,"releaseDate":116,"seo":52309,"series":41217,"sourcePRs":116,"sourceUrl":52310,"stem":52311,"__hash__":52312},"tutorials\u002Flearn\u002Fvoid\u002F07-admin-and-auth.md","Admin + Auth: Protect the Menu and Orders",{"name":9,"img":17256,"website":42491},{"type":13,"value":51074,"toc":52295},[51075,51078,51081,51083,51093,51095,51129,51132,51136,51183,51189,51206,51211,51213,51216,51525,51539,51745,51748,51752,51755,51904,51907,51953,51956,52015,52019,52022,52034,52144,52147,52149,52154,52165,52168,52178,52183,52186,52211,52213,52222,52228,52230,52280,52282,52285,52292],[21,51076,51077],{},"Orders contain names, email addresses, and phone numbers. Menu edits change what every customer can buy. Neither belongs behind a public button.",[21,51079,51080],{},"Stage 7 adds a single-admin gate: a password from a Worker secret, an HttpOnly session cookie, KV-backed sessions, protected APIs, and a dashboard for orders and the weekly menu.",[42504,51082],{"height":42506,"stage":33443},[21,51084,51085,51086,51089,51090,165],{},"The preview shows the unauthenticated door. The full app at ",[40,51087,51088],{},"\u002Fadmin"," accepts the password you set in ",[40,51091,51092],{},"ADMIN_PASSWORD",[32,51094,42726],{"id":42725},[383,51096,51097,51105,51111,51117,51123,51126],{},[386,51098,51099,51101,51102,51104],{},[40,51100,41756],{}," declares ",[40,51103,51092],{}," as a required server value.",[386,51106,51107,51110],{},[40,51108,51109],{},"POST \u002Fapi\u002Fadmin\u002Flogin"," compares the password and creates a KV session.",[386,51112,51113,51116],{},[40,51114,51115],{},"isAdmin(c)"," reads the HttpOnly cookie and verifies the session in KV.",[386,51118,51119,51122],{},[40,51120,51121],{},"GET \u002Fadmin"," server-renders the login form or the dashboard.",[386,51124,51125],{},"Protected APIs can list nothing until the session check passes.",[386,51127,51128],{},"The dashboard updates order statuses and adds\u002Fremoves flavors from the active week.",[21,51130,51131],{},"This is not customer authentication. It is one operator session for a small kitchen. Stage 8's images are uploaded through the same gate.",[32,51133,51135],{"id":51134},"the-password","The password",[48,51137,51139],{"className":670,"code":51138,"filename":41756,"language":673,"meta":56,"style":56},"import { defineEnv, string } from \"void\u002Fenv\";\n\nexport default defineEnv({\n  ADMIN_PASSWORD: string(),\n});\n",[40,51140,51141,51155,51159,51170,51179],{"__ignoreMap":56},[449,51142,51143,51145,51148,51150,51153],{"class":451,"line":452},[449,51144,681],{"class":680},[449,51146,51147],{"class":684}," { defineEnv, string } ",[449,51149,688],{"class":680},[449,51151,51152],{"class":691}," \"void\u002Fenv\"",[449,51154,695],{"class":684},[449,51156,51157],{"class":451,"line":114},[449,51158,700],{"emptyLinePlaceholder":130},[449,51160,51161,51163,51165,51168],{"class":451,"line":111},[449,51162,4629],{"class":680},[449,51164,4632],{"class":680},[449,51166,51167],{"class":721}," defineEnv",[449,51169,1391],{"class":684},[449,51171,51172,51175,51177],{"class":451,"line":468},[449,51173,51174],{"class":684},"  ADMIN_PASSWORD: ",[449,51176,25474],{"class":721},[449,51178,1624],{"class":684},[449,51180,51181],{"class":451,"line":474},[449,51182,784],{"class":684},[21,51184,51185,51186,51188],{},"Local development reads the root ",[40,51187,26592],{},"; production needs a Worker secret:",[48,51190,51192],{"className":839,"code":51191,"language":841,"meta":56,"style":56},"void secret put ADMIN_PASSWORD\n",[40,51193,51194],{"__ignoreMap":56},[449,51195,51196,51198,51200,51203],{"class":451,"line":452},[449,51197,41217],{"class":721},[449,51199,26674],{"class":691},[449,51201,51202],{"class":691}," put",[449,51204,51205],{"class":691}," ADMIN_PASSWORD\n",[21,51207,51208,51210],{},[40,51209,41236],{}," refuses to ship if the required server key is missing. The password never reaches the browser bundle.",[32,51212,46646],{"id":46645},[21,51214,51215],{},"The login route is the only place that accepts the password:",[48,51217,51220],{"className":670,"code":51218,"filename":51219,"language":673,"meta":56,"style":56},"export const POST = defineHandler(async (c) => {\n  let body: unknown;\n  try {\n    body = await c.req.json();\n  } catch {\n    return c.json({ error: \"Enter the admin password.\" }, 400);\n  }\n\n  const parsed = loginSchema.safeParse(body);\n  if (!parsed.success || parsed.data.password !== env.ADMIN_PASSWORD) {\n    return c.json({ error: \"That password is not right.\" }, 401);\n  }\n\n  const token = await createAdminSession();\n  const secure = import.meta.env.PROD ? \"; Secure\" : \"\";\n  const cookie = `${ADMIN_COOKIE}=${token}; Path=\u002F; HttpOnly; SameSite=Lax; Max-Age=43200${secure}`;\n\n  return new Response(JSON.stringify({ ok: true }), {\n    headers: {\n      \"content-type\": \"application\u002Fjson\",\n      \"set-cookie\": cookie,\n    },\n  });\n});\n","routes\u002Fapi\u002Fadmin\u002Flogin.ts",[40,51221,51222,51248,51260,51266,51281,51289,51308,51312,51316,51331,51356,51375,51379,51383,51398,51432,51462,51466,51491,51495,51505,51513,51517,51521],{"__ignoreMap":56},[449,51223,51224,51226,51228,51230,51232,51234,51236,51238,51240,51242,51244,51246],{"class":451,"line":452},[449,51225,4629],{"class":680},[449,51227,10789],{"class":680},[449,51229,14358],{"class":714},[449,51231,718],{"class":680},[449,51233,41500],{"class":721},[449,51235,725],{"class":684},[449,51237,1485],{"class":680},[449,51239,1913],{"class":684},[449,51241,37719],{"class":1491},[449,51243,1758],{"class":684},[449,51245,1498],{"class":680},[449,51247,1501],{"class":684},[449,51249,51250,51252,51254,51256,51258],{"class":451,"line":114},[449,51251,5496],{"class":680},[449,51253,5051],{"class":684},[449,51255,3070],{"class":680},[449,51257,46743],{"class":714},[449,51259,695],{"class":684},[449,51261,51262,51264],{"class":451,"line":111},[449,51263,27027],{"class":680},[449,51265,1501],{"class":684},[449,51267,51268,51271,51273,51275,51277,51279],{"class":451,"line":468},[449,51269,51270],{"class":684},"    body ",[449,51272,5014],{"class":680},[449,51274,1654],{"class":680},[449,51276,45412],{"class":684},[449,51278,4521],{"class":721},[449,51280,1322],{"class":684},[449,51282,51283,51285,51287],{"class":451,"line":474},[449,51284,27082],{"class":684},[449,51286,5746],{"class":680},[449,51288,1501],{"class":684},[449,51290,51291,51293,51295,51297,51299,51302,51304,51306],{"class":451,"line":480},[449,51292,1506],{"class":680},[449,51294,47667],{"class":684},[449,51296,4521],{"class":721},[449,51298,47672],{"class":684},[449,51300,51301],{"class":691},"\"Enter the admin password.\"",[449,51303,2737],{"class":684},[449,51305,5123],{"class":714},[449,51307,740],{"class":684},[449,51309,51310],{"class":451,"line":486},[449,51311,4599],{"class":684},[449,51313,51314],{"class":451,"line":492},[449,51315,700],{"emptyLinePlaceholder":130},[449,51317,51318,51320,51322,51324,51327,51329],{"class":451,"line":498},[449,51319,5048],{"class":680},[449,51321,47372],{"class":714},[449,51323,718],{"class":680},[449,51325,51326],{"class":684}," loginSchema.",[449,51328,47380],{"class":721},[449,51330,16383],{"class":684},[449,51332,51333,51335,51337,51339,51342,51344,51347,51349,51352,51354],{"class":451,"line":133},[449,51334,5080],{"class":680},[449,51336,1913],{"class":684},[449,51338,5085],{"class":680},[449,51340,51341],{"class":684},"parsed.success ",[449,51343,5091],{"class":680},[449,51345,51346],{"class":684}," parsed.data.password ",[449,51348,16947],{"class":680},[449,51350,51351],{"class":684}," env.",[449,51353,51092],{"class":714},[449,51355,3417],{"class":684},[449,51357,51358,51360,51362,51364,51366,51369,51371,51373],{"class":451,"line":509},[449,51359,1506],{"class":680},[449,51361,47667],{"class":684},[449,51363,4521],{"class":721},[449,51365,47672],{"class":684},[449,51367,51368],{"class":691},"\"That password is not right.\"",[449,51370,2737],{"class":684},[449,51372,17000],{"class":714},[449,51374,740],{"class":684},[449,51376,51377],{"class":451,"line":318},[449,51378,4599],{"class":684},[449,51380,51381],{"class":451,"line":520},[449,51382,700],{"emptyLinePlaceholder":130},[449,51384,51385,51387,51389,51391,51393,51396],{"class":451,"line":526},[449,51386,5048],{"class":680},[449,51388,27952],{"class":714},[449,51390,718],{"class":680},[449,51392,1654],{"class":680},[449,51394,51395],{"class":721}," createAdminSession",[449,51397,1322],{"class":684},[449,51399,51400,51402,51405,51407,51410,51412,51415,51418,51421,51423,51426,51428,51430],{"class":451,"line":532},[449,51401,5048],{"class":680},[449,51403,51404],{"class":714}," secure",[449,51406,718],{"class":680},[449,51408,51409],{"class":680}," import",[449,51411,165],{"class":684},[449,51413,51414],{"class":714},"meta",[449,51416,51417],{"class":684},".env.",[449,51419,51420],{"class":714},"PROD",[449,51422,38489],{"class":680},[449,51424,51425],{"class":691}," \"; Secure\"",[449,51427,38510],{"class":680},[449,51429,29828],{"class":691},[449,51431,695],{"class":684},[449,51433,51434,51436,51439,51441,51444,51447,51450,51452,51455,51458,51460],{"class":451,"line":2790},[449,51435,5048],{"class":680},[449,51437,51438],{"class":714}," cookie",[449,51440,718],{"class":680},[449,51442,51443],{"class":691}," `${",[449,51445,51446],{"class":714},"ADMIN_COOKIE",[449,51448,51449],{"class":691},"}=${",[449,51451,46908],{"class":684},[449,51453,51454],{"class":691},"}; Path=\u002F; HttpOnly; SameSite=Lax; Max-Age=43200${",[449,51456,51457],{"class":684},"secure",[449,51459,1517],{"class":691},[449,51461,695],{"class":684},[449,51463,51464],{"class":451,"line":3511},[449,51465,700],{"emptyLinePlaceholder":130},[449,51467,51468,51470,51472,51475,51477,51479,51481,51483,51486,51488],{"class":451,"line":3526},[449,51469,4726],{"class":680},[449,51471,1343],{"class":680},[449,51473,51474],{"class":721}," Response",[449,51476,725],{"class":684},[449,51478,36119],{"class":714},[449,51480,165],{"class":684},[449,51482,36124],{"class":721},[449,51484,51485],{"class":684},"({ ok: ",[449,51487,2169],{"class":714},[449,51489,51490],{"class":684}," }), {\n",[449,51492,51493],{"class":451,"line":3531},[449,51494,46976],{"class":684},[449,51496,51497,51499,51501,51503],{"class":451,"line":3536},[449,51498,46981],{"class":691},[449,51500,1482],{"class":684},[449,51502,46986],{"class":691},[449,51504,779],{"class":684},[449,51506,51507,51510],{"class":451,"line":4009},[449,51508,51509],{"class":691},"      \"set-cookie\"",[449,51511,51512],{"class":684},": cookie,\n",[449,51514,51515],{"class":451,"line":4015},[449,51516,1458],{"class":684},[449,51518,51519],{"class":451,"line":4021},[449,51520,13321],{"class":684},[449,51522,51523],{"class":451,"line":4027},[449,51524,784],{"class":684},[21,51526,51527,51528,349,51531,51534,51535,51538],{},"The session is random, stored in KV with a 12-hour TTL, and delivered as an ",[40,51529,51530],{},"HttpOnly",[40,51532,51533],{},"SameSite=Lax"," cookie. ",[40,51536,51537],{},"Secure"," is added in production. The browser cannot read the session token.",[48,51540,51543],{"className":670,"code":51541,"filename":51542,"language":673,"meta":56,"style":56},"const sessions = kv.map\u003C{ createdAt: string }>(\"admin-sessions\");\n\nexport async function createAdminSession(): Promise\u003Cstring> {\n  const token = crypto.randomUUID();\n  await sessions.put(token, { createdAt: new Date().toISOString() }, { ttl: 43200 });\n  return token;\n}\n\nexport async function isAdmin(c: Context): Promise\u003Cboolean> {\n  const token = getCookie(c, ADMIN_COOKIE);\n  if (!isCartToken(token)) return false;\n  return Boolean(await sessions.get(token));\n}\n","src\u002Fserver\u002Fadmin.ts",[40,51544,51545,51575,51579,51601,51615,51643,51649,51653,51657,51689,51706,51724,51741],{"__ignoreMap":56},[449,51546,51547,51549,51552,51554,51556,51558,51560,51563,51565,51567,51570,51573],{"class":451,"line":452},[449,51548,711],{"class":680},[449,51550,51551],{"class":714}," sessions",[449,51553,718],{"class":680},[449,51555,47173],{"class":684},[449,51557,6391],{"class":721},[449,51559,23909],{"class":684},[449,51561,51562],{"class":1491},"createdAt",[449,51564,3070],{"class":680},[449,51566,6081],{"class":714},[449,51568,51569],{"class":684}," }>(",[449,51571,51572],{"class":691},"\"admin-sessions\"",[449,51574,740],{"class":684},[449,51576,51577],{"class":451,"line":114},[449,51578,700],{"emptyLinePlaceholder":130},[449,51580,51581,51583,51585,51587,51589,51591,51593,51595,51597,51599],{"class":451,"line":111},[449,51582,4629],{"class":680},[449,51584,5597],{"class":680},[449,51586,5433],{"class":680},[449,51588,51395],{"class":721},[449,51590,16797],{"class":684},[449,51592,3070],{"class":680},[449,51594,5161],{"class":721},[449,51596,5547],{"class":684},[449,51598,25474],{"class":714},[449,51600,26735],{"class":684},[449,51602,51603,51605,51607,51609,51611,51613],{"class":451,"line":468},[449,51604,5048],{"class":680},[449,51606,27952],{"class":714},[449,51608,718],{"class":680},[449,51610,13226],{"class":684},[449,51612,5206],{"class":721},[449,51614,1322],{"class":684},[449,51616,51617,51619,51622,51624,51627,51629,51631,51633,51635,51638,51641],{"class":451,"line":474},[449,51618,2099],{"class":680},[449,51620,51621],{"class":684}," sessions.",[449,51623,47461],{"class":721},[449,51625,51626],{"class":684},"(token, { createdAt: ",[449,51628,5231],{"class":680},[449,51630,5234],{"class":721},[449,51632,5237],{"class":684},[449,51634,5240],{"class":721},[449,51636,51637],{"class":684},"() }, { ttl: ",[449,51639,51640],{"class":714},"43200",[449,51642,2051],{"class":684},[449,51644,51645,51647],{"class":451,"line":480},[449,51646,4726],{"class":680},[449,51648,46886],{"class":684},[449,51650,51651],{"class":451,"line":486},[449,51652,4604],{"class":684},[449,51654,51655],{"class":451,"line":492},[449,51656,700],{"emptyLinePlaceholder":130},[449,51658,51659,51661,51663,51665,51668,51670,51672,51674,51677,51679,51681,51683,51685,51687],{"class":451,"line":498},[449,51660,4629],{"class":680},[449,51662,5597],{"class":680},[449,51664,5433],{"class":680},[449,51666,51667],{"class":721}," isAdmin",[449,51669,725],{"class":684},[449,51671,37719],{"class":1491},[449,51673,3070],{"class":680},[449,51675,51676],{"class":721}," Context",[449,51678,827],{"class":684},[449,51680,3070],{"class":680},[449,51682,5161],{"class":721},[449,51684,5547],{"class":684},[449,51686,25526],{"class":714},[449,51688,26735],{"class":684},[449,51690,51691,51693,51695,51697,51699,51702,51704],{"class":451,"line":133},[449,51692,5048],{"class":680},[449,51694,27952],{"class":714},[449,51696,718],{"class":680},[449,51698,28505],{"class":721},[449,51700,51701],{"class":684},"(c, ",[449,51703,51446],{"class":714},[449,51705,740],{"class":684},[449,51707,51708,51710,51712,51714,51716,51718,51720,51722],{"class":451,"line":509},[449,51709,5080],{"class":680},[449,51711,1913],{"class":684},[449,51713,5085],{"class":680},[449,51715,46840],{"class":721},[449,51717,49286],{"class":684},[449,51719,37686],{"class":680},[449,51721,8905],{"class":714},[449,51723,695],{"class":684},[449,51725,51726,51728,51731,51733,51735,51737,51739],{"class":451,"line":318},[449,51727,4726],{"class":680},[449,51729,51730],{"class":721}," Boolean",[449,51732,725],{"class":684},[449,51734,2056],{"class":680},[449,51736,51621],{"class":684},[449,51738,12644],{"class":721},[449,51740,47392],{"class":684},[449,51742,51743],{"class":451,"line":520},[449,51744,4604],{"class":684},[21,51746,51747],{},"Logout deletes the KV session and expires the cookie. A stolen cookie is useless after logout or TTL.",[32,51749,51751],{"id":51750},"protecting-the-page-and-apis","Protecting the page and APIs",[21,51753,51754],{},"The loader decides what HTML exists:",[48,51756,51759],{"className":670,"code":51757,"filename":51758,"language":673,"meta":56,"style":56},"const authorized = await isAdmin(c);\n\nif (!authorized) {\n  return {\n    stage: CURRENT_STAGE,\n    authorized: false,\n    orders: [],\n    flavors: [],\n    weekLabel: null,\n  };\n}\n\nconst [orders, menu] = await Promise.all([listOrders(), getAdminMenu()]);\nreturn { stage: CURRENT_STAGE, authorized: true, orders, flavors: menu.flavors, weekLabel: menu.week?.label ?? null };\n","pages\u002Fadmin.server.ts",[40,51760,51761,51776,51780,51791,51797,51805,51814,51819,51824,51833,51837,51841,51845,51882],{"__ignoreMap":56},[449,51762,51763,51765,51768,51770,51772,51774],{"class":451,"line":452},[449,51764,711],{"class":680},[449,51766,51767],{"class":714}," authorized",[449,51769,718],{"class":680},[449,51771,1654],{"class":680},[449,51773,51667],{"class":721},[449,51775,47553],{"class":684},[449,51777,51778],{"class":451,"line":114},[449,51779,700],{"emptyLinePlaceholder":130},[449,51781,51782,51784,51786,51788],{"class":451,"line":111},[449,51783,17337],{"class":680},[449,51785,1913],{"class":684},[449,51787,5085],{"class":680},[449,51789,51790],{"class":684},"authorized) {\n",[449,51792,51793,51795],{"class":451,"line":468},[449,51794,4726],{"class":680},[449,51796,1501],{"class":684},[449,51798,51799,51801,51803],{"class":451,"line":474},[449,51800,45511],{"class":684},[449,51802,44144],{"class":714},[449,51804,779],{"class":684},[449,51806,51807,51810,51812],{"class":451,"line":480},[449,51808,51809],{"class":684},"    authorized: ",[449,51811,24415],{"class":714},[449,51813,779],{"class":684},[449,51815,51816],{"class":451,"line":486},[449,51817,51818],{"class":684},"    orders: [],\n",[449,51820,51821],{"class":451,"line":492},[449,51822,51823],{"class":684},"    flavors: [],\n",[449,51825,51826,51829,51831],{"class":451,"line":498},[449,51827,51828],{"class":684},"    weekLabel: ",[449,51830,43890],{"class":714},[449,51832,779],{"class":684},[449,51834,51835],{"class":451,"line":133},[449,51836,4763],{"class":684},[449,51838,51839],{"class":451,"line":509},[449,51840,4604],{"class":684},[449,51842,51843],{"class":451,"line":318},[449,51844,700],{"emptyLinePlaceholder":130},[449,51846,51847,51849,51851,51853,51855,51857,51859,51861,51863,51865,51867,51869,51871,51874,51876,51879],{"class":451,"line":520},[449,51848,711],{"class":680},[449,51850,13639],{"class":684},[449,51852,48574],{"class":714},[449,51854,349],{"class":684},[449,51856,49412],{"class":714},[449,51858,34451],{"class":684},[449,51860,5014],{"class":680},[449,51862,1654],{"class":680},[449,51864,5161],{"class":714},[449,51866,165],{"class":684},[449,51868,5813],{"class":721},[449,51870,25555],{"class":684},[449,51872,51873],{"class":721},"listOrders",[449,51875,10892],{"class":684},[449,51877,51878],{"class":721},"getAdminMenu",[449,51880,51881],{"class":684},"()]);\n",[449,51883,51884,51886,51888,51890,51893,51895,51898,51900,51902],{"class":451,"line":526},[449,51885,37686],{"class":680},[449,51887,43058],{"class":684},[449,51889,44144],{"class":714},[449,51891,51892],{"class":684},", authorized: ",[449,51894,2169],{"class":714},[449,51896,51897],{"class":684},", orders, flavors: menu.flavors, weekLabel: menu.week?.label ",[449,51899,734],{"class":680},[449,51901,27020],{"class":714},[449,51903,1520],{"class":684},[21,51905,51906],{},"The API handlers repeat the check; a page gate is not an API gate:",[48,51908,51911],{"className":670,"code":51909,"filename":51910,"language":673,"meta":56,"style":56},"if (!(await isAdmin(c))) {\n  return c.json({ error: \"Admin session required.\" }, 401);\n}\n","routes\u002Fapi\u002Fadmin\u002Fmenu.ts",[40,51912,51913,51930,51949],{"__ignoreMap":56},[449,51914,51915,51917,51919,51921,51923,51925,51927],{"class":451,"line":452},[449,51916,17337],{"class":680},[449,51918,1913],{"class":684},[449,51920,5085],{"class":680},[449,51922,725],{"class":684},[449,51924,2056],{"class":680},[449,51926,51667],{"class":721},[449,51928,51929],{"class":684},"(c))) {\n",[449,51931,51932,51934,51936,51938,51940,51943,51945,51947],{"class":451,"line":114},[449,51933,4726],{"class":680},[449,51935,47667],{"class":684},[449,51937,4521],{"class":721},[449,51939,47672],{"class":684},[449,51941,51942],{"class":691},"\"Admin session required.\"",[449,51944,2737],{"class":684},[449,51946,17000],{"class":714},[449,51948,740],{"class":684},[449,51950,51951],{"class":451,"line":111},[449,51952,4604],{"class":684},[21,51954,51955],{},"Order status updates use the same guard, validate the status against the shared enum, and append a timeline event:",[48,51957,51960],{"className":670,"code":51958,"filename":51959,"language":673,"meta":56,"style":56},"const order = await updateOrderStatus(c.req.param(\"publicId\"), parsed.data.status);\nif (!order) return c.json({ error: \"Order not found.\" }, 404);\n","routes\u002Fapi\u002Fadmin\u002Forders\u002F[publicId].ts",[40,51961,51962,51987],{"__ignoreMap":56},[449,51963,51964,51966,51968,51970,51972,51975,51977,51979,51981,51984],{"class":451,"line":452},[449,51965,711],{"class":680},[449,51967,5194],{"class":714},[449,51969,718],{"class":680},[449,51971,1654],{"class":680},[449,51973,51974],{"class":721}," updateOrderStatus",[449,51976,43295],{"class":684},[449,51978,43298],{"class":721},[449,51980,725],{"class":684},[449,51982,51983],{"class":691},"\"publicId\"",[449,51985,51986],{"class":684},"), parsed.data.status);\n",[449,51988,51989,51991,51993,51995,51998,52000,52002,52004,52006,52009,52011,52013],{"class":451,"line":114},[449,51990,17337],{"class":680},[449,51992,1913],{"class":684},[449,51994,5085],{"class":680},[449,51996,51997],{"class":684},"order) ",[449,51999,37686],{"class":680},[449,52001,47667],{"class":684},[449,52003,4521],{"class":721},[449,52005,47672],{"class":684},[449,52007,52008],{"class":691},"\"Order not found.\"",[449,52010,2737],{"class":684},[449,52012,12676],{"class":714},[449,52014,740],{"class":684},[32,52016,52018],{"id":52017},"the-dashboard","The dashboard",[21,52020,52021],{},"The authorized dashboard has two jobs:",[816,52023,52024,52031],{},[386,52025,52026,52027,52030],{},"Move an order through ",[40,52028,52029],{},"pending → confirmed → preparing → ready → picked_up"," (or cancel it).",[386,52032,52033],{},"Add or remove a flavor from the active week.",[48,52035,52038],{"className":24546,"code":52036,"filename":52037,"language":23763,"meta":56,"style":56},"\u003Cselect :value=\"order.status\" @change=\"onStatusChange(order, $event)\">\n  \u003Coption v-for=\"status in ORDER_STATUSES\" :key=\"status\" :value=\"status\">\n    {{ ORDER_STATUS_LABELS[status] }}\n  \u003C\u002Foption>\n\u003C\u002Fselect>\n\n\u003Cbutton @click=\"toggleFlavor(flavor)\">\n  {{ flavor.isActive ? \"In the week\" : \"Add to week\" }}\n\u003C\u002Fbutton>\n","src\u002FJumbleAdmin.vue",[40,52039,52040,52079,52084,52089,52094,52102,52106,52131,52136],{"__ignoreMap":56},[449,52041,52042,52044,52046,52048,52050,52052,52054,52057,52059,52062,52065,52067,52069,52072,52075,52077],{"class":451,"line":452},[449,52043,5547],{"class":684},[449,52045,12452],{"class":17370},[449,52047,38510],{"class":684},[449,52049,23622],{"class":721},[449,52051,5014],{"class":684},[449,52053,25284],{"class":691},[449,52055,52056],{"class":684},"order.status",[449,52058,25284],{"class":691},[449,52060,52061],{"class":684}," @",[449,52063,52064],{"class":721},"change",[449,52066,5014],{"class":684},[449,52068,25284],{"class":691},[449,52070,52071],{"class":721},"onStatusChange",[449,52073,52074],{"class":684},"(order, $event)",[449,52076,25284],{"class":691},[449,52078,23122],{"class":684},[449,52080,52081],{"class":451,"line":114},[449,52082,52083],{"class":684},"  \u003Coption v-for=\"status in ORDER_STATUSES\" :key=\"status\" :value=\"status\">\n",[449,52085,52086],{"class":451,"line":111},[449,52087,52088],{"class":684},"    {{ ORDER_STATUS_LABELS[status] }}\n",[449,52090,52091],{"class":451,"line":468},[449,52092,52093],{"class":684},"  \u003C\u002Foption>\n",[449,52095,52096,52098,52100],{"class":451,"line":474},[449,52097,23220],{"class":684},[449,52099,12452],{"class":17370},[449,52101,23122],{"class":684},[449,52103,52104],{"class":451,"line":480},[449,52105,700],{"emptyLinePlaceholder":130},[449,52107,52108,52110,52112,52114,52117,52119,52121,52124,52127,52129],{"class":451,"line":486},[449,52109,5547],{"class":684},[449,52111,24739],{"class":17370},[449,52113,52061],{"class":684},[449,52115,52116],{"class":721},"click",[449,52118,5014],{"class":684},[449,52120,25284],{"class":691},[449,52122,52123],{"class":721},"toggleFlavor",[449,52125,52126],{"class":684},"(flavor)",[449,52128,25284],{"class":691},[449,52130,23122],{"class":684},[449,52132,52133],{"class":451,"line":492},[449,52134,52135],{"class":684},"  {{ flavor.isActive ? \"In the week\" : \"Add to week\" }}\n",[449,52137,52138,52140,52142],{"class":451,"line":498},[449,52139,23220],{"class":684},[449,52141,24739],{"class":17370},[449,52143,23122],{"class":684},[21,52145,52146],{},"The order page polls the public status route; the admin is the only writer of the human status.",[32,52148,43385],{"id":43384},[21,52150,52151,52152,3070],{},"Create a local password in the root ",[40,52153,26592],{},[48,52155,52159],{"className":52156,"code":52157,"language":52158,"meta":56,"style":56},"language-ini shiki shiki-themes github-light github-dark","ADMIN_PASSWORD=choose-a-local-password\n","ini",[40,52160,52161],{"__ignoreMap":56},[449,52162,52163],{"class":451,"line":452},[449,52164,52157],{},[21,52166,52167],{},"Then:",[48,52169,52170],{"className":839,"code":43519,"language":841,"meta":56,"style":56},[40,52171,52172],{"__ignoreMap":56},[449,52173,52174,52176],{"class":451,"line":452},[449,52175,24321],{"class":721},[449,52177,5300],{"class":691},[21,52179,49893,52180,52182],{},[40,52181,51088],{},". Sign in, change an order status, remove a flavor, and check that the storefront reflects the menu change. The stage 7 preview stays at the login screen because the lesson iframe has no admin cookie.",[21,52184,52185],{},"Set the production secret and deploy:",[48,52187,52189],{"className":839,"code":52188,"language":841,"meta":56,"style":56},"void secret put ADMIN_PASSWORD\nvoid deploy --platform cloudflare\n",[40,52190,52191,52201],{"__ignoreMap":56},[449,52192,52193,52195,52197,52199],{"class":451,"line":452},[449,52194,41217],{"class":721},[449,52196,26674],{"class":691},[449,52198,51202],{"class":691},[449,52200,51205],{"class":691},[449,52202,52203,52205,52207,52209],{"class":451,"line":114},[449,52204,41217],{"class":721},[449,52206,41658],{"class":691},[449,52208,8896],{"class":714},[449,52210,44901],{"class":691},[32,52212,43583],{"id":43582},[21,52214,52215,52218,52219,52221],{},[40,52216,52217],{},"\u002Fpreview\u002F7"," is intentionally the door. The full ",[40,52220,51088],{}," is the protected screen. There is no public link to the dashboard; the URL is not the secret, the session is.",[21,52223,52224,52225,52227],{},"Stage 6 remains at ",[40,52226,50980],{}," with the order timeline and no admin.",[32,52229,43605],{"id":43604},[383,52231,52232,52242,52248,52254,52262,52268,52274],{},[386,52233,52234,52237,52238,52241],{},[151,52235,52236],{},"Use a secret, not a source constant."," A password in ",[40,52239,52240],{},"void.config.ts"," or a client bundle is not auth.",[386,52243,52244,52247],{},[151,52245,52246],{},"Gate every admin API."," A server-rendered page gate does not protect a route someone can call directly.",[386,52249,52250,52253],{},[151,52251,52252],{},"Never return admin data to an unauthorized loader."," The login page receives empty arrays, not hidden HTML.",[386,52255,52256,25398,52259,52261],{},[151,52257,52258],{},"Keep the cookie HttpOnly and Secure in production.",[40,52260,51533],{}," is enough for the first-party dashboard; do not open a cross-site admin flow casually.",[386,52263,52264,52267],{},[151,52265,52266],{},"Rotate the password and expire sessions."," A single-admin app still deserves basic hygiene.",[386,52269,52270,52273],{},[151,52271,52272],{},"Rate-limit and monitor login attempts"," before opening this to the public; this stage focuses on the session boundary.",[386,52275,52276,52279],{},[151,52277,52278],{},"This is not customer auth."," There is no account, no order ownership, and no customer dashboard.",[32,52281,43655],{"id":43654},[21,52283,52284],{},"The kitchen has a locked door: secret-backed login, KV sessions, protected data, order status writes, and menu edits.",[21,52286,43661,52287,52291],{},[151,52288,52289],{},[3861,52290,42402],{"href":42401}," — R2 photos, CI, and the final storefront.",[3728,52293,52294],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":56,"searchDepth":111,"depth":111,"links":52296},[52297,52298,52299,52300,52301,52302,52303,52304,52305],{"id":42725,"depth":114,"text":42726},{"id":51134,"depth":114,"text":51135},{"id":46645,"depth":114,"text":46646},{"id":51750,"depth":114,"text":51751},{"id":52017,"depth":114,"text":52018},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Gate order operations and the weekly menu behind a server-verified admin session.","Admin sessions + protected APIs",{},{"title":51071,"description":52306},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fenv-vars","learn\u002Fvoid\u002F07-admin-and-auth","1e3wngyrsdQXRLJoSAtkXnnLoCRDWND8dIszNXkwfMU",{"id":52314,"title":52315,"author":52316,"body":52317,"description":53499,"difficulty":42701,"estMinutes":4059,"extension":119,"feature":53500,"img":42703,"meta":53501,"navigation":130,"nuxtVersion":116,"order":492,"path":42401,"releaseDate":116,"seo":53502,"series":41217,"sourcePRs":116,"sourceUrl":53503,"stem":53504,"__hash__":53505},"tutorials\u002Flearn\u002Fvoid\u002F08-ship.md","Ship: R2 Images, CI, and the Final Storefront",{"name":9,"img":17256,"website":42491},{"type":13,"value":52318,"toc":53489},[52319,52322,52325,52327,52341,52343,52377,52381,52384,52679,52682,52686,52976,52983,52990,53107,53111,53114,53287,53293,53297,53300,53333,53336,53372,53378,53382,53420,53422,53473,53475,53478,53486],[21,52320,52321],{},"The storefront is complete when a photo can change without a deploy, CI can prove the build, and every route works from the same production Worker.",[21,52323,52324],{},"Stage 8 adds R2-backed flavor photos, the upload path in the admin, a CI workflow, and the final walkthrough.",[42504,52326],{"height":42506,"stage":33463},[21,52328,52329,52330,349,52332,349,52334,349,52337,1542,52339,165],{},"The preview is the final storefront. The full app has ",[40,52331,5872],{},[40,52333,45061],{},[40,52335,52336],{},"\u002Fcheckout",[40,52338,49857],{},[40,52340,51088],{},[32,52342,42726],{"id":42725},[383,52344,52345,52351,52357,52366,52369,52372],{},[386,52346,52347,52350],{},[40,52348,52349],{},"flavors.image_key"," stores an optional R2 object key.",[386,52352,52353,52356],{},[40,52354,52355],{},"POST \u002Fapi\u002Fadmin\u002Fimages"," accepts a JPEG\u002FPNG\u002FWebP through the admin session and writes it to R2.",[386,52358,52359,52362,52363,165],{},[40,52360,52361],{},"GET \u002Fapi\u002Fimages\u002F:key"," serves the image with a long cache and ",[40,52364,52365],{},"nosniff",[386,52367,52368],{},"The storefront uses the photo when present and the original generated cookie art otherwise.",[386,52370,52371],{},"A GitHub Actions workflow installs, builds, and verifies the app.",[386,52373,52374,52376],{},[40,52375,41236],{}," provisions D1, KV, the queue, the cron, and the R2 bucket.",[32,52378,52380],{"id":52379},"the-upload","The upload",[21,52382,52383],{},"The admin sends a real multipart file. The Worker picks the object key; the browser never chooses a path.",[48,52385,52388],{"className":670,"code":52386,"filename":52387,"language":673,"meta":56,"style":56},"const file = form.file;\nconst flavorId = Number(form.flavorId);\n\nif (!(file instanceof File) || !Number.isInteger(flavorId) || flavorId \u003C 1) {\n  return c.json({ error: \"Choose a flavor and an image.\" }, 400);\n}\n\nconst extension = EXTENSIONS[file.type];\nif (!extension || file.size === 0 || file.size > MAX_BYTES) {\n  return c.json({ error: \"Use a JPEG, PNG, or WebP image under 2 MB.\" }, 400);\n}\n\nconst key = `${crypto.randomUUID()}.${extension}`;\n\nawait storage.put(`flavors\u002F${key}`, file, {\n  httpMetadata: {\n    contentType: file.type,\n    cacheControl: \"public, max-age=31536000, immutable\",\n  },\n});\n\nawait db.update(flavors).set({ imageKey: key }).where(eq(flavors.id, flavorId));\nreturn { imageKey: key };\n","routes\u002Fapi\u002Fadmin\u002Fimages.ts",[40,52389,52390,52401,52415,52419,52462,52481,52485,52489,52504,52535,52554,52558,52562,52591,52595,52615,52620,52625,52635,52639,52643,52647,52672],{"__ignoreMap":56},[449,52391,52392,52394,52396,52398],{"class":451,"line":452},[449,52393,711],{"class":680},[449,52395,6243],{"class":714},[449,52397,718],{"class":680},[449,52399,52400],{"class":684}," form.file;\n",[449,52402,52403,52405,52408,52410,52412],{"class":451,"line":114},[449,52404,711],{"class":680},[449,52406,52407],{"class":714}," flavorId",[449,52409,718],{"class":680},[449,52411,43292],{"class":721},[449,52413,52414],{"class":684},"(form.flavorId);\n",[449,52416,52417],{"class":451,"line":111},[449,52418,700],{"emptyLinePlaceholder":130},[449,52420,52421,52423,52425,52427,52430,52433,52436,52438,52440,52442,52445,52448,52451,52453,52456,52458,52460],{"class":451,"line":468},[449,52422,17337],{"class":680},[449,52424,1913],{"class":684},[449,52426,5085],{"class":680},[449,52428,52429],{"class":684},"(file ",[449,52431,52432],{"class":680},"instanceof",[449,52434,52435],{"class":721}," File",[449,52437,1758],{"class":684},[449,52439,5091],{"class":680},[449,52441,12868],{"class":680},[449,52443,52444],{"class":684},"Number.",[449,52446,52447],{"class":721},"isInteger",[449,52449,52450],{"class":684},"(flavorId) ",[449,52452,5091],{"class":680},[449,52454,52455],{"class":684}," flavorId ",[449,52457,5547],{"class":680},[449,52459,20024],{"class":714},[449,52461,3417],{"class":684},[449,52463,52464,52466,52468,52470,52472,52475,52477,52479],{"class":451,"line":474},[449,52465,4726],{"class":680},[449,52467,47667],{"class":684},[449,52469,4521],{"class":721},[449,52471,47672],{"class":684},[449,52473,52474],{"class":691},"\"Choose a flavor and an image.\"",[449,52476,2737],{"class":684},[449,52478,5123],{"class":714},[449,52480,740],{"class":684},[449,52482,52483],{"class":451,"line":480},[449,52484,4604],{"class":684},[449,52486,52487],{"class":451,"line":486},[449,52488,700],{"emptyLinePlaceholder":130},[449,52490,52491,52493,52496,52498,52501],{"class":451,"line":492},[449,52492,711],{"class":680},[449,52494,52495],{"class":714}," extension",[449,52497,718],{"class":680},[449,52499,52500],{"class":714}," EXTENSIONS",[449,52502,52503],{"class":684},"[file.type];\n",[449,52505,52506,52508,52510,52512,52515,52517,52520,52522,52524,52526,52528,52530,52533],{"class":451,"line":498},[449,52507,17337],{"class":680},[449,52509,1913],{"class":684},[449,52511,5085],{"class":680},[449,52513,52514],{"class":684},"extension ",[449,52516,5091],{"class":680},[449,52518,52519],{"class":684}," file.size ",[449,52521,37592],{"class":680},[449,52523,5103],{"class":714},[449,52525,26561],{"class":680},[449,52527,52519],{"class":684},[449,52529,2490],{"class":680},[449,52531,52532],{"class":714}," MAX_BYTES",[449,52534,3417],{"class":684},[449,52536,52537,52539,52541,52543,52545,52548,52550,52552],{"class":451,"line":133},[449,52538,4726],{"class":680},[449,52540,47667],{"class":684},[449,52542,4521],{"class":721},[449,52544,47672],{"class":684},[449,52546,52547],{"class":691},"\"Use a JPEG, PNG, or WebP image under 2 MB.\"",[449,52549,2737],{"class":684},[449,52551,5123],{"class":714},[449,52553,740],{"class":684},[449,52555,52556],{"class":451,"line":509},[449,52557,4604],{"class":684},[449,52559,52560],{"class":451,"line":318},[449,52561,700],{"emptyLinePlaceholder":130},[449,52563,52564,52566,52568,52570,52572,52575,52577,52579,52581,52584,52587,52589],{"class":451,"line":520},[449,52565,711],{"class":680},[449,52567,16959],{"class":714},[449,52569,718],{"class":680},[449,52571,51443],{"class":691},[449,52573,52574],{"class":684},"crypto",[449,52576,165],{"class":691},[449,52578,5206],{"class":721},[449,52580,16797],{"class":691},[449,52582,52583],{"class":691},"}.${",[449,52585,52586],{"class":684},"extension",[449,52588,1517],{"class":691},[449,52590,695],{"class":684},[449,52592,52593],{"class":451,"line":526},[449,52594,700],{"emptyLinePlaceholder":130},[449,52596,52597,52599,52601,52603,52605,52608,52610,52612],{"class":451,"line":532},[449,52598,2056],{"class":680},[449,52600,16182],{"class":684},[449,52602,47461],{"class":721},[449,52604,725],{"class":684},[449,52606,52607],{"class":691},"`flavors\u002F${",[449,52609,16495],{"class":684},[449,52611,1517],{"class":691},[449,52613,52614],{"class":684},", file, {\n",[449,52616,52617],{"class":451,"line":2790},[449,52618,52619],{"class":684},"  httpMetadata: {\n",[449,52621,52622],{"class":451,"line":3511},[449,52623,52624],{"class":684},"    contentType: file.type,\n",[449,52626,52627,52630,52633],{"class":451,"line":3526},[449,52628,52629],{"class":684},"    cacheControl: ",[449,52631,52632],{"class":691},"\"public, max-age=31536000, immutable\"",[449,52634,779],{"class":684},[449,52636,52637],{"class":451,"line":3531},[449,52638,1474],{"class":684},[449,52640,52641],{"class":451,"line":3536},[449,52642,784],{"class":684},[449,52644,52645],{"class":451,"line":4009},[449,52646,700],{"emptyLinePlaceholder":130},[449,52648,52649,52651,52653,52655,52658,52660,52663,52665,52667,52669],{"class":451,"line":4015},[449,52650,2056],{"class":680},[449,52652,12255],{"class":684},[449,52654,13952],{"class":721},[449,52656,52657],{"class":684},"(flavors).",[449,52659,13962],{"class":721},[449,52661,52662],{"class":684},"({ imageKey: key }).",[449,52664,12461],{"class":721},[449,52666,725],{"class":684},[449,52668,13024],{"class":721},[449,52670,52671],{"class":684},"(flavors.id, flavorId));\n",[449,52673,52674,52676],{"class":451,"line":4021},[449,52675,37686],{"class":680},[449,52677,52678],{"class":684}," { imageKey: key };\n",[21,52680,52681],{},"The key is a UUID plus a known extension. Uploads are restricted to raster images, capped at 2 MB, and gated by the same admin session as the dashboard.",[32,52683,52685],{"id":52684},"serving-the-photo","Serving the photo",[48,52687,52690],{"className":670,"code":52688,"filename":52689,"language":673,"meta":56,"style":56},"const IMAGE_KEY = \u002F^[0-9a-f-]{36}\\.(jpg|png|webp)$\u002Fi;\n\nexport const GET = defineHandler(async (c) => {\n  const key = c.req.param(\"key\");\n  if (!IMAGE_KEY.test(key)) return c.notFound();\n\n  const object = await storage.get(`flavors\u002F${key}`);\n  if (!object) return c.notFound();\n\n  const headers = new Headers();\n  object.writeHttpMetadata(headers);\n  headers.set(\"etag\", object.httpEtag);\n  headers.set(\"X-Content-Type-Options\", \"nosniff\");\n  headers.set(\"Content-Disposition\", \"inline\");\n  headers.set(\"Cache-Control\", \"public, max-age=31536000, immutable\");\n  return new Response(object.body, { headers });\n});\n","routes\u002Fapi\u002Fimages\u002F[key].ts",[40,52691,52692,52738,52742,52768,52787,52814,52818,52843,52862,52866,52882,52893,52908,52926,52944,52961,52972],{"__ignoreMap":56},[449,52693,52694,52696,52699,52701,52703,52706,52709,52712,52716,52719,52721,52724,52726,52729,52732,52734,52736],{"class":451,"line":452},[449,52695,711],{"class":680},[449,52697,52698],{"class":714}," IMAGE_KEY",[449,52700,718],{"class":680},[449,52702,5866],{"class":691},[449,52704,52705],{"class":680},"^",[449,52707,52708],{"class":714},"[0-9a-f-]",[449,52710,52711],{"class":680},"{36}",[449,52713,52715],{"class":52714},"snhLl","\\.",[449,52717,52718],{"class":36108},"(jpg",[449,52720,27017],{"class":680},[449,52722,52723],{"class":36108},"png",[449,52725,27017],{"class":680},[449,52727,52728],{"class":36108},"webp)",[449,52730,52731],{"class":680},"$",[449,52733,5872],{"class":691},[449,52735,2505],{"class":680},[449,52737,695],{"class":684},[449,52739,52740],{"class":451,"line":114},[449,52741,700],{"emptyLinePlaceholder":130},[449,52743,52744,52746,52748,52750,52752,52754,52756,52758,52760,52762,52764,52766],{"class":451,"line":111},[449,52745,4629],{"class":680},[449,52747,10789],{"class":680},[449,52749,41495],{"class":714},[449,52751,718],{"class":680},[449,52753,41500],{"class":721},[449,52755,725],{"class":684},[449,52757,1485],{"class":680},[449,52759,1913],{"class":684},[449,52761,37719],{"class":1491},[449,52763,1758],{"class":684},[449,52765,1498],{"class":680},[449,52767,1501],{"class":684},[449,52769,52770,52772,52774,52776,52778,52780,52782,52785],{"class":451,"line":468},[449,52771,5048],{"class":680},[449,52773,16959],{"class":714},[449,52775,718],{"class":680},[449,52777,45412],{"class":684},[449,52779,43298],{"class":721},[449,52781,725],{"class":684},[449,52783,52784],{"class":691},"\"key\"",[449,52786,740],{"class":684},[449,52788,52789,52791,52793,52795,52798,52800,52802,52805,52807,52809,52812],{"class":451,"line":474},[449,52790,5080],{"class":680},[449,52792,1913],{"class":684},[449,52794,5085],{"class":680},[449,52796,52797],{"class":714},"IMAGE_KEY",[449,52799,165],{"class":684},[449,52801,46782],{"class":721},[449,52803,52804],{"class":684},"(key)) ",[449,52806,37686],{"class":680},[449,52808,47667],{"class":684},[449,52810,52811],{"class":721},"notFound",[449,52813,1322],{"class":684},[449,52815,52816],{"class":451,"line":480},[449,52817,700],{"emptyLinePlaceholder":130},[449,52819,52820,52822,52825,52827,52829,52831,52833,52835,52837,52839,52841],{"class":451,"line":486},[449,52821,5048],{"class":680},[449,52823,52824],{"class":714}," object",[449,52826,718],{"class":680},[449,52828,1654],{"class":680},[449,52830,16182],{"class":684},[449,52832,12644],{"class":721},[449,52834,725],{"class":684},[449,52836,52607],{"class":691},[449,52838,16495],{"class":684},[449,52840,1517],{"class":691},[449,52842,740],{"class":684},[449,52844,52845,52847,52849,52851,52854,52856,52858,52860],{"class":451,"line":492},[449,52846,5080],{"class":680},[449,52848,1913],{"class":684},[449,52850,5085],{"class":680},[449,52852,52853],{"class":684},"object) ",[449,52855,37686],{"class":680},[449,52857,47667],{"class":684},[449,52859,52811],{"class":721},[449,52861,1322],{"class":684},[449,52863,52864],{"class":451,"line":498},[449,52865,700],{"emptyLinePlaceholder":130},[449,52867,52868,52870,52873,52875,52877,52880],{"class":451,"line":133},[449,52869,5048],{"class":680},[449,52871,52872],{"class":714}," headers",[449,52874,718],{"class":680},[449,52876,1343],{"class":680},[449,52878,52879],{"class":721}," Headers",[449,52881,1322],{"class":684},[449,52883,52884,52887,52890],{"class":451,"line":509},[449,52885,52886],{"class":684},"  object.",[449,52888,52889],{"class":721},"writeHttpMetadata",[449,52891,52892],{"class":684},"(headers);\n",[449,52894,52895,52898,52900,52902,52905],{"class":451,"line":318},[449,52896,52897],{"class":684},"  headers.",[449,52899,13962],{"class":721},[449,52901,725],{"class":684},[449,52903,52904],{"class":691},"\"etag\"",[449,52906,52907],{"class":684},", object.httpEtag);\n",[449,52909,52910,52912,52914,52916,52919,52921,52924],{"class":451,"line":520},[449,52911,52897],{"class":684},[449,52913,13962],{"class":721},[449,52915,725],{"class":684},[449,52917,52918],{"class":691},"\"X-Content-Type-Options\"",[449,52920,349],{"class":684},[449,52922,52923],{"class":691},"\"nosniff\"",[449,52925,740],{"class":684},[449,52927,52928,52930,52932,52934,52937,52939,52942],{"class":451,"line":526},[449,52929,52897],{"class":684},[449,52931,13962],{"class":721},[449,52933,725],{"class":684},[449,52935,52936],{"class":691},"\"Content-Disposition\"",[449,52938,349],{"class":684},[449,52940,52941],{"class":691},"\"inline\"",[449,52943,740],{"class":684},[449,52945,52946,52948,52950,52952,52955,52957,52959],{"class":451,"line":532},[449,52947,52897],{"class":684},[449,52949,13962],{"class":721},[449,52951,725],{"class":684},[449,52953,52954],{"class":691},"\"Cache-Control\"",[449,52956,349],{"class":684},[449,52958,52632],{"class":691},[449,52960,740],{"class":684},[449,52962,52963,52965,52967,52969],{"class":451,"line":2790},[449,52964,4726],{"class":680},[449,52966,1343],{"class":680},[449,52968,51474],{"class":721},[449,52970,52971],{"class":684},"(object.body, { headers });\n",[449,52973,52974],{"class":451,"line":3511},[449,52975,784],{"class":684},[21,52977,52978,52979,52982],{},"The route only serves keys under ",[40,52980,52981],{},"flavors\u002F"," that match the UUID shape. R2 never becomes a general file server.",[21,52984,52985,52986,52989],{},"The storefront falls back to ",[40,52987,52988],{},"CookieArt"," when a flavor has no image:",[48,52991,52994],{"className":24546,"code":52992,"filename":52993,"language":23763,"meta":56,"style":56},"\u003Cimg\n  v-if=\"flavor.imageKey\"\n  class=\"menu-cookie-image\"\n  :src=\"`\u002Fapi\u002Fimages\u002F${flavor.imageKey}`\"\n  :alt=\"`${flavor.name} cookie`\"\n\u002F>\n\u003CCookieArt\n  v-else\n  :color=\"flavor.color\"\n  :accent=\"flavor.accent\"\n  :label=\"`${flavor.name} cookie`\"\n\u002F>\n","src\u002FJumbleMenu.vue",[40,52995,52996,53003,53018,53028,53052,53073,53078,53083,53088,53093,53098,53103],{"__ignoreMap":56},[449,52997,52998,53000],{"class":451,"line":452},[449,52999,5547],{"class":684},[449,53001,53002],{"class":17370},"img\n",[449,53004,53005,53008,53010,53012,53015],{"class":451,"line":114},[449,53006,53007],{"class":680},"  v-if",[449,53009,5014],{"class":684},[449,53011,25284],{"class":691},[449,53013,53014],{"class":684},"flavor.imageKey",[449,53016,53017],{"class":691},"\"\n",[449,53019,53020,53023,53025],{"class":451,"line":111},[449,53021,53022],{"class":721},"  class",[449,53024,5014],{"class":684},[449,53026,53027],{"class":691},"\"menu-cookie-image\"\n",[449,53029,53030,53033,53036,53038,53041,53044,53046,53049],{"class":451,"line":468},[449,53031,53032],{"class":684},"  :",[449,53034,53035],{"class":721},"src",[449,53037,5014],{"class":684},[449,53039,53040],{"class":691},"\"`\u002Fapi\u002Fimages\u002F${",[449,53042,53043],{"class":684},"flavor",[449,53045,165],{"class":691},[449,53047,53048],{"class":684},"imageKey",[449,53050,53051],{"class":691},"}`\"\n",[449,53053,53054,53056,53059,53061,53064,53066,53068,53070],{"class":451,"line":474},[449,53055,53032],{"class":684},[449,53057,53058],{"class":721},"alt",[449,53060,5014],{"class":684},[449,53062,53063],{"class":691},"\"`${",[449,53065,53043],{"class":684},[449,53067,165],{"class":691},[449,53069,13144],{"class":684},[449,53071,53072],{"class":691},"} cookie`\"\n",[449,53074,53075],{"class":451,"line":480},[449,53076,53077],{"class":684},"\u002F>\n",[449,53079,53080],{"class":451,"line":486},[449,53081,53082],{"class":684},"\u003CCookieArt\n",[449,53084,53085],{"class":451,"line":492},[449,53086,53087],{"class":684},"  v-else\n",[449,53089,53090],{"class":451,"line":498},[449,53091,53092],{"class":684},"  :color=\"flavor.color\"\n",[449,53094,53095],{"class":451,"line":133},[449,53096,53097],{"class":684},"  :accent=\"flavor.accent\"\n",[449,53099,53100],{"class":451,"line":509},[449,53101,53102],{"class":684},"  :label=\"`${flavor.name} cookie`\"\n",[449,53104,53105],{"class":451,"line":318},[449,53106,53077],{"class":684},[32,53108,53110],{"id":53109},"ci","CI",[21,53112,53113],{},"The workflow is deliberately small: install, then build the app. The build runs the same route\u002Fresource inference as a deploy.",[48,53115,53118],{"className":17361,"code":53116,"filename":53117,"language":17363,"meta":56,"style":56},"name: Jumble CI\non:\n  push:\n    paths: [\"apps\u002Fjumble\u002F**\", \"pnpm-lock.yaml\", \".github\u002Fworkflows\u002Fjumble-ci.yml\"]\n  pull_request:\n    paths: [\"apps\u002Fjumble\u002F**\", \"pnpm-lock.yaml\", \".github\u002Fworkflows\u002Fjumble-ci.yml\"]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    env:\n      ADMIN_PASSWORD: ci-build-only-password\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: voidzero-dev\u002Fsetup-vp@v1\n        with:\n          cache: true\n      - run: vp install\n      - run: pnpm --filter jumble build\n",".github\u002Fworkflows\u002Fjumble-ci.yml",[40,53119,53120,53129,53135,53141,53163,53169,53187,53193,53200,53208,53215,53225,53231,53241,53252,53258,53266,53276],{"__ignoreMap":56},[449,53121,53122,53124,53126],{"class":451,"line":452},[449,53123,13144],{"class":17370},[449,53125,1482],{"class":684},[449,53127,53128],{"class":691},"Jumble CI\n",[449,53130,53131,53133],{"class":451,"line":114},[449,53132,3492],{"class":714},[449,53134,17374],{"class":684},[449,53136,53137,53139],{"class":451,"line":111},[449,53138,17871],{"class":17370},[449,53140,17374],{"class":684},[449,53142,53143,53146,53148,53151,53153,53156,53158,53161],{"class":451,"line":468},[449,53144,53145],{"class":17370},"    paths",[449,53147,17389],{"class":684},[449,53149,53150],{"class":691},"\"apps\u002Fjumble\u002F**\"",[449,53152,349],{"class":684},[449,53154,53155],{"class":691},"\"pnpm-lock.yaml\"",[449,53157,349],{"class":684},[449,53159,53160],{"class":691},"\".github\u002Fworkflows\u002Fjumble-ci.yml\"",[449,53162,17405],{"class":684},[449,53164,53165,53167],{"class":451,"line":474},[449,53166,17890],{"class":17370},[449,53168,17374],{"class":684},[449,53170,53171,53173,53175,53177,53179,53181,53183,53185],{"class":451,"line":480},[449,53172,53145],{"class":17370},[449,53174,17389],{"class":684},[449,53176,53150],{"class":691},[449,53178,349],{"class":684},[449,53180,53155],{"class":691},[449,53182,349],{"class":684},[449,53184,53160],{"class":691},[449,53186,17405],{"class":684},[449,53188,53189,53191],{"class":451,"line":486},[449,53190,17942],{"class":17370},[449,53192,17374],{"class":684},[449,53194,53195,53198],{"class":451,"line":492},[449,53196,53197],{"class":17370},"  build",[449,53199,17374],{"class":684},[449,53201,53202,53204,53206],{"class":451,"line":498},[449,53203,17956],{"class":17370},[449,53205,1482],{"class":684},[449,53207,17961],{"class":691},[449,53209,53210,53213],{"class":451,"line":133},[449,53211,53212],{"class":17370},"    env",[449,53214,17374],{"class":684},[449,53216,53217,53220,53222],{"class":451,"line":509},[449,53218,53219],{"class":17370},"      ADMIN_PASSWORD",[449,53221,1482],{"class":684},[449,53223,53224],{"class":691},"ci-build-only-password\n",[449,53226,53227,53229],{"class":451,"line":318},[449,53228,17966],{"class":17370},[449,53230,17374],{"class":684},[449,53232,53233,53235,53237,53239],{"class":451,"line":520},[449,53234,17973],{"class":684},[449,53236,17976],{"class":17370},[449,53238,1482],{"class":684},[449,53240,17981],{"class":691},[449,53242,53243,53245,53247,53249],{"class":451,"line":526},[449,53244,17973],{"class":684},[449,53246,17976],{"class":17370},[449,53248,1482],{"class":684},[449,53250,53251],{"class":691},"voidzero-dev\u002Fsetup-vp@v1\n",[449,53253,53254,53256],{"class":451,"line":532},[449,53255,17997],{"class":17370},[449,53257,17374],{"class":684},[449,53259,53260,53262,53264],{"class":451,"line":2790},[449,53261,18014],{"class":17370},[449,53263,1482],{"class":684},[449,53265,17933],{"class":714},[449,53267,53268,53270,53272,53274],{"class":451,"line":3511},[449,53269,17973],{"class":684},[449,53271,12264],{"class":17370},[449,53273,1482],{"class":684},[449,53275,36944],{"class":691},[449,53277,53278,53280,53282,53284],{"class":451,"line":3526},[449,53279,17973],{"class":684},[449,53281,12264],{"class":17370},[449,53283,1482],{"class":684},[449,53285,53286],{"class":691},"pnpm --filter jumble build\n",[21,53288,53289,53290,53292],{},"Add ",[40,53291,41704],{},"\u002Fmigration checks when the schema changes. The deploy itself is a release step, not a pull-request step.",[32,53294,53296],{"id":53295},"the-final-deploy","The final deploy",[21,53298,53299],{},"Generate and apply the last migration, set the admin secret, and ship:",[48,53301,53303],{"className":839,"code":53302,"language":841,"meta":56,"style":56},"void db generate\nvoid secret put ADMIN_PASSWORD\nvoid deploy --platform cloudflare\n",[40,53304,53305,53313,53323],{"__ignoreMap":56},[449,53306,53307,53309,53311],{"class":451,"line":452},[449,53308,41217],{"class":721},[449,53310,11475],{"class":691},[449,53312,43513],{"class":691},[449,53314,53315,53317,53319,53321],{"class":451,"line":114},[449,53316,41217],{"class":721},[449,53318,26674],{"class":691},[449,53320,51202],{"class":691},[449,53322,51205],{"class":691},[449,53324,53325,53327,53329,53331],{"class":451,"line":111},[449,53326,41217],{"class":721},[449,53328,41658],{"class":691},[449,53330,8896],{"class":714},[449,53332,44901],{"class":691},[21,53334,53335],{},"Void creates or updates:",[383,53337,53338,53344,53350,53356,53362,53369],{},[386,53339,53340,53341,53343],{},"D1 ",[40,53342,41334],{}," with migrations.",[386,53345,53346,53347,53349],{},"KV ",[40,53348,41341],{}," for carts and admin sessions.",[386,53351,53352,53353,165],{},"Queue ",[40,53354,53355],{},"order-confirmation",[386,53357,53358,53359,165],{},"Cron ",[40,53360,53361],{},"0 6 * * 1",[386,53363,53364,53365,53368],{},"R2 ",[40,53366,53367],{},"STORAGE"," for flavor photos.",[386,53370,53371],{},"Worker routes and assets.",[21,53373,53374,53375,165],{},"The deployed app is ",[40,53376,53377],{},"https:\u002F\u002Fjumble.educreon.workers.dev",[32,53379,53381],{"id":53380},"the-final-walkthrough","The final walkthrough",[816,53383,53384,53389,53392,53395,53398,53401,53407,53410,53413],{},[386,53385,49893,53386,53388],{},[40,53387,5872],{}," — the weekly menu, generated art, and the cart trigger.",[386,53390,53391],{},"Open a cookie, choose a 6-pack, and add it.",[386,53393,53394],{},"Raise the quantity, open checkout, and choose a pickup slot.",[386,53396,53397],{},"Place the order and land on a public order code.",[386,53399,53400],{},"The queue confirms it; the timeline appends the confirmation.",[386,53402,53403,53404,53406],{},"Sign in at ",[40,53405,51088],{},", move the order to Preparing, then Ready.",[386,53408,53409],{},"Toggle a flavor out of the week; the storefront updates.",[386,53411,53412],{},"Upload a flavor photo; the menu uses it without a redeploy.",[386,53414,49893,53415,23841,53417,53419],{},[40,53416,46440],{},[40,53418,48448],{}," to confirm the older stages still stop at their boundaries.",[32,53421,43605],{"id":43604},[383,53423,53424,53430,53438,53444,53455,53461,53467],{},[386,53425,53426,53429],{},[151,53427,53428],{},"R2 is not a CMS."," Validate content type and size, choose the key, and keep the admin gate.",[386,53431,53432,53437],{},[151,53433,17781,53434,53436],{},[40,53435,52365],{}," and a safe disposition."," Uploaded files are untrusted input.",[386,53439,53440,53443],{},[151,53441,53442],{},"Cache immutable keys."," A new upload gets a new UUID; replacing a photo changes the key.",[386,53445,53446,25398,53449,53451,53452,53454],{},[151,53447,53448],{},"Secrets are deploy prerequisites.",[40,53450,41236],{}," fails without ",[40,53453,51092],{},"; keep it out of Git.",[386,53456,53457,53460],{},[151,53458,53459],{},"Migrations are release artifacts."," Generate, review, and commit them before deploying.",[386,53462,53463,53466],{},[151,53464,53465],{},"Do not leak admin data into the login render."," The unauthorized loader returns empty data.",[386,53468,53469,53472],{},[151,53470,53471],{},"The stage routes are the proof."," Stage 4 has a cart without checkout; stage 5 has checkout without queue; stage 6 has status without admin; stage 7 has admin without photos.",[32,53474,43655],{"id":43654},[21,53476,53477],{},"All eight stages are in production: a branded storefront, a weekly D1 menu, KV carts, D1 checkout, queue-backed confirmations, polling order status, protected admin operations, and R2 photos.",[21,53479,42559,53480,53482,53483,53485],{},[40,53481,5872],{},". The source is ",[40,53484,42308],{},". The lessons are the changelog.",[3728,53487,53488],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .snhLl, html code.shiki .snhLl{--shiki-default:#22863A;--shiki-default-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold}html pre.shiki code .sA_wV, html code.shiki .sA_wV{--shiki-default:#032F62;--shiki-dark:#DBEDFF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":56,"searchDepth":111,"depth":111,"links":53490},[53491,53492,53493,53494,53495,53496,53497,53498],{"id":42725,"depth":114,"text":42726},{"id":52379,"depth":114,"text":52380},{"id":52684,"depth":114,"text":52685},{"id":53109,"depth":114,"text":53110},{"id":53295,"depth":114,"text":53296},{"id":53380,"depth":114,"text":53381},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},"Finish Jumble with R2 photos, a CI workflow, the full deploy, and a final walkthrough.","R2 + CI + production",{},{"title":52315,"description":53499},"https:\u002F\u002Fvoid.cloud\u002Fguide\u002Fstorage","learn\u002Fvoid\u002F08-ship","S5rbTaoOa_TJbAbg-Rmcj7UNZlA2ufXzvNJVAmpgBEI",{"id":46548,"title":46549,"author":53507,"body":53508,"description":48534,"difficulty":42701,"estMinutes":4032,"extension":119,"feature":48535,"img":42703,"meta":55236,"navigation":130,"nuxtVersion":116,"order":468,"path":42365,"releaseDate":116,"seo":55237,"series":41217,"sourcePRs":116,"sourceUrl":42632,"stem":48538,"__hash__":48539},{"name":9,"img":17256,"website":42491},{"type":13,"value":53509,"toc":55224},[53510,53512,53514,53516,53518,53520,53554,53556,53558,53560,53574,53576,53578,53584,53700,53908,53912,53914,53916,53996,54320,54330,54332,54336,54798,54804,54808,54928,54930,54932,54934,54990,54994,55110,55112,55114,55116,55126,55128,55144,55146,55148,55162,55166,55168,55174,55178,55180,55212,55214,55216,55222],[21,53511,46555],{},[21,53513,46558],{},[42504,53515],{"height":46561,"stage":4873},[32,53517,42726],{"id":42725},[21,53519,46566],{},[816,53521,53522,53528,53536,53550],{},[386,53523,53524,21921,53526,46577],{},[151,53525,46573],{},[40,53527,46576],{},[386,53529,53530,46583,53532,1546,53534,165],{},[151,53531,46582],{},[40,53533,46586],{},[40,53535,41133],{},[386,53537,53538,21263,53542,349,53544,349,53546,1542,53548,165],{},[151,53539,53540],{},[40,53541,46595],{},[40,53543,14531],{},[40,53545,14556],{},[40,53547,14579],{},[40,53549,46604],{},[386,53551,53552,46610],{},[151,53553,46609],{},[21,53555,46613],{},[32,53557,42758],{"id":42757},[21,53559,46618],{},[383,53561,53562,53568,53570,53572],{},[386,53563,46623,53564,46627,53566,165],{},[40,53565,46626],{},[40,53567,46630],{},[386,53569,46633],{},[386,53571,46636],{},[386,53573,46639],{},[21,53575,46642],{},[32,53577,46646],{"id":46645},[21,53579,46649,53580,46652,53582,165],{},[40,53581,46576],{},[40,53583,46655],{},[48,53585,53586],{"className":670,"code":46658,"filename":46659,"language":673,"meta":56,"style":56},[40,53587,53588,53602,53616,53642,53646,53674,53696],{"__ignoreMap":56},[449,53589,53590,53592,53594,53596,53598,53600],{"class":451,"line":452},[449,53591,4629],{"class":680},[449,53593,10789],{"class":680},[449,53595,46670],{"class":714},[449,53597,718],{"class":680},[449,53599,46675],{"class":691},[449,53601,695],{"class":684},[449,53603,53604,53606,53608,53610,53612,53614],{"class":451,"line":114},[449,53605,4629],{"class":680},[449,53607,10789],{"class":680},[449,53609,46686],{"class":714},[449,53611,718],{"class":680},[449,53613,46691],{"class":691},[449,53615,695],{"class":684},[449,53617,53618,53620,53622,53624,53626,53628,53630,53632,53634,53636,53638,53640],{"class":451,"line":111},[449,53619,4629],{"class":680},[449,53621,10789],{"class":680},[449,53623,46702],{"class":714},[449,53625,718],{"class":680},[449,53627,25516],{"class":714},[449,53629,11428],{"class":680},[449,53631,25516],{"class":714},[449,53633,11428],{"class":680},[449,53635,28028],{"class":714},[449,53637,11428],{"class":680},[449,53639,46719],{"class":714},[449,53641,695],{"class":684},[449,53643,53644],{"class":451,"line":468},[449,53645,700],{"emptyLinePlaceholder":130},[449,53647,53648,53650,53652,53654,53656,53658,53660,53662,53664,53666,53668,53670,53672],{"class":451,"line":474},[449,53649,4629],{"class":680},[449,53651,5433],{"class":680},[449,53653,46734],{"class":721},[449,53655,725],{"class":684},[449,53657,23622],{"class":1491},[449,53659,3070],{"class":680},[449,53661,46743],{"class":714},[449,53663,827],{"class":684},[449,53665,3070],{"class":680},[449,53667,46750],{"class":1491},[449,53669,46753],{"class":680},[449,53671,6081],{"class":714},[449,53673,1501],{"class":684},[449,53675,53676,53678,53680,53682,53684,53686,53688,53690,53692,53694],{"class":451,"line":480},[449,53677,4726],{"class":680},[449,53679,11316],{"class":680},[449,53681,46766],{"class":684},[449,53683,37592],{"class":680},[449,53685,46771],{"class":691},[449,53687,46774],{"class":680},[449,53689,46777],{"class":714},[449,53691,165],{"class":684},[449,53693,46782],{"class":721},[449,53695,46785],{"class":684},[449,53697,53698],{"class":451,"line":486},[449,53699,4604],{"class":684},[48,53701,53702],{"className":670,"code":46792,"filename":46793,"language":673,"meta":56,"style":56},[40,53703,53704,53718,53736,53750,53754,53766,53778,53784,53788,53792,53828,53846,53852,53860,53864,53874,53882,53886,53890,53894,53904],{"__ignoreMap":56},[449,53705,53706,53708,53710,53712,53714,53716],{"class":451,"line":452},[449,53707,24643],{"class":680},[449,53709,46802],{"class":721},[449,53711,16797],{"class":684},[449,53713,3070],{"class":680},[449,53715,6081],{"class":714},[449,53717,1501],{"class":684},[449,53719,53720,53722,53724,53726,53728,53730,53732,53734],{"class":451,"line":114},[449,53721,5048],{"class":680},[449,53723,46817],{"class":714},[449,53725,718],{"class":680},[449,53727,46822],{"class":684},[449,53729,16504],{"class":721},[449,53731,725],{"class":684},[449,53733,46829],{"class":714},[449,53735,740],{"class":684},[449,53737,53738,53740,53742,53744,53746,53748],{"class":451,"line":111},[449,53739,5080],{"class":680},[449,53741,1913],{"class":684},[449,53743,46840],{"class":721},[449,53745,46843],{"class":684},[449,53747,37686],{"class":680},[449,53749,46848],{"class":684},[449,53751,53752],{"class":451,"line":468},[449,53753,700],{"emptyLinePlaceholder":130},[449,53755,53756,53758,53760,53762,53764],{"class":451,"line":474},[449,53757,5048],{"class":680},[449,53759,27952],{"class":714},[449,53761,718],{"class":680},[449,53763,46863],{"class":721},[449,53765,1322],{"class":684},[449,53767,53768,53770,53772,53774,53776],{"class":451,"line":480},[449,53769,46870],{"class":684},[449,53771,16185],{"class":721},[449,53773,725],{"class":684},[449,53775,46829],{"class":714},[449,53777,46879],{"class":684},[449,53779,53780,53782],{"class":451,"line":486},[449,53781,4726],{"class":680},[449,53783,46886],{"class":684},[449,53785,53786],{"class":451,"line":492},[449,53787,4604],{"class":684},[449,53789,53790],{"class":451,"line":498},[449,53791,700],{"emptyLinePlaceholder":130},[449,53793,53794,53796,53798,53800,53802,53804,53806,53808,53810,53812,53814,53816,53818,53820,53822,53824,53826],{"class":451,"line":133},[449,53795,1485],{"class":680},[449,53797,5433],{"class":680},[449,53799,46903],{"class":721},[449,53801,725],{"class":684},[449,53803,46908],{"class":1491},[449,53805,3070],{"class":680},[449,53807,6081],{"class":714},[449,53809,349],{"class":684},[449,53811,2654],{"class":1491},[449,53813,23914],{"class":680},[449,53815,46921],{"class":721},[449,53817,827],{"class":684},[449,53819,3070],{"class":680},[449,53821,5161],{"class":721},[449,53823,5547],{"class":684},[449,53825,46932],{"class":721},[449,53827,26735],{"class":684},[449,53829,53830,53832,53834,53836,53838,53840,53842,53844],{"class":451,"line":509},[449,53831,5048],{"class":680},[449,53833,46941],{"class":714},[449,53835,718],{"class":680},[449,53837,1654],{"class":680},[449,53839,5660],{"class":721},[449,53841,725],{"class":684},[449,53843,46952],{"class":691},[449,53845,768],{"class":684},[449,53847,53848,53850],{"class":451,"line":318},[449,53849,13553],{"class":680},[449,53851,46961],{"class":684},[449,53853,53854,53856,53858],{"class":451,"line":520},[449,53855,46966],{"class":684},[449,53857,46969],{"class":691},[449,53859,779],{"class":684},[449,53861,53862],{"class":451,"line":526},[449,53863,46976],{"class":684},[449,53865,53866,53868,53870,53872],{"class":451,"line":532},[449,53867,46981],{"class":691},[449,53869,1482],{"class":684},[449,53871,46986],{"class":691},[449,53873,779],{"class":684},[449,53875,53876,53878,53880],{"class":451,"line":2790},[449,53877,46993],{"class":684},[449,53879,46996],{"class":714},[449,53881,46999],{"class":684},[449,53883,53884],{"class":451,"line":3511},[449,53885,1458],{"class":684},[449,53887,53888],{"class":451,"line":3526},[449,53889,13321],{"class":684},[449,53891,53892],{"class":451,"line":3531},[449,53893,700],{"emptyLinePlaceholder":130},[449,53895,53896,53898,53900,53902],{"class":451,"line":3536},[449,53897,4726],{"class":680},[449,53899,47018],{"class":684},[449,53901,4521],{"class":721},[449,53903,1322],{"class":684},[449,53905,53906],{"class":451,"line":4009},[449,53907,4604],{"class":684},[21,53909,47029,53910,47032],{},[40,53911,46576],{},[21,53913,47035],{},[32,53915,47039],{"id":47038},[48,53917,53918],{"className":670,"code":47042,"filename":46659,"language":673,"meta":56,"style":56},[40,53919,53920,53932,53942,53952,53962,53966,53970,53982,53992],{"__ignoreMap":56},[449,53921,53922,53924,53926,53928,53930],{"class":451,"line":452},[449,53923,4629],{"class":680},[449,53925,11308],{"class":680},[449,53927,47053],{"class":721},[449,53929,718],{"class":680},[449,53931,1501],{"class":684},[449,53933,53934,53936,53938,53940],{"class":451,"line":114},[449,53935,47062],{"class":1491},[449,53937,3070],{"class":680},[449,53939,6081],{"class":714},[449,53941,695],{"class":684},[449,53943,53944,53946,53948,53950],{"class":451,"line":111},[449,53945,45137],{"class":1491},[449,53947,3070],{"class":680},[449,53949,4975],{"class":714},[449,53951,695],{"class":684},[449,53953,53954,53956,53958,53960],{"class":451,"line":468},[449,53955,4982],{"class":1491},[449,53957,3070],{"class":680},[449,53959,4975],{"class":714},[449,53961,695],{"class":684},[449,53963,53964],{"class":451,"line":474},[449,53965,20963],{"class":684},[449,53967,53968],{"class":451,"line":480},[449,53969,700],{"emptyLinePlaceholder":130},[449,53971,53972,53974,53976,53978,53980],{"class":451,"line":486},[449,53973,4629],{"class":680},[449,53975,11308],{"class":680},[449,53977,47105],{"class":721},[449,53979,718],{"class":680},[449,53981,1501],{"class":684},[449,53983,53984,53986,53988,53990],{"class":451,"line":492},[449,53985,47114],{"class":1491},[449,53987,3070],{"class":680},[449,53989,47053],{"class":721},[449,53991,5071],{"class":684},[449,53993,53994],{"class":451,"line":498},[449,53995,20963],{"class":684},[48,53997,53998],{"className":670,"code":47127,"filename":47128,"language":673,"meta":56,"style":56},[40,53999,54000,54012,54024,54028,54050,54054,54068,54072,54080,54088,54112,54128,54156,54160,54164,54176,54180,54184,54214,54236,54254,54258,54262,54290,54316],{"__ignoreMap":56},[449,54001,54002,54004,54006,54008,54010],{"class":451,"line":452},[449,54003,681],{"class":680},[449,54005,47137],{"class":684},[449,54007,688],{"class":680},[449,54009,47142],{"class":691},[449,54011,695],{"class":684},[449,54013,54014,54016,54018,54020,54022],{"class":451,"line":114},[449,54015,681],{"class":680},[449,54017,25443],{"class":684},[449,54019,688],{"class":680},[449,54021,47155],{"class":691},[449,54023,695],{"class":684},[449,54025,54026],{"class":451,"line":111},[449,54027,700],{"emptyLinePlaceholder":130},[449,54029,54030,54032,54034,54036,54038,54040,54042,54044,54046,54048],{"class":451,"line":468},[449,54031,711],{"class":680},[449,54033,47168],{"class":714},[449,54035,718],{"class":680},[449,54037,47173],{"class":684},[449,54039,6391],{"class":721},[449,54041,5547],{"class":684},[449,54043,47180],{"class":714},[449,54045,47183],{"class":684},[449,54047,47186],{"class":691},[449,54049,740],{"class":684},[449,54051,54052],{"class":451,"line":474},[449,54053,700],{"emptyLinePlaceholder":130},[449,54055,54056,54058,54060,54062,54064,54066],{"class":451,"line":480},[449,54057,711],{"class":680},[449,54059,47199],{"class":714},[449,54061,718],{"class":680},[449,54063,47204],{"class":684},[449,54065,25487],{"class":721},[449,54067,1391],{"class":684},[449,54069,54070],{"class":451,"line":486},[449,54071,47213],{"class":684},[449,54073,54074,54076,54078],{"class":451,"line":492},[449,54075,11190],{"class":684},[449,54077,47220],{"class":721},[449,54079,5567],{"class":684},[449,54081,54082,54084,54086],{"class":451,"line":498},[449,54083,47227],{"class":684},[449,54085,25487],{"class":721},[449,54087,1391],{"class":684},[449,54089,54090,54092,54094,54096,54098,54100,54102,54104,54106,54108,54110],{"class":451,"line":133},[449,54091,47236],{"class":684},[449,54093,25474],{"class":721},[449,54095,5237],{"class":684},[449,54097,37442],{"class":721},[449,54099,725],{"class":684},[449,54101,4798],{"class":714},[449,54103,374],{"class":684},[449,54105,37432],{"class":721},[449,54107,725],{"class":684},[449,54109,47255],{"class":714},[449,54111,1613],{"class":684},[449,54113,54114,54116,54118,54120,54122,54124,54126],{"class":451,"line":509},[449,54115,47262],{"class":684},[449,54117,25497],{"class":721},[449,54119,5237],{"class":684},[449,54121,25502],{"class":721},[449,54123,5237],{"class":684},[449,54125,47273],{"class":721},[449,54127,1624],{"class":684},[449,54129,54130,54132,54134,54136,54138,54140,54142,54144,54146,54148,54150,54152,54154],{"class":451,"line":318},[449,54131,47280],{"class":684},[449,54133,25497],{"class":721},[449,54135,5237],{"class":684},[449,54137,25502],{"class":721},[449,54139,5237],{"class":684},[449,54141,37442],{"class":721},[449,54143,725],{"class":684},[449,54145,4798],{"class":714},[449,54147,374],{"class":684},[449,54149,37432],{"class":721},[449,54151,725],{"class":684},[449,54153,45260],{"class":714},[449,54155,1613],{"class":684},[449,54157,54158],{"class":451,"line":520},[449,54159,5785],{"class":684},[449,54161,54162],{"class":451,"line":526},[449,54163,19898],{"class":684},[449,54165,54166,54168,54170,54172,54174],{"class":451,"line":532},[449,54167,11190],{"class":684},[449,54169,37432],{"class":721},[449,54171,725],{"class":684},[449,54173,47323],{"class":714},[449,54175,1613],{"class":684},[449,54177,54178],{"class":451,"line":2790},[449,54179,784],{"class":684},[449,54181,54182],{"class":451,"line":3511},[449,54183,700],{"emptyLinePlaceholder":130},[449,54185,54186,54188,54190,54192,54194,54196,54198,54200,54202,54204,54206,54208,54210,54212],{"class":451,"line":3526},[449,54187,4629],{"class":680},[449,54189,5597],{"class":680},[449,54191,5433],{"class":680},[449,54193,47344],{"class":721},[449,54195,725],{"class":684},[449,54197,46908],{"class":1491},[449,54199,3070],{"class":680},[449,54201,6081],{"class":714},[449,54203,827],{"class":684},[449,54205,3070],{"class":680},[449,54207,5161],{"class":721},[449,54209,5547],{"class":684},[449,54211,47363],{"class":721},[449,54213,26735],{"class":684},[449,54215,54216,54218,54220,54222,54224,54226,54228,54230,54232,54234],{"class":451,"line":3531},[449,54217,5048],{"class":680},[449,54219,47372],{"class":714},[449,54221,718],{"class":680},[449,54223,47377],{"class":684},[449,54225,47380],{"class":721},[449,54227,725],{"class":684},[449,54229,2056],{"class":680},[449,54231,47387],{"class":684},[449,54233,12644],{"class":721},[449,54235,47392],{"class":684},[449,54237,54238,54240,54242,54244,54246,54248,54250,54252],{"class":451,"line":3536},[449,54239,4726],{"class":680},[449,54241,47399],{"class":684},[449,54243,45548],{"class":680},[449,54245,47404],{"class":721},[449,54247,47407],{"class":684},[449,54249,3070],{"class":680},[449,54251,47412],{"class":721},[449,54253,1322],{"class":684},[449,54255,54256],{"class":451,"line":4009},[449,54257,4604],{"class":684},[449,54259,54260],{"class":451,"line":4015},[449,54261,700],{"emptyLinePlaceholder":130},[449,54263,54264,54266,54268,54270,54272,54274,54276,54278,54280,54282,54284,54286,54288],{"class":451,"line":4021},[449,54265,4629],{"class":680},[449,54267,5597],{"class":680},[449,54269,5433],{"class":680},[449,54271,47433],{"class":721},[449,54273,725],{"class":684},[449,54275,46908],{"class":1491},[449,54277,3070],{"class":680},[449,54279,6081],{"class":714},[449,54281,349],{"class":684},[449,54283,47446],{"class":1491},[449,54285,3070],{"class":680},[449,54287,47105],{"class":721},[449,54289,3417],{"class":684},[449,54291,54292,54294,54296,54298,54300,54302,54304,54306,54308,54310,54312,54314],{"class":451,"line":4027},[449,54293,2099],{"class":680},[449,54295,47387],{"class":684},[449,54297,47461],{"class":721},[449,54299,47464],{"class":684},[449,54301,25511],{"class":714},[449,54303,11428],{"class":680},[449,54305,25516],{"class":714},[449,54307,11428],{"class":680},[449,54309,28028],{"class":714},[449,54311,11428],{"class":680},[449,54313,46719],{"class":714},[449,54315,2051],{"class":684},[449,54317,54318],{"class":451,"line":4032},[449,54319,4604],{"class":684},[21,54321,47487,54322,1546,54324,47492,54326,47495,54328,47498],{},[40,54323,46586],{},[40,54325,41133],{},[40,54327,41341],{},[40,54329,41236],{},[32,54331,47502],{"id":47501},[21,54333,54334,47508],{},[40,54335,47507],{},[48,54337,54338],{"className":670,"code":47511,"filename":47507,"language":673,"meta":56,"style":56},[40,54339,54340,54366,54378,54394,54398,54412,54426,54430,54434,54460,54472,54498,54502,54524,54550,54554,54568,54594,54622,54626,54642,54660,54664,54668,54682,54696,54720,54724,54728,54734,54754,54762,54770,54774,54778,54786,54794],{"__ignoreMap":56},[449,54341,54342,54344,54346,54348,54350,54352,54354,54356,54358,54360,54362,54364],{"class":451,"line":452},[449,54343,4629],{"class":680},[449,54345,10789],{"class":680},[449,54347,41495],{"class":714},[449,54349,718],{"class":680},[449,54351,41500],{"class":721},[449,54353,725],{"class":684},[449,54355,1485],{"class":680},[449,54357,1913],{"class":684},[449,54359,37719],{"class":1491},[449,54361,1758],{"class":684},[449,54363,1498],{"class":680},[449,54365,1501],{"class":684},[449,54367,54368,54370,54372,54374,54376],{"class":451,"line":114},[449,54369,5048],{"class":680},[449,54371,27952],{"class":714},[449,54373,718],{"class":680},[449,54375,47550],{"class":721},[449,54377,47553],{"class":684},[449,54379,54380,54382,54384,54386,54388,54390,54392],{"class":451,"line":111},[449,54381,5080],{"class":680},[449,54383,1913],{"class":684},[449,54385,5085],{"class":680},[449,54387,47564],{"class":684},[449,54389,37686],{"class":680},[449,54391,47569],{"class":721},[449,54393,1322],{"class":684},[449,54395,54396],{"class":451,"line":468},[449,54397,700],{"emptyLinePlaceholder":130},[449,54399,54400,54402,54404,54406,54408,54410],{"class":451,"line":474},[449,54401,5048],{"class":680},[449,54403,15064],{"class":714},[449,54405,718],{"class":680},[449,54407,1654],{"class":680},[449,54409,43800],{"class":721},[449,54411,1322],{"class":684},[449,54413,54414,54416,54418,54420,54422,54424],{"class":451,"line":480},[449,54415,4726],{"class":680},[449,54417,47596],{"class":721},[449,54419,47599],{"class":684},[449,54421,2056],{"class":680},[449,54423,47344],{"class":721},[449,54425,47606],{"class":684},[449,54427,54428],{"class":451,"line":486},[449,54429,784],{"class":684},[449,54431,54432],{"class":451,"line":492},[449,54433,700],{"emptyLinePlaceholder":130},[449,54435,54436,54438,54440,54442,54444,54446,54448,54450,54452,54454,54456,54458],{"class":451,"line":498},[449,54437,4629],{"class":680},[449,54439,10789],{"class":680},[449,54441,14358],{"class":714},[449,54443,718],{"class":680},[449,54445,41500],{"class":721},[449,54447,725],{"class":684},[449,54449,1485],{"class":680},[449,54451,1913],{"class":684},[449,54453,37719],{"class":1491},[449,54455,1758],{"class":684},[449,54457,1498],{"class":680},[449,54459,1501],{"class":684},[449,54461,54462,54464,54466,54468,54470],{"class":451,"line":133},[449,54463,5048],{"class":680},[449,54465,27952],{"class":714},[449,54467,718],{"class":680},[449,54469,47550],{"class":721},[449,54471,47553],{"class":684},[449,54473,54474,54476,54478,54480,54482,54484,54486,54488,54490,54492,54494,54496],{"class":451,"line":509},[449,54475,5080],{"class":680},[449,54477,1913],{"class":684},[449,54479,5085],{"class":680},[449,54481,47564],{"class":684},[449,54483,37686],{"class":680},[449,54485,47667],{"class":684},[449,54487,4521],{"class":721},[449,54489,47672],{"class":684},[449,54491,47675],{"class":691},[449,54493,2737],{"class":684},[449,54495,5123],{"class":714},[449,54497,740],{"class":684},[449,54499,54500],{"class":451,"line":318},[449,54501,700],{"emptyLinePlaceholder":130},[449,54503,54504,54506,54508,54510,54512,54514,54516,54518,54520,54522],{"class":451,"line":520},[449,54505,5048],{"class":680},[449,54507,5051],{"class":714},[449,54509,718],{"class":680},[449,54511,1654],{"class":680},[449,54513,5060],{"class":721},[449,54515,4717],{"class":684},[449,54517,1498],{"class":680},[449,54519,45412],{"class":684},[449,54521,4521],{"class":721},[449,54523,47708],{"class":684},[449,54525,54526,54528,54530,54532,54534,54536,54538,54540,54542,54544,54546,54548],{"class":451,"line":526},[449,54527,5080],{"class":680},[449,54529,1913],{"class":684},[449,54531,5085],{"class":680},[449,54533,47719],{"class":684},[449,54535,37686],{"class":680},[449,54537,47667],{"class":684},[449,54539,4521],{"class":721},[449,54541,47672],{"class":684},[449,54543,47730],{"class":691},[449,54545,2737],{"class":684},[449,54547,5123],{"class":714},[449,54549,740],{"class":684},[449,54551,54552],{"class":451,"line":532},[449,54553,700],{"emptyLinePlaceholder":130},[449,54555,54556,54558,54560,54562,54564,54566],{"class":451,"line":2790},[449,54557,5048],{"class":680},[449,54559,15064],{"class":714},[449,54561,718],{"class":680},[449,54563,1654],{"class":680},[449,54565,43800],{"class":721},[449,54567,1322],{"class":684},[449,54569,54570,54572,54574,54576,54578,54580,54582,54584,54586,54588,54590,54592],{"class":451,"line":3511},[449,54571,5048],{"class":680},[449,54573,45467],{"class":714},[449,54575,718],{"class":680},[449,54577,45472],{"class":684},[449,54579,37464],{"class":721},[449,54581,5164],{"class":684},[449,54583,13080],{"class":1491},[449,54585,1758],{"class":684},[449,54587,1498],{"class":680},[449,54589,45485],{"class":684},[449,54591,37592],{"class":680},[449,54593,47781],{"class":684},[449,54595,54596,54598,54600,54602,54604,54606,54608,54610,54612,54614,54616,54618,54620],{"class":451,"line":3526},[449,54597,5048],{"class":680},[449,54599,47788],{"class":714},[449,54601,718],{"class":680},[449,54603,45193],{"class":714},[449,54605,165],{"class":684},[449,54607,37464],{"class":721},[449,54609,5164],{"class":684},[449,54611,13080],{"class":1491},[449,54613,1758],{"class":684},[449,54615,1498],{"class":680},[449,54617,47807],{"class":684},[449,54619,37592],{"class":680},[449,54621,47812],{"class":684},[449,54623,54624],{"class":451,"line":3531},[449,54625,700],{"emptyLinePlaceholder":130},[449,54627,54628,54630,54632,54634,54636,54638,54640],{"class":451,"line":3536},[449,54629,5080],{"class":680},[449,54631,1913],{"class":684},[449,54633,5085],{"class":680},[449,54635,47827],{"class":684},[449,54637,5091],{"class":680},[449,54639,12868],{"class":680},[449,54641,47834],{"class":684},[449,54643,54644,54646,54648,54650,54652,54654,54656,54658],{"class":451,"line":4009},[449,54645,1506],{"class":680},[449,54647,47667],{"class":684},[449,54649,4521],{"class":721},[449,54651,47672],{"class":684},[449,54653,47847],{"class":691},[449,54655,2737],{"class":684},[449,54657,47852],{"class":714},[449,54659,740],{"class":684},[449,54661,54662],{"class":451,"line":4015},[449,54663,4599],{"class":684},[449,54665,54666],{"class":451,"line":4021},[449,54667,700],{"emptyLinePlaceholder":130},[449,54669,54670,54672,54674,54676,54678,54680],{"class":451,"line":4027},[449,54671,5048],{"class":680},[449,54673,47869],{"class":714},[449,54675,718],{"class":680},[449,54677,1654],{"class":680},[449,54679,47344],{"class":721},[449,54681,28579],{"class":684},[449,54683,54684,54686,54688,54690,54692,54694],{"class":451,"line":4032},[449,54685,5048],{"class":680},[449,54687,47884],{"class":714},[449,54689,718],{"class":680},[449,54691,47889],{"class":684},[449,54693,37464],{"class":721},[449,54695,5567],{"class":684},[449,54697,54698,54700,54702,54704,54706,54708,54710,54712,54714,54716,54718],{"class":451,"line":4038},[449,54699,47898],{"class":684},[449,54701,13080],{"class":1491},[449,54703,1758],{"class":684},[449,54705,1498],{"class":680},[449,54707,45485],{"class":684},[449,54709,37592],{"class":680},[449,54711,47911],{"class":684},[449,54713,16941],{"class":680},[449,54715,47807],{"class":684},[449,54717,37592],{"class":680},[449,54719,47920],{"class":684},[449,54721,54722],{"class":451,"line":4044},[449,54723,14242],{"class":684},[449,54725,54726],{"class":451,"line":4049},[449,54727,700],{"emptyLinePlaceholder":130},[449,54729,54730,54732],{"class":451,"line":4054},[449,54731,5080],{"class":680},[449,54733,47935],{"class":684},[449,54735,54736,54738,54740,54742,54744,54746,54748,54750,54752],{"class":451,"line":4059},[449,54737,47940],{"class":684},[449,54739,5014],{"class":680},[449,54741,5856],{"class":684},[449,54743,37442],{"class":721},[449,54745,47949],{"class":684},[449,54747,24063],{"class":680},[449,54749,47954],{"class":684},[449,54751,45260],{"class":714},[449,54753,740],{"class":684},[449,54755,54756,54758,54760],{"class":451,"line":4065},[449,54757,27082],{"class":684},[449,54759,5720],{"class":680},[449,54761,1501],{"class":684},[449,54763,54764,54766,54768],{"class":451,"line":4070},[449,54765,47971],{"class":684},[449,54767,5258],{"class":721},[449,54769,47976],{"class":684},[449,54771,54772],{"class":451,"line":4075},[449,54773,4599],{"class":684},[449,54775,54776],{"class":451,"line":4081},[449,54777,700],{"emptyLinePlaceholder":130},[449,54779,54780,54782,54784],{"class":451,"line":4086},[449,54781,2099],{"class":680},[449,54783,47433],{"class":721},[449,54785,47993],{"class":684},[449,54787,54788,54790,54792],{"class":451,"line":4092},[449,54789,4726],{"class":680},[449,54791,47596],{"class":721},[449,54793,48002],{"class":684},[449,54795,54796],{"class":451,"line":4098},[449,54797,784],{"class":684},[21,54799,54800,48011,54802,48014],{},[40,54801,14579],{},[40,54803,46604],{},[21,54805,1556,54806,48020],{},[40,54807,48019],{},[48,54809,54810],{"className":670,"code":48023,"filename":46659,"language":673,"meta":56,"style":56},[40,54811,54812,54826,54840,54844,54864,54868,54876,54884,54888,54892,54896,54900,54904,54908,54916,54920,54924],{"__ignoreMap":56},[449,54813,54814,54816,54818,54820,54822,54824],{"class":451,"line":452},[449,54815,711],{"class":680},[449,54817,45467],{"class":714},[449,54819,718],{"class":680},[449,54821,48036],{"class":684},[449,54823,12644],{"class":721},[449,54825,48041],{"class":684},[449,54827,54828,54830,54832,54834,54836,54838],{"class":451,"line":114},[449,54829,711],{"class":680},[449,54831,47788],{"class":714},[449,54833,718],{"class":680},[449,54835,48052],{"class":684},[449,54837,12644],{"class":721},[449,54839,48057],{"class":684},[449,54841,54842],{"class":451,"line":111},[449,54843,700],{"emptyLinePlaceholder":130},[449,54845,54846,54848,54850,54852,54854,54856,54858,54860,54862],{"class":451,"line":468},[449,54847,17337],{"class":680},[449,54849,1913],{"class":684},[449,54851,5085],{"class":680},[449,54853,47827],{"class":684},[449,54855,5091],{"class":680},[449,54857,12868],{"class":680},[449,54859,48078],{"class":684},[449,54861,48081],{"class":680},[449,54863,695],{"class":684},[449,54865,54866],{"class":451,"line":474},[449,54867,700],{"emptyLinePlaceholder":130},[449,54869,54870,54872,54874],{"class":451,"line":480},[449,54871,48092],{"class":684},[449,54873,5258],{"class":721},[449,54875,1391],{"class":684},[449,54877,54878,54880,54882],{"class":451,"line":486},[449,54879,48101],{"class":684},[449,54881,48104],{"class":721},[449,54883,48107],{"class":684},[449,54885,54886],{"class":451,"line":492},[449,54887,48112],{"class":684},[449,54889,54890],{"class":451,"line":498},[449,54891,48117],{"class":684},[449,54893,54894],{"class":451,"line":133},[449,54895,48122],{"class":684},[449,54897,54898],{"class":451,"line":509},[449,54899,48127],{"class":684},[449,54901,54902],{"class":451,"line":318},[449,54903,48132],{"class":684},[449,54905,54906],{"class":451,"line":520},[449,54907,48137],{"class":684},[449,54909,54910,54912,54914],{"class":451,"line":526},[449,54911,48142],{"class":684},[449,54913,13175],{"class":680},[449,54915,48147],{"class":684},[449,54917,54918],{"class":451,"line":532},[449,54919,48152],{"class":684},[449,54921,54922],{"class":451,"line":2790},[449,54923,48157],{"class":684},[449,54925,54926],{"class":451,"line":3511},[449,54927,784],{"class":684},[21,54929,48164],{},[32,54931,48168],{"id":48167},[21,54933,48171],{},[48,54935,54936],{"className":24546,"code":48174,"filename":48175,"language":23763,"meta":56,"style":56},[40,54937,54938,54946,54950,54954,54958,54962,54966,54970,54974,54978,54982,54986],{"__ignoreMap":56},[449,54939,54940,54942,54944],{"class":451,"line":452},[449,54941,48182],{"class":684},[449,54943,41217],{"class":17370},[449,54945,26735],{"class":684},[449,54947,54948],{"class":451,"line":114},[449,54949,48191],{"class":684},[449,54951,54952],{"class":451,"line":111},[449,54953,700],{"emptyLinePlaceholder":130},[449,54955,54956],{"class":451,"line":468},[449,54957,48200],{"class":684},[449,54959,54960],{"class":451,"line":474},[449,54961,48205],{"class":684},[449,54963,54964],{"class":451,"line":480},[449,54965,48210],{"class":684},[449,54967,54968],{"class":451,"line":486},[449,54969,700],{"emptyLinePlaceholder":130},[449,54971,54972],{"class":451,"line":492},[449,54973,48219],{"class":684},[449,54975,54976],{"class":451,"line":498},[449,54977,48224],{"class":684},[449,54979,54980],{"class":451,"line":133},[449,54981,48229],{"class":684},[449,54983,54984],{"class":451,"line":509},[449,54985,4599],{"class":684},[449,54987,54988],{"class":451,"line":318},[449,54989,4604],{"class":684},[21,54991,48240,54992,48243],{},[40,54993,16248],{},[48,54995,54996],{"className":24546,"code":48246,"filename":48247,"language":23763,"meta":56,"style":56},[40,54997,54998,55038,55042,55046,55050,55054,55058,55062,55066,55070,55074,55078,55082,55086,55090,55094,55098,55102],{"__ignoreMap":56},[449,54999,55000,55002,55004,55006,55008,55010,55012,55014,55016,55018,55020,55022,55024,55026,55028,55030,55032,55034,55036],{"class":451,"line":452},[449,55001,5547],{"class":684},[449,55003,48256],{"class":17370},[449,55005,24711],{"class":680},[449,55007,5014],{"class":684},[449,55009,25284],{"class":691},[449,55011,48265],{"class":684},[449,55013,20172],{"class":680},[449,55015,48270],{"class":684},[449,55017,25284],{"class":691},[449,55019,38510],{"class":684},[449,55021,16495],{"class":721},[449,55023,5014],{"class":684},[449,55025,25284],{"class":691},[449,55027,48283],{"class":684},[449,55029,25284],{"class":691},[449,55031,29391],{"class":721},[449,55033,5014],{"class":684},[449,55035,48292],{"class":691},[449,55037,23122],{"class":684},[449,55039,55040],{"class":451,"line":114},[449,55041,48299],{"class":684},[449,55043,55044],{"class":451,"line":111},[449,55045,700],{"emptyLinePlaceholder":130},[449,55047,55048],{"class":451,"line":468},[449,55049,48308],{"class":684},[449,55051,55052],{"class":451,"line":474},[449,55053,48313],{"class":684},[449,55055,55056],{"class":451,"line":480},[449,55057,48318],{"class":684},[449,55059,55060],{"class":451,"line":486},[449,55061,48323],{"class":684},[449,55063,55064],{"class":451,"line":492},[449,55065,48328],{"class":684},[449,55067,55068],{"class":451,"line":498},[449,55069,700],{"emptyLinePlaceholder":130},[449,55071,55072],{"class":451,"line":133},[449,55073,48337],{"class":684},[449,55075,55076],{"class":451,"line":509},[449,55077,48342],{"class":684},[449,55079,55080],{"class":451,"line":318},[449,55081,48347],{"class":684},[449,55083,55084],{"class":451,"line":520},[449,55085,48352],{"class":684},[449,55087,55088],{"class":451,"line":526},[449,55089,48357],{"class":684},[449,55091,55092],{"class":451,"line":532},[449,55093,48362],{"class":684},[449,55095,55096],{"class":451,"line":2790},[449,55097,33848],{"class":684},[449,55099,55100],{"class":451,"line":3511},[449,55101,48328],{"class":684},[449,55103,55104,55106,55108],{"class":451,"line":3526},[449,55105,23220],{"class":684},[449,55107,48256],{"class":17370},[449,55109,23122],{"class":684},[21,55111,48381],{},[32,55113,43385],{"id":43384},[21,55115,48386],{},[48,55117,55118],{"className":839,"code":43519,"language":841,"meta":56,"style":56},[40,55119,55120],{"__ignoreMap":56},[449,55121,55122,55124],{"class":451,"line":452},[449,55123,24321],{"class":721},[449,55125,5300],{"class":691},[21,55127,46412],{},[48,55129,55130],{"className":443,"code":48401,"language":445,"meta":56,"style":56},[40,55131,55132,55136,55140],{"__ignoreMap":56},[449,55133,55134],{"class":451,"line":452},[449,55135,44927],{},[449,55137,55138],{"class":451,"line":114},[449,55139,46426],{},[449,55141,55142],{"class":451,"line":111},[449,55143,48416],{},[21,55145,48419],{},[21,55147,46444],{},[48,55149,55150],{"className":839,"code":44888,"language":841,"meta":56,"style":56},[40,55151,55152],{"__ignoreMap":56},[449,55153,55154,55156,55158,55160],{"class":451,"line":452},[449,55155,41217],{"class":721},[449,55157,41658],{"class":691},[449,55159,8896],{"class":714},[449,55161,44901],{"class":691},[21,55163,48438,55164,48441],{},[40,55165,41341],{},[32,55167,43583],{"id":43582},[21,55169,46466,55170,48449,55172,48452],{},[40,55171,48448],{},[40,55173,5872],{},[21,55175,48455,55176,48458],{},[40,55177,46440],{},[32,55179,43605],{"id":43604},[383,55181,55182,55188,55192,55196,55200,55204,55208],{},[386,55183,55184,48468,55186,165],{},[151,55185,48467],{},[40,55187,45538],{},[386,55189,55190,48476],{},[151,55191,48475],{},[386,55193,55194,48482],{},[151,55195,48481],{},[386,55197,55198,48488],{},[151,55199,48487],{},[386,55201,55202,48494],{},[151,55203,48493],{},[386,55205,55206,48500],{},[151,55207,48499],{},[386,55209,55210,48506],{},[151,55211,48505],{},[32,55213,43655],{"id":43654},[21,55215,48511],{},[21,55217,43661,55218,48518],{},[151,55219,55220],{},[3861,55221,42673],{"href":42374},[3728,55223,48521],{},{"title":56,"searchDepth":111,"depth":111,"links":55225},[55226,55227,55228,55229,55230,55231,55232,55233,55234,55235],{"id":42725,"depth":114,"text":42726},{"id":42757,"depth":114,"text":42758},{"id":46645,"depth":114,"text":46646},{"id":47038,"depth":114,"text":47039},{"id":47501,"depth":114,"text":47502},{"id":48167,"depth":114,"text":48168},{"id":43384,"depth":114,"text":43385},{"id":43582,"depth":114,"text":43583},{"id":43604,"depth":114,"text":43605},{"id":43654,"depth":114,"text":43655},{},{"title":46549,"description":48534},1795659061092,"b5ecbe0a-5a00-4f27-b237-09fd42e4ee33"]