# 4. Setup and Installation

This section provides a step-by-step guide to setting up and installing the Ferdy Framework for different environments. It includes prerequisites, installation methods, and configuration details.

### **4.1 Prerequisites**

Before setting up the Ferdy Framework, ensure the following:

1. **System Requirements:**
   * Operating System: Windows, macOS, or Linux.
   * Hardware: Minimum 8 GB RAM, recommended 16 GB for development.
   * Disk Space: At least 20 GB free space.
2. **Dependencies:**
   * Programming Languages: Python 3.9+ and Node.js 16+.
   * Package Managers: pip (Python), npm/yarn (JavaScript).
   * Docker (optional for containerized deployment).
   * Database: PostgreSQL (recommended) or MongoDB.
3. **API Access:**
   * Ferdy API keys (available via the developer portal).
   * OAuth client credentials for integrations with third-party services (Google, Microsoft, etc.).
4. **Cloud Access:**
   * Cloud account credentials (AWS, GCP, or Azure) for deploying Ferdy services.

***

### **4.2 Installation**

#### **4.2.1  Option 1: Local Installation for Development**

1. **Clone the Repository:**\
   `git clone https://github.com/ferdy-framework/ferdy.git`<br>
2. **Install Dependencies:**
   1. Backend
      1. `cd backend`
      2. `pip install -r requirements.txt`
   2. Frontend
      1. `cd frontend`
      2. `npm install`<br>
3. **Environment Configuration:**
   1. Create a .env file in the backend directory with the following:

      `DATABASE_URL=postgres://user:password@localhost:5432/ferdy`

      `API_KEY=your-ferdy-api-key`

      `SECRET_KEY=your-secret-key`
4. **Database Setup:**

   `python manage.py migrate`
5. **Run the Development Server:**
   1. Backend:\
      `python manage.py runserver`
   2. Frontend:\
      `npm start`
6. **Access the Application:**
   * Open your browser and navigate to <http://localhost:3000>.

***

#### **4.2.2  Option 2: Dockerized Deployment**

1. **Install Docker:** Ensure Docker is installed and running on your system.

   Use Ferdy’s Docker Compose File:\
   `docker-compose up -d`
2. **Verify Deployment:** Check running containers:\
   `docker ps`
3. **Access the Application:**
   * Navigate to <http://localhost:8080> for the Ferdy Dashboard.

***

#### **4.2.3  Option 3: Cloud Deployment**

1. **Select a Cloud Provider:** Choose a supported provider: AWS, GCP, or Azure.
2. **Use Terraform for Infrastructure Setup:**

**Initialize Terraform:**\
`terraform init`

**Apply Ferdy deployment configuration:**\
`terraform apply`

3. **Deploy Ferdy Framework:**
   * Use CI/CD pipelines (e.g., GitHub Actions, Jenkins) for deployment.
   * Push Ferdy Docker containers to your cloud registry and deploy to Kubernetes.

***

### **4.3 Configuration**

#### **4.3.1  Application Configuration**

Modify the config.yaml file to customize:

**Default Models:**\
models:

&#x20; `default: "gpt-4"`

&#x20; `fallback: "gpt-3.5-turbo"`<br>

**4.3.2  Voice Settings:**\
voice:

&#x20; `recognition: "Google Speech-to-Text"`

&#x20; `synthesis: "Amazon Polly"`

**4.3.3  API Keys**

Store API keys in a secure environment variable or secret manager:

`export FERDY_API_KEY=your-api-key`

**4.3.4  Authentication**

Enable OAuth for user authentication:

Configure providers (Google, Microsoft) in auth.yaml:\
\
`oauth:`

&#x20; `google:`

&#x20;   `client_id: "your-google-client-id"`

&#x20;   `client_secret: "your-google-client-secret"`

&#x20; `microsoft:`

&#x20;   `client_id: "your-microsoft-client-id"`

&#x20;   `client_secret: "your-microsoft-client-secret"`

***

### **4.4 Verification**

After installation, verify the setup:

1. **API Health Check:**

Use the Ferdy health check endpoint:\
`curl http://localhost:8000/api/health`

Expected Response (json):\
`{"status": "healthy"}`

2. **Database Connectivity:**

Ensure the database is reachable and populated:\
`python manage.py dbcheck`

3. F**rontend Accessibility:**
   * Open the browser and navigate to the frontend.


---

# 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://feeda.gitbook.io/ferdy-framework/4.-setup-and-installation.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.
