Technology Stack
ZapDev leverages modern web technologies to deliver a real-time, AI-powered development platform. This page provides a comprehensive overview of all technologies, their roles, and integration patterns.Core Framework
Next.js 15
Version:^16.1.1 (see package.json:84)
Role: Full-stack React framework providing the foundation for ZapDev’s frontend and API layer.
Key Features Used:
- App Router: File-based routing with nested layouts
- React Server Components: Default rendering for improved performance
- Server Actions: Type-safe server mutations
- API Routes: RESTful endpoints for external integrations
- Turbopack: Next-generation bundler for faster builds
- Image Optimization: Automatic image optimization and lazy loading
React 19
Version:^19.2.3 (see package.json:89)
Role: UI library for building interactive components.
Notable Features:
- Concurrent Rendering: Improved responsiveness
- Automatic Batching: Optimized state updates
- Suspense: Declarative loading states
- Transitions: Smooth UI updates
Database & Backend
Convex
Version:^1.31.2 (see package.json:71)
Role: Real-time database and backend-as-a-service.
Why Convex?
- Reactive Queries: UI automatically updates when data changes
- Type Safety: Generated TypeScript types for all tables and queries
- Built-in Auth: Seamless Clerk integration
- Serverless: No database provisioning or scaling required
- ACID Transactions: Reliable data consistency
convex/schema.ts:92):
projects- User projects (framework, settings)messages- Conversation historyfragments- Generated code snapshotsfragmentDrafts- In-progress modificationsusage- Credit tracking and rate limitssubscriptions- Billing and plansagentRuns- Background job trackingimports- Figma/GitHub import statusoauthConnections- OAuth tokens
AI & Code Generation
Vercel AI SDK
Package:ai v^6.0.5 (see package.json:65)
Role: Unified interface for AI model interactions.
Features:
- Streaming text generation
- Tool calling (function execution)
- Multi-provider support (OpenAI, Anthropic, etc.)
- Type-safe tool definitions
AI Providers
OpenRouter (via AI SDK)
Packages:@ai-sdk/openai v^3.0.2 (see package.json:16)
Role: Primary AI gateway for model access.
Supported Models:
- GPT-4 Turbo (OpenAI)
- Claude 3.5 Sonnet (Anthropic)
- Gemini Pro (Google)
- DeepSeek V2
- Grok (xAI)
Cerebras
Package:@ai-sdk/cerebras v^2.0.5 (see package.json:15)
Role: Fast inference for framework detection and prompt enhancement.
E2B Code Interpreter
Package:e2b v^2.13.0 (see package.json:75)
Role: Secure, isolated code execution environments.
Sandbox Types:
- Next.js: Pre-configured Next.js 15 template
- Angular: Angular 19 with Material Design
- React: Vite + React 18 + Chakra UI
- Vue: Vue 3 + Vuetify
- Svelte: SvelteKit + DaisyUI
- Python-optimized file operations
- Pre-warmed dev servers
- Network isolation
- Resource limits (CPU, memory)
- Automatic cleanup
sandbox-templates/nextjs/):
Background Jobs
Inngest
Package:inngest v^3.52.3 (see package.json:79)
Role: Event-driven background job orchestration.
Functions (see src/inngest/functions/):
- code-agent.ts: Long-running code generation
- figma-import.ts: Design file processing
- webcontainer-run.ts: Browser-based execution
src/inngest/client.ts:51):
- Realtime:
@inngest/realtimev^0.4.6for streaming updates - Agent Kit:
@inngest/agent-kitv^0.13.2for AI workflows
WebContainer API
Package:@webcontainer/api v^1.6.1 (see package.json:64)
Role: Browser-based Node.js runtime for code execution.
Use Cases:
- Client-side preview generation
- Lightweight task execution
- Alternative to E2B sandboxes
Type-Safe API
Zod
Package:zod v^4.2.1 (see package.json:106)
Role: Schema validation for forms and data validation.
Usage:
Note about tRPC: While tRPC packages are installed (
@trpc/server, @trpc/client), the project currently uses Convex directly for all API operations. The tRPC routers in src/modules/*/server/procedures.ts are empty placeholders. All data fetching uses Convex queries and mutations via convex/react.Authentication
Clerk
Packages:@clerk/nextjsv^6.36.5(seepackage.json:18)@clerk/backendv^2.29.0(seepackage.json:17)
- Social OAuth (Google, GitHub, etc.)
- Email/password authentication
- Magic links
- JWT token issuance
- User management dashboard
- Frontend:
ClerkProviderwraps app - Middleware: Route protection in
middleware.ts - Backend: JWT verification in API routes
- Convex: Token-based auth (see
convex/auth.config.ts:1)
Payments & Subscriptions
Polar
Package:@polar-sh/sdk v^0.41.5 (see package.json:28)
Role: Subscription billing and customer management.
Features:
- Subscription plans (free, pro, unlimited)
- Customer portal
- Webhook events
- Usage-based billing
convex/polar.ts, convex/subscriptions.ts):
- Webhook handlers in
convex/http.ts:1 - Subscription status tracking
- Credit allocation based on plan
- Free: 5 generations/day
- Pro: 100 generations/day
- Unlimited: No limits
Stripe (Alternative)
Package:stripe v^20.1.0 (see package.json:99)
Role: Payment processing infrastructure (optional).
UI Components
Shadcn/ui
Architecture: Copy/paste components (not a library) Base: Radix UI primitives + Tailwind CSS Components (seesrc/components/ui/):
- Forms: Button, Input, Select, Checkbox
- Overlays: Dialog, Popover, Tooltip
- Feedback: Toast, Alert, Progress
- Navigation: Tabs, Accordion, Dropdown Menu
- Data: Table, Card, Separator
Radix UI
Packages:@radix-ui/react-* (29 packages, see package.json:29-54)
Role: Unstyled, accessible UI primitives.
Benefits:
- WAI-ARIA compliant
- Keyboard navigation
- Focus management
- Screen reader support
Tailwind CSS v4
Packages:tailwindcssv^4.1.18(seepackage.json:116)@tailwindcss/postcssv^4.1.18(seepackage.json:110)
tailwind.config.ts
Features:
- JIT (Just-in-Time) compilation
- Custom design tokens
- Dark mode support
- Responsive utilities
Lucide Icons
Package:lucide-react v^0.518.0 (see package.json:83)
Role: Icon library with React components.
Usage:
State Management
TanStack Query (React Query)
Package:@tanstack/react-query v^5.90.12 (see package.json:57)
Role: Server state management and caching.
Configuration (see src/trpc/query-client.ts):
- Automatic background refetching
- Optimistic updates
- Infinite queries (pagination)
- Query invalidation
React Hook Form
Package:react-hook-form v^7.69.0 (see package.json:93)
Role: Form state management and validation.
Integration: Works with Zod via @hookform/resolvers v^3.10.0 (see package.json:20)
Usage:
Code Display
Prism.js
Packages:prismjsv^1.30.0(seepackage.json:87)@types/prismjsv^1.26.5(seepackage.json:112)
- JavaScript/TypeScript
- JSX/TSX
- CSS/SCSS
- HTML
- JSON
File Management
UploadThing
Packages:uploadthingv^7.7.4(seepackage.json:103)@uploadthing/reactv^7.3.3(seepackage.json:62)
- Figma file uploads
- Image attachments
- Project exports
JSZip
Package:jszip v^3.10.1 (see package.json:82)
Role: Generate ZIP archives for project downloads.
Usage:
External Integrations
Figma API
Processing:src/lib/figma-processor.ts
Flow:
- User connects Figma via OAuth (
convex/oauth.ts) - Imports design file (
src/inngest/functions/figma-import.ts) - Processes nodes and styles
- Generates component code
GitHub API
Routes:/api/import/github/auth- OAuth initiation/api/import/github/callback- OAuth callback/api/import/github/repos- Repository listing/api/import/github/process- Code import
Firecrawl
Package:firecrawl v^4.10.0 (see package.json:78)
Role: Web scraping for inspiration and reference.
Features:
- JavaScript rendering
- Content extraction
- Markdown conversion
Brave Search
Implementation:src/lib/brave-search.ts
Role: Web search for code examples and documentation.
Development Tools
TypeScript
Version:^5.9.3 (see package.json:120)
Configuration: Strict mode enabled in tsconfig.json
Compiler Options:
strict: truenoUncheckedIndexedAccess: true- Path aliases:
@/*→src/*
ESLint
Packages:eslintv^9.39.2(seepackage.json:115)eslint-config-nextv^16.1.1(seepackage.json:77)@eslint/eslintrcv^3.3.3(seepackage.json:109)
Bun
Role: JavaScript runtime and package manager. Why Bun?- 10-20x faster than npm
- Native TypeScript support
- Built-in test runner
- ESM and CommonJS compatibility
Jest
Package:jest v^30.2.0 (see package.json:81)
Role: Testing framework.
Configuration: tests/setup.ts
Test Structure (see tests/):
agent-workflow.test.ts- E2E agent flowscredit-system.test.ts- Usage trackingframeworks.test.ts- Framework detectionsecurity.test.ts- Input validation
Monitoring & Analytics
Sentry
Package:@sentry/nextjs v^10.32.1 (see package.json:55)
Role: Error tracking and performance monitoring.
Features:
- Automatic error capture
- Release tracking
- Performance traces
- User context
Vercel Speed Insights
Package:@vercel/speed-insights v^1.3.1 (see package.json:63)
Role: Real user monitoring (RUM).
Metrics:
- Core Web Vitals (LCP, FID, CLS)
- Time to First Byte (TTFB)
- First Contentful Paint (FCP)
Web Vitals
Package:web-vitals v^5.1.0 (see package.json:105)
Role: Client-side performance measurement.
Usage:
Utility Libraries
Class Variance Authority (CVA)
Package:class-variance-authority v^0.7.1 (see package.json:66)
Role: Type-safe variant generation for components.
Usage:
clsx + tailwind-merge
Packages:clsxv^2.1.1(seepackage.json:69)tailwind-mergev^3.4.0(seepackage.json:102)
cn() utility (see src/lib/utils.ts):
date-fns
Package:date-fns v^4.1.0 (see package.json:73)
Role: Date manipulation and formatting.
Usage:
SuperJSON
Package:superjson v^2.2.6 (see package.json:100)
Role: Serialize/deserialize complex types (Date, Map, Set).
Used in: tRPC transformer for Date objects in API responses
Package Manager
Why Bun?
Migration: Project migrated from npm/pnpm to Bun (seeAGENTS.md:53)
Benefits:
- Speed: 10-20x faster installs
- Native TypeScript: No transpilation needed
- Built-in Tools: Test runner, bundler, transpiler
- Compatibility: Works with npm packages
- Primary:
bun.lock - Legacy:
pnpm-lock.yaml(technical debt)
Version Matrix
| Category | Package | Version |
|---|---|---|
| Runtime | Node.js | 18+ |
| Package Manager | Bun | Latest |
| Framework | Next.js | 16.1.1 |
| React | 19.2.3 | |
| Database | Convex | 1.31.2 |
| AI | Vercel AI SDK | 6.0.5 |
| E2B | 2.13.0 | |
| Jobs | Inngest | 3.52.3 |
| Agent Kit | 0.13.2 | |
| API | tRPC | 11.8.1 |
| Zod | 4.2.1 | |
| Auth | Clerk | 6.36.5 |
| UI | Tailwind CSS | 4.1.18 |
| Radix UI | Latest | |
| Lucide | 0.518.0 | |
| State | TanStack Query | 5.90.12 |
| Testing | Jest | 30.2.0 |
| Monitoring | Sentry | 10.32.1 |
Environment Variables Reference
Dependency Management
Adding Dependencies
Updating Dependencies
Security Audits
Build Optimization
Bundle Analysis
Code Splitting
Automatic route-based splitting via Next.js:- Each route → separate chunk
- Shared components → separate chunk
- node_modules → vendor chunk
Tree Shaking
Automatic dead code elimination for:- Unused exports
- Unreachable code
- Unused imports