File size: 2,286 Bytes
21cac8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Agent Deployment Guide: AUXteam/UX-agent

This file informs future agents about deployment specifics and best practices for the UX Analyst AI app on Hugging Face Spaces.

## 1. Deployment Configuration

### Target Space
- **Profile:** `AUXteam`  
- **Space:** `UX-agent`  
- **Full Identifier:** `AUXteam/UX-agent`  
- **Frontend Port:** `7860` (mandatory for all Hugging Face Spaces)

### Deployment Method
- **SDK:** `docker`

### HF Token
- The HF Token is provided in the environment.
- All monitoring and log‑streaming commands rely on this token.

### Required Files
- `Dockerfile`
- `README.md` with Hugging Face YAML frontmatter:
  ```yaml
  ---
  title: UX Analyst AI
  sdk: docker
  app_port: 7860
  ---
  ```
- `.hfignore` to exclude unnecessary files
- `Agent.md` (this file)

---

## 2. API Exposure and Documentation

### Mandatory Endpoints
Every deployment **must** expose:

- **`/health`**  
  - Returns HTTP 200 when the app is ready.  
  - Required for Hugging Face to transition the Space from *starting**running*.

- **`/api-docs`**  
  - Documents **all** available API endpoints.  
  - Reachable at: `https://AUXteam-UX-agent.hf.space/api-docs`

### Functional Endpoints

#### /api/analyze
- **Method:** POST
- **Purpose:** Start a new UX analysis for a given URL.
- **Request Example:**
  ```json
  {
    "url": "https://example.com",
    "options": {
      "viewports": ["desktop", "mobile"],
      "includeAccessibility": true,
      "analysisType": "comprehensive"
    }
  }
  ```
- **Response Example:**
  ```json
  {
    "id": "analysis-uuid",
    "status": "pending",
    "url": "https://example.com"
  }
  ```

#### /api/analyze/:id
- **Method:** GET
- **Purpose:** Get the status and results of a specific analysis.

#### /api/health
- **Method:** GET
- **Purpose:** Detailed health status of all internal services.

---

## 3. Deployment Workflow

### Standard Deployment Command
```bash
hf upload AUXteam/UX-agent . --repo-type=space --delete "*"
```

### Monitoring Logs
**Build Logs:**
```bash
curl -N -H "Authorization: Bearer $HF_TOKEN" "https://huggingface.co/api/spaces/AUXteam/UX-agent/logs/build"
```

**Run Logs:**
```bash
curl -N -H "Authorization: Bearer $HF_TOKEN" "https://huggingface.co/api/spaces/AUXteam/UX-agent/logs/run"
```