Add web server with REST API and React frontend#172
Open
Add web server with REST API and React frontend#172
Conversation
- New `src/web.ts`: Bun HTTP server serving REST API + static frontend - Search endpoints: /api/search (BM25), /api/vsearch (vector), /api/query (hybrid) - Document retrieval: /api/doc/:path (supports docid lookup) - Collection browser: /api/ls, /api/collections CRUD - Context management: /api/contexts CRUD - Status dashboard: /api/status with health info - SPA fallback for frontend routing - New `frontend/`: Vite + React 19 + TypeScript + Tailwind v4 - shadcn/ui component library (Button, Card, Badge, Tabs, Input, Dialog, etc.) - SearchPage: 3-tier search (Keyword/Semantic/Deep) with TanStack Query - DocumentPage: Markdown rendering with syntax highlighting - BrowsePage: Collection tree with context management - StatusPage: Index health dashboard - API client with typed fetch wrappers - CLI: `qmd web [--port N]` starts server on localhost:3100 https://claude.ai/code/session_01BGAQy6TdWrvieh7MR6WaF5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a complete web server implementation with a REST API backend and React-based frontend UI for QMD. The web server provides HTTP endpoints for searching, browsing documents, managing collections, and viewing index status, while serving a modern single-page application built with React, TypeScript, and Tailwind CSS.
Key Changes
Backend (src/web.ts)
/api/search(FTS),/api/vsearch(vector),/api/query(hybrid)/api/doc/:pathwith optional line range parameters/api/lsfor browsing collections and filesGET,DELETE,PATCH)/api/statusfor index health and statisticsfrontend/dist/with proper MIME type handlingFrontend (React + TypeScript)
SearchPage: Multi-tier search (keyword, semantic, deep/hybrid)BrowsePage: Collection and file browsing with context managementDocumentPage: Full document viewing with syntax highlightingStatusPage: Index health and statistics dashboardSearchBar: Search interface with tier selectionResultCard: Unified result display for all search typesLayout: Navigation sidebar with routinglib/api.ts) with TypeScript types matching backend responsesConfiguration
CLI Integration
qmd.tshelp text to document newqmd webcommandNotable Implementation Details
store.tsandcollections.tsfunctions*) and collection-specific contextshttps://claude.ai/code/session_01BGAQy6TdWrvieh7MR6WaF5