Technology Stack
The web app leverages cutting-edge technologies for optimal performance and developer experience:Next.js 16
App Router with Server Components, Turbopack, and typed routes
React 19
Latest React features with improved server component support
TailwindCSS 4
Utility-first CSS with automatic class sorting via Biome
shadcn/ui
Accessible component library built on Radix UI primitives
Frontend Stack
UI Framework
- Next.js 16.1.1 with App Router and Turbopack for fast development
- React 19.2.3 with Server Components and React Server Actions
- TypeScript 5.9.3 for type safety across the application
- TailwindCSS 4.1.18 with
@tailwindcss/postcssfor styling - Framer Motion 12 for smooth animations and transitions
Component Library
The app uses shadcn/ui components built on top of Radix UI primitives:- Accordion, Avatar, Badge, Button, Calendar
- Card, Carousel, Chart (with Recharts)
- Command Palette (CMDK), Dialog, Dropdown Menu
- Form components with React Hook Form integration
- Hover Card, Input, Label, Popover, Progress
- Scroll Area, Select, Separator, Switch, Tooltip
cn() utility and support dark mode through next-themes.
State Management
- Client State
- Server State
- Form State
Zustand for global client state management:
- Lightweight and unopinionated
- No boilerplate required
- DevTools support in development
Backend Stack
Database Layer
- PostgreSQL via Neon serverless driver (
@neondatabase/serverless) - Drizzle ORM for type-safe database queries and migrations
- Database location: Connection string in root
.envfile
Database configuration is defined in
drizzle.config.ts at the root level, not in apps/web/.env. All migrations are stored in apps/web/src/db/migrations.Authentication
- Better-Auth 1.4.10 for session-based authentication
- OAuth provider support via
accounttable - Session management with IP tracking and expiration
- Expo integration for cross-platform authentication
AI Integration
Anthropic Claude
Claude Sonnet 4.5 via
@ai-sdk/anthropic with native tool supportOpenAI
GPT models via
@ai-sdk/openai for embeddings and fallbackAI SDK
Vercel AI SDK with streaming, tools, and artifacts support
Upstash Search
Semantic search for Canvas LMS content indexing
- ToolLoopAgent with container-based execution
- Extended thinking (10k token budget)
- Native Anthropic tools: code execution, web search, memory, web fetch
- Custom tools: Canvas content search, todo management, study sets
Project Structure
The web app follows Next.js 16 App Router conventions:API Routes
The web app exposes several API endpoints:/api/auth
Better-Auth authentication endpoints handling:
- User registration and login
- OAuth provider authentication
- Session management
- Account linking
/api/chat
AI chat streaming endpoint:
- Uses Anthropic Claude Sonnet 4.5
- Streams responses with tool execution
- Supports extended thinking mode
- Container-based execution with skill persistence
- Context includes user info, geolocation, timezone, classes
/api/metadata
Chat metadata generation:
- Auto-generates chat titles
- Provides contextual suggestions
- Used for conversation organization
/api/cron
Scheduled tasks for:
- Canvas content synchronization
- Assignment deadline notifications
- Database cleanup operations
Development Features
- Developer Tools
- Performance
- Type Safety
- React Query DevTools for debugging server state
- AI SDK DevTools for inspecting AI interactions
- Drizzle Studio for database management (
bun db:studio) - Biome for linting and formatting with auto-fix
Environment Configuration
Required environment variables:@t3-oss/env-nextjs in src/env.ts.
Build & Deployment
Development
Production
The web app runs on port 3000 by default. Canvas integration credentials are stored in the
user.settings JSONB column, allowing flexible per-user configuration.Next.js Configuration
Key Next.js features enabled:- Typed Routes: Type-safe navigation with autocomplete
- Component Caching: Optimized component rendering
- View Transitions: Smooth page transitions (experimental)
- Image Optimization: Remote patterns for Canvas LMS images
- Turbopack: Fast development builds
next.config.ts for full configuration details.