Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.
Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.
Given the increasing integration of Machine Learning and AI/LLM models in all applications, it is crucial to explore the potential of a robust cloud application platform like Upsun for conducting these experiments.As a watch enthusiast, what would be better than a recommendation engine to find the right watch for you? Here is the app we are going to build from scratch here:
Let’s review the architecture we are going to create and deploy:Our application will be composed of 3 main components:
A static React frontend is used to present the UI to the user.
An API built with Laravel 11 will handle the search requests and populate our database.
A Postgres instance to store our watches records and vectors for the embeddings of our content.
For speed and cost efficiency reasons, we will leverage both OpenAI for creating embeddings and Groq for the LLM part. We will use llama3–8b-8192 as a model on Groq, but mixtral or any other would also work.
You will need php8.x and composer installed locally for this to work. As we deploy our app on Upsun, you can grab the upsun cli by following the steps here.First, create a new folder for your project:
mkdir watches && cd watches
Let’s start by installing Laravel 11 with the API components:
Let’s now create a new React app. We are using Vite here with the react-ts template but feel free to use any other variant. We will set up shacdn/ui for the UI to speed up building our interface.
cd ..npm create vite@latest frontend -- --template react-tscd frontend# Install shacdn/uinpm create vite@latestnpm install -D tailwindcss postcss autoprefixernpx tailwindcss init -p# (so you can import "path" without error)npm i -D @types/node
Add the following code to the tsconfig.json file to resolve paths:
Add the following code to the vite.config.ts so your app can resolve paths without error
// vite.config.tsimport path from "path"import react from "@vitejs/plugin-react"import { defineConfig } from "vite"export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, },})
Now run the shacdn init with the following settings:
npx shadcn-ui@latest initWould you like to use TypeScript (recommended)? yesWhich style would you like to use? › DefaultWhich color would you like to use as base color? › SlateWhere is your global CSS file? › › src/index.cssDo you want to use CSS variables for colors? › yesWhere is your tailwind.config.js located? › tailwind.config.jsConfigure the import alias for components: › @/componentsConfigure the import alias for utils: › @/lib/utilsAre you using React Server Components? › no (no)
Setting up our local development environment & infrastructure
While you could use Laravel Sail or any other Docker-based local setup to develop the project, I find relying on the Upsun tethering feature always way quicker. It maps the remote services (database, Redis, etc.) to local ports, so you only need to run the runtimes (PHP, JS, …) locally.To do that, we first need to go through the Upsun configuration. While you can use the upsun ify CLI command to generate an automatic configuration, here is the complete configuration explained. Create a new .upsun/config.yaml and paste the following:
# Routing for the frontend and APIroutes: "https://frontend.{all}/": { type: upstream, upstream: "frontend:http" } "https://api.{all}/": { type: upstream, upstream: "app:http" } "http://{all}/": { type: redirect, to: "https://frontend.{all}/" }services: database: type: postgresql:15 # We will use Postgres with the vector extension configuration: extensions: - vector redis: # Redis is used for the Laravel cache type: redis:7.0applications: # Our react frontend frontend: source: root: "frontend" # folder where the app is type: nodejs:20 build: flavor: none web: locations: "/": root: "dist" # Customize if your build outputs the app somewhere else expires: 1h passthru: "/index.html" commands: start: sleep infinity # needed as we serve static files hooks: # customize if you use another build tool build: | set -x -e npm install npm run build app: source: root: "watches" type: php:8.3 dependencies: php: composer/composer: "^2" runtime: extensions: - apcu - redis - blackfire - ctype - iconv - mbstring - pdo_pgsql - pdo_pgsql - sodium - xsl build: flavor: none web: locations: "/": root: "public" expires: 1h passthru: "/index.php" mounts: # Where Laravel needs write access "/.config": source: "storage" source_path: "config" "bootstrap/cache": source: "storage" source_path: "cache" "storage": source: "storage" source_path: "storage" relationships: # link our services database: "database:postgresql" redis: "redis:redis" hooks: build: | set -eux composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader --no-dev deploy: | # customize if needed but should be ok for Laravel set -eux mkdir -p storage/framework/sessions mkdir -p storage/framework/cache mkdir -p storage/framework/views php artisan migrate --force php artisan optimize:clear
Once done, we must inject some variables into our Laravel app to grab the proper credentials. Create the watches/.environment file with the following:
# Set database environment variablesexport DB_HOST="$DATABASE_HOST"export DB_PORT="$DATABASE_PORT"export DB_PATH="$DATABASE_PATH"export DB_USERNAME="$DATABASE_USERNAME"export DB_PASSWORD="$DATABASE_PASSWORD"export DB_SCHEME="postgresql"export DATABASE_URL="${DB_SCHEME}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_PATH}"# Set Laravel-specific environment variablesexport DB_CONNECTION="pgsql"export DB_DATABASE="$DB_PATH"# Set Cache environment variablesexport CACHE_STORE="redis"export CACHE_HOST="$REDIS_HOST"export CACHE_PORT="$REDIS_PORT"export CACHE_SCHEME="$REDIS_SCHEME"export CACHE_URL="${CACHE_SCHEME}://${CACHE_HOST}:${CACHE_PORT}"# Set Redis environment variablesexport REDIS_URL="$CACHE_URL"
You can customize any other environment variable this way. Remember they will always be the same value as this is committed to our repo.Let’s add the configuration to our git repo:
Let’s create an Upsun project for our application:
upsun project:create* Project title (--title)Default: Untitled Project> Watch finder* Region (--region)The region where the project will be hosted.Get a 3% discount on resources for regions with a carbon intensity of less than 100 gCO2eq/kWh. [au.platform.sh ] Sydney, Australia (AWS) [545 gC02eq/kWh] [au-2.platform.sh] Sydney, Australia (AZURE) [545 gC02eq/kWh] [ca-1.platform.sh] Montreal, Canada (AWS) [31 gC02eq/kWh] [ch-1.platform.sh] Zurich, Switzerland (GCP) [91 gC02eq/kWh] [de-2.platform.sh] Frankfurt, Germany (GCP) [416 gC02eq/kWh] [eu.platform.sh ] Dublin, Ireland (AWS) [386 gC02eq/kWh] [eu-2.platform.sh] Dublin, Ireland (AWS) [386 gC02eq/kWh] [eu-4.platform.sh] Dublin, Ireland (AWS) [386 gC02eq/kWh] [eu-5.platform.sh] Stockholm, Sweden (AWS) [23 gC02eq/kWh] [fr-3.platform.sh] Gravelines, France (OVH) [59 gC02eq/kWh] [fr-4.platform.sh] Paris, France (AZURE) [59 gC02eq/kWh] [uk-1.platform.sh] London, United Kingdom (GCP) [200 gC02eq/kWh] [us.platform.sh ] Washington, United States (AWS) [396 gC02eq/kWh] [us-2.platform.sh] Washington, United States (AWS) [396 gC02eq/kWh] [us-3.platform.sh] Moses Lake, United States (AZURE) [56 gC02eq/kWh] [us-4.platform.sh] Charleston, United States (GCP) [647 gC02eq/kWh]> us-3.platform.shDefault branch (--default-branch)The default Git branch name for the project (the production environment)Default: main>Are you sure you want to continue? [Y/n]
The Upsun bot will then provide an empty project for you and set the remote in your local git repository. Once done, you are ready to deploy:
upsun push
The pipeline will build and deploy both apps. After a couple of minutes, the boilerplate apps will be available on:
https://frontend.<branch>.<project>.<region>.platformsh.sitehttps://app.<branch>.<project>.<region>.platformsh.siteYou should be directed to the default pages for both the React and Laravel applications.We can now connect to our remote database and cache services:
upsun tunnel:openEnter a number to choose an app: [0] app [1] frontend > 0Are you sure you want to open SSH tunnel(s) to the environment main (type: production)? [Y/n]SSH tunnel opened to database at: pgsql://main:main@127.0.0.1:30000/mainSSH tunnel opened to redis at: redis://127.0.0.1:30001
You can now edit your local watches/.env to use these services:
You will need your local PHP runtime to have the phpredis extension loaded. Please refer to the following documentation on the Laravel site.If you want to use test hostnames for your applications, edit /etc/hosts or your Windows host file with the following or any other names you like:
127.0.0.1 watches.test frontend.watches.test api.watches.testIf so, update the .env file with the proper hostname:
APP_URL=http://api.watches.test
We can now launch our development services. In two terminals, run:
php artisan serve
npm run dev -- --host=frontend.watches.test
Note the -- for the argument to be able to run. Your local applications are now available at http://frontend.watches.test:5137 and http://api.watches.test.
As we will recommend a specific watch to our user, we must first have a database containing the potential results. Fortunately, Kaggle has a Luxury Watch Dataset (no longer available. Check https://www.kaggle.com/kashnitsky/datasets/ for other public data sets) available for download. Create an account if needed and download the CSV file.We will now move and rename the CSV file into our project:
For us to use OpenAI and Groq APIs, we need to inject our credentials. Create new API keys from their respective websites.In Laravel, we will add the respective arrays in the services configuration:
<?phpnamespace App\Console\Commands;use Illuminate\Console\Command;class Vectorize extends Command{ /** * The name and signature of the console command. * * @var string */ protected $signature = 'app:vectorize'; /** * The console command description. * * @var string */ protected $description = 'Vectorize the CSV file and stores it into the database.'; /** * Execute the console command. */ public function handle() { \App\Jobs\Vectorize::dispatchSync(); }}
Our Vectorize job is more complex. It will:
Parse the CSV and create the watches in the database
Combine all attributes of each watch into a text string that we will send to OpenAI to get an embedding
Store that embedding in our database as a vector
<?phpnamespace App\Jobs;use App\Models\Watch;use DB;use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Queue\SerializesModels;use OpenAI;use Pgvector\Laravel\Vector;class Vectorize implements ShouldQueue{ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** * Create a new job instance. */ public function __construct() { // } /** * Execute the job. */ public function handle(): void { // Empty DB DB::table('watches')->truncate(); $client = OpenAI::client(config('services.openai.key')); // Parse the CSV and get the headers $file = base_path("seeds/watches-full.csv"); $csv = array_map("str_getcsv", file($file)); $header = array_shift($csv); // Transform the rows into an array with the header and the row $watches = array_map(fn($row) => array_combine($header, $row), $csv); // Loop the CSV and create the watches in database foreach($csv as $row) { try{ Watch::create([ 'brand' => $row[0], 'model' => $row[1], 'case_material' => $row[2], 'strap_material' => $row[3], 'movement_type' => $row[4], 'water_resistance' => $row[5], 'case_diameter_mm' => $row[6], 'case_thickness_mm' => $row[7], 'band_width_mm' => $row[8], 'dial_color' => $row[9], 'crystal_material' => $row[10], 'complications' => $row[11], 'power_reserve' => $row[12], 'price_usd' => preg_replace("/[^0-9.]/", "", $row[13]), ]); } catch(\Exception $e){ ray($row); } } // Create a text version of the watch row that will list the // attributes and their values as a large string $watchesInput = collect($watches)->map(function ($watch) { $str = ''; foreach($watch as $key=>$item) { $str .= $key.':'.$item.','; } return rtrim($str, '|'); }); // Send the text version of all watches to the OpenAI embedding // endpoint. We do a batch query to avoid sending 500 different API calls $response = $client->embeddings()->create([ 'model' => 'text-embedding-3-small', 'input' => $watchesInput->toArray() ]); // Loop through the embeddings sent and update our watches // in the database with the matching embedding foreach ($response->embeddings as $embedding) { $watch = Watch::find($embedding->index + 1); $watch->embedding = new Vector($embedding->embedding); $watch->save(); } }}
You can now run the job by triggering:
php artisan app:vectorize
It should take a few seconds. Once done you can connect to your Postgres instance and check the results:
upsun sqlEnter a number to choose an app: [0] app [1] frontend > 0
psql (16.2 (Debian 16.2-1.pgdg120+2), server 15.6 (Debian 15.6-1.pgdg110+2))Type "help" for help.main=> SELECT brand, model FROM watches; brand | model---------------------+-------------------------- Omega | Seamaster Tag Heuer | Carrera Breitling | Navitimer[...]
Perfect, we have our database of 508 watches and the embeddings created from their content.
Create the API controller to get the search request
Let’s create the API controller for our frontend to query the database. The controller will take care of:
Parsing and validating the query value sent through the POST request
Creating an embedding of the query
Query the database using nearestNeighbors to find the most relevant watch
Send a streamed request to the Grok Chat API to create a proper answer with the details of the watch and the reason why it is the best.
As the response is streamed from Grok, we automatically stream it to our client using an Event Stream. This will allow us to display the answer being generated in real-time instead of waiting for the full answer being processes.
<?phpnamespace App\Http\Controllers;use App\Helpers\MarkdownHelper;use App\Http\Requests\SearchWatchRequest;use App\Models\Watch;use OpenAI;use Pgvector\Laravel\Distance;use Pgvector\Laravel\Vector;class WatchController extends Controller{ public function search(SearchWatchRequest $request) { $embeddingClient = OpenAI::client(config('services.openai.key')); $chatClient = OpenAI::factory() ->withApiKey(config('services.groq.key')) ->withBaseUri('api.groq.com/openai/v1') // default: api.openai.com/v1 ->make(); // Create the embedding of the query $response = $embeddingClient->embeddings()->create([ 'model' => 'text-embedding-3-small', 'input' => $request->input('query') ]); $embedding = new Vector($response->embeddings[0]->embedding); // Find the closest watch $neighbor = Watch::query()->nearestNeighbors('embedding', $embedding, Distance::L2)->first(); // Ask OpenAI for the closest watches $stream = $chatClient->chat()->createStreamed([ 'model' => 'llama3-8b-8192', 'messages' => [ [ 'role' => 'system', 'content' => "You are an helpful AI that will recommend watches to the user. The watch selected is below with its attributes as a list. Your response is a markdown document.First, output the brand and model of the watch as a title. Second, send the user a bullet list view of the watch attributes without doing any modification. Then, add a paragraph of why this watch matches their request using the watch attributes." ], [ 'role' => 'user', 'content' => "The recommended watch is: " . MarkdownHelper::toMarkdown($neighbor) ], ['role' => 'user', 'content' => $request->input('query')], ], ]); return response()->stream(function () use ($stream) { $i = 0; $text = ""; foreach($stream as $response){ $text .= $response->choices[0]->delta->content; $i++; echo "event: chunk\n"; echo "data: {\"index\": " . $i . ", \"chunk\": " . json_encode($response->choices[0]->delta->content) . "}\n\n"; ob_flush(); flush(); // Break the loop if the client aborted the connection (closed the page) if (connection_aborted()) { break; } } }, 200, [ 'Cache-Control' => 'no-cache', 'X-Accel-Buffering' => 'no', 'Content-Type' => 'text/event-stream', ]); }}
As you can see, we are validating the POST request via the SearchWatchRequest validator. Remember to return true in the authorize() method, or you will get a 403 when POSTing to it.
<?phpnamespace App\Http\Requests;use Illuminate\Foundation\Http\FormRequest;class SearchWatchRequest extends FormRequest{ /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ 'query' => 'required|string', ]; }}
In a production application, you must also validate that the user exists and is not abusing the system. You can leverage Laravel Sanctum for this.
You can now use curl or a tool like Postman to query the API and get your result. As you can see, the result is streamed in chunks by our Laravel API. Congratulations!
Add the vectorize job in .upsun/config.yaml so it is done every time in the background after you deploy the app without impacting the app availability. You might want to trigger this manually if you have more data to avoid increasing your OpenAI bill too much.
getApiURL will use our local development values if the hostname is watches.test. If not, it will replace the frontend string with api on any other hostname. This will allow us to make it functional in any preview environment on Upsun as well as production. You can always change the logic there to map your own deployment needs.
The JSX is rendered on load. We use a <Markdown/> field to render the answer.
The user writes a prompt in the main <TextArea/> that is store in a variable prompt using useState.
When clicking the <Button/> , the script triggers submitForm() which creates a newStreamResponse
newStreamResponse starts by setting the state variable streaming as true so we can use it to freeze our UI while the request loads and reset the answer as well as creating a local variable named messageContent to store the stream content coming back from the API.
It then uses fetchEventSource to query our Laravel API. The openWhenHidden option specifies if the stream should be listened to when the tab or window is not in focus. We pass our prompt as the body of this POST request.
The onmessage method defines how we treat incoming data from the Event stream. Here we concatenate the new chunk to our messageContent and then update the state variable answer to show the result. In case your content is too long or the chunks are coming in too fast, you might want to delay the update to avoid too many renderings.
When the stream ends, we reset the streaming variable to false.
You can now use the frontend URL that Upsun gave you in the deploy log to access your app. Let’s query it!Everything works as expected! You can see in my recording above, that I am using a custom hostname. In your Upsun console, click the Go Live button and follow the instructions to configure your DNS and setup the domain!
While this example is stripped down to the core, it is interesting to see how you can leverage embeddings for search, classification or any other Machine Learning process. With all the tooling now available, it becomes super accessible to everyone to query models and run these applications on a Cloud Applications Platform like Upsun.com.
Last modified on October 23, 2026
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Upsun Developer","description":"Upsun Developer — documentation, guides, and more.","colors":{"primary":"#6046ff","light":"#F7F8F8","dark":"#646F75"},"logo":{"light":"https://mintcdn.com/upsun-c9761871/WSCgazBk0GWUPP4l/logo/Upsun-dev-center-light.svg?fit=max\u0026auto=format\u0026n=WSCgazBk0GWUPP4l\u0026q=85\u0026s=c35e42815c3d17de292fb0a86d41aa5f","dark":"https://mintcdn.com/upsun-c9761871/WSCgazBk0GWUPP4l/logo/Upsun-dev-center-dark.svg?fit=max\u0026auto=format\u0026n=WSCgazBk0GWUPP4l\u0026q=85\u0026s=6bdea7a02f9b19da987e3502457d1ce8","href":"https://developer.upsun.com/"},"favicon":"https://mintcdn.com/upsun-c9761871/zc3aDujkEk92gVGr/favicon.png?fit=max\u0026auto=format\u0026n=zc3aDujkEk92gVGr\u0026q=85\u0026s=3b2ecb4deccafac0ea68acf519ab577b","api":{"examples":{"prefill":true}},"appearance":{"default":"system"},"background":{"color":{"light":"#F7F8F8","dark":"#0E1113"}},"navbar":{"links":[{"href":"https://auth.upsun.com/","label":"Console"},{"href":"https://upsun.com/demo/","label":"Watch a demo"}],"primary":{"type":"button","label":"Free trial","href":"https://auth.upsun.com/register"}},"footer":{"socials":{"github":"https://github.com/upsun","youtube":"https://www.youtube.com/@upsundotcom","x":"https://x.com/upsundotcom","linkedin":"https://www.linkedin.com/company/upsundotcom"},"links":[{"header":"Docs","items":[{"label":"Documentation","href":"/docs/get-started"},{"label":"Tutorials","href":"/tutorials"},{"label":"API Reference","href":"/api"},{"label":"CLI Reference","href":"/cli"}]},{"header":"Resources","items":[{"label":"Changelog","href":"/changelog"},{"label":"Upsun Blog","href":"https://upsun.com/blog"},{"label":"Community","href":"https://community.upsun.com"},{"label":"Support","href":"/docs/get-started/here/support"}]},{"header":"Company","items":[{"label":"About","href":"https://upsun.com/about-us"},{"label":"Pricing","href":"https://upsun.com/pricing"},{"label":"Careers","href":"https://upsun.com/jobs"}]}]},"seo":{"metatags":{"robots":"index, follow","description":"Upsun User Documentation, Dev Center, news, and more."},"indexing":"all"},"fonts":{"heading":{"family":"Instrument Sans","weight":700},"body":{"family":"Instrument Sans","weight":400}},"icons":{"library":"lucide"},"styling":{"latex":true},"integrations":{"gtm":{"tagId":"GTM-KJ4F382K"},"telemetry":{"enabled":true}},"errors":{"404":{"redirect":false,"title":"This page took an unexpected detour","description":"It might have moved, or maybe it never existed. Either way, let's get you back on track. Try searching above or head to one of these:\n\n\u003cdiv style={{textAlign: 'left'}}>\n\n\u003cColumns cols={2}>\n \u003cCard title=\"Get Started\" icon=\"rocket\" href=\"/docs/get-started\">\n Deploy your first app on Upsun\n \u003c/Card>\n \u003cCard title=\"Documentation\" icon=\"book-open\" href=\"/docs/core-concepts\">\n Explore the full documentation\n \u003c/Card>\n \u003cCard title=\"Tutorials\" icon=\"play\" href=\"/tutorials\">\n Follow step-by-step guides\n \u003c/Card>\n \u003cCard title=\"API Reference\" icon=\"code\" href=\"/api\">\n REST API and SDK reference\n \u003c/Card>\n\u003c/Columns>\n\n\u003c/div>"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"metadata":{"timestamp":true},"variables":{"config_platformsh":"Platform.sh","config_config_dir":".upsun/","config_config_files_app":".upsun/config.yaml","config_config_files_services":".upsun/config.yaml","config_config_files_routes":".upsun/config.yaml","config_config_files_env":".environment","config_glossary_mb":"MB","config_product_blackfire":"Upsun Blackfire","config_product_cloud":"Upsun Cloud","config_product_dispatch":"Upsun Dispatch","config_vendor_name":"Upsun","config_vendor_cli":"upsun","config_vendor_alt":"upsun","config_vendor_prefix":"UPSUN","config_vendor_community_url":"https://community.upsun.com/","config_vendor_hostname":"platformsh.site","config_vendor_host":"upsun.com","config_vendor_docs":"https://developer.upsun.com","config_vendor_api":"https://api.upsun.com","config_vendor_console":"https://console.upsun.com","config_vendor_sales":"https://upsun.com/contact-us/","config_vendor_support_url":"https://support.upsun.com","config_vendor_support_ticket":"https://support.upsun.com/hc/en-us/requests/new?ticket_form_id=35294051960082","config_vendor_support_feature":"https://support.upsun.com/hc/en-us/requests/new?ticket_form_id=37982573191442","config_vendor_support_requests":"https://support.upsun.com/hc/en-us/requests","config_vendor_register":"https://auth.upsun.com/register/","meta_version_solr":"10.0","meta_version_composable":"26.05","meta_version_nodejs":"26","meta_version_python":"3.14","meta_version_php_latest":"8.5"},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"upsun-c9761871","hasAudioNarration":false,"actualSubdomain":"upsun-c9761871","customDomains":["developer.upsun.com"],"gitSource":{"type":"github","owner":"upsun","repo":"devcenter-mintlify","deployBranch":"main","contentDirectory":"contents","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aeda102ea85807f25ff507f","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Cloud","count":543},{"language":"default","tag":"API","count":271},{"language":"default","tag":"OpenAPI Reference","count":263},{"language":"default","tag":"Docs","count":256},{"language":"default","tag":"Configure Apps \u0026 Services","count":79},{"language":"default","tag":"Get Started","count":42},{"language":"default","tag":"Manage Projects","count":36},{"language":"default","tag":"Configure apps","count":30},{"language":"default","tag":"Pick a Stack","count":27},{"language":"default","tag":"PHP","count":26}],"searchSettings":{"maxResults":16}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"email","email":"advocacy@upsun.com"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"styles.css","href":"/_mintlify/custom/upsun-c9761871/73d0de61d492770e/styles.css"}],"page":{"pagePath":"posts/hands-on/harnessing-power-embeddings","slug":"/posts/hands-on/harnessing-power-embeddings","pageMetadata":{"title":"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.","subtitle":"","date":"2024-05-20T02:00:00.000Z","icon":"tutorial","featured":true,"author":["gmoigneu"],"sidebar":{"exclude":true},"type":"post","description":"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\n","tags":["embeddings","vector-database","ai","laravel","react","postgresql","pgvector","openai","groq","upsun"],"categories":["hands-on"],"math":false,"href":"/posts/hands-on/harnessing-power-embeddings"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const PostMeta=({data={}})=>{const _components={a:`a`,..._provideComponents()};const{author,date}=data;const authors=Array.isArray(author)?author:author?[author]:[];const toSlug=value=>String(value).toLowerCase().trim().replace(/\\s+/g,`-`).replace(/[^a-z0-9-]/g,``);const resolveAuthor=slug=>{const entry=AUTHOR_MAP[slug]||{};const name=entry.name||slug;const github=entry.github||null;const url=`/posts/authors/${toSlug(slug)}`;const avatarUrl=github?`https://github.com/${github}.png?size=64`:null;return{name,url,avatarUrl}};const formattedDate=date?new Date(date).toLocaleDateString(`en-US`,{year:`numeric`,month:`long`,day:`numeric`}):null;if(authors.length===0\u0026\u0026!formattedDate)return null;const AUTHOR_MAP={\"aaron-collier\":{\"name\":`Aaron Collier`},\"aaron-dudenhofer\":{\"name\":`Aaron Dudenhofer`},\"aaron-porter\":{\"name\":`Aaron Porter`},\"adriaan-odendaal\":{\"name\":`Adriaan Odendaal`},\"ajmal\":{\"name\":`Ajmal Siddiqui`},\"akalipetis\":{\"name\":`Antonis Kalipetis`},\"alexander-varwijk\":{\"name\":`Alexander Varwijk`},\"alicia-bevilacqua\":{\"name\":`Alicia Bevilacqua`},\"amelie-deguerry\":{\"name\":`Amelie Deguerry`},\"anacidre\":{\"name\":`Ana Cidre`,\"linkedin\":`https://www.linkedin.com/in/ana-cidre`},\"andoni\":{\"name\":`Andoni Auzmendi`},\"andrei-taranu\":{\"name\":`Andrei (Alex) Taranu`,\"linkedin\":`https://www.linkedin.com/in/andrei-alex-taranu/`},\"andrew-baxter\":{\"name\":`Andrew Baxter`},\"andrew-melck\":{\"name\":`Andrew Melck`},\"antoine-crochet-damais\":{\"name\":`Antoine Crochet Damais`},\"augustin-delaporte\":{\"name\":`Augustin Delaporte`,\"linkedin\":`https://www.linkedin.com/in/augustindelaporte/`},\"branislav-bujisic\":{\"name\":`Branislav Bujisic`},\"carl-smith\":{\"name\":`Carl Smith`},\"caroline-leroy\":{\"name\":`Caroline Leroy`},\"cati-mayer\":{\"name\":`Cati Mayer`},\"catplat\":{\"name\":`C Trinkwon`},\"ceelolulu\":{\"name\":`Celeste van der Watt`},\"chadwcarlson\":{\"name\":`Chad Carlson`,\"github\":`chadwcarlson`,\"linkedin\":`https://www.linkedin.com/in/chadwcarlson`},\"charles-moore\":{\"name\":`Charles Moore`,\"linkedin\":`https://www.linkedin.com/in/charles-g-moore/`},\"chris-ward\":{\"name\":`Chris Ward`},\"chris-yates\":{\"name\":`Chris Yates`},\"christian-sieber\":{\"name\":`Christian Sieber`},\"christopher-lockheardt\":{\"name\":`Christopher Lockheardt`},\"christopher-skene\":{\"name\":`Christopher Skene`},\"chuck-morgan\":{\"name\":`Chuck Morgan`},\"corey-dockendorf\":{\"name\":`Corey Dockendorf`},\"crell\":{\"name\":`Crell`},\"damz\":{\"name\":`Damz`},\"dan-morrison\":{\"name\":`Dan Morrison`},\"davidbonachera\":{\"name\":`David Bonachera`,\"github\":`davidbonachera`,\"linkedin\":`https://www.linkedin.com/in/davidbonachera`},\"dereliahmet1\":{\"name\":`Ahmet Faruk Dereli`},\"devicezero\":{\"name\":`Jonas Kröger`,\"github\":`devicezero`,\"linkedin\":`https://www.linkedin.com/in/jonaskroeger/`},\"doug-goldberg\":{\"name\":`Doug Goldberg`},\"duncan-naves\":{\"name\":`Duncan Naves`,\"github\":`duncannaves`,\"linkedin\":`https://www.linkedin.com/in/duncan-naves-a94423aa`},\"erika-bustamante\":{\"name\":`Erika Bustamante`},\"fabpot\":{\"name\":`Fabien Potencier`},\"flovntp\":{\"name\":`Florent Huck`,\"github\":`flovntp`,\"linkedin\":`https://www.linkedin.com/in/florenthuck`},\"fred-plais\":{\"name\":`Fred Plais`},\"gauthier-garnier\":{\"name\":`Gauthier Garnier`},\"gilzow\":{\"name\":`Paul Gilzow`},\"gmoigneu\":{\"name\":`Guillaume Moigneu`,\"github\":`gmoigneu`,\"linkedin\":`https://www.linkedin.com/in/guillaumemoigneu/`},\"gregqualls\":{\"name\":`Greg Qualls`},\"guguss\":{\"name\":`Augustin Delaporte`},\"haylee-millar\":{\"name\":`Haylee Millar`},\"ivana-kotur\":{\"name\":`Ivana Kotur`},\"jackrabbithanna\":{\"name\":`Mark Hanna`,\"github\":`jackrabbithanna`},\"jared-wright\":{\"name\":`Jared Wright`,\"github\":`jww-sh`,\"linkedin\":`https://www.linkedin.com/in/jaredwaynewright`},\"jessica-orozco\":{\"name\":`Jessica Orozco`},\"joey-stanford\":{\"name\":`Joey Stanford`},\"john-grubb\":{\"name\":`John Grubb`},\"jonas-kruger\":{\"name\":`Jonas Kruger`},\"kathryn-frazer\":{\"name\":`Kathryn Frazer`},\"kemiojo\":{\"name\":`Kemi Elizabeth Ojogbede`},\"kieronsambrook-smith\":{\"name\":`Kieronsambrook Smith`},\"laurent-arnoud\":{\"name\":`Laurent Arnoud`,\"linkedin\":`https://www.linkedin.com/in/laurent-arnoud-861b44121/`},\"letoya-boyne\":{\"name\":`Letoya Boyne`},\"lolautruche\":{\"name\":`Jérôme Vieilledent`},\"lyly-lepinay\":{\"name\":`Lyly Lepinay`},\"manauwar-alam\":{\"name\":`Manauwar Alam`},\"marc-antoine-porri\":{\"name\":`Marc Antoine Porri`},\"maria-antinkaapo\":{\"name\":`Maria Antinkaapo`},\"maria-de-anton\":{\"name\":`Maria De Anton`},\"mark-dorison\":{\"name\":`Mark Dorison`},\"markus-hausammann\":{\"name\":`Markus Hausammann`},\"mary-thomas\":{\"name\":`Mary Thomas`},\"mathias-bolt-lesniak\":{\"name\":`Mathias Bolt Lesniak`},\"mathieu-strauch\":{\"name\":`Mathieu Strauch`},\"matthias-van-woensel\":{\"name\":`Matthias Van Woensel`,\"linkedin\":`https://www.linkedin.com/in/matthias-van-woensel-267a069`},\"maz-mohammadi\":{\"name\":`Maz Mohammadi`},\"michael-sharp\":{\"name\":`Michael Sharp`},\"mupsi\":{\"name\":`Marine Gandy`},\"natalie-harper\":{\"name\":`Natalie Harper`},\"ngommenginger\":{\"name\":`Nicolas Gommenginger`,\"linkedin\":`https://www.linkedin.com/in/nicolas-gommenginger`},\"nicholas-bennison\":{\"name\":`Nicholas Bennison`},\"nicholas-vahalik\":{\"name\":`Nicholas Vahalik`},\"nick-hardiman\":{\"name\":`Nick Hardiman`},\"nickanderegg\":{\"name\":`Nickanderegg`},\"nicolas-grekas\":{\"name\":`Nicolas Grekas`,\"github\":`nicolas-grekas`,\"linkedin\":`https://www.linkedin.com/in/nicolasgrekas/`},\"niti-malwade\":{\"name\":`Niti Malwade`},\"opensocialteam\":{\"name\":`Opensocialteam`},\"ori-pekelman\":{\"name\":`Ori Pekelman`},\"otavio-santana\":{\"name\":`Otavio Santana`},\"palwandi\":{\"name\":`Pawan Alwandi`,\"github\":`pawpy`,\"linkedin\":`https://www.linkedin.com/in/pawanalwandi`},\"patrick-boest\":{\"name\":`Patrick Boest`},\"patrick-dawkins\":{\"name\":`Patrick Dawkins`,\"github\":`pjcdawkins`,\"linkedin\":`https://www.linkedin.com/in/patrickdawkins`},\"patrick-klima\":{\"name\":`Patrick Klima`},\"pjcdawkins\":{\"name\":`Pjcdawkins`},\"prineet-kaurbhurji\":{\"name\":`Prineet Kaurbhurji`},\"quentin-sinig\":{\"name\":`Quentin Sinig`},\"ralt\":{\"name\":`Florian Margaine`,\"github\":`ralt`,\"linkedin\":`https://www.linkedin.com/in/florian-margaine-43971136`},\"ramanathanramakrishnamurthy\":{\"name\":`Ramanathanramakrishnamurthy`},\"remi-lejeune\":{\"name\":`Rémi Lejeune`},\"ribel\":{\"name\":`Taras Kruts`},\"robert-douglass\":{\"name\":`Robert Douglass`},\"rudy-weber\":{\"name\":`Rudy Weber`},\"ryan-hicks\":{\"name\":`Ryan Hicks`},\"sabri-helal\":{\"name\":`Sabri Helal`},\"savannah-bergeron\":{\"name\":`Savannah Bergeron`},\"shannon-vettes\":{\"name\":`Shannon Vettes`},\"shawn-ogasawara\":{\"name\":`Shawn Ogasawara`,\"linkedin\":`https://www.linkedin.com/in/shawn-ogasawara-83a9a0/`},\"shawna-spoor\":{\"name\":`Shawna Spoor`},\"shedrack-akintayo\":{\"name\":`Shedrack Akintayo`},\"simon-ruggier\":{\"name\":`Simon Ruggier`},\"sophie-van-der-kindere\":{\"name\":`Sophie Van Der Kindere`},\"stefanos-thampis\":{\"name\":`Stefanos Thampis`},\"stephen-weinberg\":{\"name\":`Stephen Weinberg`},\"sukhman-virk\":{\"name\":`Sukhman Virk`},\"sumaira-nazir\":{\"name\":`Sumaira Nazir`},\"sumer\":{\"name\":`Sümer Cip`,\"noindex\":true,\"github\":`sumerc`,\"linkedin\":`https://www.linkedin.com/in/sumer-cip/`},\"syed-raza\":{\"name\":`Syed Raza`},\"tamara-bacchia\":{\"name\":`Tamara Bacchia`},\"tara-arnold\":{\"name\":`Tara Arnold`},\"theosakamg\":{\"name\":`Mickael Gaillard`,\"github\":`theosakamg`},\"thomasdiluccio\":{\"name\":`Thomas di Luccio`},\"tim-anderson\":{\"name\":`Tim Anderson`},\"tom-helmer-hansen\":{\"name\":`Tom Helmer Hansen`},\"tylermills\":{\"name\":`Tyler Mills`},\"upsun\":{\"name\":`Upsun`},\"veronika-tolkachova\":{\"name\":`Veronika Tolkachova`,\"linkedin\":`https://www.linkedin.com/in/veronika-tolkachova-169167a2`},\"vince-parker\":{\"name\":`Vince Parker`},\"vinnie-russo\":{\"name\":`Vincenzo Russo`},\"vrobert78\":{\"name\":`Vincent Robert`,\"github\":`vrobert78`,\"linkedin\":`https://www.linkedin.com/in/vincent-robert-498a883`},\"yuriy-babenko\":{\"name\":`Yuriy Babenko`},\"yuriy-gerasimov\":{\"name\":`Yuriy Gerasimov`}};return _jsx(`div`,{className:`post-meta`,children:(authors.length>0||formattedDate)\u0026\u0026_jsxs(`div`,{className:`post-meta-info`,children:[authors.length>0\u0026\u0026_jsx(`div`,{className:`post-meta-authors`,children:authors.map(slug=>{const{name,url,avatarUrl}=resolveAuthor(slug);const inner=_jsxs(_Fragment,{children:[avatarUrl\u0026\u0026_jsx(`img`,{src:avatarUrl,alt:name,className:`post-meta-avatar`}),_jsx(`span`,{className:`post-meta-author-name`,children:name})]});return url?_jsx(_components.a,{href:url,className:`post-meta-author`,children:inner},slug):_jsx(`span`,{className:`post-meta-author`,children:inner},slug)})}),authors.length>0\u0026\u0026formattedDate\u0026\u0026_jsx(`span`,{className:`post-meta-separator`,\"aria-hidden\":`true`,children:`·`}),formattedDate\u0026\u0026_jsx(`span`,{className:`post-meta-date`,children:formattedDate})]})})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`PostMeta`,children:_jsx(PostMeta,{data:{author:[`gmoigneu`],date:`2024-05-20T02:00:00+00:00`}})}),`\n`,_jsxs(_components.p,{children:[`Given the increasing integration of Machine Learning and AI/LLM models in all applications, it is crucial to explore the potential of a robust cloud application platform like `,_jsx(_components.a,{href:`https://upsun.com`,children:`Upsun`}),` for conducting these experiments.`]}),`\n`,_jsx(_components.p,{children:`As a watch enthusiast, what would be better than a recommendation engine to find the right watch for you? Here is the app we are going to build from scratch here:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/zF_RXmglQ7AAec_B/images/posts/hands-on/harnessing-power-embeddings/1_BC6-rHCejum9YaJOaP9GOQ.gif?s=be552f39a902e498e627f51b9f5835b5`,alt:`Watch Recommendation App`,\"data-og-width\":`2304`,width:`2304`,\"data-og-height\":`1704`,height:`1704`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_BC6-rHCejum9YaJOaP9GOQ.gif`,\"data-optimize\":`true`,\"data-opv\":`3`}),`\n`,_jsx(Heading,{level:`3`,id:`source`,children:`Source`}),`\n`,_jsxs(_components.p,{children:[`You can find the full example repository on Github: `,_jsx(_components.a,{href:`https://github.com/gmoigneu/upsun-embeddings-watches`,children:`https://github.com/gmoigneu/upsun-embeddings-watches`})]}),`\n`,_jsx(Heading,{level:`3`,id:`architecture`,children:`Architecture`}),`\n`,_jsx(_components.p,{children:`Let’s review the architecture we are going to create and deploy:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=07c9c9b945bf0efa65335e83ac5b5204`,alt:`Watch Recommendation Architecture`,\"data-og-width\":`1400`,width:`1400`,\"data-og-height\":`651`,height:`651`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=280\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=f6bdef053bfa59efec60b862f14bd869 280w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=560\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=7b0643af3b54376b7b824ec41e62093e 560w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=840\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=0d772333df84bce24a958fdab21d01b5 840w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=deba941f82dd60894abfaf4f6d85e134 1100w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=39827fca7c6302e8f3ac7ea077610cd0 1650w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_aNXnQzfhqkLhtaj1Bidh6w.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=d4647fbc37cc8f86fcb1bccf2dfc1e20 2500w`}),`\n`,_jsx(_components.p,{children:`Our application will be composed of 3 main components:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`A static React frontend is used to present the UI to the user.`}),`\n`,_jsx(_components.li,{children:`An API built with Laravel 11 will handle the search requests and populate our database.`}),`\n`,_jsx(_components.li,{children:`A Postgres instance to store our watches records and vectors for the embeddings of our content.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For speed and cost efficiency reasons, we will leverage both OpenAI for creating embeddings and Groq for the LLM part. We will use `,_jsx(_components.code,{children:`llama3–8b-8192`}),` as a model on Groq, but `,_jsx(_components.code,{children:`mixtral`}),` or any other would also work.`]}),`\n`,_jsx(Heading,{level:`2`,id:`bootstrapping-our-apps`,children:`Bootstrapping our\\xA0apps`}),`\n`,_jsxs(_components.p,{children:[`You will need `,_jsx(_components.code,{children:`php8.x`}),` and `,_jsx(_components.code,{children:`composer`}),` installed locally for this to work. As we deploy our app on Upsun, you can grab the upsun cli by following the steps `,_jsx(_components.a,{href:`https://docs.upsun.com/administration/cli.html#1-install`,children:`here`}),`.`]}),`\n`,_jsx(_components.p,{children:`First, create a new folder for your project:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Let’s start by installing Laravel 11 with the API components:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create-project`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` laravel/laravel`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api:install`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You will need a few extra packages:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# required `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` openai-php/client`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` pgvector/pgvector`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# optional`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` laravel/telescope`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # for debugging requests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` spatie/laravel-ray`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # amazing little debugging helper`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Let’s now create a new React app. We are using Vite here with the `,_jsx(_components.code,{children:`react-ts`}),` template but feel free to use any other variant. We will set up `,_jsx(_components.code,{children:`shacdn/ui`}),` for the UI to speed up building our interface.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ..`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` vite@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` frontend`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --template`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` react-ts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` frontend`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Install shacdn/ui`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` vite@latest`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tailwindcss`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` postcss`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` autoprefixer`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tailwindcss`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -p`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (so you can import \"path\" without error)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @types/node`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Add the following code to the `,_jsx(_components.code,{children:`tsconfig.json`}),` file to resolve paths:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"compilerOptions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // ...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"baseUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"paths\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"@/*\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/*\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Add the following code to the `,_jsx(_components.code,{children:`vite.config.ts`}),` so your app can resolve paths without error`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// vite.config.ts`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` path`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"path\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` react`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@vitejs/plugin-react\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`defineConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vite\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` defineConfig`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` plugins:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`react`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()]`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resolve:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` alias:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`resolve`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`__dirname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./src\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Now run the `,_jsx(_components.code,{children:`shacdn`}),` init with the following settings:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` shadcn-ui@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Would`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` like`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` use`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` TypeScript`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (recommended)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` yes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Which`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` style`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` would`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` like`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` use?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Default`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Which`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` color`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` would`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` like`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` use`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` as`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` base`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` color?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Slate`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Where`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` is`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` your`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` global`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` CSS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` file?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` src/index.css`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Do`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` want`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` use`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` CSS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` variables`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` colors?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` yes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Where`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` is`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` your`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tailwind.config.js`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` located?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tailwind.config.js`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Configure`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` alias`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` components:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @/components`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Configure`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` alias`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` utils:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @/lib/utils`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Are`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` using`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` React`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Server`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Components?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ›`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` no`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (no)`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Add the needed components for our UI:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` shadcn-ui@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` button`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` shadcn-ui@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` textarea`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Our React app will use two extra packages:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @microsoft/fetch-event-source`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # AJAX requests with EventStream support`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` axios`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # for making API requests`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Our two apps are now bootstrapped. Time to initialize our git repo:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ..`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Add Laravel API to the repo\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` frontend`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Add React frontend to the repo\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`setting-up-our-local-development-environment-\u0026-infrastructure`,children:`Setting up our local development environment \u0026 infrastructure`}),`\n`,_jsxs(_components.p,{children:[`While you could use `,_jsx(_components.a,{href:`https://laravel.com/docs/11.x/sail`,children:`Laravel Sail`}),` or any other Docker-based local setup to develop the project, I find relying on the `,_jsx(_components.a,{href:`https://docs.upsun.com/get-started/here/local/tethered.html`,children:`Upsun tethering feature`}),` always way quicker. It maps the remote services (database, Redis, etc.) to local ports, so you only need to run the runtimes (PHP, JS,\\xA0…) locally.`]}),`\n`,_jsxs(_components.p,{children:[`To do that, we first need to go through the Upsun configuration. While you can use the `,_jsx(_components.code,{children:`upsun ify`}),` CLI command to generate an automatic configuration, here is the complete configuration explained. Create a new\\xA0`,_jsx(_components.code,{children:`.upsun/config.yaml`}),` and paste the following:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`95`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`95`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Routing for the frontend and API`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`routes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://frontend.{all}/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`upstream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`upstream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"frontend:http\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.{all}/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`upstream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`upstream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"app:http\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"http://{all}/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`redirect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://frontend.{all}/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`services`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` database`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`postgresql:15`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # We will use Postgres with the vector extension`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` configuration`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` extensions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`vector`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` redis`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Redis is used for the Laravel cache`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`redis:7.0`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`applications`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Our react frontend`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` frontend`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"frontend\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # folder where the app is`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`nodejs:20`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` flavor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`none`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` web`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` locations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dist\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Customize if your build outputs the app somewhere else`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` expires`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1h`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` passthru`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/index.html\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` commands`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` start`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sleep infinity`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # needed as we serve static files`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` hooks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# customize if you use another build tool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -x -e`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` npm install `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` npm run build`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"watches\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`php:8.3`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dependencies`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` composer/composer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"^2\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runtime`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` extensions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`apcu`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`redis`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`blackfire`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ctype`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`iconv`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`mbstring`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pdo_pgsql`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pdo_pgsql`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sodium`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`xsl`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` flavor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`none`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` web`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` locations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"public\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` expires`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1h`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` passthru`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/index.php\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` mounts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Where Laravel needs write access`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/.config\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"storage\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"config\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"bootstrap/cache\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"storage\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cache\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"storage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"storage\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"storage\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` relationships`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # link our services`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` database`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"database:postgresql\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` redis`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"redis:redis\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` hooks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -eux`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader --no-dev`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` deploy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` # customize if needed but should be ok for Laravel`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -eux`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mkdir -p storage/framework/sessions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mkdir -p storage/framework/cache`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mkdir -p storage/framework/views`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` php artisan migrate --force`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` php artisan optimize:clear`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Once done, we must inject some variables into our Laravel app to grab the proper credentials. Create the `,_jsx(_components.code,{children:`watches/.environment`}),` file with the following:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Set database environment variables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_HOST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DATABASE_HOST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_PORT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DATABASE_PORT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_PATH`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DATABASE_PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_USERNAME`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DATABASE_USERNAME`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_PASSWORD`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DATABASE_PASSWORD`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_SCHEME`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"postgresql\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DATABASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_SCHEME`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}://${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_USERNAME`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}:${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_PASSWORD`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}@${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_HOST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}:${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_PORT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}/${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DB_PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Set Laravel-specific environment variables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_CONNECTION`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pgsql\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DB_DATABASE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DB_PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Set Cache environment variables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CACHE_STORE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"redis\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CACHE_HOST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDIS_HOST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CACHE_PORT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDIS_PORT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CACHE_SCHEME`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDIS_SCHEME`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CACHE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CACHE_SCHEME`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}://${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CACHE_HOST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"}:${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CACHE_PORT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Set Redis environment variables`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` REDIS_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$CACHE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You can customize any other environment variable this way. Remember they will always be the same value as this is committed to our repo.`}),`\n`,_jsx(_components.p,{children:`Let’s add the configuration to our git repo:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .upsun`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .environment`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Add Upsun configuration\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`our-first-deploy`,children:`Our first\\xA0deploy`}),`\n`,_jsx(_components.p,{children:`Let’s create an Upsun project for our application:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`33`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`33`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` project:create`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Project title (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`--title`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Default:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Untitled`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Project`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Watch finder`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Region (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`--region`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`The`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` region`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` where`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` project`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` will`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` be`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` hosted.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` a`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 3%`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` discount`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` on`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` resources`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` regions`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` with`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` a`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` carbon`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` intensity`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` of`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` less`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` than`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` gCO2eq/kWh.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [au.platform.sh ] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Sydney,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Australia`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`545`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [au-2.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Sydney,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Australia`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AZURE) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`545`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ca-1.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Montreal,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Canada`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`31`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ch-1.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Zurich,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Switzerland`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (GCP) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`91`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [de-2.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Frankfurt,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Germany`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (GCP) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`416`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [eu.platform.sh ] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Dublin,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Ireland`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`386`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [eu-2.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Dublin,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Ireland`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`386`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [eu-4.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Dublin,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Ireland`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`386`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [eu-5.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Stockholm,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Sweden`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`23`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [fr-3.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Gravelines,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` France`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (OVH) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`59`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [fr-4.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Paris,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` France`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AZURE) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`59`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [uk-1.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`London,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` United`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Kingdom`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (GCP) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [us.platform.sh ] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Washington,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` United`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` States`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`396`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [us-2.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Washington,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` United`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` States`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AWS) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`396`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [us-3.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Moses`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Lake,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` United`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` States`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (AZURE) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`56`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [us-4.platform.sh] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Charleston,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` United`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` States`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (GCP) [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`647`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gC02eq/kWh]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` us-3.platform.sh`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Default`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (--default-branch)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`The`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` default`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` name`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` project`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (the `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`production`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` environment`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Default:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` main`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Are`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sure`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` want`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` continue?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [Y/n]`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The Upsun bot will then provide an empty project for you and set the remote in your local git repository. Once done, you are ready to deploy:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` push`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The pipeline will build and deploy both apps. After a couple of minutes, the boilerplate apps will be available on:\n`,_jsx(_components.code,{children:`https://frontend.\u003cbranch>.\u003cproject>.\u003cregion>.platformsh.site`}),`\n`,_jsx(_components.code,{children:`https://app.\u003cbranch>.\u003cproject>.\u003cregion>.platformsh.site`})]}),`\n`,_jsx(_components.p,{children:`You should be directed to the default pages for both the React and Laravel applications.`}),`\n`,_jsx(_components.p,{children:`We can now connect to our remote database and cache services:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tunnel:open`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Enter`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` a`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` number`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` choose`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` an`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [0] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`app`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [1] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`frontend`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` 0`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Are`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sure`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` you`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` want`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` open`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SSH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tunnel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` environment`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (type: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`production`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [Y/n]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`SSH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tunnel`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` opened`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` database`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` pgsql://main:main@127.0.0.1:30000/main`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`SSH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tunnel`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` opened`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` redis`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` redis://127.0.0.1:30001`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can now edit your local `,_jsx(_components.code,{children:`watches/.env`}),` to use these services:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`ini`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ini`,children:_jsxs(_components.code,{language:`ini`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_CONNECTION`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=pgsql`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_HOST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=127.0.0.1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_PORT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=3000`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=main`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_USERNAME`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=main`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DB_PASSWORD`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=main`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SESSION_DRIVER`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=redis`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SESSION_LIFETIME`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=120`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SESSION_ENCRYPT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=false`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SESSION_PATH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=/`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SESSION_DOMAIN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=null`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`BROADCAST_CONNECTION`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=redis`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FILESYSTEM_DISK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=local`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`QUEUE_CONNECTION`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=redis`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CACHE_STORE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=redis`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CACHE_PREFIX`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`REDIS_CLIENT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=phpredis`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`REDIS_HOST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=127.0.0.1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`REDIS_PASSWORD`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=null`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`REDIS_PORT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=30001`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You will need your local PHP runtime to have the `,_jsx(_components.code,{children:`phpredis`}),` extension loaded. Please refer to the following `,_jsx(_components.a,{href:`https://laravel.com/docs/11.x/redis#phpredis`,children:`documentation on the Laravel site`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`If you want to use test hostnames for your applications, edit `,_jsx(_components.code,{children:`/etc/hosts`}),` or your Windows host file with the following or any other names you like:\n`,_jsx(_components.code,{children:`127.0.0.1 watches.test frontend.watches.test api.watches.test`})]}),`\n`,_jsxs(_components.p,{children:[`If so, update the\\xA0`,_jsx(_components.code,{children:`.env`}),` file with the proper hostname:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`ini`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ini`,children:_jsxs(_components.code,{language:`ini`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`APP_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=http://api.watches.test`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`We can now launch our development services. In two terminals, run:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` serve`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dev`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --host=frontend.watches.test`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note the `,_jsx(_components.code,{children:`--`}),` for the argument to be able to run. Your local applications are now available at `,_jsx(_components.code,{children:`http://frontend.watches.test:5137`}),` and `,_jsx(_components.code,{children:`http://api.watches.test`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`getting-some-data-about-watches`,children:`Getting some data about\\xA0watches`}),`\n`,_jsxs(_components.p,{children:[`As we will recommend a specific watch to our user, we must first have a database containing the potential results. Fortunately, Kaggle has a Luxury Watch Dataset (no longer available. Check `,_jsx(_components.a,{href:`https://www.kaggle.com/kashnitsky/datasets/`,children:`https://www.kaggle.com/kashnitsky/datasets/`}),` for other public data sets) available for download. Create an account if needed and download the CSV file.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=bf9a3463686221f9a392f44fca132213`,alt:`Kaggle dataset`,\"data-og-width\":`1400`,width:`1400`,\"data-og-height\":`978`,height:`978`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=280\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=07c9bf0984766e3fecc28823e108dfcd 280w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=560\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=3e1d66e154a7994c3fe948e995cc7d0d 560w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=840\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=5965e7b205b9c19d1078bde2caaae6ad 840w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=d668310c2eb9c2a02cb404c87c2431d6 1100w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=1a1785b3d062278e35865895505ad394 1650w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_gxvdmCjJdRoPQRCpuyf2yw.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=4e2acfdf6a4ee32a9251c64645c171b9 2500w`}),`\n`,_jsx(_components.p,{children:`We will now move and rename the CSV file into our project:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watches/seeds/`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mv`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/Downloads/Luxury`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`watch.csv`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./seeds/watches-full.csv`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuring-our-external-services`,children:`Configuring our external\\xA0services`}),`\n`,_jsxs(_components.p,{children:[`For us to use `,_jsx(_components.a,{href:`https://platform.openai.com/api-keys`,children:`OpenAI`}),` and `,_jsx(_components.a,{href:`https://console.groq.com/keys`,children:`Groq`}),` APIs, we need to inject our credentials. Create new API keys from their respective websites.`]}),`\n`,_jsx(_components.p,{children:`In Laravel, we will add the respective arrays in the services configuration:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'key'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'OPENAI_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'groq'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'key'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'GROQ_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Once done, add the variables to your local\\xA0`,_jsx(_components.code,{children:`.env`}),` file:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`ini`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ini`,children:_jsxs(_components.code,{language:`ini`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`APP_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=http://api.watches.test`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`[...]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`OPENAI_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=sk-proj-**************`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROQ_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=gsk_**************`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`For them to work on Upsun, create two variables using the cli\\xA0:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` variable:create`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` GROQ_API_KEY`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -l`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` project`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --sensitive=true`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --prefix=env:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --value=gsk_xxxxxxxxxxxxxx`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` variable:create`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` OPENAI_API_KEY`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -l`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` project`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --sensitive=true`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --prefix=env:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --value=sk-proj-xxxxxxxxxxxxxx`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`let’s-import-our-watches-into-the-database`,children:`Let’s import our watches into the\\xA0database`}),`\n`,_jsxs(_components.p,{children:[`We will need a few things first. Create a Watch model. You can create it using `,_jsx(_components.code,{children:`php artisan make:model Watch --m`}),` or by adding the files manually:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`32`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`32`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` App\\\\Models`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Database\\\\Eloquent\\\\Factories\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`HasFactory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Database\\\\Eloquent\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Pgvector\\\\Laravel\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`HasNeighbors`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Pgvector\\\\Laravel\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Model`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` HasFactory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`HasNeighbors`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $casts`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'embedding'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Vector`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $fillable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'brand'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'strap_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'movement_type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'water_resistance'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_diameter_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_thickness_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'band_width_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'dial_color'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'crystal_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'complications'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'power_reserve'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'price_usd'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ];`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note in the model that we use our `,_jsx(_components.code,{children:`Vector`}),` custom type to store and cast the embedding column. Create the migration file for the model:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` make`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` migration`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create_watches_table`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`42`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`42`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Database\\\\Migrations\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Migration`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Database\\\\Schema\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Blueprint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\Facades\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Schema`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` class`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Migration`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Run the migrations.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` up`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Schema`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'watches'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Blueprint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'brand'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'model'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'case_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'strap_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'movement_type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'water_resistance'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decimal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'case_diameter_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decimal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'case_thickness_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decimal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'band_width_mm'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'dial_color'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'crystal_material'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'complications'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'power_reserve'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`integer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'price_usd'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'embedding'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1536`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nullable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $table`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`timestamps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Reverse the migrations.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` down`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Schema`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`dropIfExists`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'watches'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Our `,_jsx(_components.code,{children:`embedding`}),` columns will use the vector type from the `,_jsx(_components.code,{children:`pg_vector`}),` package.`]}),`\n`,_jsx(_components.p,{children:`Migrate the database:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` migrate`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`We now need to code a job that will import the watches and generate the embedding. Create the command and the job:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` make:command`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Vectorize`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` make:job`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Vectorize`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Our command is simple and only triggers the job:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` App\\\\Console\\\\Commands`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Console\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Command`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Vectorize`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Command`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * The name and signature of the console command.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` *`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@var`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` string`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $signature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'app:vectorize'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * The console command description.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` *`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@var`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` string`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $description`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Vectorize the CSV file and stores it into the database.'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Execute the console command.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handle`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\App\\\\Jobs\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Vectorize`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`dispatchSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Our `,_jsx(_components.code,{children:`Vectorize`}),` job is more complex. It will:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Parse the CSV and create the watches in the database`}),`\n`,_jsx(_components.li,{children:`Combine all attributes of each watch into a text string that we will send to OpenAI to get an embedding`}),`\n`,_jsx(_components.li,{children:`Store that embedding in our database as a vector`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`94`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`94`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` App\\\\Jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` App\\\\Models\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Watch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` DB`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Bus\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Queueable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Contracts\\\\Queue\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`ShouldQueue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Foundation\\\\Bus\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Dispatchable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Queue\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`InteractsWithQueue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Queue\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`SerializesModels`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Pgvector\\\\Laravel\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Vectorize`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` implements`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ShouldQueue`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Dispatchable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`InteractsWithQueue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Queueable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`SerializesModels`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Create a new job instance.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` __construct`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` //`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Execute the job.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handle`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Empty DB`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` DB`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`table`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'watches'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`truncate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'services.openai.key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Parse the CSV and get the headers`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $file`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` base_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"seeds/watches-full.csv\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $csv`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` array_map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"str_getcsv\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`file`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$file`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $header`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` array_shift`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$csv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Transform the rows into an array with the header and the row`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watches`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` array_map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`fn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) => `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`array_combine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$header`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$csv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Loop the CSV and create the watches in database`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$csv`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'brand'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_material'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'strap_material'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'movement_type'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'water_resistance'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_diameter_mm'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'case_thickness_mm'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`7`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'band_width_mm'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'dial_color'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'crystal_material'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'complications'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`11`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'power_reserve'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'price_usd'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` preg_replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`\"/[^0-9.]/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`13`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Exception`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`){`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ray`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Create a text version of the watch row that will list the `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // attributes and their values as a large string`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watchesInput`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` collect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$watches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$watch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`':'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$item`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`','`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` rtrim`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'|'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Send the text version of all watches to the OpenAI embedding `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // endpoint. We do a batch query to avoid sending 500 different API calls`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`embeddings`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'text-embedding-3-small'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'input'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watchesInput`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toArray`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Loop through the embeddings sent and update our watches`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // in the database with the matching embedding`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`embeddings`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $embedding`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`find`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$embedding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`index`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`embedding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$embedding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`embedding`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`save`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You can now run the job by triggering:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app:vectorize`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`It should take a few seconds. Once done you can connect to your Postgres instance and check the results:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sql`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Enter`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` a`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` number`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` choose`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` an`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [0] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`app`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [1] `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`frontend`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` 0`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`psql (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (Debian `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.pgdg120`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`server`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (Debian `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.pgdg110`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`Type`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"help\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` help.`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`main`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` brand, model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` watches;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` brand | model`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`---------------------+--------------------------`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Omega | Seamaster`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Tag Heuer | Carrera`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Breitling | Navitimer`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[...]`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Perfect, we have our database of 508 watches and the embeddings created from their content.`}),`\n`,_jsx(Heading,{level:`2`,id:`create-the-api-controller-to-get-the-search-request`,children:`Create the API controller to get the search\\xA0request`}),`\n`,_jsx(_components.p,{children:`Let’s create the API controller for our frontend to query the database. The controller will take care of:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Parsing and validating the query value sent through the POST request`}),`\n`,_jsx(_components.li,{children:`Creating an embedding of the query`}),`\n`,_jsxs(_components.li,{children:[`Query the database using `,_jsx(_components.code,{children:`nearestNeighbors`}),` to find the most relevant watch`]}),`\n`,_jsx(_components.li,{children:`Send a streamed request to the Grok Chat API to create a proper answer with the details of the watch and the reason why it is the best.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`As the response is streamed from Grok, we automatically stream it to our client using an Event Stream. This will allow us to display the answer being generated in real-time instead of waiting for the full answer being processes.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`75`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`75`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` App\\\\Http\\\\Controllers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` App\\\\Helpers\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`MarkdownHelper`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` App\\\\Http\\\\Requests\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`SearchWatchRequest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` App\\\\Models\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Watch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Pgvector\\\\Laravel\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Distance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Pgvector\\\\Laravel\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` WatchController`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Controller`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` search`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`SearchWatchRequest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $embeddingClient`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'services.openai.key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $chatClient`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`factory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withApiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'services.groq.key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withBaseUri`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'api.groq.com/openai/v1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// default: api.openai.com/v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`make`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Create the embedding of the query`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $embeddingClient`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`embeddings`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'text-embedding-3-small'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'input'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`input`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'query'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $embedding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Vector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`embeddings`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`embedding`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Find the closest watch`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $neighbor`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`nearestNeighbors`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'embedding'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$embedding`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Distance`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`L2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`first`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Ask OpenAI for the closest watches`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $stream`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $chatClient`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createStreamed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'llama3-8b-8192'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'messages'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'role'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'system'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'content'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are an helpful AI that will recommend watches to the user. The watch selected is below with its attributes as a list. Your response is a markdown document.First, output the brand and model of the watch as a title. Second, send the user a bullet list view of the watch attributes without doing any modification. Then, add a paragraph of why this watch matches their request using the watch attributes.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'role'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'content'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The recommended watch is: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` MarkdownHelper`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toMarkdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$neighbor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'role'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'content'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`input`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'query'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$stream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$stream`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`){`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`delta`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`++`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"event: chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"data: {`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`index`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \", `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` json_encode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`delta`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` ob_flush`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` flush`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Break the loop if the client aborted the connection (closed the page)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`connection_aborted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Cache-Control'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'no-cache'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-Accel-Buffering'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'no'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'text/event-stream'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`As you can see, we are validating the POST request via the `,_jsx(_components.code,{children:`SearchWatchRequest`}),` validator. Remember to return `,_jsx(_components.code,{children:`true`}),` in the `,_jsx(_components.code,{children:`authorize()`}),` method, or you will get a 403 when POSTing to it.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`28`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` App\\\\Http\\\\Requests`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Foundation\\\\Http\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`FormRequest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SearchWatchRequest`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` FormRequest`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Determine if the user is authorized to make this request.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` authorize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` bool`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * Get the validation rules that apply to the request.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` *`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@return`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` array`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`, \\\\Illuminate\\\\Contracts\\\\Validation\\\\ValidationRule|array\u003cmixed>|string>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` rules`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` array`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'query'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'required|string'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ];`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In a production application, you must also validate that the user exists and is not abusing the system. You can leverage `,_jsx(_components.a,{href:`https://laravel.com/docs/11.x/sanctum`,children:`Laravel Sanctum`}),` for this.`]}),`\n`,_jsx(Heading,{level:`2`,id:`wrap-up-the-laravel-configuration`,children:`Wrap up the Laravel configuration`}),`\n`,_jsx(_components.p,{children:`Two tasks need to be done before our Laravel is fully operational. First, create a new route to handle the request:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\Facades\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Route`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Route`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/watch'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`App\\\\Http\\\\Controllers\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`WatchController`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'search'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Then, as we will query our API through a React frontend, we need to make CORS will be correctly set. Publish the CORS configuration file with:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`php`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` artisan`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` config:publish`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` cors`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Open `,_jsx(_components.code,{children:`cors.php`}),` and review the settings:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'paths'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'api/'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'api/watch'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'allowed_methods'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'*'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'allowed_origins'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'*'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'allowed_origins_patterns'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'*'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'allowed_headers'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'*'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'exposed_headers'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'max_age'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'supports_credentials'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`let’s-test-our-api`,children:`Let’s test our\\xA0API!`}),`\n`,_jsxs(_components.p,{children:[`You can now use `,_jsx(_components.code,{children:`curl`}),` or a tool like Postman to query the API and get your result. As you can see, the result is streamed in chunks by our Laravel API. Congratulations!`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=48b80aa4c45971dc59b5403fdc5c6b0f`,alt:`API Test with Postman`,\"data-og-width\":`1400`,width:`1400`,\"data-og-height\":`906`,height:`906`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=280\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=8be8ba7b75a69195365a342d26560c6a 280w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=560\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=10c4f0d9dacb0abda5e49c1c5172cf2e 560w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=840\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=358fe07404b6f2e79c737654c6a59d5e 840w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=0ef4195facbc26a607eb9c1399e5694f 1100w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=f22c15fae30bb15259917c146eae2001 1650w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_G3WdQjWJK47lV_BtfLZYKw.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=072fb98badf89229f22519ca5a71697e 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`let’s-deploy-it`,children:`Let’s deploy it!`}),`\n`,_jsxs(_components.p,{children:[`Add the vectorize job in\\xA0`,_jsx(_components.code,{children:`.upsun/config.yaml`}),` so it is done every time in the background after you deploy the app without impacting the app availability. You might want to trigger this manually if you have more data to avoid increasing your OpenAI bill too much.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` root`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"watches\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` hooks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` [...]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` deploy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` [...]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` post_deploy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -eux`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` php artisan app:vectorize`})}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Working API\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` push`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The deploy log will output the URLs for both endpoint. You can now retest the API with Postman on the Upsun API hostname.`}),`\n`,_jsx(Heading,{level:`2`,id:`time-to-build-our-frontend`,children:`Time to build our\\xA0frontend`}),`\n`,_jsx(_components.p,{children:`Let’s switch to our frontend React app now.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ../frontend`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`As our UI will be really straightforward, we only need two basic `,_jsx(_components.code,{children:`shacdn/ui`}),` components:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` shadcn-ui@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` button`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` shadcn-ui@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` textarea`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The components are now installed in `,_jsx(_components.code,{children:`src/components/ui`}),`.`]}),`\n`,_jsx(_components.p,{children:`We will use two different libraries to query our APIs:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`axios`}),` would be used to query other potential endpoints of our Laravel API`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`@microsoft/fetch-event-source`}),` to stream the result from our API`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Let’s install both:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` axios`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @microsoft/fetch-event-source`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# We also use markdown to format the output so let's install it`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` react-markdown`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`We are now creating a shared axios instance for our project with the configuration and a method to define our API URL:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/* src/lib/axios.ts */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Axios`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'axios'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getApiURL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`hostname`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'watches.test'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'http://api.watches.test'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`origin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'frontend'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'api'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` entrypoint`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getApiURL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` axios`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Axios`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` entrypoint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-Requested-With'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'XMLHttpRequest'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` axios`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`getApiURL`}),` will use our local development values if the hostname is `,_jsx(_components.code,{children:`watches.test`}),`. If not, it will replace the `,_jsx(_components.code,{children:`frontend`}),` string with `,_jsx(_components.code,{children:`api`}),` on any other hostname. This will allow us to make it functional in any preview environment on Upsun as well as production. You can always change the logic there to map your own deployment needs.`]}),`\n`,_jsx(Heading,{level:`3`,id:`the-main-app-tsx`,children:`The main\\xA0App.tsx`}),`\n`,_jsx(_components.p,{children:`It’s time to build that frontend application layout and logic:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`87`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`87`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/* src/App.tsx */`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'react'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` './App.css'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` './components/ui/button'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Textarea`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` './components/ui/textarea'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` './index.css'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Markdown`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'react-markdown'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`fetchEventSource`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@microsoft/fetch-event-source'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`getApiURL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` './lib/axios'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` App`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`prompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`setPrompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`answer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`setAnswer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Try queries like: \"affordave dive watch\", \"dress watch with a black dial\", \"more affordable alternative to a Rolex submariner\", ...'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`isStreaming`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`setIsStreaming`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` submitForm`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` newStreamResponse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` newStreamResponse`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` ctrl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` AbortController`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setAnswer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messageContent`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ''`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setIsStreaming`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetchEventSource`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getApiURL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/api/watch`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Accept'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '*/*'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` openWhenHidden:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'query'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onmessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`ev`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` tmp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`parse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ev`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tmp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messageContent`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tmp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setAnswer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messageContent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onclose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // do not retry`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`abort`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onerror`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // toast.error('Something unexpected happened.', {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // position: toast.POSITION.BOTTOM_RIGHT,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // toastId: 'prompt-error',`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // })`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`abort`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signal:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setIsStreaming`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c>`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` className`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"grid w-full gap-2\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`h1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` className`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text-4xl mb-8 text-center\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`⌚ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Watch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Finder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`h1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Textarea`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` onChange`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{(e) => `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setPrompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(e.target.value)} `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` placeholder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Describe the watch you are looking for...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{() => `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`submitForm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` disabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{isStreaming || `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Find`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` a`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` watch`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!\u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` className`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"p-4 rounded-sm my-8 bg-gray-100 prose lg:prose-md w-full max-w-max text-left\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Markdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`answer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Markdown`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` App`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`How it works:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The JSX is rendered on load. We use a `,_jsx(_components.code,{children:`\u003cMarkdown/>`}),` field to render the answer.`]}),`\n`,_jsxs(_components.li,{children:[`The user writes a prompt in the main `,_jsx(_components.code,{children:`\u003cTextArea/>`}),` that is store in a variable `,_jsx(_components.code,{children:`prompt`}),` using `,_jsx(_components.code,{children:`useState`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`When clicking the `,_jsx(_components.code,{children:`\u003cButton/>`}),`\\xA0, the script triggers `,_jsx(_components.code,{children:`submitForm()`}),` which creates a newStreamResponse`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`newStreamResponse`}),` starts by setting the state variable `,_jsx(_components.code,{children:`streaming`}),` as true so we can use it to freeze our UI while the request loads and reset the answer as well as creating a local variable named `,_jsx(_components.code,{children:`messageContent`}),` to store the stream content coming back from the API.`]}),`\n`,_jsxs(_components.li,{children:[`It then uses `,_jsx(_components.code,{children:`fetchEventSource`}),` to query our Laravel API. The `,_jsx(_components.code,{children:`openWhenHidden`}),` option specifies if the stream should be listened to when the tab or window is not in focus. We pass our prompt as the body of this POST request.`]}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.code,{children:`onmessage`}),` method defines how we treat incoming data from the Event stream. Here we concatenate the new chunk to our `,_jsx(_components.code,{children:`messageContent`}),` and then update the state variable `,_jsx(_components.code,{children:`answer`}),` to show the result. In case your content is too long or the chunks are coming in too fast, you might want to delay the update to avoid too many renderings.`]}),`\n`,_jsxs(_components.li,{children:[`When the stream ends, we reset the `,_jsx(_components.code,{children:`streaming`}),` variable to `,_jsx(_components.code,{children:`false`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`final-deploy`,children:`Final deploy`}),`\n`,_jsx(_components.p,{children:`Once these files added, let’s deploy:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` commit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Add frontend\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`upsun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` push`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`the-result`,children:`The result`}),`\n`,_jsx(_components.p,{children:`You can now use the frontend URL that Upsun gave you in the deploy log to access your app. Let’s query it!`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/zF_RXmglQ7AAec_B/images/posts/hands-on/harnessing-power-embeddings/1_Z8XkMhRxQAeMD-XCGGhuYw.gif?s=ff2aa10cc34d2441e5180ac897416824`,alt:`Final Application Demo`,\"data-og-width\":`2244`,width:`2244`,\"data-og-height\":`1394`,height:`1394`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_Z8XkMhRxQAeMD-XCGGhuYw.gif`,\"data-optimize\":`true`,\"data-opv\":`3`}),`\n`,_jsx(_components.p,{children:`Everything works as expected! You can see in my recording above, that I am using a custom hostname. In your Upsun console, click the Go Live button and follow the instructions to configure your DNS and setup the domain!`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=dfa62fce777d91887f4ac6499a3d2c01`,alt:`Setup domain`,\"data-og-width\":`1400`,width:`1400`,\"data-og-height\":`999`,height:`999`,\"data-path\":`images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=280\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=45a1f24c2502b4ddc3b0f0630296a7b2 280w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=560\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=62b46f9eea02d79226ea53c540637d7a 560w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=840\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=f5ebc9751258661acfe76040f8c7e3ce 840w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=5cf2d11e039874b1412dd3ba22594f97 1100w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=d1426ba6f81a1d3a616451be2161894f 1650w, https://mintcdn.com/upsun-c9761871/tziXiwEbbKjwbX3l/images/posts/hands-on/harnessing-power-embeddings/1_nxjr3gUbM2_HWnwfs9e9iA.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=tziXiwEbbKjwbX3l\u0026q=85\u0026s=a3846910de31b3e827b2acca38139887 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`conclusion`,children:`Conclusion`}),`\n`,_jsx(_components.p,{children:`While this example is stripped down to the core, it is interesting to see how you can leverage embeddings for search, classification or any other Machine Learning process. With all the tooling now available, it becomes super accessible to everyone to query models and run these applications on a Cloud Applications Platform like Upsun.com.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{PostMeta,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.","subtitle":"","date":"2024-05-20T02:00:00.000Z","icon":"tutorial","featured":true,"author":["gmoigneu"],"sidebar":{"exclude":true},"type":"post","description":"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\n","tags":["embeddings","vector-database","ai","laravel","react","postgresql","pgvector","openai","groq","upsun"],"categories":["hands-on"],"math":false,"href":"/posts/hands-on/harnessing-power-embeddings"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[144,8703,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"Source","slug":"source","depth":3,"children":[]},{"title":"Architecture","slug":"architecture","depth":3,"children":[]},{"title":"Bootstrapping our apps","slug":"bootstrapping-our-apps","depth":2,"children":[]},{"title":"Setting up our local development environment \u0026 infrastructure","slug":"setting-up-our-local-development-environment-\u0026-infrastructure","depth":2,"children":[]},{"title":"Our first deploy","slug":"our-first-deploy","depth":2,"children":[]},{"title":"Getting some data about watches","slug":"getting-some-data-about-watches","depth":2,"children":[]},{"title":"Configuring our external services","slug":"configuring-our-external-services","depth":2,"children":[]},{"title":"Let’s import our watches into the database","slug":"let’s-import-our-watches-into-the-database","depth":2,"children":[]},{"title":"Create the API controller to get the search request","slug":"create-the-api-controller-to-get-the-search-request","depth":2,"children":[]},{"title":"Wrap up the Laravel configuration","slug":"wrap-up-the-laravel-configuration","depth":2,"children":[]},{"title":"Let’s test our API!","slug":"let’s-test-our-api","depth":2,"children":[]},{"title":"Let’s deploy it!","slug":"let’s-deploy-it","depth":2,"children":[]},{"title":"Time to build our frontend","slug":"time-to-build-our-frontend","depth":2,"children":[{"title":"The main App.tsx","slug":"the-main-app-tsx","depth":3,"children":[]}]},{"title":"Final deploy","slug":"final-deploy","depth":2,"children":[]},{"title":"The result","slug":"the-result","depth":2,"children":[]},{"title":"Conclusion","slug":"conclusion","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/upsun-c9761871/426c6190a2163560/sidebar-fix.js","/_mintlify/custom/upsun-c9761871/af4757650ec2f1cc/search-override.js"],"subdomain":"upsun-c9761871","siteName":"Upsun Developer","title":"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database. - Upsun Developer","contextualStarterQuestions":[{"_id":"6adb704fb212730b204af363","deploymentId":"696781be74d50424a2a74647","questionText":"How do embeddings work?","status":"active","generatedBy":"contextual","path":"posts/hands-on/harnessing-power-embeddings","createdAt":"2026-10-23T14:33:51.146Z","updatedAt":"2026-10-23T14:33:51.146Z","__v":0},{"_id":"6adb704fb212730b204af362","deploymentId":"696781be74d50424a2a74647","questionText":"What is a vector database?","status":"active","generatedBy":"contextual","path":"posts/hands-on/harnessing-power-embeddings","createdAt":"2026-10-23T14:33:51.146Z","updatedAt":"2026-10-23T14:33:51.146Z","__v":0},{"_id":"6adb704fb212730b204af361","deploymentId":"696781be74d50424a2a74647","questionText":"How do I build a recommendation app?","status":"active","generatedBy":"contextual","path":"posts/hands-on/harnessing-power-embeddings","createdAt":"2026-10-23T14:33:51.146Z","updatedAt":"2026-10-23T14:33:51.146Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T14:33:09.991Z","gitLastModified":"2026-10-23T14:32:40.000Z","originalFileLocation":"posts/hands-on/harnessing-power-embeddings.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Upsun Developer\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database. - Upsun Developer\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Upsun Developer\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://upsun-c9761871.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Harnessing+the+power+of+Embeddings%3A+a+real-world+example+of+a+watch+recommendation+app+using+a+vector+database.\u0026amp;description=Learn+how+to+build+a+real-world+watch+recommendation+application+using+embeddings+and+a+vector+database.+This+tutorial+covers+using+Postgres+with+pgvector%2C+Lara\u0026amp;theme=a5db750ae46123aa22d266f2\u0026amp;signature=d7151af3c71871eb26acf900a2846bb605ae139082d17a864504a26a1ed35ea8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database. - Upsun Developer\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://upsun-c9761871.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Harnessing+the+power+of+Embeddings%3A+a+real-world+example+of+a+watch+recommendation+app+using+a+vector+database.\u0026amp;description=Learn+how+to+build+a+real-world+watch+recommendation+application+using+embeddings+and+a+vector+database.+This+tutorial+covers+using+Postgres+with+pgvector%2C+Lara\u0026amp;theme=a5db750ae46123aa22d266f2\u0026amp;signature=d7151af3c71871eb26acf900a2846bb605ae139082d17a864504a26a1ed35ea8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/upsun-c9761871/rMHAq1HO1s16sbdD/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Upsun Developer\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6046ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/posts/hands-on/harnessing-power-embeddings.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developer.upsun.com/#organization\",\"name\":\"Upsun Developer\",\"url\":\"https://developer.upsun.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/upsun-c9761871/WSCgazBk0GWUPP4l/logo/Upsun-dev-center-light.svg?fit=max\u0026auto=format\u0026n=WSCgazBk0GWUPP4l\u0026q=85\u0026s=c35e42815c3d17de292fb0a86d41aa5f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developer.upsun.com#website\",\"name\":\"Upsun Developer\",\"url\":\"https://developer.upsun.com\",\"publisher\":{\"@id\":\"https://developer.upsun.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings#webpage\",\"url\":\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings\",\"name\":\"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.\",\"description\":\"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\",\"dateModified\":\"2026-10-23T14:32:40.000Z\",\"isPartOf\":{\"@id\":\"https://developer.upsun.com#website\"}},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings#article\",\"headline\":\"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.\",\"name\":\"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database.\",\"description\":\"Learn how to build a real-world watch recommendation application using embeddings and a vector database. This tutorial covers using Postgres with pgvector, Laravel, React, OpenAI, and Groq, deployed on Upsun.\",\"url\":\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings\",\"mainEntityOfPage\":{\"@id\":\"https://developer.upsun.com/posts/hands-on/harnessing-power-embeddings#webpage\"},\"dateModified\":\"2026-10-23T14:32:40.000Z\",\"publisher\":{\"@id\":\"https://developer.upsun.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.upsun.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Upsun Developer\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Upsun Developer","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Home","icon":"house","pages":[{"mode":"custom","title":"Upsun Developer Center","href":""}]},{"tab":"Dispatch","icon":"https://mintlify.s3.us-west-1.amazonaws.com/upsun-c9761871/images/icons/dispatch.svg","anchors":[{"anchor":"Docs","icon":"book","pages":[{"mode":"custom","title":"Upsun Dispatch","href":"/dispatch"},{"group":"Get Started","icon":"rocket","expanded":false,"pages":[{"title":"Get Started with Upsun Dispatch","sidebarTitle":"Get Started","href":"/dispatch/docs/get-started/index"},{"title":"Quickstart","href":"/dispatch/docs/get-started/quickstart"},{"title":"Free and paid usage","href":"/dispatch/docs/get-started/free-and-paid-usage"},{"title":"Get support","href":"/dispatch/docs/get-started/support"}]},{"group":"Integrations","icon":"link","expanded":false,"pages":[{"title":"Integration overview","sidebarTitle":"Integration overview","href":"/dispatch/docs/integrations/index"},{"group":"VCS integrations","expanded":true,"pages":[{"title":"Set up GitHub","sidebarTitle":"GitHub","href":"/dispatch/docs/integrations/github"},{"title":"Set up GitLab","sidebarTitle":"GitLab","href":"/dispatch/docs/integrations/gitlab"}]},{"group":"Ticketing integrations","expanded":true,"pages":[{"title":"Set up Jira","sidebarTitle":"Jira","href":"/dispatch/docs/integrations/jira"},{"title":"Set up Linear","sidebarTitle":"Linear","href":"/dispatch/docs/integrations/linear"}]},{"group":"Notification integrations","expanded":true,"pages":[{"title":"Set up Slack","sidebarTitle":"Slack","href":"/dispatch/docs/integrations/slack"}]}]},{"group":"Workflows","icon":"workflow","expanded":false,"pages":[{"title":"Workflows in Upsun Dispatch","sidebarTitle":"Concept","href":"/dispatch/docs/workflows/index"},{"group":"Built-in workflows","root":{"title":"Built-in workflows","sidebarTitle":"Built-in workflows","href":"/dispatch/docs/workflows/builtin"},"expanded":true,"pages":[{"title":"Code review","sidebarTitle":"Code review","href":"/dispatch/docs/workflows/code-review"},{"title":"Issue to code","sidebarTitle":"Issue to code","href":"/dispatch/docs/workflows/issue-to-code"},{"title":"CVE scan","sidebarTitle":"CVE scan","href":"/dispatch/docs/workflows/cve-scan"}]}]},{"group":"Manage","icon":"layout-grid","expanded":false,"pages":[{"title":"Use the Upsun Dispatch console","href":"/dispatch/docs/dashboard/index"}]}]}]},{"tab":"Cloud","icon":"https://mintlify.s3.us-west-1.amazonaws.com/upsun-c9761871/images/icons/cloud.svg","anchors":[{"anchor":"Docs","icon":"book","pages":[{"mode":"custom","title":"Upsun Cloud","href":"/cloud"},{"group":"Get Started","icon":"rocket","expanded":false,"pages":[{"title":"Get Started with Upsun Cloud","sidebarTitle":"Quickstart","href":"/docs/get-started/index"},{"group":"Setup Guide","root":{"title":"Getting started with Upsun Cloud","sidebarTitle":"Introduction","href":"/docs/get-started/here/index"},"pages":[{"title":"Setup","href":"/docs/get-started/here/setup"},{"title":"Create a project","href":"/docs/get-started/here/create-project"},{"group":"Configure your project","root":{"title":"Configure your project","href":"/docs/get-started/here/configure/index"},"pages":[{"title":"JavaScript/Node.js","href":"/docs/get-started/here/configure/nodejs"},{"title":"PHP","href":"/docs/get-started/here/configure/php"},{"title":"Python","href":"/docs/get-started/here/configure/python"}]},{"title":"Set resources","href":"/docs/get-started/here/set-resources"},{"title":"Make changes to your project","sidebarTitle":"Revisions","href":"/docs/get-started/here/make-changes"},{"group":"Local development","root":{"title":"Local development","href":"/docs/get-started/here/local/index"},"pages":[{"title":"Tethered","href":"/docs/get-started/here/local/tethered"}]},{"title":"Third party integrations","href":"/docs/get-started/here/third-party"},{"title":"Get support","href":"/docs/get-started/here/support"}]},{"group":"Pick a Stack","root":{"title":"How to deploy","sidebarTitle":"Overview","href":"/docs/get-started/stacks/index"},"pages":[{"group":"PHP","root":{"title":"Deploy PHP apps on Upsun Cloud","sidebarTitle":"Overview","href":"/docs/get-started/stacks/php"},"pages":[{"group":"Laravel","root":{"title":"Deploy Laravel on Upsun Cloud","sidebarTitle":"Laravel","href":"/docs/get-started/stacks/laravel/index"},"pages":[{"title":"Get started","sidebarTitle":"Get started","href":"/docs/get-started/stacks/laravel/get-started"},{"title":"Configure environment variables","sidebarTitle":"Environment variables","href":"/docs/get-started/stacks/laravel/environment-variables"},{"title":"Set up cron jobs","sidebarTitle":"Cron jobs","href":"/docs/get-started/stacks/laravel/crons"},{"title":"Set up Redis","sidebarTitle":"Set up Redis","href":"/docs/get-started/stacks/laravel/setup-redis"},{"title":"Manage continuous observability with Upsun Blackfire","sidebarTitle":"Upsun Blackfire","href":"/docs/get-started/stacks/laravel/blackfire"},{"title":"Handle queues with Horizon","sidebarTitle":"Handle queues with Horizon","href":"/docs/get-started/stacks/laravel/laravel-horizon"},{"title":"Debug with Laravel Telescope","sidebarTitle":"Debug with Laravel Telescope","href":"/docs/get-started/stacks/laravel/laravel-telescope"},{"title":"FAQ","sidebarTitle":"FAQ","href":"/docs/get-started/stacks/laravel/faq"}]},{"group":"Symfony","root":{"title":"Deploy Symfony on Upsun Cloud","sidebarTitle":"Symfony","href":"/docs/get-started/stacks/symfony/index"},"pages":[{"title":"Get started","sidebarTitle":"Get started","href":"/docs/get-started/stacks/symfony/get-started"},{"title":"Configure environment variables","href":"/docs/get-started/stacks/symfony/environment-variables"},{"title":"Set up cron jobs","sidebarTitle":"Cron jobs","href":"/docs/get-started/stacks/symfony/crons"},{"title":"Configure workers","sidebarTitle":"Workers","href":"/docs/get-started/stacks/symfony/workers"},{"title":"Manage continuous observability with Upsun Blackfire","sidebarTitle":"Upsun Blackfire","href":"/docs/get-started/stacks/symfony/blackfire"},{"title":"Symfony integration","sidebarTitle":"Symfony integration","href":"/docs/get-started/stacks/symfony/integration"},{"title":"Local development","sidebarTitle":"Local development","href":"/docs/get-started/stacks/symfony/local"},{"title":"Symfony CLI Tips","sidebarTitle":"Symfony CLI Tips","href":"/docs/get-started/stacks/symfony/symfony-cli-tips"},{"title":"FAQ","sidebarTitle":"FAQ","href":"/docs/get-started/stacks/symfony/faq"}]}]},{"group":"JavaScript","root":{"title":"Deploy JavaScript apps on Upsun Cloud","sidebarTitle":"Overview","href":"/docs/get-started/stacks/javascript"},"pages":[{"title":"Deploy Next.js on Upsun Cloud","sidebarTitle":"Next.js","href":"/docs/get-started/stacks/nextjs"},{"group":"Express","root":{"title":"Deploy Express on Upsun Cloud","sidebarTitle":"Express","href":"/docs/get-started/stacks/express/index"},"pages":[{"title":"Add a database to Express","href":"/docs/get-started/stacks/express/add-database"}]},{"group":"Strapi","root":{"title":"Deploy Strapi on Upsun Cloud","sidebarTitle":"Strapi","href":"/docs/get-started/stacks/strapi/index"},"pages":[{"title":"Add a database to Strapi","sidebarTitle":"Add a database to Strapi","href":"/docs/get-started/stacks/strapi/add-database"}]}]},{"group":"Python","root":{"title":"Deploy Python apps on Upsun Cloud","sidebarTitle":"Overview","href":"/docs/get-started/stacks/python"},"pages":[{"title":"Deploy Django on Upsun Cloud","sidebarTitle":"Django","href":"/docs/get-started/stacks/django"},{"title":"Deploy Flask on Upsun Cloud","sidebarTitle":"Flask","href":"/docs/get-started/stacks/flask"}]},{"group":"AI","root":{"title":"How to deploy AI","href":"/docs/get-started/ai/index"},"pages":[{"title":"Host AI Agents","sidebarTitle":"AI Agents","href":"/docs/get-started/ai/aiagent"},{"title":"Hosting Model Context Protocol (MCP) Servers","sidebarTitle":"Deploy MCP","href":"/docs/get-started/ai/deploy-mcp"},{"title":"The Upsun MCP Server","href":"/docs/get-started/ai/using-the-mcp"},{"title":"Upsun Cloud performance agent","href":"/docs/get-started/ai/upsun-cloud-performance-agent"},{"title":"Upsun Cloud log-analyzer agent","href":"/docs/get-started/ai/upsun-cloud-log-analyzer-agent"}]}]}]},{"group":"Core Concepts","icon":"layers","expanded":false,"pages":[{"group":"How Upsun Cloud Works","root":{"title":"What is Upsun Cloud?","sidebarTitle":"What is Upsun Cloud?","href":"/docs/core-concepts/index"},"pages":[{"title":"Philosophy","href":"/docs/core-concepts/philosophy"}]},{"group":"Workflow Overview","root":{"title":"Workflow Overview","href":"/docs/core-concepts/workflow"},"pages":[{"group":"YAML","root":{"title":"YAML","href":"/docs/core-concepts/yaml/index"},"pages":[{"title":"What YAML is","href":"/docs/core-concepts/yaml/what-is-yaml"},{"title":"Upsun Cloud YAML structure","href":"/docs/core-concepts/yaml/yaml-structure"},{"title":"Upsun Cloud YAML tags","href":"/docs/core-concepts/yaml/platform-yaml-tags"}]},{"title":"Structure","href":"/docs/core-concepts/structure"},{"title":"Get support","href":"/docs/core-concepts/get-support"}]},{"group":"Using Upsun Cloud Effectively","root":{"title":"Using Upsun Cloud Effectively","sidebarTitle":"Best practices","href":"/docs/core-concepts/best-practices/index"},"pages":[{"title":"HTTP caching","href":"/docs/core-concepts/best-practices/http-caching"},{"title":"From monoliths through headless to microservices","sidebarTitle":"Monolith, headless or microservices?","href":"/docs/core-concepts/best-practices/oneormany"},{"title":"Keep your Git repository clean","sidebarTitle":"Clean repository","href":"/docs/core-concepts/best-practices/clean-repository"}]},{"group":"Common Tasks","root":{"title":"Common Tasks","sidebarTitle":"Common Tasks","href":"/docs/core-concepts/common-tasks/index"},"pages":[{"title":"Automate your code updates","sidebarTitle":"Automate your code updates","href":"/docs/core-concepts/common-tasks/dependency-updates"},{"title":"Restrict access to a service","sidebarTitle":"Restrict service access","href":"/docs/core-concepts/common-tasks/restrict-service-access"},{"title":"Exporting data","sidebarTitle":"Exporting data","href":"/docs/core-concepts/common-tasks/exporting"},{"title":"Upgrade to a maintained version of a runtime or service","sidebarTitle":"Upgrade runtimes and services","href":"/docs/core-concepts/upgrade-runtimes-services"}]}]},{"group":"Configure Apps \u0026 Services","icon":"settings","expanded":false,"pages":[{"group":"Configure apps","root":{"title":"Configure apps","sidebarTitle":"Overview","href":"/docs/configure-apps/index"},"pages":[{"group":"Image types","root":{"title":"Choose an image type","href":"/docs/configure-apps/app-reference/index"},"pages":[{"title":"Single-runtime image","href":"/docs/configure-apps/app-reference/single-runtime-image"},{"title":"Composable image","href":"/docs/configure-apps/app-reference/composable-image"}]},{"group":"Image properties","root":{"title":"Image properties","sidebarTitle":"Overview","href":"/docs/configure-apps/image-properties/index"},"pages":[{"title":"Access","href":"/docs/configure-apps/image-properties/access"},{"title":"Additional hosts","href":"/docs/configure-apps/image-properties/additional_hosts"},{"title":"Workload authorizations","sidebarTitle":"Authorizations","href":"/docs/configure-apps/image-properties/authorizations"},{"title":"Container profile","href":"/docs/configure-apps/image-properties/container_profile"},{"title":"Crons","href":"/docs/configure-apps/image-properties/crons"},{"title":"Hooks","href":"/docs/configure-apps/image-properties/hooks"},{"title":"Mounts","href":"/docs/configure-apps/image-properties/mounts"},{"title":"Relationships","href":"/docs/configure-apps/image-properties/relationships"},{"title":"Source","href":"/docs/configure-apps/image-properties/source"},{"title":"Variables","href":"/docs/configure-apps/image-properties/variables"},{"title":"Web","href":"/docs/configure-apps/image-properties/web"},{"title":"Workers","href":"/docs/configure-apps/image-properties/workers"}]},{"group":"Advanced","pages":[{"title":"Source operations","href":"/docs/configure-apps/source-operations"},{"title":"Runtime operations","href":"/docs/configure-apps/runtime-operations"},{"group":"Configure what's served","root":{"title":"Configure what's served","sidebarTitle":"Overview","href":"/docs/configure-apps/web/index"},"pages":[{"title":"Create a basic PHP app with a front controller","sidebarTitle":"PHP with front controller","href":"/docs/configure-apps/web/php-basic"},{"title":"Rewrite requests without redirects","sidebarTitle":"Rewrite requests","href":"/docs/configure-apps/web/rewrite-requests"},{"title":"Serve directories at different paths","sidebarTitle":"Serve different paths","href":"/docs/configure-apps/web/serve-different-directories"},{"title":"Serve static sites","sidebarTitle":"Static sites","href":"/docs/configure-apps/web/static"},{"title":"Set custom headers on static content","sidebarTitle":"Custom headers","href":"/docs/configure-apps/web/custom-headers"}]},{"group":"Multiple apps","root":{"title":"Set up multiple apps in a single project","sidebarTitle":"Overview","href":"/docs/configure-apps/multi-app/index"},"pages":[{"title":"Choose a project structure","href":"/docs/configure-apps/multi-app/project-structure"},{"title":"Define routes for your multiple apps","sidebarTitle":"Define routes","href":"/docs/configure-apps/multi-app/routes"},{"title":"Define relationships between your multiple apps","sidebarTitle":"Define relationships","href":"/docs/configure-apps/multi-app/relationships"}]},{"title":"Timezones","sidebarTitle":"Timezones","href":"/docs/configure-apps/timezone"},{"group":"Use build and deploy hooks","root":{"title":"Use build and deploy hooks","sidebarTitle":"Overview","href":"/docs/configure-apps/hooks/index"},"pages":[{"title":"Change hooks in different environments","href":"/docs/configure-apps/hooks/vary-hooks-by-environment"},{"title":"Comparison of hooks","href":"/docs/configure-apps/hooks/hooks-comparison"},{"title":"Use hooks with dependencies","href":"/docs/configure-apps/hooks/hooks-and-dependencies"}]},{"title":"Work with workers","sidebarTitle":"Work with workers","href":"/docs/configure-apps/workers"},{"title":"Configure tasks to run on-demand workloads and AI agents","sidebarTitle":"Task containers","href":"/docs/configure-apps/tasks"}]}]},{"group":"Languages","root":{"title":"Languages","sidebarTitle":"Overview","href":"/docs/languages/index"},"pages":[{"title":"C#/.NET Core","href":"/docs/languages/dotnet"},{"title":"Elixir","href":"/docs/languages/elixir"},{"title":"Go","href":"/docs/languages/go"},{"group":"Java","root":{"title":"Java","sidebarTitle":"Overview","href":"/docs/languages/java/index"},"pages":[{"title":"Moving a Java application to Upsun Cloud","sidebarTitle":"Moving to Upsun Cloud","href":"/docs/languages/java/migration"},{"title":"Performance tuning Java","sidebarTitle":"Tuning","href":"/docs/languages/java/tuning"}]},{"group":"JavaScript/Node.js","root":{"title":"JavaScript/Node.js","sidebarTitle":"Overview","href":"/docs/languages/nodejs/index"},"pages":[{"title":"Debugging","href":"/docs/languages/nodejs/debug"},{"title":"Manage Node.js versions","href":"/docs/languages/nodejs/node-version"}]},{"group":"PHP","root":{"title":"PHP","sidebarTitle":"Overview","href":"/docs/languages/php/index"},"pages":[{"title":"Extensions","href":"/docs/languages/php/extensions"},{"title":"PHP performance tuning","href":"/docs/languages/php/tuning"},{"title":"PHP-FPM sizing","href":"/docs/languages/php/fpm"},{"title":"FrankenPHP","sidebarTitle":"FrankenPHP","href":"/docs/languages/php/frankenphp"},{"title":"Using Xdebug","sidebarTitle":"Xdebug","href":"/docs/languages/php/xdebug"},{"title":"Custom Redis versions","sidebarTitle":"Custom Redis","href":"/docs/languages/php/redis"},{"title":"Swoole","sidebarTitle":"Swoole","href":"/docs/languages/php/swoole"},{"title":"Authenticated Composer repositories","sidebarTitle":"Authenticated Composer","href":"/docs/languages/php/composer-auth"},{"title":"Troubleshoot PHP","sidebarTitle":"Troubleshoot","href":"/docs/languages/php/troubleshoot"}]},{"group":"Python","root":{"title":"Python","sidebarTitle":"Overview","href":"/docs/languages/python/index"},"pages":[{"title":"Manage Python dependencies","sidebarTitle":"Manage dependencies","href":"/docs/languages/python/dependencies"},{"title":"Web servers","href":"/docs/languages/python/server"},{"title":"Manage Python versions in non-Python containers","sidebarTitle":"Python in non-Python containers","href":"/docs/languages/python/python-version"}]},{"title":"Ruby","href":"/docs/languages/ruby"},{"title":"Rust","href":"/docs/languages/rust"}]},{"group":"Services","root":{"title":"Add services","href":"/docs/add-services/index"},"pages":[{"title":"ClickHouse","href":"/docs/add-services/clickhouse"},{"title":"Elasticsearch and Enterprise Search (search service)","sidebarTitle":"Elasticsearch and Enterprise Search","href":"/docs/add-services/elasticsearch"},{"title":"Gotenberg","href":"/docs/add-services/gotenberg"},{"title":"Headless Chrome","href":"/docs/add-services/headless-chrome"},{"title":"InfluxDB (Database service)","sidebarTitle":"InfluxDB","href":"/docs/add-services/influxdb"},{"title":"Kafka (Message queue service)","sidebarTitle":"Kafka","href":"/docs/add-services/kafka"},{"title":"Memcached (Object cache)","sidebarTitle":"Memcached","href":"/docs/add-services/memcached"},{"title":"Mercure","sidebarTitle":"Mercure","href":"/docs/add-services/mercure"},{"title":"MongoDB (Database service)","sidebarTitle":"MongoDB","href":"/docs/add-services/mongodb"},{"group":"MariaDB/MySQL","root":{"title":"MariaDB/MySQL (database service)","sidebarTitle":"Overview","href":"/docs/add-services/mysql/index"},"pages":[{"title":"MariaDB read-only replication","sidebarTitle":"MariaDB read-only replication","href":"/docs/add-services/mysql/mysql-readonly-replication"},{"title":"MariaDB/MySQL external replication","sidebarTitle":"External replication","href":"/docs/add-services/mysql/mysql-replication"},{"title":"Troubleshoot MySQL","sidebarTitle":"Troubleshoot","href":"/docs/add-services/mysql/troubleshoot"}]},{"title":"Network Storage","href":"/docs/add-services/network-storage"},{"title":"OpenSearch (search service)","sidebarTitle":"OpenSearch","href":"/docs/add-services/opensearch"},{"group":"PostgreSQL","root":{"title":"PostgreSQL (Database service)","sidebarTitle":"Overview","href":"/docs/add-services/postgresql/index"},"pages":[{"title":"PostgreSQL read-only replication","sidebarTitle":"Read-only replication","href":"/docs/add-services/postgresql/postgresql-readonly-replication"}]},{"title":"RabbitMQ (message queue service)","sidebarTitle":"RabbitMQ","href":"/docs/add-services/rabbitmq"},{"title":"Redis (Object cache)","sidebarTitle":"Redis","href":"/docs/add-services/redis"},{"title":"Solr (Search service)","sidebarTitle":"Solr","href":"/docs/add-services/solr"},{"title":"Valkey","sidebarTitle":"Valkey","href":"/docs/add-services/valkey"},{"title":"Varnish","href":"/docs/add-services/varnish"},{"title":"Vault key management service","sidebarTitle":"Vault KMS","href":"/docs/add-services/vault"},{"group":"Self-hosted services","root":{"title":"Self-hosted services","sidebarTitle":"Self-hosted services","href":"/docs/add-services/self-hosted"},"pages":[{"group":"Public Docker images","root":{"title":"Self-hosted services from public Docker images","sidebarTitle":"Public Docker images","href":"/docs/add-services/docker-images/index"},"pages":[{"title":"Meilisearch","sidebarTitle":"Meilisearch","href":"/docs/add-services/docker-images/docker-meilisearch"},{"title":"n8n","sidebarTitle":"n8n","href":"/docs/add-services/docker-images/docker-n8n"}]}]}]},{"group":"Routes","root":{"title":"Define routes","sidebarTitle":"Overview","href":"/docs/routes/index"},"pages":[{"title":"Server Side Includes (SSI)","href":"/docs/routes/ssi"},{"title":"HTTP cache","href":"/docs/routes/cache"},{"title":"HTTPS","sidebarTitle":"HTTPS","href":"/docs/routes/https"},{"title":"Proxy routes","href":"/docs/routes/proxy"},{"title":"Redirects","href":"/docs/routes/redirects"}]}]},{"group":"Build, Deploy \u0026 Run","icon":"server","expanded":false,"pages":[{"title":"Build and deploy","href":"/docs/core-concepts/build-deploy"},{"group":"Local development","root":{"title":"Set up your local development environment","sidebarTitle":"Overview","href":"/docs/development/local/index"},"pages":[{"group":"Integrated environments","pages":[{"title":"Use DDEV for local development","sidebarTitle":"DDEV","href":"/docs/development/local/ddev"}]},{"group":"Supported environments","pages":[{"title":"Tethered local development","sidebarTitle":"Tethered","href":"/docs/development/local/tethered"},{"title":"Untethered local development","sidebarTitle":"Untethered","href":"/docs/development/local/untethered"}]}]},{"group":"Variables","root":{"title":"Variables overview","sidebarTitle":"Overview","href":"/docs/development/variables/index"},"pages":[{"title":"Set variables","href":"/docs/development/variables/set-variables"},{"title":"Use variables","href":"/docs/development/variables/use-variables"}]},{"group":"Development tools","root":{"title":"Development tools","href":"/docs/development/tools"},"pages":[{"title":"Access your site","href":"/docs/development/access-site"},{"title":"Transfer files to and from your app","sidebarTitle":"Transfer files","href":"/docs/development/file-transfer"},{"title":"HTTP Headers","sidebarTitle":"Headers","href":"/docs/development/headers"},{"title":"Send email from your Upsun Cloud environment using an SMTP proxy","sidebarTitle":"Email","href":"/docs/development/email"},{"title":"Pull code from a private Git repository","sidebarTitle":"Private repositories","href":"/docs/development/private-repository"},{"title":"Use Git submodules","sidebarTitle":"Git submodules","href":"/docs/development/submodules"},{"title":"Regions","href":"/docs/development/regions"},{"title":"Use Drush with Upsun Cloud","sidebarTitle":"Drush","href":"/docs/development/drush"}]},{"group":"SSH","root":{"title":"Connect securely with SSH","sidebarTitle":"Overview","href":"/docs/development/ssh/index"},"pages":[{"title":"Authenticate with SSH keys","sidebarTitle":"SSH keys","href":"/docs/development/ssh/ssh-keys"},{"title":"Troubleshoot SSH","href":"/docs/development/ssh/troubleshoot-ssh"}]},{"group":"Database management","root":{"title":"Sanitize databases","sidebarTitle":"Overview","href":"/docs/development/sanitize-db/index"},"pages":[{"title":"Sanitizing databases: MariaDB and Drupal","sidebarTitle":"MariaDB and Drupal","href":"/docs/development/sanitize-db/mariadb"},{"title":"Sanitizing databases: PostgreSQL and Django","sidebarTitle":"PostgreSQL and Django","href":"/docs/development/sanitize-db/postgresql"},{"title":"Sanitizing databases: PostgreSQL and Symfony","sidebarTitle":"PostgreSQL and Symfony","href":"/docs/development/sanitize-db/postgresql-symfony"}]}]},{"group":"Manage Projects","icon":"layout-grid","expanded":false,"pages":[{"title":"Manage projects","sidebarTitle":"Overview","href":"/docs/projects/index"},{"group":"Project settings","root":{"title":"Project settings","href":"/docs/projects/settings"},"pages":[{"title":"Change a project's region","sidebarTitle":"Change regions","href":"/docs/projects/region-migration"},{"title":"Change the project timezone","href":"/docs/projects/change-project-timezone"},{"title":"Delete a project","sidebarTitle":"Delete a project","href":"/docs/projects/delete-project"}]},{"group":"Custom domains","root":{"title":"Custom domains","sidebarTitle":"Overview","href":"/docs/domains/index"},"pages":[{"group":"Set up a custom domain","root":{"title":"Set up a custom domain","sidebarTitle":"Set up a custom domain","href":"/docs/domains/steps/index"},"pages":[{"title":"DNS management and apex domains","sidebarTitle":"DNS and apex domains","href":"/docs/domains/steps/dns"},{"title":"Configure a third-party TLS certificate","sidebarTitle":"Custom TLS certificates","href":"/docs/domains/steps/tls"},{"title":"Share subdomains across different projects","sidebarTitle":"Subdomains across projects","href":"/docs/domains/steps/subdomains"},{"title":"DNS challenge for domain ownership","sidebarTitle":"DNS challenge","href":"/docs/domains/steps/dns-challenge"},{"title":"Set up a custom domain on a preview environment","sidebarTitle":"Preview environment domains","href":"/docs/domains/steps/custom-domains-preview-environments"},{"title":"Troubleshoot domain issues","sidebarTitle":"Troubleshoot","href":"/docs/domains/troubleshoot"}]},{"group":"CDN","root":{"title":"Content delivery networks (CDNs)","sidebarTitle":"Overview","href":"/docs/domains/cdn/index"},"pages":[{"title":"Set up your Fastly CDN","sidebarTitle":"Fastly setup","href":"/docs/domains/cdn/fastly"},{"title":"Managed Fastly CDN","sidebarTitle":"Managed Fastly CDN","href":"/docs/domains/cdn/managed-fastly"},{"title":"Set up your Cloudflare CDN","sidebarTitle":"Cloudflare setup","href":"/docs/domains/cdn/cloudflare"}]}]},{"group":"Administration","root":{"title":"Administration","href":"/docs/administration/index"},"pages":[{"group":"Console","root":{"title":"Console","sidebarTitle":"Overview","href":"/docs/administration/web/index"},"pages":[{"title":"Configure a project","href":"/docs/administration/web/configure-project"},{"title":"Configure environments","sidebarTitle":"Configure environments","href":"/docs/administration/web/configure-environment"}]},{"title":"Organizations","href":"/docs/administration/organizations"},{"title":"Administer teams","sidebarTitle":"Teams","href":"/docs/administration/teams"},{"title":"Administer users","sidebarTitle":"Users","href":"/docs/administration/users"},{"title":"Pricing","href":"/docs/administration/pricing"},{"group":"Billing","root":{"title":"Billing","href":"/docs/administration/billing/index"},"pages":[{"title":"Set up a billing account and billing profile","href":"/docs/administration/billing/bp-setup"},{"title":"Add and manage payment methods","href":"/docs/administration/billing/bp-payment-method"},{"title":"View invoices","href":"/docs/administration/billing/bp-invoices"},{"title":"Monitor spending and usage","href":"/docs/administration/billing/bp-monitor-billing"},{"title":"Manage billing members on a billing profile","href":"/docs/administration/billing/bp-users"},{"title":"Edit a billing profile","href":"/docs/administration/billing/bp-edit-billing-profile"},{"title":"View discounts and commitments","href":"/docs/administration/billing/bp-discounts"},{"title":"View vouchers","href":"/docs/administration/billing/bp-vouchers"},{"title":"Transfer an organization to a different billing profile","href":"/docs/administration/billing/bp-transfers"},{"title":"Billing FAQ","href":"/docs/administration/billing/bp-faq"}]},{"title":"Server upgrades","href":"/docs/administration/servers"},{"group":"Security","root":{"title":"Security","sidebarTitle":"Overview","href":"/docs/administration/security/index"},"pages":[{"title":"Multifactor Authentication (MFA)","sidebarTitle":"Multifactor Authentication (MFA)","href":"/docs/administration/security/mfa"},{"title":"Single Sign-On (SSO)","sidebarTitle":"Single Sign-On (SSO)","href":"/docs/administration/security/sso"}]}]},{"group":"Security \u0026 compliance","root":{"title":"Security and compliance","sidebarTitle":"Overview","href":"/docs/security/index"},"pages":[{"title":"Fastly WAF","href":"/docs/security/fastly-waf"},{"title":"Upsun WAF","sidebarTitle":"Upsun WAF","href":"/docs/security/waf"},{"title":"Data retention","href":"/docs/security/data-retention"},{"title":"Project isolation","href":"/docs/security/project-isolation"}]}]},{"group":"Manage Environments","icon":"git-branch","expanded":false,"pages":[{"title":"Manage Upsun Cloud environments","sidebarTitle":"Overview","href":"/docs/environments/index"},{"group":"Backup \u0026 restore","root":{"title":"Backup \u0026 restore","href":"/docs/environments/backup-restore"},"pages":[{"title":"Back up an environment","sidebarTitle":"Back up an environment","href":"/docs/environments/backup"},{"title":"Restore an environment from a backup","sidebarTitle":"Restore an environment","href":"/docs/environments/restore"}]},{"group":"Environment settings","root":{"title":"Environment settings","href":"/docs/environments/settings"},"pages":[{"title":"Change an environment's parent","sidebarTitle":"Change parent","href":"/docs/environments/change-parent"},{"title":"Rename the default environment","sidebarTitle":"Rename the default environment","href":"/docs/environments/default-environment"},{"title":"Configure HTTP access control","sidebarTitle":"Configure HTTP access control","href":"/docs/environments/http-access-control"},{"title":"Manage search indexing for an environment","sidebarTitle":"Manage search indexing","href":"/docs/environments/search-engine-visibility"}]},{"group":"Environment actions","root":{"title":"Environment actions","href":"/docs/environments/actions"},"pages":[{"title":"Cancel an activity","href":"/docs/environments/cancel-activity"},{"title":"Deactivate an environment","sidebarTitle":"Deactivate an environment","href":"/docs/environments/deactivate-environment"}]}]},{"group":"Manage Resources","icon":"gauge","expanded":false,"pages":[{"title":"Manage resources","sidebarTitle":"Overview","href":"/docs/manage-resources/index"},{"title":"How resources work on Upsun Cloud","sidebarTitle":"How resources work","href":"/docs/manage-resources/how-resources-work"},{"group":"Configure resources","root":{"title":"Configure resources","href":"/docs/manage-resources/configure"},"pages":[{"title":"Resource initialization","sidebarTitle":"Resource initialization","href":"/docs/manage-resources/resource-init"},{"title":"Resource configuration","sidebarTitle":"Resource configuration","href":"/docs/manage-resources/adjust-resources"},{"title":"Project build resources","sidebarTitle":"Project build resources","href":"/docs/manage-resources/build-resources"}]},{"group":"Scaling","root":{"title":"Scaling","href":"/docs/manage-resources/scaling"},"pages":[{"title":"Autoscaling","sidebarTitle":"Autoscaling","href":"/docs/manage-resources/autoscaling"},{"title":"Guaranteed resources","sidebarTitle":"Guaranteed resources","href":"/docs/manage-resources/guaranteed-resources"}]},{"title":"Object storage","sidebarTitle":"Object storage","href":"/docs/manage-resources/object-storage"}]},{"group":"Observability \u0026 Metrics","icon":"activity","expanded":false,"pages":[{"title":"Increase observability","sidebarTitle":"Overview","href":"/docs/observability/index"},{"group":"Infrastructure metrics","root":{"title":"Infrastructure metrics","sidebarTitle":"Overview","href":"/docs/observability/metrics/index"},"pages":[{"title":"HTTP metrics","sidebarTitle":"HTTP metrics","href":"/docs/observability/metrics/http-metrics"},{"title":"Understand metrics","sidebarTitle":"Understand metrics","href":"/docs/observability/metrics/understand-metrics"}]},{"group":"Application metrics","root":{"title":"Application metrics","sidebarTitle":"Overview","href":"/docs/observability/application-metrics/index"},"pages":[{"title":"Monitor Cron job executions","sidebarTitle":"Monitor Cron job executions","href":"/docs/observability/application-metrics/cron-metrics"},{"title":"Understanding application observability","sidebarTitle":"Understanding application observability","href":"/docs/observability/application-metrics/understanding"},{"title":"Upsun Blackfire for PHP and Python","sidebarTitle":"Upsun Blackfire for PHP and Python","href":"/docs/observability/application-metrics/blackfire"},{"group":"Continuous profiling","pages":[{"title":"Continuous Profiling dashboard","sidebarTitle":"Dashboard","href":"/docs/observability/application-metrics/cont-prof"},{"title":"Comparing Continuous Profiling Timeframes","sidebarTitle":"Comparing Timeframes","href":"/docs/observability/application-metrics/cont-prof-comparison"},{"title":"Continuous profiling for Go","sidebarTitle":"Go continuous profiler","href":"/docs/observability/application-metrics/go"},{"title":"Continuous profiling for Java","sidebarTitle":"Java continuous profiler","href":"/docs/observability/application-metrics/java"},{"title":"Continuous profiling for Node.js","sidebarTitle":"Node.js continuous profiler","href":"/docs/observability/application-metrics/nodejs"},{"title":"Continuous profiling for PHP","sidebarTitle":"PHP continuous profiler","href":"/docs/observability/application-metrics/php"},{"title":"Continuous profiling for Python","sidebarTitle":"Python continuous profiler","href":"/docs/observability/application-metrics/python"},{"title":"Continuous profiling for Ruby","sidebarTitle":"Ruby continuous profiler","href":"/docs/observability/application-metrics/ruby"},{"title":"Continuous profiling for Rust","sidebarTitle":"Rust continuous profiler","href":"/docs/observability/application-metrics/rust"}]}]},{"group":"Logs","root":{"title":"Consume logs","sidebarTitle":"Overview","href":"/docs/observability/logs/index"},"pages":[{"title":"Log Explorer","sidebarTitle":"Log Explorer","href":"/docs/observability/logs/log-explorer"},{"title":"Access your logs","sidebarTitle":"Access logs","href":"/docs/observability/logs/access-logs"},{"title":"Forward Upsun Cloud and Upsun Blackfire logs","sidebarTitle":"Forward Upsun Cloud and Upsun Blackfire logs","href":"/docs/observability/logs/forward-logs"}]}]},{"group":"Integrations","icon":"link","expanded":false,"pages":[{"sidebarTitle":"Overview","title":"External Integrations","href":"/docs/integrations/overview"},{"group":"Source integrations","root":{"title":"Source integrations","sidebarTitle":"Overview","href":"/docs/integrations/source/index"},"pages":[{"title":"Integrate with Bitbucket","sidebarTitle":"Bitbucket","href":"/docs/integrations/source/bitbucket"},{"title":"Integrate with GitHub","sidebarTitle":"GitHub","href":"/docs/integrations/source/github"},{"title":"Integrate with GitLab","sidebarTitle":"GitLab","href":"/docs/integrations/source/gitlab"},{"title":"Resolve access issues with source integrations","sidebarTitle":"Resolve access issues with source integrations","href":"/docs/integrations/source/troubleshoot"}]},{"group":"Activity scripts","root":{"title":"Activity scripts","sidebarTitle":"Overview","href":"/docs/integrations/activity/index"},"pages":[{"title":"Activity reference","sidebarTitle":"Activity reference","href":"/docs/integrations/activity/reference"},{"title":"Utility routines","sidebarTitle":"Utility routines","href":"/docs/integrations/activity/utility"},{"title":"Webhooks","href":"/docs/integrations/activity/webhooks"},{"group":"Examples","pages":[{"title":"Example: Discord","href":"/docs/integrations/activity/discord"},{"title":"Example: Slack","sidebarTitle":"Example: Slack","href":"/docs/integrations/activity/slack"}]}]},{"title":"Fastly CDN","href":"/docs/integrations/fastly-cdn"},{"title":"Health notifications","href":"/docs/integrations/notifications"}]},{"group":"Troubleshooting","icon":"circle-alert","expanded":false,"pages":[{"title":"502 error resolution guide","sidebarTitle":"502 error resolutions","href":"/docs/troubleshooting/502-errors"},{"title":"Troubleshoot development","sidebarTitle":"Development","href":"/docs/troubleshooting/general"},{"title":"Troubleshoot disks","sidebarTitle":"Disks","href":"/docs/troubleshooting/disks"},{"title":"Troubleshoot mounts","sidebarTitle":"Mounts","href":"/docs/troubleshooting/mounts"}]},{"group":"Resources","icon":"code","expanded":false,"pages":[{"title":"Glossary","sidebarTitle":"Glossary","href":"/docs/glossary/index"},{"title":"Data Register","sidebarTitle":"Data Register","href":"/docs/registry/index"},{"title":"Request features","sidebarTitle":"Request features","href":"/docs/request-features/index"}]}]},{"anchor":"Tutorials","icon":"graduation-cap","pages":[{"title":"Tutorials","sidebarTitle":"Overview","icon":"graduation-cap","href":"/tutorials/index"},{"group":"AI use cases","icon":"brain","pages":[{"title":"AI use cases","sidebarTitle":"Overview","href":"/tutorials/ai/index"},{"title":"Building a LangChain chatbot on Upsun Cloud","sidebarTitle":"LangChain chatbot","tag":"New","href":"/tutorials/ai/langchain-chatbot"},{"title":"Building a RAG pipeline with Qdrant on Upsun Cloud","sidebarTitle":"RAG pipeline","tag":"New","href":"/tutorials/ai/rag-pipeline"},{"title":"Deploying a coding agent with opencode on Upsun Cloud","sidebarTitle":"Coding agent","tag":"New","href":"/tutorials/ai/coding-agent"},{"title":"Building a news digest with workers on Upsun Cloud","sidebarTitle":"News digest","tag":"New","href":"/tutorials/ai/news-digest"},{"title":"Building an AI support ticket classifier on Upsun Cloud","sidebarTitle":"Form processing","tag":"New","href":"/tutorials/ai/form-processing"},{"title":"Building an AI-powered BI tool on Upsun Cloud","sidebarTitle":"eCommerce insights","tag":"New","href":"/tutorials/ai/ecommerce-insights"}]},{"group":"Self-hosted services","icon":"server","pages":[{"title":"Self-hosted services","sidebarTitle":"Overview","href":"/tutorials/self-hosted/index"},{"title":"Qdrant","sidebarTitle":"Qdrant","href":"/tutorials/self-hosted/qdrant"},{"title":"Chroma","sidebarTitle":"Chroma","href":"/tutorials/self-hosted/chroma"}]},{"group":"CMS guides","icon":"newspaper","pages":[{"title":"CMS guides","sidebarTitle":"Overview","href":"/tutorials/cms/index"},{"group":"WordPress","root":{"title":"Deploy WordPress on Upsun Cloud","sidebarTitle":"WordPress","href":"/tutorials/wordpress/index"},"pages":[{"title":"Deploy Vanilla WordPress on Upsun Cloud","sidebarTitle":"Vanilla WordPress","href":"/tutorials/wordpress/vanilla"},{"title":"Deploy Composer-based WordPress on Upsun Cloud","sidebarTitle":"Composer WordPress","href":"/tutorials/wordpress/composer"},{"title":"Deploy Bedrock-based WordPress on Upsun Cloud","sidebarTitle":"Bedrock WordPress","href":"/tutorials/wordpress/bedrock"},{"title":"Deploy WordPress Multisite on Upsun Cloud","sidebarTitle":"WordPress Multisite","href":"/tutorials/wordpress/multisite"}]},{"title":"Deploy Drupal on Upsun Cloud","sidebarTitle":"Drupal","href":"/tutorials/drupal"},{"title":"Deploy Magento on Upsun Cloud","sidebarTitle":"Magento","href":"/tutorials/magento"},{"title":"Deploy Shopware on Upsun Cloud","sidebarTitle":"Shopware","href":"/tutorials/shopware"},{"title":"Deploy Pimcore on Upsun Cloud","sidebarTitle":"Pimcore","href":"/tutorials/pimcore"},{"title":"Deploy Liferay on Upsun Cloud","sidebarTitle":"Liferay","href":"/tutorials/liferay"}]},{"group":"Migration guides","icon":"move-right","pages":[{"title":"Migration guides","sidebarTitle":"Overview","href":"/tutorials/migration/index"},{"title":"Migrating from another provider to Upsun Cloud","sidebarTitle":"From another provider","href":"/tutorials/migration/from-other-provider"},{"title":"Converting from Upsun Fixed (formerly Platform.sh)","sidebarTitle":"Converting from Upsun Fixed (formerly Platform.sh)","href":"/tutorials/migration/from-fixed"}]}]},{"anchor":"API","icon":"code","pages":[{"title":"Upsun Cloud API","sidebarTitle":"API Home","icon":"code","href":"/api/index"},{"group":"SDK","pages":[{"title":"Overview","icon":"book-open","sidebarTitle":"Overview","href":"/api/sdk/overview"},{"title":"Upsun Cloud SDK for PHP","sidebarTitle":"PHP","icon":"php","tag":"Beta","href":"/api/sdk/php"},{"title":"Upsun Cloud SDK for NodeJs","sidebarTitle":"NodeJs","icon":"js","tag":"Beta","href":"/api/sdk/js"}]},{"group":"REST API","pages":[{"title":"Overview","icon":"book-open","sidebarTitle":"Overview","href":"/api/rest/overview"},{"title":"Authentication","icon":"lock","sidebarTitle":"Authentication","href":"/api/rest/authentication"},{"title":"Errors","icon":"circle-x","sidebarTitle":"Errors","href":"/api/rest/errors"},{"title":"Endpoints","icon":"route","sidebarTitle":"Endpoints","href":"/api/rest/endpoints"}]},{"group":"OpenAPI Reference","pages":[{"group":"API Reference","pages":[{"title":"Query project carbon emissions metrics for an entire organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/metrics/carbon","href":"/api-reference/query-project-carbon-emissions-metrics-for-an-entire-organization"},{"title":"List support tickets","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /tickets","href":"/api-reference/list-support-tickets"}]},{"group":"Add-ons","pages":[{"title":"Get add-ons","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/addons","href":"/api-reference/add-ons/get-add-ons"}]},{"group":"Alerts","pages":[{"title":"Get usage alerts for a subscription","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /alerts/subscriptions/{subscriptionId}/usage","href":"/api-reference/alerts/get-usage-alerts-for-a-subscription"},{"title":"Update usage alerts.","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /alerts/subscriptions/{subscriptionId}/usage","href":"/api-reference/alerts/update-usage-alerts"}]},{"group":"API Tokens","pages":[{"title":"List a user's API tokens","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/api-tokens","href":"/api-reference/api-tokens/list-a-users-api-tokens"},{"title":"Create an API token","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/api-tokens","href":"/api-reference/api-tokens/create-an-api-token"},{"title":"Get an API token","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/api-tokens/{token_id}","href":"/api-reference/api-tokens/get-an-api-token"},{"title":"Delete an API token","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /users/{user_id}/api-tokens/{token_id}","href":"/api-reference/api-tokens/delete-an-api-token"}]},{"group":"Autoscaling","pages":[{"title":"Retrieves Autoscaler settings","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/autoscaling/settings","href":"/api-reference/autoscaling/retrieves-autoscaler-settings"},{"title":"Updates Autoscaler settings","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/autoscaling/settings","href":"/api-reference/autoscaling/updates-autoscaler-settings"},{"title":"Modifies Autoscaler settings","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/environments/{environmentId}/autoscaling/settings","href":"/api-reference/autoscaling/modifies-autoscaler-settings"}]},{"group":"Blackfire Monitoring","pages":[{"title":"Get server cache metrics","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/server/caches","href":"/api-reference/blackfire-monitoring/get-server-cache-metrics"},{"title":"Get server monitoring overview","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/server","href":"/api-reference/blackfire-monitoring/get-server-monitoring-overview"},{"title":"Get server transaction breakdown","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/server/transactions-break-down","href":"/api-reference/blackfire-monitoring/get-server-transaction-breakdown"},{"title":"Get top spans","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/server/top-spans","href":"/api-reference/blackfire-monitoring/get-top-spans"}]},{"group":"Blackfire Profiling","pages":[{"title":"Get profile timeline data","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles/{uuid}/timeline","href":"/api-reference/blackfire-profiling/get-profile-timeline-data"},{"title":"Get profile subprofiles","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles/{uuid}/subprofiles","href":"/api-reference/blackfire-profiling/get-profile-subprofiles"},{"title":"Get profile details","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles/{uuid}/profile","href":"/api-reference/blackfire-profiling/get-profile-details"},{"title":"Get profile call graph","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles/{uuid}/graph","href":"/api-reference/blackfire-profiling/get-profile-call-graph"},{"title":"Get recommendation statistics","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles/recommendations","href":"/api-reference/blackfire-profiling/get-recommendation-statistics"},{"title":"List profiling results","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/profiles","href":"/api-reference/blackfire-profiling/list-profiling-results"}]},{"group":"Cert Management","pages":[{"title":"Get list of SSL certificates","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/certificates","href":"/api-reference/cert-management/get-list-of-ssl-certificates"},{"title":"Add an SSL certificate","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/certificates","href":"/api-reference/cert-management/add-an-ssl-certificate"},{"title":"Get an SSL certificate","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/certificates/{certificateId}","href":"/api-reference/cert-management/get-an-ssl-certificate"},{"title":"Delete an SSL certificate","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/certificates/{certificateId}","href":"/api-reference/cert-management/delete-an-ssl-certificate"},{"title":"Update an SSL certificate","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/certificates/{certificateId}","href":"/api-reference/cert-management/update-an-ssl-certificate"},{"title":"Get projects provisioners","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/provisioners","href":"/api-reference/cert-management/get-projects-provisioners"},{"title":"Get projects provisioners 1","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/provisioners/{certificateProvisionerDocumentId}","href":"/api-reference/cert-management/get-projects-provisioners-1"},{"title":"Patch projects provisioners","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/provisioners/{certificateProvisionerDocumentId}","href":"/api-reference/cert-management/patch-projects-provisioners"}]},{"group":"Connections","pages":[{"title":"List federated login connections","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/connections","href":"/api-reference/connections/list-federated-login-connections"},{"title":"Get a federated login connection","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/connections/{provider}","href":"/api-reference/connections/get-a-federated-login-connection"},{"title":"Delete a federated login connection","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /users/{user_id}/connections/{provider}","href":"/api-reference/connections/delete-a-federated-login-connection"}]},{"group":"Continuous Profiling","pages":[{"title":"List profiled applications","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{envId}/continuous-profiling","href":"/api-reference/continuous-profiling/list-profiled-applications"},{"title":"Get application timeline","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{envId}/continuous-profiling/app/{app}","href":"/api-reference/continuous-profiling/get-application-timeline"},{"title":"Get merged profile","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{envId}/continuous-profiling/app/{app}/merge","href":"/api-reference/continuous-profiling/get-merged-profile"},{"title":"Get application filter values","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{envId}/continuous-profiling/app/{app}/filter","href":"/api-reference/continuous-profiling/get-application-filter-values"}]},{"group":"Deployment","pages":[{"title":"Get an environment's deployment information","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/deployments","href":"/api-reference/deployment/get-an-environments-deployment-information"},{"title":"Get a single environment deployment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/deployments/{deploymentId}","href":"/api-reference/deployment/get-a-single-environment-deployment"}]},{"group":"Deployment Target","pages":[{"title":"Get project deployment target info","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/deployments","href":"/api-reference/deployment-target/get-project-deployment-target-info"},{"title":"Create a project deployment target","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/deployments","href":"/api-reference/deployment-target/create-a-project-deployment-target"},{"title":"Get a single project deployment target","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/deployments/{deploymentTargetConfigurationId}","href":"/api-reference/deployment-target/get-a-single-project-deployment-target"},{"title":"Delete a single project deployment target","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/deployments/{deploymentTargetConfigurationId}","href":"/api-reference/deployment-target/delete-a-single-project-deployment-target"},{"title":"Update a project deployment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/deployments/{deploymentTargetConfigurationId}","href":"/api-reference/deployment-target/update-a-project-deployment"}]},{"group":"Diff","pages":[{"title":"Get projects gitdiffs ","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/diffs/{diffBaseId}/{diffTargetId}","href":"/api-reference/diff/get-projects-gitdiffs-"}]},{"group":"Discounts","pages":[{"title":"Get an organization discount","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /discounts/{id}","href":"/api-reference/discounts/get-an-organization-discount"},{"title":"Get the value of the First Project Incentive discount","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /discounts/types/allowance","href":"/api-reference/discounts/get-the-value-of-the-first-project-incentive-discount"},{"title":"List organization discounts","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/discounts","href":"/api-reference/discounts/list-organization-discounts"}]},{"group":"Domain Claim","pages":[{"title":"Get projects domain claims","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/domain-claims","href":"/api-reference/domain-claim/get-projects-domain-claims"},{"title":"Post projects domain claims","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/domain-claims","href":"/api-reference/domain-claim/post-projects-domain-claims"},{"title":"Get projects domain claims 1","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/domain-claims/{domainClaimId}","href":"/api-reference/domain-claim/get-projects-domain-claims-1"},{"title":"Delete projects domain claims","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/domain-claims/{domainClaimId}","href":"/api-reference/domain-claim/delete-projects-domain-claims"},{"title":"Patch projects domain claims","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/domain-claims/{domainClaimId}","href":"/api-reference/domain-claim/patch-projects-domain-claims"}]},{"group":"Domain Management","pages":[{"title":"Get list of project domains","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/domains","href":"/api-reference/domain-management/get-list-of-project-domains"},{"title":"Add a project domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/domains","href":"/api-reference/domain-management/add-a-project-domain"},{"title":"Get a project domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/domains/{domainId}","href":"/api-reference/domain-management/get-a-project-domain"},{"title":"Delete a project domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/domains/{domainId}","href":"/api-reference/domain-management/delete-a-project-domain"},{"title":"Update a project domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/domains/{domainId}","href":"/api-reference/domain-management/update-a-project-domain"},{"title":"Get a list of environment domains","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/domains","href":"/api-reference/domain-management/get-a-list-of-environment-domains"},{"title":"Add an environment domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/domains","href":"/api-reference/domain-management/add-an-environment-domain"},{"title":"Get an environment domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/domains/{domainId}","href":"/api-reference/domain-management/get-an-environment-domain"},{"title":"Delete an environment domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/environments/{environmentId}/domains/{domainId}","href":"/api-reference/domain-management/delete-an-environment-domain"},{"title":"Update an environment domain","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/environments/{environmentId}/domains/{domainId}","href":"/api-reference/domain-management/update-an-environment-domain"}]},{"group":"Entrypoint","pages":[{"title":"Get observability entrypoint","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability","href":"/api-reference/entrypoint/get-observability-entrypoint"}]},{"group":"Environment","pages":[{"title":"Get list of project environments","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments","href":"/api-reference/environment/get-list-of-project-environments"},{"title":"Get an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}","href":"/api-reference/environment/get-an-environment"},{"title":"Delete an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/environments/{environmentId}","href":"/api-reference/environment/delete-an-environment"},{"title":"Update an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/environments/{environmentId}","href":"/api-reference/environment/update-an-environment"},{"title":"Activate an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/activate","href":"/api-reference/environment/activate-an-environment"},{"title":"Branch an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/branch","href":"/api-reference/environment/branch-an-environment"},{"title":"Deactivate an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/deactivate","href":"/api-reference/environment/deactivate-an-environment"},{"title":"Deploy an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/deploy","href":"/api-reference/environment/deploy-an-environment"},{"title":"Initialize a new environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/initialize","href":"/api-reference/environment/initialize-a-new-environment"},{"title":"Post projects environments maintenance redeploy","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/maintenance-redeploy","href":"/api-reference/environment/post-projects-environments-maintenance-redeploy"},{"title":"Merge an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/merge","href":"/api-reference/environment/merge-an-environment"},{"title":"Pause an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/pause","href":"/api-reference/environment/pause-an-environment"},{"title":"Redeploy an environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/redeploy","href":"/api-reference/environment/redeploy-an-environment"},{"title":"Resume a paused environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/resume","href":"/api-reference/environment/resume-a-paused-environment"},{"title":"Synchronize a child environment with its parent","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/synchronize","href":"/api-reference/environment/synchronize-a-child-environment-with-its-parent"}]},{"group":"Environment Activity","pages":[{"title":"Get environment activity log","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/activities","href":"/api-reference/environment-activity/get-environment-activity-log"},{"title":"Get an environment activity log entry","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/activities/{activityId}","href":"/api-reference/environment-activity/get-an-environment-activity-log-entry"},{"title":"Cancel an environment activity","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/activities/{activityId}/cancel","href":"/api-reference/environment-activity/cancel-an-environment-activity"}]},{"group":"Environment Backups","pages":[{"title":"Create backup of environment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/backup","href":"/api-reference/environment-backups/create-backup-of-environment"},{"title":"Get an environment's backup list","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/backups","href":"/api-reference/environment-backups/get-an-environments-backup-list"},{"title":"Get an environment backup's info","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/backups/{backupId}","href":"/api-reference/environment-backups/get-an-environment-backups-info"},{"title":"Delete an environment backup","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/environments/{environmentId}/backups/{backupId}","href":"/api-reference/environment-backups/delete-an-environment-backup"},{"title":"Restore an environment snapshot","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/backups/{backupId}/restore","href":"/api-reference/environment-backups/restore-an-environment-snapshot"}]},{"group":"Environment Type","pages":[{"title":"Get environment types","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environment-types","href":"/api-reference/environment-type/get-environment-types"},{"title":"Get environment type links","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environment-types/{environmentTypeId}","href":"/api-reference/environment-type/get-environment-type-links"}]},{"group":"Environment Variables","pages":[{"title":"Get list of environment variables","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/variables","href":"/api-reference/environment-variables/get-list-of-environment-variables"},{"title":"Add an environment variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/variables","href":"/api-reference/environment-variables/add-an-environment-variable"},{"title":"Get an environment variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/variables/{variableId}","href":"/api-reference/environment-variables/get-an-environment-variable"},{"title":"Delete an environment variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/environments/{environmentId}/variables/{variableId}","href":"/api-reference/environment-variables/delete-an-environment-variable"},{"title":"Update an environment variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/environments/{environmentId}/variables/{variableId}","href":"/api-reference/environment-variables/update-an-environment-variable"}]},{"group":"Grants","pages":[{"title":"List extended access of a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/extended-access","href":"/api-reference/grants/list-extended-access-of-a-user"},{"title":"Get access document by access ID","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /access/{access_id}","href":"/api-reference/grants/get-access-document-by-access-id"}]},{"group":"Http Traffic","pages":[{"title":"Get HTTP traffic timeline by URL","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/http/breakdown/urls","href":"/api-reference/http-traffic/get-http-traffic-timeline-by-url"},{"title":"Get HTTP traffic timeline by IP","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/http/breakdown/ips","href":"/api-reference/http-traffic/get-http-traffic-timeline-by-ip"},{"title":"Get HTTP traffic timeline by user agent","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/http/breakdown/user-agents","href":"/api-reference/http-traffic/get-http-traffic-timeline-by-user-agent"}]},{"group":"Invoices","pages":[{"title":"List invoices","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/invoices","href":"/api-reference/invoices/list-invoices"},{"title":"Get invoice","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/invoices/{invoice_id}","href":"/api-reference/invoices/get-invoice"}]},{"group":"MFA","pages":[{"title":"Get information about TOTP enrollment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/totp","href":"/api-reference/mfa/get-information-about-totp-enrollment"},{"title":"Confirm TOTP enrollment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/totp","href":"/api-reference/mfa/confirm-totp-enrollment"},{"title":"Withdraw TOTP enrollment","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /users/{user_id}/totp","href":"/api-reference/mfa/withdraw-totp-enrollment"},{"title":"Re-create recovery codes","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/codes","href":"/api-reference/mfa/re-create-recovery-codes"},{"title":"Get organization MFA settings","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/mfa-enforcement","href":"/api-reference/mfa/get-organization-mfa-settings"},{"title":"Enable organization MFA enforcement","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/mfa-enforcement/enable","href":"/api-reference/mfa/enable-organization-mfa-enforcement"},{"title":"Disable organization MFA enforcement","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/mfa-enforcement/disable","href":"/api-reference/mfa/disable-organization-mfa-enforcement"},{"title":"Send MFA reminders to organization members","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/mfa/remind","href":"/api-reference/mfa/send-mfa-reminders-to-organization-members"}]},{"group":"Orders","pages":[{"title":"Download an invoice.","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /orders/download","href":"/api-reference/orders/download-an-invoice"},{"title":"List orders","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/orders","href":"/api-reference/orders/list-orders"},{"title":"Get order","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/orders/{order_id}","href":"/api-reference/orders/get-order"},{"title":"Create confirmation credentials for for 3D-Secure","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/orders/{order_id}/authorize","href":"/api-reference/orders/create-confirmation-credentials-for-for-3d-secure"}]},{"group":"Organization Invitations","pages":[{"title":"List invitations to an organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/invitations","href":"/api-reference/organization-invitations/list-invitations-to-an-organization"},{"title":"Invite user to an organization by email","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/invitations","href":"/api-reference/organization-invitations/invite-user-to-an-organization-by-email"},{"title":"Cancel a pending invitation to an organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /organizations/{organization_id}/invitations/{invitation_id}","href":"/api-reference/organization-invitations/cancel-a-pending-invitation-to-an-organization"}]},{"group":"Organization Management","pages":[{"title":"Estimate total spend","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/estimate","href":"/api-reference/organization-management/estimate-total-spend"},{"title":"Get billing alert configuration","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/alerts/billing","href":"/api-reference/organization-management/get-billing-alert-configuration"},{"title":"Update billing alert configuration","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/alerts/billing","href":"/api-reference/organization-management/update-billing-alert-configuration"},{"title":"Get organization prepayment information","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/prepayment","href":"/api-reference/organization-management/get-organization-prepayment-information"},{"title":"List organization prepayment transactions","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/prepayment/transactions","href":"/api-reference/organization-management/list-organization-prepayment-transactions"}]},{"group":"Organization Members","pages":[{"title":"List organization members","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/members","href":"/api-reference/organization-members/list-organization-members"},{"title":"Create organization member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/members","href":"/api-reference/organization-members/create-organization-member"},{"title":"Get organization member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/members/{user_id}","href":"/api-reference/organization-members/get-organization-member"},{"title":"Delete organization member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /organizations/{organization_id}/members/{user_id}","href":"/api-reference/organization-members/delete-organization-member"},{"title":"Update organization member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/members/{user_id}","href":"/api-reference/organization-members/update-organization-member"}]},{"group":"Organization Projects","pages":[{"title":"List projects","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/projects","href":"/api-reference/organization-projects/list-projects"},{"title":"Create project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/projects","href":"/api-reference/organization-projects/create-project"},{"title":"Stream provisioning progress","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/projects/provisioning","href":"/api-reference/organization-projects/stream-provisioning-progress"},{"title":"Get project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/projects/{project_id}","href":"/api-reference/organization-projects/get-project"},{"title":"Delete project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /organizations/{organization_id}/projects/{project_id}","href":"/api-reference/organization-projects/delete-project"},{"title":"Update project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/projects/{project_id}","href":"/api-reference/organization-projects/update-project"},{"title":"Query project carbon emissions metrics","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/projects/{project_id}/metrics/carbon","href":"/api-reference/organization-projects/query-project-carbon-emissions-metrics"}]},{"group":"Organizations","pages":[{"title":"User organizations","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/organizations","href":"/api-reference/organizations/user-organizations"},{"title":"List organizations","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations","href":"/api-reference/organizations/list-organizations"},{"title":"Create organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations","href":"/api-reference/organizations/create-organization"},{"title":"Get organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}","href":"/api-reference/organizations/get-organization"},{"title":"Delete organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /organizations/{organization_id}","href":"/api-reference/organizations/delete-organization"},{"title":"Update organization","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}","href":"/api-reference/organizations/update-organization"}]},{"group":"PhoneNumber","pages":[{"title":"Verify phone number","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/phonenumber","href":"/api-reference/phonenumber/verify-phone-number"},{"title":"Confirm phone number","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/phonenumber/{sid}","href":"/api-reference/phonenumber/confirm-phone-number"}]},{"group":"Profiles","pages":[{"title":"Get address","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/address","href":"/api-reference/profiles/get-address"},{"title":"Update address","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/address","href":"/api-reference/profiles/update-address"},{"title":"Get profile","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/profile","href":"/api-reference/profiles/get-profile"},{"title":"Update profile","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/profile","href":"/api-reference/profiles/update-profile"}]},{"group":"Project","pages":[{"title":"Get a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}","href":"/api-reference/project/get-a-project"},{"title":"Get a project's capabilities","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/capabilities","href":"/api-reference/project/get-a-projects-capabilities"},{"title":"Clear project build cache","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/clear_build_cache","href":"/api-reference/project/clear-project-build-cache"},{"title":"Post projects maintenance redeploy","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/maintenance-redeploy","href":"/api-reference/project/post-projects-maintenance-redeploy"}]},{"group":"Project Activity","pages":[{"title":"Get project activity log","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/activities","href":"/api-reference/project-activity/get-project-activity-log"},{"title":"Get a project activity log entry","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/activities/{activityId}","href":"/api-reference/project-activity/get-a-project-activity-log-entry"},{"title":"Cancel a project activity","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/activities/{activityId}/cancel","href":"/api-reference/project-activity/cancel-a-project-activity"}]},{"group":"Project Invitations","pages":[{"title":"List invitations to a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{project_id}/invitations","href":"/api-reference/project-invitations/list-invitations-to-a-project"},{"title":"Invite user to a project by email","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{project_id}/invitations","href":"/api-reference/project-invitations/invite-user-to-a-project-by-email"},{"title":"Cancel a pending invitation to a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{project_id}/invitations/{invitation_id}","href":"/api-reference/project-invitations/cancel-a-pending-invitation-to-a-project"}]},{"group":"Project Settings","pages":[{"title":"Get list of project settings","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/settings","href":"/api-reference/project-settings/get-list-of-project-settings"},{"title":"Update a project setting","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/settings","href":"/api-reference/project-settings/update-a-project-setting"}]},{"group":"Project Variables","pages":[{"title":"Get list of project variables","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/variables","href":"/api-reference/project-variables/get-list-of-project-variables"},{"title":"Add a project variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/variables","href":"/api-reference/project-variables/add-a-project-variable"},{"title":"Get a project variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/variables/{projectVariableId}","href":"/api-reference/project-variables/get-a-project-variable"},{"title":"Delete a project variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/variables/{projectVariableId}","href":"/api-reference/project-variables/delete-a-project-variable"},{"title":"Update a project variable","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/variables/{projectVariableId}","href":"/api-reference/project-variables/update-a-project-variable"}]},{"group":"Projects","pages":[{"title":"List project history","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/projects/{project_id}/history","href":"/api-reference/projects/list-project-history"}]},{"group":"Records","pages":[{"title":"List plan records","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/records/plan","href":"/api-reference/records/list-plan-records"},{"title":"List usage records","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/records/usage","href":"/api-reference/records/list-usage-records"}]},{"group":"References","pages":[{"title":"List referenced users","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ref/users","href":"/api-reference/references/list-referenced-users"},{"title":"List referenced teams","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ref/teams","href":"/api-reference/references/list-referenced-teams"},{"title":"List referenced organizations","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ref/organizations","href":"/api-reference/references/list-referenced-organizations"},{"title":"List referenced projects","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ref/projects","href":"/api-reference/references/list-referenced-projects"},{"title":"List referenced regions","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ref/regions","href":"/api-reference/references/list-referenced-regions"}]},{"group":"Regions","pages":[{"title":"List regions","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /regions","href":"/api-reference/regions/list-regions"},{"title":"Get region","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /regions/{region_id}","href":"/api-reference/regions/get-region"}]},{"group":"Repository","pages":[{"title":"Get a blob object","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/blobs/{repositoryBlobId}","href":"/api-reference/repository/get-a-blob-object"},{"title":"Get a commit object","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/commits/{repositoryCommitId}","href":"/api-reference/repository/get-a-commit-object"},{"title":"Get list of repository refs","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/refs","href":"/api-reference/repository/get-list-of-repository-refs"},{"title":"Get a ref object","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/refs/{repositoryRefId}","href":"/api-reference/repository/get-a-ref-object"},{"title":"Get a tree object","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/git/trees/{repositoryTreeId}","href":"/api-reference/repository/get-a-tree-object"}]},{"group":"Resources","pages":[{"title":"Get resource metrics overview","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/resources/overview","href":"/api-reference/resources/get-resource-metrics-overview"},{"title":"Get resource metrics summary","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/resources/summary","href":"/api-reference/resources/get-resource-metrics-summary"},{"title":"Get resource metrics by service","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/observability/resources/service/{service}","href":"/api-reference/resources/get-resource-metrics-by-service"}]},{"group":"Routing","pages":[{"title":"Get list of routes","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/routes","href":"/api-reference/routing/get-list-of-routes"},{"title":"Get a route's info","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/routes/{routeId}","href":"/api-reference/routing/get-a-routes-info"}]},{"group":"Runtime Operations","pages":[{"title":"Execute a runtime operation","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/deployments/{deploymentId}/operations","href":"/api-reference/runtime-operations/execute-a-runtime-operation"}]},{"group":"Source Operations","pages":[{"title":"Trigger a source operation","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/source-operation","href":"/api-reference/source-operations/trigger-a-source-operation"},{"title":"List source operations","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/source-operations","href":"/api-reference/source-operations/list-source-operations"}]},{"group":"SSH Keys","pages":[{"title":"Get an SSH key","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /ssh_keys/{key_id}","href":"/api-reference/ssh-keys/get-an-ssh-key"},{"title":"Delete an SSH key","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /ssh_keys/{key_id}","href":"/api-reference/ssh-keys/delete-an-ssh-key"},{"title":"Add a new public SSH key to a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /ssh_keys","href":"/api-reference/ssh-keys/add-a-new-public-ssh-key-to-a-user"}]},{"group":"Subscriptions","pages":[{"title":"Checks if the user is able to update a project.","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /subscriptions/{subscriptionId}/can-update","href":"/api-reference/subscriptions/checks-if-the-user-is-able-to-update-a-project"},{"title":"Checks if the user can afford the requested resources.","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /subscriptions/{subscriptionId}/can-afford","href":"/api-reference/subscriptions/checks-if-the-user-can-afford-the-requested-resources"},{"title":"Estimate the price of a new subscription","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/estimate","href":"/api-reference/subscriptions/estimate-the-price-of-a-new-subscription"},{"title":"Checks if the user is able to create a new project.","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/can-create","href":"/api-reference/subscriptions/checks-if-the-user-is-able-to-create-a-new-project"},{"title":"Estimate the price of a subscription","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/{subscription_id}/estimate","href":"/api-reference/subscriptions/estimate-the-price-of-a-subscription"},{"title":"Get current usage for a subscription","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/{subscription_id}/current_usage","href":"/api-reference/subscriptions/get-current-usage-for-a-subscription"},{"title":"List addons for a subscription","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/{subscription_id}/addons","href":"/api-reference/subscriptions/list-addons-for-a-subscription"},{"title":"Get usage alerts","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage","href":"/api-reference/subscriptions/get-usage-alerts"},{"title":"Update usage alerts.","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage","href":"/api-reference/subscriptions/update-usage-alerts"},{"title":"List subscriptions","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions","href":"/api-reference/subscriptions/list-subscriptions"},{"title":"Create subscription","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/subscriptions","href":"/api-reference/subscriptions/create-subscription"},{"title":"Get subscription","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/subscriptions/{subscription_id}","href":"/api-reference/subscriptions/get-subscription"},{"title":"Delete subscription","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /organizations/{organization_id}/subscriptions/{subscription_id}","href":"/api-reference/subscriptions/delete-subscription"},{"title":"Update subscription","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /organizations/{organization_id}/subscriptions/{subscription_id}","href":"/api-reference/subscriptions/update-subscription"}]},{"group":"Support","pages":[{"title":"Create a new support ticket","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /tickets","href":"/api-reference/support/create-a-new-support-ticket"},{"title":"Update a ticket","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /tickets/{ticket_id}","href":"/api-reference/support/update-a-ticket"},{"title":"List support ticket priorities","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /tickets/priority","href":"/api-reference/support/list-support-ticket-priorities"},{"title":"List support ticket categories","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /tickets/category","href":"/api-reference/support/list-support-ticket-categories"}]},{"group":"System Information","pages":[{"title":"Get information about the Git server.","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/system","href":"/api-reference/system-information/get-information-about-the-git-server"},{"title":"Restart the Git server","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/system/restart","href":"/api-reference/system-information/restart-the-git-server"}]},{"group":"Task","pages":[{"title":"Get projects environments tasks","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/tasks","href":"/api-reference/task/get-projects-environments-tasks"},{"title":"Get projects environments tasks 1","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/environments/{environmentId}/tasks/{taskId}","href":"/api-reference/task/get-projects-environments-tasks-1"},{"title":"Post projects environments tasks run","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/environments/{environmentId}/tasks/{taskId}/run","href":"/api-reference/task/post-projects-environments-tasks-run"}]},{"group":"Team Access","pages":[{"title":"List team access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{project_id}/team-access","href":"/api-reference/team-access/list-team-access-for-a-project"},{"title":"Grant team access to a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{project_id}/team-access","href":"/api-reference/team-access/grant-team-access-to-a-project"},{"title":"Get team access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{project_id}/team-access/{team_id}","href":"/api-reference/team-access/get-team-access-for-a-project"},{"title":"Remove team access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{project_id}/team-access/{team_id}","href":"/api-reference/team-access/remove-team-access-for-a-project"},{"title":"List project access for a team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams/{team_id}/project-access","href":"/api-reference/team-access/list-project-access-for-a-team"},{"title":"Grant project access to a team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /teams/{team_id}/project-access","href":"/api-reference/team-access/grant-project-access-to-a-team"},{"title":"Get project access for a team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams/{team_id}/project-access/{project_id}","href":"/api-reference/team-access/get-project-access-for-a-team"},{"title":"Remove project access for a team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /teams/{team_id}/project-access/{project_id}","href":"/api-reference/team-access/remove-project-access-for-a-team"}]},{"group":"Teams","pages":[{"title":"List teams","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams","href":"/api-reference/teams/list-teams"},{"title":"Create team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /teams","href":"/api-reference/teams/create-team"},{"title":"Get team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams/{team_id}","href":"/api-reference/teams/get-team"},{"title":"Delete team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /teams/{team_id}","href":"/api-reference/teams/delete-team"},{"title":"Update team","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /teams/{team_id}","href":"/api-reference/teams/update-team"},{"title":"List team members","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams/{team_id}/members","href":"/api-reference/teams/list-team-members"},{"title":"Create team member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /teams/{team_id}/members","href":"/api-reference/teams/create-team-member"},{"title":"Get team member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /teams/{team_id}/members/{user_id}","href":"/api-reference/teams/get-team-member"},{"title":"Delete team member","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /teams/{team_id}/members/{user_id}","href":"/api-reference/teams/delete-team-member"},{"title":"User teams","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/teams","href":"/api-reference/teams/user-teams"}]},{"group":"Third-Party Integrations","pages":[{"title":"Get list of existing integrations for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/integrations","href":"/api-reference/third-party-integrations/get-list-of-existing-integrations-for-a-project"},{"title":"Integrate project with a third-party service","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{projectId}/integrations","href":"/api-reference/third-party-integrations/integrate-project-with-a-third-party-service"},{"title":"Get information about an existing third-party integration","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{projectId}/integrations/{integrationId}","href":"/api-reference/third-party-integrations/get-information-about-an-existing-third-party-integration"},{"title":"Delete an existing third-party integration","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{projectId}/integrations/{integrationId}","href":"/api-reference/third-party-integrations/delete-an-existing-third-party-integration"},{"title":"Update an existing third-party integration","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{projectId}/integrations/{integrationId}","href":"/api-reference/third-party-integrations/update-an-existing-third-party-integration"}]},{"group":"User Access","pages":[{"title":"List user access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{project_id}/user-access","href":"/api-reference/user-access/list-user-access-for-a-project"},{"title":"Grant user access to a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /projects/{project_id}/user-access","href":"/api-reference/user-access/grant-user-access-to-a-project"},{"title":"Get user access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /projects/{project_id}/user-access/{user_id}","href":"/api-reference/user-access/get-user-access-for-a-project"},{"title":"Remove user access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /projects/{project_id}/user-access/{user_id}","href":"/api-reference/user-access/remove-user-access-for-a-project"},{"title":"Update user access for a project","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /projects/{project_id}/user-access/{user_id}","href":"/api-reference/user-access/update-user-access-for-a-project"},{"title":"List project access for a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/project-access","href":"/api-reference/user-access/list-project-access-for-a-user"},{"title":"Grant project access to a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/project-access","href":"/api-reference/user-access/grant-project-access-to-a-user"},{"title":"Get project access for a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}/project-access/{project_id}","href":"/api-reference/user-access/get-project-access-for-a-user"},{"title":"Remove project access for a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /users/{user_id}/project-access/{project_id}","href":"/api-reference/user-access/remove-project-access-for-a-user"},{"title":"Update project access for a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /users/{user_id}/project-access/{project_id}","href":"/api-reference/user-access/update-project-access-for-a-user"}]},{"group":"User Profiles","pages":[{"title":"List user profiles","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /profiles","href":"/api-reference/user-profiles/list-user-profiles"},{"title":"Get a single user profile","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /profiles/{userId}","href":"/api-reference/user-profiles/get-a-single-user-profile"},{"title":"Update a user profile","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /profiles/{userId}","href":"/api-reference/user-profiles/update-a-user-profile"},{"title":"Get a user address","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /profiles/{userId}/address","href":"/api-reference/user-profiles/get-a-user-address"},{"title":"Update a user address","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /profiles/{userId}/address","href":"/api-reference/user-profiles/update-a-user-address"},{"title":"Create a user profile picture","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /profile/{uuid}/picture","href":"/api-reference/user-profiles/create-a-user-profile-picture"},{"title":"Delete a user profile picture","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec delete /profile/{uuid}/picture","href":"/api-reference/user-profiles/delete-a-user-profile-picture"}]},{"group":"Users","pages":[{"title":"Get current logged-in user info","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /me","href":"/api-reference/users/get-current-logged-in-user-info"},{"title":"Check if phone verification is required","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /me/phone","href":"/api-reference/users/check-if-phone-verification-is-required"},{"title":"Check if verification is required","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /me/verification","href":"/api-reference/users/check-if-verification-is-required"},{"title":"Get the current user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/me","href":"/api-reference/users/get-the-current-user"},{"title":"Get a user by email","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/email={email}","href":"/api-reference/users/get-a-user-by-email"},{"title":"Get a user by username","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/username={username}","href":"/api-reference/users/get-a-user-by-username"},{"title":"Get a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /users/{user_id}","href":"/api-reference/users/get-a-user"},{"title":"Update a user","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec patch /users/{user_id}","href":"/api-reference/users/update-a-user"},{"title":"Reset email address","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/emailaddress","href":"/api-reference/users/reset-email-address"},{"title":"Reset user password","deprecated":null,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /users/{user_id}/resetpassword","href":"/api-reference/users/reset-user-password"}]},{"group":"Vouchers","pages":[{"title":"List vouchers","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec get /organizations/{organization_id}/vouchers","href":"/api-reference/vouchers/list-vouchers"},{"title":"Apply voucher","deprecated":true,"version":null,"openapi":"https://meta.upsun.com/openapi-spec post /organizations/{organization_id}/vouchers/apply","href":"/api-reference/vouchers/apply-voucher"}]}]}]},{"anchor":"CLI","icon":"terminal","pages":[{"title":"Upsun Cloud CLI","sidebarTitle":"CLI Home","icon":"terminal","mode":"custom","href":"/cli/index"},{"group":"Getting started","icon":"rocket","pages":[{"title":"Install the Upsun Cloud CLI","sidebarTitle":"Install","href":"/cli/install"},{"title":"Use the Upsun Cloud CLI","sidebarTitle":"Use","href":"/cli/use"},{"title":"Authenticate the Upsun Cloud CLI using an API token","sidebarTitle":"API tokens","href":"/cli/api-tokens"},{"title":"Initialize a project","href":"/cli/init"}]},{"group":"Reference","icon":"book-open","pages":[{"title":"CLI Command reference","sidebarTitle":"Command reference","href":"/cli/reference"},{"title":"AI coding agents","sidebarTitle":"AI coding agents","href":"/cli/ai-coding-agents"}]}]},{"anchor":"Changelog","icon":"scroll-text","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"tab":"Blog","icon":"newspaper","pages":[{"title":"Blog","sidebarTitle":"Blog overview","icon":"newspaper","mode":"custom","href":"/posts"},{"group":"Articles","icon":"newspaper","pages":[{"title":"All Articles","sidebarTitle":"All","mode":"wide","href":"/posts/articles/index"},{"title":"Artificial Intelligence","sidebarTitle":"AI","mode":"wide","href":"/posts/articles/ai"},{"title":"How It Works","sidebarTitle":"How It Works","mode":"wide","href":"/posts/articles/how-it-works"},{"title":"How-Tos","sidebarTitle":"How-Tos","mode":"wide","href":"/posts/articles/how-tos"},{"title":"Insights","sidebarTitle":"Insights","mode":"wide","href":"/posts/articles/insights"},{"title":"Releases","sidebarTitle":"Releases","mode":"wide","href":"/posts/articles/releases"},{"title":"Hands-On","sidebarTitle":"Hands-On","mode":"wide","href":"/posts/articles/hands-on"}]}]},{"tab":"AI","icon":"sparkles","pages":[{"mode":"custom","title":"AI on Upsun","href":"/ai"},{"group":"MCP","root":{"title":"Overview","icon":"book-open","sidebarTitle":"Overview","tag":"New","href":"/ai/mcp/overview"},"pages":[{"title":"Upsun MCP on Cursor","sidebarTitle":"Cursor","href":"/ai/mcp/integrations/cursor"},{"title":"Upsun MCP on VSCode","sidebarTitle":"VSCode","href":"/ai/mcp/integrations/vscode"},{"title":"Upsun MCP on your Agent","sidebarTitle":"Other","href":"/ai/mcp/integrations/all"}]},{"group":"Onboarding","root":{"title":"Overview","icon":"book-open","sidebarTitle":"Overview","tag":"New","href":"/ai/onboarding/overview"},"pages":[{"title":"Setup","sidebarTitle":"Setup","href":"/ai/onboarding/setup"},{"title":"Best Practices","sidebarTitle":"Best Practices","href":"/ai/onboarding/best-practices"}]}]}]},"basePath":"","title":"Harnessing the power of Embeddings: a real-world example of a watch recommendation app using a vector database. - Upsun Developer","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-CE4cYsJE.js","lightbox-handle-r17bVUz3.js"]}