[{"data":1,"prerenderedAt":729},["ShallowReactive",2],{"navigation":3,"page-\u002Fgetting-started\u002Fquickstart":105,"surround-\u002Fgetting-started\u002Fquickstart":724},[4,17,25,48,63,74,86],{"title":5,"path":6,"stem":7,"children":8,"icon":16,"exact":11},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12],{"title":10,"path":6,"stem":7,"exact":11,"children":-1},"Introduction",true,{"title":13,"path":14,"stem":15,"exact":11,"children":-1},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F2.quickstart","i-lucide-rocket",{"title":18,"path":19,"stem":20,"children":21,"icon":24,"exact":11},"Concepts","\u002Fconcepts","2.concepts\u002F1.index",[22],{"title":23,"path":19,"stem":20,"exact":11,"children":-1},"The Kuppit model","i-lucide-shapes",{"title":26,"path":27,"stem":28,"children":29,"icon":47,"exact":11},"Deployments","\u002Fdeployments","3.deployments\u002F1.index",[30,31,35,39,43],{"title":26,"path":27,"stem":28,"exact":11,"children":-1},{"title":32,"path":33,"stem":34,"exact":11,"children":-1},"Builds","\u002Fdeployments\u002Fbuilds","3.deployments\u002F2.builds",{"title":36,"path":37,"stem":38,"exact":11,"children":-1},"Redeploy and roll back","\u002Fdeployments\u002Fredeploy-and-rollback","3.deployments\u002F3.redeploy-and-rollback",{"title":40,"path":41,"stem":42,"exact":11,"children":-1},"Logs","\u002Fdeployments\u002Flogs","3.deployments\u002F4.logs",{"title":44,"path":45,"stem":46,"exact":11,"children":-1},"When a deployment fails","\u002Fdeployments\u002Fwhen-a-deployment-fails","3.deployments\u002F5.when-a-deployment-fails","i-lucide-cloud-upload",{"title":49,"path":50,"stem":51,"children":52,"icon":62,"exact":11},"Resources","\u002Fresources","4.resources\u002F1.index",[53,54,58],{"title":49,"path":50,"stem":51,"exact":11,"children":-1},{"title":55,"path":56,"stem":57,"exact":11,"children":-1},"Web services","\u002Fresources\u002Fweb-services","4.resources\u002F2.web-services",{"title":59,"path":60,"stem":61,"exact":11,"children":-1},"PostgreSQL","\u002Fresources\u002Fpostgresql","4.resources\u002F3.postgresql","i-lucide-boxes",{"title":64,"icon":65,"path":66,"stem":67,"children":68,"page":73,"exact":11},"Configuration","i-lucide-sliders-horizontal","\u002Fconfiguration","5.configuration",[69],{"title":70,"path":71,"stem":72,"exact":11,"children":-1},"Environment variables","\u002Fconfiguration\u002Fvariables","5.configuration\u002F1.variables",false,{"title":75,"path":76,"stem":77,"children":78,"icon":85,"exact":11},"Domains","\u002Fdomains","7.domains\u002F1.index",[79,81],{"title":80,"path":76,"stem":77,"exact":11,"children":-1},"Hostnames",{"title":82,"path":83,"stem":84,"exact":11,"children":-1},"Custom domains","\u002Fdomains\u002Fcustom-domains","7.domains\u002F2.custom-domains","i-lucide-globe",{"title":87,"path":88,"stem":89,"children":90,"icon":104,"exact":11},"Environments","\u002Fenvironments","8.environments\u002F1.index",[91,92,96,100],{"title":87,"path":88,"stem":89,"exact":11,"children":-1},{"title":93,"path":94,"stem":95,"exact":11,"children":-1},"Preview environments","\u002Fenvironments\u002Fpreview-environments","8.environments\u002F2.preview-environments",{"title":97,"path":98,"stem":99,"exact":11,"children":-1},"Named environments","\u002Fenvironments\u002Fnamed-environments","8.environments\u002F3.named-environments",{"title":101,"path":102,"stem":103,"exact":11,"children":-1},"Deleting an environment","\u002Fenvironments\u002Fdeleting-an-environment","8.environments\u002F4.deleting-an-environment","i-lucide-git-branch",{"id":106,"title":13,"badge":107,"body":108,"category":107,"description":718,"draft":73,"extension":719,"links":107,"meta":720,"navigation":11,"path":14,"seo":721,"sitemap":722,"stem":15,"__hash__":723},"docs\u002F1.getting-started\u002F2.quickstart.md",null,{"type":109,"value":110,"toc":704},"minimark",[111,120,125,128,132,162,652,656,700],[112,113,114,115,119],"p",{},"By the end of this page you will have a web service running on a ",[116,117,118],"code",{},"kuppit.app"," hostname, a PostgreSQL database in the same environment, and a variable that connects them.",[121,122,124],"h2",{"id":123},"what-youll-do","What you'll do",[112,126,127],{},"Install the Kuppit GitHub App, create a project from a repository, deploy it, add PostgreSQL, and reference the database's connection string from the service.",[121,129,131],{"id":130},"before-you-begin","Before you begin",[133,134,135,151],"ul",{},[136,137,138,139,142,143,146,147,150],"li",{},"A GitHub repository you can install apps on. It needs either a ",[116,140,141],{},"Dockerfile"," at the root or a Node.js application Kuppit recognises: Nuxt, Next.js, Express, or a ",[116,144,145],{},"package.json"," with a ",[116,148,149],{},"start"," script.",[136,152,153,154,161],{},"A Kuppit account. Sign in at ",[155,156,160],"a",{"href":157,"rel":158},"https:\u002F\u002Fapp.kuppit.run\u002Flogin",[159],"nofollow","app.kuppit.run"," with GitHub. Kuppit is in private alpha, so a new account waits for approval before it can create a project.",[163,164,166,171,191,198,202,208,218,222,229,232,239,243,246,298,305,308,401,409,413,440,443,447,468,475,481,485,513,521,524,527,634,638],"steps",{"level":165},"3",[167,168,170],"h3",{"id":169},"connect-github","Connect GitHub",[112,172,173,174,178,179,182,183,186,187,190],{},"Open ",[175,176,177],"strong",{},"Projects"," and choose ",[175,180,181],{},"New project",". If no GitHub installation is connected yet, Kuppit shows ",[175,184,185],{},"Connect the Kuppit GitHub App",". Choose ",[175,188,189],{},"Install on GitHub",", pick the account, and grant access to the repository you want to deploy.",[112,192,193,194,197],{},"You can grant access to a single repository. Kuppit only ever sees what you grant, and you can widen or narrow the grant later from GitHub's application settings or from ",[175,195,196],{},"Settings"," in Kuppit.",[167,199,201],{"id":200},"create-a-project","Create a project",[112,203,204,205,207],{},"Back in ",[175,206,181],{},", choose the repository and the branch to deploy. Kuppit reads the branch and analyses it.",[112,209,210,211,214,215,217],{},"For a repository with one application at its root, Kuppit proposes a single web service named ",[116,212,213],{},"web",". If the repository uses a ",[116,216,141],{},", the proposal builds from it. Otherwise Kuppit detects the framework, the Node.js version and the package manager, and builds without one.",[167,219,221],{"id":220},"review-what-kuppit-detected","Review what Kuppit detected",[112,223,224,225,228],{},"The proposal shows the build strategy and, for an automatic build, the framework, Node.js version, package manager, build command and start command it found. Change the ",[175,226,227],{},"Root directory"," if the application lives in a subdirectory of the repository, and Kuppit analyses again from there.",[112,230,231],{},"If the branch has moved since the analysis, Kuppit says so and offers to deploy the analysed commit or analyse the latest one.",[112,233,234,235,238],{},"Choose ",[175,236,237],{},"Deploy analyzed commit"," to create the project and its first deployment.",[167,240,242],{"id":241},"deploy","Deploy",[112,244,245],{},"The project opens on its Production environment with the new service, and the deployment moves through four states:",[247,248,249,262],"table",{},[250,251,252],"thead",{},[253,254,255,259],"tr",{},[256,257,258],"th",{},"Status",[256,260,261],{},"Meaning",[263,264,265,274,282,290],"tbody",{},[253,266,267,271],{},[268,269,270],"td",{},"Queued",[268,272,273],{},"Accepted and waiting for a builder.",[253,275,276,279],{},[268,277,278],{},"Building",[268,280,281],{},"Turning the commit into a container image.",[253,283,284,287],{},[268,285,286],{},"Deploying",[268,288,289],{},"Kuppit is provisioning and promoting the new revision.",[253,291,292,295],{},[268,293,294],{},"Live",[268,296,297],{},"Serving production traffic.",[112,299,300,301,304],{},"A deployment that stops before reaching production is ",[175,302,303],{},"Failed",", and traffic is not moved: whatever was serving before keeps serving. Open the deployment to see which phase failed and the build or runtime logs from it.",[112,306,307],{},"For supported frameworks, Kuppit configures the deployment automatically. If you run your own server, it must listen on the port Kuppit assigns and accept connections from outside the container:",[309,310,316],"pre",{"className":311,"code":312,"filename":313,"language":314,"meta":315,"style":315},"language-ts shiki shiki-themes material-theme-lighter github-light github-dark","const port = Number(process.env.PORT ?? 8080)\n\nserver.listen(port, '0.0.0.0')\n","server.ts","ts","",[116,317,318,365,371],{"__ignoreMap":315},[319,320,323,327,331,335,339,343,347,350,352,355,358,362],"span",{"class":321,"line":322},"line",1,[319,324,326],{"class":325},"sbsja","const",[319,328,330],{"class":329},"s_hVV"," port",[319,332,334],{"class":333},"smGrS"," =",[319,336,338],{"class":337},"sGLFI"," Number",[319,340,342],{"class":341},"su5hD","(process",[319,344,346],{"class":345},"sP7_E",".",[319,348,349],{"class":341},"env",[319,351,346],{"class":345},[319,353,354],{"class":329},"PORT",[319,356,357],{"class":333}," ??",[319,359,361],{"class":360},"srdBf"," 8080",[319,363,364],{"class":341},")\n",[319,366,368],{"class":321,"line":367},2,[319,369,370],{"emptyLinePlaceholder":11},"\n",[319,372,374,377,379,382,385,388,392,396,399],{"class":321,"line":373},3,[319,375,376],{"class":341},"server",[319,378,346],{"class":345},[319,380,381],{"class":337},"listen",[319,383,384],{"class":341},"(port",[319,386,387],{"class":345},",",[319,389,391],{"class":390},"sjJ54"," '",[319,393,395],{"class":394},"s_sjI","0.0.0.0",[319,397,398],{"class":390},"'",[319,400,364],{"class":341},[112,402,403,405,406,346],{},[116,404,354],{}," is set by Kuppit and cannot be overridden. See ",[155,407,55],{"href":408},"\u002Fresources\u002Fweb-services#the-port-contract",[167,410,412],{"id":411},"open-the-hostname","Open the hostname",[112,414,415,416,418,419,421,422,425,426,429,430,433,434,436,437,346],{},"Every web service gets a stable hostname on ",[116,417,118],{}," when it is created. For a service named ",[116,420,213],{}," in a project named ",[116,423,424],{},"acme",", it looks like ",[116,427,428],{},"acme-a1b2c3.kuppit.app",", where the last six characters are unique to the service. Find it on the service's ",[175,431,432],{},"Overview",", or on its ",[175,435,75],{}," tab under ",[175,438,439],{},"Kuppit domain",[112,441,442],{},"Open it. Your application is live, with HTTPS.",[167,444,446],{"id":445},"add-postgresql","Add PostgreSQL",[112,448,449,450,452,453,456,457,459,460,463,464,467],{},"On the environment's ",[175,451,432],{},", choose ",[175,454,455],{},"Add resource",", then ",[175,458,59],{},". For a first database there is one choice: ",[175,461,462],{},"Create a new database",", which provisions an empty, isolated PostgreSQL database in this environment. Keep the name ",[116,465,466],{},"database",", review the plan, and create it.",[112,469,470,471,474],{},"Provisioning takes a few minutes. The database's card shows its progress and turns ",[175,472,473],{},"Ready"," when it can accept connections.",[476,477,478],"note",{},[112,479,480],{},"A database lives in Production or in a custom environment, never in a preview environment. Preview environments are created from pull requests and are meant to be disposable; they do not receive a copy of production data.",[167,482,484],{"id":483},"reference-the-database","Reference the database",[112,486,487,488,490,491,494,495,498,499,502,503,506,507,509,510,512],{},"Open the ",[116,489,213],{}," service's ",[175,492,493],{},"Variables"," tab and choose ",[175,496,497],{},"Add variable",". Name it ",[116,500,501],{},"DATABASE_URL",", and instead of typing a value, choose ",[175,504,505],{},"Reference"," and select ",[116,508,466],{}," → ",[116,511,501],{},". The variable is stored as a reference:",[309,514,519],{"className":515,"code":517,"language":518,"meta":315},[516],"language-text","DATABASE_URL = ${{ database.DATABASE_URL }}\n","text",[116,520,517],{"__ignoreMap":315},[112,522,523],{},"The actual connection string is composed when Kuppit prepares the deployment, from the database's current credentials and address. It is never stored on the service and never shown in the dashboard.",[112,525,526],{},"Your application reads it like any other environment variable:",[309,528,531],{"className":311,"code":529,"filename":530,"language":314,"meta":315,"style":315},"import { Client } from 'pg'\n\nconst db = new Client({\n    connectionString: process.env.DATABASE_URL\n})\n\nawait db.connect()\n","server\u002Fdb.ts",[116,532,533,559,563,583,605,613,618],{"__ignoreMap":315},[319,534,535,539,542,545,548,551,553,556],{"class":321,"line":322},[319,536,538],{"class":537},"sVHd0","import",[319,540,541],{"class":345}," {",[319,543,544],{"class":341}," Client",[319,546,547],{"class":345}," }",[319,549,550],{"class":537}," from",[319,552,391],{"class":390},[319,554,555],{"class":394},"pg",[319,557,558],{"class":390},"'\n",[319,560,561],{"class":321,"line":367},[319,562,370],{"emptyLinePlaceholder":11},[319,564,565,567,570,572,575,577,580],{"class":321,"line":373},[319,566,326],{"class":325},[319,568,569],{"class":329}," db",[319,571,334],{"class":333},[319,573,574],{"class":333}," new",[319,576,544],{"class":337},[319,578,579],{"class":341},"(",[319,581,582],{"class":345},"{\n",[319,584,586,590,593,596,598,600,602],{"class":321,"line":585},4,[319,587,589],{"class":588},"skxfh","    connectionString",[319,591,592],{"class":345},":",[319,594,595],{"class":341}," process",[319,597,346],{"class":345},[319,599,349],{"class":341},[319,601,346],{"class":345},[319,603,604],{"class":329},"DATABASE_URL\n",[319,606,608,611],{"class":321,"line":607},5,[319,609,610],{"class":345},"}",[319,612,364],{"class":341},[319,614,616],{"class":321,"line":615},6,[319,617,370],{"emptyLinePlaceholder":11},[319,619,621,624,626,628,631],{"class":321,"line":620},7,[319,622,623],{"class":537},"await",[319,625,569],{"class":341},[319,627,346],{"class":345},[319,629,630],{"class":337},"connect",[319,632,633],{"class":341},"()\n",[167,635,637],{"id":636},"redeploy","Redeploy",[112,639,640,641,644,645,648,649,651],{},"Changing variables does not restart anything by itself. The service shows ",[175,642,643],{},"Runtime configuration has changed","; choose ",[175,646,647],{},"Redeploy now"," to build the current commit again with the new configuration. When the deployment reaches ",[175,650,294],{},", the service is connected to the database.",[121,653,655],{"id":654},"from-here","From here",[133,657,658,668,678,687],{},[136,659,660,663,664,667],{},[175,661,662],{},"Push to the branch."," Every push to the deployed branch creates a new deployment automatically. The previous one becomes ",[175,665,666],{},"Previous"," and can be rolled back to.",[136,669,670,673,674,677],{},[175,671,672],{},"Open a pull request."," Each pull request gets a preview environment of its own, on a hostname like ",[116,675,676],{},"pr-42-acme-a1b2c3.kuppit.app",". It is updated on every push and removed when the pull request closes.",[136,679,680,683,684,686],{},[175,681,682],{},"Understand the model."," ",[155,685,23],{"href":19}," explains projects, environments, resources and the graph between them.",[136,688,689,683,692,694,695,697,698,346],{},[175,690,691],{},"Go deeper on what you just did.",[155,693,55],{"href":56},", ",[155,696,59],{"href":60}," and ",[155,699,70],{"href":71},[701,702,703],"style",{},"html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":315,"searchDepth":373,"depth":373,"links":705},[706,707,717],{"id":123,"depth":367,"text":124},{"id":130,"depth":367,"text":131,"children":708},[709,710,711,712,713,714,715,716],{"id":169,"depth":373,"text":170},{"id":200,"depth":373,"text":201},{"id":220,"depth":373,"text":221},{"id":241,"depth":373,"text":242},{"id":411,"depth":373,"text":412},{"id":445,"depth":373,"text":446},{"id":483,"depth":373,"text":484},{"id":636,"depth":373,"text":637},{"id":654,"depth":367,"text":655},"Deploy a web service from GitHub, add a PostgreSQL database, connect the two, and open the result on a public URL.","md",{},{"title":13,"description":718},{"loc":14},"9kDkePgBkGeaSIvYl8tmJNrmTpUil--DyFKWumlKRhw",[725,727],{"title":10,"path":6,"stem":7,"description":726,"children":-1},"What Kuppit is, what you need to use it, and where to start.",{"title":23,"path":19,"stem":20,"description":728,"children":-1},"Projects, environments, resources and deployments, and how they connect into one application graph.",1788534985201]