Component

UX Labs — Frontend & API

The main Next.js application that serves the web UI, public REST API, MCP server for AI assistants, and the real-time SSE event bridge. Everything starts here.

tinyfish-io/ux-labs

Tech Stack

FrameworkNext.js 16 (App Router)
UIReact 19 + shadcn/ui
AuthClerk
DBMySQL + Drizzle ORM
QueueRedis Pub/Sub + SQS
AnalyticsPostHog + Sentry

Entry Points

Four ways into the platform — all converge through UX Labs into the same job pipeline.

🖥Web UI

Playground · Dashboard

REST API

Sync / Async / SSE / Batch

🤖MCP Server

OAuth 2.1 · JSON-RPC

🐍Python SDK

httpx client

UX Labs (Next.js 16)

Clerk Auth → Zod Validation → MySQL → SQS Dispatch → Redis Pub/Sub

→ SQS → Task Worker

Key Responsibilities

Web UI

Dashboard, playground, projects, batches, and job detail pages. Users submit URLs + goals and watch the AI browser in real-time via an embedded iframe.

REST API v1

Public API with X-API-Key auth. Supports sync, async, SSE streaming, and batch run modes. Auto-generated OpenAPI spec at /v1/openapi.json.

MCP Server

JSON-RPC 2.0 over HTTP at /mcp, authenticated via OAuth 2.1 (Clerk as provider). Lets AI assistants invoke Mino programmatically.

SSE Event Bridge

Subscribes to Redis Pub/Sub and streams run events to clients. Falls back to 2-second DB polling if SSE connection stalls > 3s.

API Endpoints

MethodEndpointPurpose
POST/v1/automation/runSynchronous run — blocks until complete
POST/v1/automation/run-asyncAsync run — returns runId immediately
POST/v1/automation/run-sseSSE streaming run
POST/v1/automation/run-batchBatch create (up to 100 runs)
GET/v1/runsList runs with cursor pagination
GET/v1/runs/:idGet single run details
POST/v1/runs/:id/cancelCancel a running job

Real-Time Streaming

Three-layer SSE pipeline delivers live browser events to clients:

EVATask Worker
SSE over HTTPRaw agent events (tool calls, screenshots, completion)
Task WorkerRedis
PUBLISHNormalized events on run-events:{runId} channel
RedisClient
SSE via UX LabsCONNECTED → EVENT* → COMPLETE stream

Code Pointers

frontend/app/(pages)Authenticated UI pages
frontend/app/v1Public REST API v1 routes
frontend/app/mcpMCP server (JSON-RPC)
frontend/app/actionsServer Actions (mutations)
frontend/app/dbDrizzle schema + CRUD
frontend/app/lib/sseSSE plumbing (Redis → HTTP)
frontend/app/hooksReact hooks (useRunStream, useBatchSSE)