Skip to main content
CodeSenseiSearch

Documentation

How the stack is put together, how to call the API, and how to run it yourself. The source of truth is the repo — these pages are summaries with runnable examples.

What's running behind this site

Frontend
Next.js 16 (App Router) on Vercel

Server components where possible; client components only for the search bar, results, and filter sheet.

API
NestJS on Vercel serverless functions

Express handler bootstraps Nest once per cold start and reuses the app across warm invocations. Swagger at /api/docs.

Database
Supabase Postgres with pgvector

Pooled connection (pgbouncer, port 6543) for runtime queries; direct (5432) for Prisma migrations. HNSW-ready vector column.

Embeddings
Gemini gemini-embedding-001

768 dimensions via outputDimensionality. RETRIEVAL_DOCUMENT at ingest, RETRIEVAL_QUERY at search.

Ingestion workers
BullMQ on Upstash Redis

Workers skipped in serverless mode; ingestion runs from a laptop or a Vercel cron POST against a trigger endpoint.

Observability
pino structured logs

One JSON line per request. Health endpoint reports DB, Redis, and Gemini reachability separately.

Run it locally

git clone https://github.com/Shailesh93602/CodeSenseiSearch.git
cd CodeSenseiSearch
docker compose up -d            # Postgres (pgvector) + Redis
pnpm install
pnpm --filter api db:migrate
pnpm dev                        # web on :3000, api on :3001

Full setup including the Gemini API key and other env vars is in the repo's README.