Introduction

tsproxy

A production-ready search proxy for Typesense (opens in a new tab) with caching, rate limiting, an ingestion queue, and headless React components.

Why tsproxy?

Typesense is a fast, typo-tolerant search engine. But exposing it directly to frontend clients creates challenges:

  • API key exposure — Typesense search-only keys still reveal your cluster details
  • No caching layer — every keystroke hits your search cluster
  • No rate limiting — bad actors can overwhelm your search backend
  • No ingestion queue — bulk writes can spike resource usage
  • InstantSearch compatibility — Typesense needs a translation layer for Algolia's InstantSearch widgets

tsproxy solves all of these with a single proxy server.

Architecture

Frontend (React)          tsproxy API           Typesense
┌─────────────────┐     ┌──────────────────┐    ┌──────────┐
│ @tsproxy/react  │────▶│ HonoJS Proxy     │───▶│ Typesense│
│ @tsproxy/js     │     │ - LRU Cache      │    │ Server   │
│ InstantSearch   │◀────│ - Rate Limiting  │◀───│          │
└─────────────────┘     │ - BullMQ Queue   │    └──────────┘
                        │ - Algolia ↔ TS   │
                        │   Transform      │
                        └──────────────────┘

Packages

PackageDescription
@tsproxy/apiHonoJS proxy server with search, ingest, caching, rate limiting
@tsproxy/jsInstantSearch-compatible searchClient adapter for the proxy
@tsproxy/reactHeadless React components with BaseUI-style overrides

Quick Start

# Clone and install
git clone https://github.com/akshitkrnagpal/tsproxy.git
cd tsproxy
pnpm install
 
# Start Typesense + Redis
docker compose up -d
 
# Seed sample data
pnpm seed
 
# Start the proxy and demo
pnpm dev

Then open http://localhost:3001/search (opens in a new tab).