User Interface
OpenRAG ships a modern authenticated chat interface built with Next.js and ShadcnUI components. It runs as a Docker container on port 3000.Overview
Access
Authentication
OpenRAG uses JWT-based authentication backed by PostgreSQL. Credentials are verified against theusers table — not hardcoded anywhere.
Default admin account is seeded automatically on first startup:
admin / admin.Change this password immediately from the Users tab in the Admin panel.
How it works
POST /auth/loginvalidates credentials against bcrypt-hashed passwords in PostgreSQL- A signed JWT token (HS256, 24h expiry) is returned and stored in
localStorage - All admin API calls include
Authorization: Bearer <token> - The
/auth/meendpoint validates the token and returns the current user’s role
Running the Interface
The frontend is deployed as a Docker container:Architecture
Key Features
Authentication
Login page with role-based access. Admin users can access the admin panel; regular users are limited to the chat interface.
Markdown Rendering
LLM responses are rendered as full markdown — headers, bold, lists, code blocks.
Source Citations
Each response includes the source documents and their relevance scores.
Loading State
Shows a “Generating response…” spinner while the LLM generates (typically 60-90s on CPU).
API Request
Each query sends the following payload to the API:use_llm: true routes through the full RAG pipeline (vector search → context augmentation → LLM generation). Setting it to false returns only retrieved chunks without LLM synthesis.
File Structure
Dependencies
Environment Variables
Production Build (Docker)
deps → builder → runner) and Next.js standalone output mode for a minimal production image.
Admin Panel
The admin panel athttp://localhost:3000/admin is accessible only to users with the admin role. It has 8 tabs, each dedicated to a different aspect of the system.
Dashboard
The landing tab. Pulls live data fromGET /stats and displays:
- Primary stats row: total documents (e.g. 534), total vectors (e.g. 1909 across all Qdrant collections), total chunks, total queries
- Secondary stats row: average query time (ms), queries in the last 24h / 7d, number of collections, number of users
- Document status breakdown: a color-coded progress bar showing processed / processing / failed counts at a glance
- Qdrant collections: one card per collection with vector count, indexed count, and status badge
- Service health grid: live reachability check for Orchestrator, Qdrant, and MinIO with green/red indicators
Collections
QueriesGET /collections and shows one card per Qdrant collection with:
- Collection name and status badge (
green/ degraded) - Vectors count (actual Qdrant points, not a cached DB value)
- Indexed vectors count
- Segments count
- Vector size (e.g. 768 for multilingual model)
- Creation date
Documents
Paginated list of all documents fromGET /documents (50 per page):
- Search by filename (client-side filter)
- Status filter dropdown (processed / processing / failed / uploaded)
- Per-document columns: filename, status (color-coded), collection, chunk count
- Delete button per document (removes from DB + Qdrant vectors)
- Pagination controls with total count display
Upload
File upload form:- Click-to-select file area (PDF, DOCX, TXT, MD)
- Collection name input (default:
default) - Submit →
POST /documents/uploadmultipart form - Success banner showing the assigned
document_id - Processing happens asynchronously in the Orchestrator — check the Documents tab for status
History
Paginated query log fromGET /history (admin JWT required, 20 per page):
- Total query count
- Per-query row: question text, timestamp (relative e.g. “3h ago”), execution time, user ID, number of sources
- Expandable row: click to reveal the full LLM response and the list of source documents with relevance scores
- Pagination controls
Monitoring
Links and embeds for the observability stack:
An embedded Grafana iframe shows the live dashboard directly in the page. Quick-links to common Prometheus query graphs (request rate, P95 latency, Qdrant collections) are also available.
Ollama
Pulls data from the Ollama HTTP API (port 11434):- Ollama version
- Running models: models currently loaded in RAM (shown with animated dot)
- Installed models: all pulled models with disk size and last-modified date
Users
Full user management backed byGET/POST/DELETE/PATCH /auth/users (admin JWT required):
- User list: username, role badge (
admin/user), creation date - Create user: inline form — username, password (visibility toggle), role selector (
useroradmin) - Delete user: one-click delete with confirmation (cannot delete your own account)
- Change password: expandable inline form per user — minimum 4 characters
Authorization: Bearer <token> automatically.
