Qubit is an AI-powered conversational search engine application. It answers user queries using a powerful mixture of large language models for reasoning and live web search for gathering the latest information.
- Conversational Search: Ask questions and get well-reasoned, source-backed answers.
- Real-time Web Search: Integrated with Tavily for fetching up-to-date web context.
- LLM Integration: Powered by Groq SDK for blazing-fast inference.
- Project Management: Organize your conversations and tasks into spaces called "Projects".
- Source Tracking: Easily consult the list of sources/URLs the AI referenced to build its answers.
- Conversation Sharing: Share specific conversations or chats with others via a public or read-only view.
- Authentication: Secure user authentication managed with Supabase.
- Framework: React 19 + React Router v7
- Bundler & Runtime: Bun
- Styling: Tailwind CSS v4
- UI Components: Shadcn UI (Radix UI primitives + Lucide React icons)
- Data Rendering: React Markdown with remark-gfm for formatting code blocks, tables, etc.
- State Management & Data Fetching: Axios, React state
- Framework: Express.js (TypeScript) + Express Rate Limit
- Runtime: Bun / Node.js
- Database ORM: Prisma (w/
@prisma/adapter-pgand@prisma/extension-accelerate) - Database: PostgreSQL
- Validation: Zod
- External APIs:
Qubit/
├── backend/ # Express.js REST API
│ ├── prisma/ # Prisma schema & migrations
│ ├── middlewares/ # Express route middlewares
│ ├── utils/ # Validation & utilities
│ ├── index.ts # Entry point
│ ├── prompt.ts # Contains system prompts & LLM instructions
│ └── package.json
└── frontend/ # React SPA
├── src/ # React source code
│ ├── components/ # Reusable UI components (Dashboard, Sidebar, etc.)
│ ├── pages/ # View components (Auth, Dashboard, SharedConversation)
│ ├── lib/ # Client utilities
│ └── App.tsx # App Router
├── bunfig.toml # Bun configuration
├── build.ts # Custom Bun build script
└── package.json
- Bun installed on your machine
- A PostgreSQL database
- API Keys for Supabase, Groq, and Tavily.
git clone <your-repo-url>
cd perplexityNavigate to the backend directory and install dependencies using Bun:
cd backend
bun installConfigure your .env file in the backend folder:
# Example environment variables needed
DATABASE_URL="postgres://user:pass@host:port/db"
GROQ_API_KEY="your-groq-api-key"
TAVILY_API_KEY="your-tavily-api-key"
SUPABASE_URL="your-supabase-url"
SUPABASE_ANON_KEY="your-supabase-anon-key"
PORT=8000Run database migrations:
bunx prisma generate
bunx prisma migrate devStart the backend server:
bun run index.tsOpen a new terminal window, navigate to the frontend directory, and install dependencies:
cd frontend
bun installConfigure your .env file in the frontend folder:
BUN_PUBLIC_SUPABASE_URL="your-supabase-url"
BUN_PUBLIC_SUPABASE_PUBLISHABLE_KEY="your-supabase-publishable-key"
VITE_API_BASE_URL="http://localhost:8000"Configure your config.ts file in the frontend folder:
export const BACKEND_URL ="http://localhost:3001"
Start the React development server:
bun run devNavigate to http://localhost:3000 (or the port specified by Bun) in your browser.