Overview
Strata (internally "AI Browzer") is a real-time AI search application: users ask a question, the backend crawls the web live for relevant sources, and the answer streams back with citations attached.
Core Features
- OAuth Authentication: Google and GitHub sign-in via the Supabase Auth client, with a custom JWT verification middleware protecting every backend endpoint.
- Live Web Search: Real-time search indexing and retrieval through the Tavily API for up-to-date context on every query.
- Streamed AI Synthesis: Answers stream chunk-by-chunk from OpenAI's
gpt-4o-minivia Server-Sent Events, with cited sources appended at the end of the stream inside a structured<SOURCES>block. - Dashboard Workspace: A secured layout showing the authenticated user's profile and session state.
Architecture
The stack runs entirely on Bun as the execution engine for both frontend and backend. Auth flows through Supabase (2-way sync triggers keep the Postgres User table aligned with Supabase's own auth.users), while Express streams the search-and-synthesize pipeline:
- Frontend sends the query to
POST /strata_ask. - Backend fetches live snippets and URLs from Tavily.
- Backend calls OpenAI with the query + search context,
stream: true. - Each text chunk is written directly to the response as it arrives.
- Once generation completes, the backend appends the source URLs and closes the stream.
The relational schema (Prisma on PostgreSQL) models User → Conversation → Message so full chat history can be persisted and later replayed as context for follow-up questions — the next planned feature.
Planned Features
- Persisted database chat history and multi-turn, context-aware conversations
- Per-user daily query credit limits
- Stripe-based credit top-ups