Tech Stack
OneGlance is built with modern, production-ready technologies chosen for type safety, developer experience, and scalability.Overview
| Category | Technology | Version | Why Chosen |
|---|---|---|---|
| Monorepo | Turborepo | 2.3.3 | Fast incremental builds with caching |
| Package Manager | pnpm | 10.16.0 | Disk-efficient, strict dependencies |
| Runtime | Node.js | 20+ | Required for Next.js 15 |
| Language | TypeScript | 5.9.3 | Type safety across entire stack |
| Web Framework | Next.js | 15.5.5 | App Router, RSC, built-in optimizations |
| API Layer | tRPC | 11.0.0 | End-to-end type safety |
| Authentication | Better Auth | 1.3.9 | Modern, lightweight auth |
| Job Queue | BullMQ | 5.66.4 | Robust Redis-backed queue |
| Browser Automation | Playwright | 1.57.0 | Reliable headless browser control |
| Database (OLTP) | PostgreSQL | - | Transactional data |
| Database (OLAP) | ClickHouse | - | Analytical time-series data |
| ORM | Drizzle ORM | 0.41.0 | Type-safe SQL with migrations |
| Styling | Tailwind CSS | 4.0.15 | Utility-first CSS |
| UI Components | Radix UI | - | Accessible primitives |
| Validation | Zod | 3.24.2 | Runtime type validation |
| State Management | React Query | 5.69.0 | Server state management |
| Linting | Biome | 1.9.4 | Fast linter and formatter |
Core Technologies
Node.js 20+
Version: 20 or higher (frompackage.json:32-34)
Why Chosen:
- Required for Next.js 15
- Native fetch API support
- Performance improvements over Node 18
- Long-term support (LTS)
package.json):
TypeScript 5.9.3
Version:5.9.3 (from package.json:29)
Why Chosen:
- Type safety across entire codebase
- Better refactoring and IDE support
- Catch errors at compile time
- Shared types between frontend and backend
tsconfig.json
Strict Mode Enabled:
pnpm 10.16.0
Version:10.16.0 (from package.json:31)
Why Chosen:
- 3x faster than npm for monorepo installations
- Disk efficient: Uses content-addressable storage
- Strict: No phantom dependencies
- Native workspace support: Better than npm workspaces
- Rejected due to slower installation and phantom dependency issues
pnpm-workspace.yaml):
Turborepo 2.3.3
Version:2.3.3 (from package.json:28)
Why Chosen:
- Incremental builds (only rebuilds changed packages)
- Remote caching support
- Dependency-aware task execution
- Parallel task execution
turbo.json):
Frontend Stack
Next.js 15.5.5
Version:15.5.5 (from apps/web/package.json:38)
Why Chosen:
- App Router: Modern file-based routing with layouts
- React Server Components: Reduced client bundle size
- Streaming SSR: Faster initial page loads
- Built-in optimizations: Image optimization, font optimization
- API Routes: Collocated with frontend code
- App Router (
app/directory) - Server Actions (form submissions)
- Route Groups (
(auth)/for authenticated routes) - Layouts and Templates
- Loading states
- Error boundaries
apps/web/next.config.js):
React 19.0.0
Version:19.0.0 (from apps/web/package.json:41)
Why Chosen:
- Required for Next.js 15
- Server Components support
- Improved Suspense handling
- Better TypeScript support
- Server Components (default in App Router)
- Client Components (
"use client") - Suspense boundaries
- React Query integration
Tailwind CSS 4.0.15
Version:4.0.15 (from apps/web/package.json:58)
Why Chosen:
- Utility-first CSS for rapid development
- Small bundle size (unused classes purged)
- Design system consistency
- Great DX with autocomplete
@tailwindcss/typography(0.5.19) - Prose stylingtw-animate-css(1.3.8) - Animation utilities
apps/web/tailwind.config.js):
Radix UI
Packages Used (frompackages/ui/package.json:22-32):
@radix-ui/react-dialog- Modals and dialogs@radix-ui/react-dropdown-menu- Dropdown menus@radix-ui/react-select- Custom select inputs@radix-ui/react-checkbox- Checkboxes@radix-ui/react-label- Form labels@radix-ui/react-tabs- Tab navigation@radix-ui/react-tooltip- Tooltips@radix-ui/react-popover- Popovers@radix-ui/react-scroll-area- Custom scrollbars@radix-ui/react-separator- Dividers
- Unstyled, accessible primitives
- Full keyboard navigation
- ARIA attributes included
- Composable and customizable
Lucide React 0.544.0
Version:0.544.0 (from apps/web/package.json:37)
Why Chosen:
- Large icon library (1000+ icons)
- Tree-shakeable (only imports used icons)
- Consistent design
- TypeScript support
API Layer
tRPC 11.0.0
Version:11.0.0 (from apps/web/package.json:31-33)
Why Chosen:
- End-to-end type safety: Frontend knows exact API types
- No code generation: Types inferred automatically
- Great DX: Autocomplete and type checking
- No schema files: Types derived from implementation
- Rejected due to manual type synchronization and code generation overhead
apps/web/src/server/api/trpc.ts:21-37):
apps/web/src/server/api/root.ts):
agent- Job submission and progressanalysis- Query analysis resultsprompt- Prompt CRUD operationsworkspace- Workspace managementinternal- Cron and internal endpoints
SuperJSON 2.2.1
Version:2.2.1 (from apps/web/package.json:45)
Why Chosen:
- Serializes
Date,Map,Set,BigInt,undefined - Required for tRPC to pass complex types
- Zero configuration with tRPC
Authentication
Better Auth 1.3.9
Version:1.3.9 (from apps/web/package.json:34)
Why Chosen:
- Modern, lightweight alternative to NextAuth.js
- Better TypeScript support
- Framework-agnostic
- Simpler session management
- Built-in social providers
- Better Auth chosen for simpler setup and better DX
apps/web/src/lib/auth/auth.ts):
- HTTP-only cookies
- Session stored in PostgreSQL
- Middleware checks for protected routes
State Management
TanStack Query (React Query) 5.69.0
Version:5.69.0 (from apps/web/package.json:30)
Why Chosen:
- Server state management (not local state)
- Automatic caching and refetching
- Optimistic updates
- Integrated with tRPC
useQueryfor data fetchinguseMutationfor mutations- Query invalidation
- Background refetching
Backend Stack
BullMQ 5.66.4
Version:5.66.4 (from apps/agent/package.json:18)
Why Chosen:
- Robust Redis-backed job queue
- Job retry with exponential backoff
- Job progress tracking
- Priority queues
- Graceful shutdown support
- Event-based job monitoring
- BullMQ chosen for better Redis support and active maintenance
packages/services/src/agent/queue.ts:17-33):
apps/agent/src/worker.ts:26-35):
- Separate queue for each AI provider (ChatGPT, Claude, etc.)
- Prevents one provider’s failures from blocking others
- Sequential processing per provider (concurrency: 1)
Playwright 1.57.0
Version:1.57.0 (from apps/agent/package.json:20)
Why Chosen:
- Modern browser automation API
- Headless execution
- Built-in waiting and retry
- Cross-browser support
- Auto-wait for elements
- Playwright chosen for better API and active maintenance
apps/agent/src/core/createAgent.ts):
apps/agent/src/core/providers/chatgpt/- ChatGPT automationapps/agent/src/core/providers/claude/- Claude automationapps/agent/src/core/providers/gemini/- Gemini automationapps/agent/src/core/providers/perplexity/- Perplexity automationapps/agent/src/core/providers/ai-overview/- AI Overview scraping
Redis (via ioredis 5.9.2)
Version:5.9.2 (from packages/services/package.json:26)
Why Chosen:
- Used by BullMQ for job queue storage
- Fast in-memory data store
- Pub/sub for job events
- Atomic operations for job progress
- Job queue storage (BullMQ)
- Job progress tracking (
job:{id}:result) - Session storage (optional)
packages/services/src/agent/redis.ts):
Database Stack
PostgreSQL
Purpose: Transactional data (OLTP) Why Chosen:- ACID compliance
- Relational integrity
- JSON support (for metadata)
- Strong ecosystem
- User accounts (Better Auth)
- Workspaces
- Prompts
- Workspace settings
- Team members
pg driver (8.17.2) via Drizzle ORM
ClickHouse
Client:@clickhouse/client 1.12.1 (from packages/db/package.json:24)
Purpose: Analytical data (OLAP)
Why Chosen:
- Fast analytical queries on millions of rows
- Column-oriented storage (optimized for aggregations)
- Time-series data (prompt responses over time)
- Compression: 10x better than PostgreSQL for analytics
- Prompt responses (raw LLM outputs)
- Analysis results (sentiment, position, visibility)
- Time-series metrics
- Source tracking
packages/db/clickhouse-init/
Connection (packages/db/src/clients/clickhouse.ts:1-5):
Drizzle ORM 0.41.0
Version:0.41.0 (from apps/web/package.json:36)
Why Chosen:
- Type-safe SQL queries
- Migration system
- Zero runtime overhead
- PostgreSQL-first design
- Better DX than Prisma for this use case
- Drizzle chosen for lighter runtime and better TypeScript inference
packages/db/src/schema/workspace.ts):
Validation
Zod 3.24.2
Version:3.24.2 (from apps/web/package.json:46)
Why Chosen:
- Runtime type validation
- TypeScript inference
- Integrates with tRPC and React Hook Form
- Composable schemas
Development Tools
Biome 1.9.4
Version:1.9.4 (from package.json:26)
Why Chosen:
- Fast: Written in Rust, 100x faster than ESLint
- All-in-one: Linter + formatter (no need for Prettier)
- Compatible: Can replace ESLint + Prettier
- Great DX: Fast feedback in editor
- Biome chosen for speed and simplicity
biome.json):
Knip 5.85.0
Version:5.85.0 (from package.json:27)
Purpose: Find unused files, dependencies, and exports
Why Chosen:
- Keeps codebase clean
- Identifies dead code
- Detects unused dependencies
External Services
OpenAI API 5.23.2
Client:openai 5.23.2 (from packages/services/package.json:27)
Purpose: LLM-based response analysis
Model Used: GPT-4.1 (from packages/services/src/analysis/runAnalysis.ts:21)
Why Chosen:
- High-quality structured output (JSON mode)
- Reliable API
- Good performance on analysis tasks
packages/services/src/analysis/runAnalysis.ts:20-36):
Utility Libraries
React Hook Form 7.62.0
Version:7.62.0 (from packages/ui/package.json:36)
Why Chosen:
- Performant form state management
- Easy validation with Zod
- Minimal re-renders
Class Variance Authority 0.7.1
Version:0.7.1 (from packages/ui/package.json:33)
Purpose: Component variant management
Usage:
Turndown 7.2.2
Version:7.2.2 (from apps/agent/package.json:21)
Purpose: Convert HTML responses to Markdown
Usage: Clean AI provider responses before storage
Marked 17.0.1
Version:17.0.1 (from packages/utils/package.json:21)
Purpose: Markdown parsing and rendering
Sanitize HTML 2.17.1
Version:2.17.1 (from packages/utils/package.json:22)
Purpose: XSS protection when rendering user content
Version Summary
Key Dependencies
Technology Decisions Summary
Why This Stack Works
-
Type Safety End-to-End
- TypeScript + tRPC + Zod = Zero runtime type mismatches
- Drizzle ORM = Type-safe database queries
- Shared types package = Single source of truth
-
Performance
- Next.js 15 = Fast server-side rendering
- React Query = Automatic caching
- ClickHouse = Fast analytical queries
- Warm browser pool = Faster job execution
-
Developer Experience
- Turborepo = Fast incremental builds
- tRPC = Autocomplete for API calls
- Biome = Fast linting and formatting
- Drizzle Studio = Visual database browser
-
Scalability
- BullMQ = Horizontal worker scaling
- ClickHouse = Handles millions of rows
- Redis = Fast job queue
- Provider isolation = No cascading failures
-
Reliability
- BullMQ = Job retry and failure handling
- Playwright = Robust browser automation
- Proxy rotation = Avoid rate limits
- Graceful shutdown = Clean worker termination
Migration Path
If considering technology changes:- Next.js → Remix: Possible but loses tRPC integration
- tRPC → REST: Loses type safety, requires OpenAPI
- Drizzle → Prisma: More features but heavier runtime
- BullMQ → Temporal: Better orchestration but more complex
- Playwright → Puppeteer: Less features and maintenance
Related Documentation
- System Architecture - How these technologies work together
- Monorepo Structure - Where each technology is used