Architecture Overview
TechCal is a modern career operating system built on a scalable, type-safe architecture that combines server-side rendering, real-time data access, and intelligent recommendation systems.System Layers
The platform follows a layered architecture with clear separation of concerns:Layer Breakdown
Frontend Layer
Next.js App Router with device-aware routing and server-side rendering:- Public Routes: Landing pages, marketing content, authentication
- Protected Routes: Dashboard, calendar, discovery workspace
- Layout Guards: Enforce onboarding completion at
src/app/(protected)/layout.tsx:73-82
- Server components for initial data fetching
- Client components for rich interactivity
- Lazy-loaded UI libraries (MUI, FullCalendar)
- Framer Motion and GSAP for animations
- TanStack Query: Client data fetching with hydration from server components
- React Context: Cross-cutting concerns (auth, calendar, notifications)
- Local State: Component-specific UI state
Backend Layer
API Routes with authentication and rate limiting:src/services/):
- Event services: CRUD, filtering, search
- Career services: Profile management, onboarding
- Analytics services: Telemetry, monitoring, insights
- Scoring services: Career impact calculation
- Redis (Vercel KV): Career impact scores (1 hour TTL)
- Upstash: Rate limit sliding windows
- React Query: Client-side query caching
Data Access Layer
Supabase provides:- PostgreSQL: Relational database with RLS policies
- Auth: User authentication and session management
- Storage: Avatar uploads and media files
- Real-time: Subscription to data changes
events: Core event dataprofiles: User profiles and career datatracked_events: User event interactions (bookmarks, attendance)event_speakers: Speaker information and relationshipshackathons: Hackathon coordination and teamsfollows: Social network connections
Intelligence Layer
Scoring Engine (src/lib/recommendation/baseScorer.ts:252-554):
- Pure alignment core for career-event matching
- Skill, goal, interest, and networking alignment
- Cold-start scoring for anonymous users
- Base scoring → Advanced scoring → Behavioral reranking
- Shadow mode for A/B testing
- Diversity enhancement to prevent filter bubbles
- Modular collectors (RSS, API, ICS, HTML)
- Quality scoring and auto-publish thresholds
- Deduplication with fuzzy matching
- Admin moderation queue
Key Architectural Decisions
Server-Side Rendering
Server components fetch data during SSR, reducing client bundle size and improving initial load performance.
src/app/(protected)/layout.tsx
Type Safety
Strict TypeScript throughout with Supabase-generated types:src/types/database.ts
Feature Flags
Environment-based feature toggles enable safe rollouts:Shadow Mode for Safe Experimentation
Shadow Mode for Safe Experimentation
Shadow mode computes both legacy and new algorithms, logs deltas for analysis, but serves the stable version to users. This enables data-driven iteration without production risk.
Telemetry & Monitoring
Sentry Integration:- Breadcrumbs for scoring decisions
- Exception tracking with context
- Performance monitoring
src/utils/supabase/telemetry.ts):
- Sanitized payload logging
- Asynchronous writes
- Sampled at 10% to reduce overhead
- CTR tracking by trigger and score bucket
- Score distribution analysis
- Behavioral boost effectiveness
Entry Points
Public Access
/- Landing page with adaptive marketing/u/[username]- Public user profiles/community- Community directory
Protected Access
/discover- Discovery workspace with filtering and scoring/calendar- FullCalendar-powered event scheduling/dashboard- Career analytics and goal tracking/hackathons- Team coordination and participation
Admin Access
/admin/ingestion/moderation- Event moderation queue/admin/ingestion/run- Manual ingestion trigger
Deployment
Vercel-compatible architecture:- Edge Functions: Rate limiting, authentication checks
- Serverless Functions: API routes, server components
- Static Generation: Marketing pages, documentation
- Cron Jobs: Configured in
vercel.jsonfor hourly ingestion
Performance Budgets
The platform enforces performance budgets:- Scoring latency < 100ms per event
- API response times < 500ms
- Client bundle size < 500KB
Next Steps
Tech Stack
Explore the complete technology stack and dependencies
Data Model
Learn about database schema and relationships
Scoring Engine
Understand the career alignment scoring algorithm
Ingestion Pipeline
See how events are collected and processed