> ## Documentation Index
> Fetch the complete documentation index at: https://docs.structify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Set up Structify for development or production

## System Requirements

Before installing Structify, ensure your system meets these requirements:

* **Python**: 3.11 or higher
* **Node.js**: 18.x or higher
* **Rust**: 1.75 or higher
* **PostgreSQL**: 15+ with pgvector extension
* **Redis**: 7.0 or higher
* **Docker**: 20.10+ (optional, for containerized deployment)

## Development Setup

### Complete Installation

Clone and set up all components for local development:

<CodeGroup>
  ```bash macOS/Linux theme={null}
  # Clone the repository
  git clone https://github.com/StructifyAI/agent.git prospero
  cd prospero

  # Python setup
  cd prospero/python
  curl -LsSf https://astral.sh/uv/install.sh | sh
  uv sync

  # Rust setup
  cd ../rust
  cargo build

  # Frontend setup
  cd ../frontend
  npm install

  # Database setup
  docker run -d \
    --name postgres \
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_DB=prospero \
    -p 5432:5432 \
    pgvector/pgvector:pg15

  # Redis setup
  docker run -d \
    --name redis \
    -p 6379:6379 \
    redis:7-alpine
  ```

  ```bash Windows theme={null}
  # Clone the repository
  git clone https://github.com/StructifyAI/agent.git prospero
  cd prospero

  # Python setup
  cd prospero\python
  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  uv sync

  # Rust setup
  cd ..\rust
  cargo build

  # Frontend setup
  cd ..\frontend
  npm install

  # Use Docker Desktop for PostgreSQL and Redis
  ```
</CodeGroup>

### Environment Configuration

Create `.env` files for each component:

<Tabs>
  <Tab title="Frontend (.env.local)">
    ```bash prospero/frontend/.env.local theme={null}
    NEXT_PUBLIC_API_URL=http://localhost:8080
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    ```
  </Tab>

  <Tab title="Python (.env)">
    ```bash prospero/python/.env theme={null}
    DATABASE_URL=postgresql://postgres:postgres@localhost:5432/prospero
    REDIS_URL=redis://localhost:6379
    STRUCTIFY_API_KEY=your_api_key
    ```
  </Tab>

  <Tab title="Rust (.env)">
    ```bash prospero/rust/.env theme={null}
    DATABASE_URL=postgresql://postgres:postgres@localhost:5432/prospero
    REDIS_URL=redis://localhost:6379
    JWT_SECRET=your_jwt_secret
    ```
  </Tab>
</Tabs>

## Component-Specific Installation

### Python SDK Only

Install just the Python SDK for workflow development:

```bash theme={null}
pip install structify
# or using uv
uv pip install structify
```

### TypeScript SDK Only

Install the TypeScript SDK for frontend integration:

```bash npm theme={null}
npm install @structify/prospero
```

```bash yarn theme={null}
yarn add @structify/prospero
```

```bash pnpm theme={null}
pnpm add @structify/prospero
```

## Production Deployment

### Docker Deployment

Use the provided Docker Compose configuration:

```yaml docker-compose.yml theme={null}
version: '3.8'

services:
  api:
    build:
      context: ./prospero/rust
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    environment:
      DATABASE_URL: postgresql://postgres:postgres@db:5432/prospero
      REDIS_URL: redis://redis:6379
    depends_on:
      - db
      - redis

  frontend:
    build:
      context: ./prospero/frontend
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    environment:
      NEXT_PUBLIC_API_URL: http://api:8080

  db:
    image: pgvector/pgvector:pg15
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: prospero
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:
```

Start the services:

```bash theme={null}
docker-compose up -d
```

### Kubernetes Deployment

Deploy to Kubernetes using the provided manifests:

```bash theme={null}
kubectl apply -f prospero/infra/k8s/
```

## Verification

Verify your installation is working correctly:

<Tabs>
  <Tab title="API Server">
    ```bash theme={null}
    curl http://localhost:8080/health
    # Should return: {"status":"healthy"}
    ```
  </Tab>

  <Tab title="Frontend">
    Open [http://localhost:3000](http://localhost:3000) in your browser.
    You should see the Structify dashboard.
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from structify import Workflow
    print(Workflow.version())
    # Should print the version number
    ```
  </Tab>
</Tabs>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Database connection errors">
    Ensure PostgreSQL is running and the pgvector extension is installed:

    ```sql theme={null}
    CREATE EXTENSION IF NOT EXISTS vector;
    ```
  </Accordion>

  <Accordion title="Rust compilation errors">
    Update Rust to the latest stable version:

    ```bash theme={null}
    rustup update stable
    ```
  </Accordion>

  <Accordion title="Node.js version issues">
    Use nvm to install the correct Node.js version:

    ```bash theme={null}
    nvm install 18
    nvm use 18
    ```
  </Accordion>

  <Accordion title="Python dependency conflicts">
    Use uv for deterministic dependency resolution:

    ```bash theme={null}
    uv sync --refresh
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Build your first workflow
  </Card>

  <Card title="Development Setup" icon="code" href="/development/setup">
    Configure your development environment
  </Card>
</CardGroup>
