# Local Setup Guide

This guide will walk you through running the TravelAgent system on your local machine for development and testing.

## Prerequisites

* **Node.js**: Version v18.17 or newer (LTS recommended)
* **Package Manager**: npm (built into Node.js), pnpm, or yarn
* **Git**: For version control

## Step 1: Clone the Repository

First, clone the project from GitHub to your computer and navigate to the `travelagent` subdirectory (which is the root of the Next.js application):

```bash
git clone <your-repository-url>
cd TravelAgent/travelagent
```

## Step 2: Install Dependencies

We use npm for package management. Run the following command in the `travelagent` directory:

```bash
npm install
```

This will install Next.js, Tailwind CSS, shadcn/ui, Supabase Client, Gemini SDK, and all other necessary dependencies.

## Step 3: Environment Variables

The project requires connections to Supabase (for database and authentication) and Google Gemini (for the AI model). Copy the example file to create your own local environment variable file:

```bash
cp .env.example .env.local
```

Open `.env.local` and fill in your API keys. For detailed explanations of each field, please refer to the [Environment Variables](/travelagent/docs/en/deployment/environment-variables.md) section.

## Step 4: Start the Development Server

Once configured, you can start the local development server:

```bash
npm run dev
```

If successful, you will see a message like this:

```
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
```

Now open your browser and navigate to `http://localhost:3000` to start using the system!

## Step 5: Database Setup (First Time Only)

If you are connecting to a brand new Supabase project, make sure you execute all the `.sql` files located in `supabase/migrations/` using the Supabase SQL Editor. This will create the correct tables and Row Level Security (RLS) policies. For detailed database structure, see [Supabase Database & Auth](/travelagent/docs/en/architecture/supabase.md).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://letztek.gitbook.io/travelagent/docs/en/deployment/local-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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