This document provides a technical overview of the JobHunt application architecture.
- Next.js 15 - React framework with App Router
- TypeScript 5 - Type-safe JavaScript
- React 18 - UI library
- Shadcn UI - Component library built on Radix UI
- Tailwind CSS 4 - Utility-first CSS framework
- React Hook Form - Form state management
- Zod - Schema validation
- @dnd-kit - Drag-and-drop functionality
- Supabase - Backend-as-a-Service
- PostgreSQL database
- Authentication
- Row Level Security (RLS)
- Real-time subscriptions
- Vitest - Unit and integration testing
- Testing Library - Component testing
- jsdom - DOM implementation for tests
- ESLint - Code linting
- Prettier - Code formatting
- TypeScript Compiler - Type checking
jobhunt/
├── .github/ # GitHub templates
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ └── PULL_REQUEST_TEMPLATE.md
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── (auth)/ # Auth-related pages
│ │ ├── (dashboard)/ # Protected dashboard pages
│ │ ├── globals.css # Global styles
│ │ └── layout.tsx # Root layout
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn UI components
│ │ └── ... # Feature components
│ ├── lib/ # Utility functions
│ │ ├── design-tokens/ # Design system tokens
│ │ ├── supabase/ # Supabase clients
│ │ └── utils.ts # Helper functions
│ └── types/ # TypeScript types
├── supabase/
│ ├── migrations/ # Database migrations
│ └── config.toml # Supabase configuration
├── scripts/ # Build and validation scripts
└── tests/ # Test files (co-located with source)
Atomic Design Principles:
- Atoms: Basic UI elements (Button, Input, Label)
- Molecules: Simple component combinations (FormField, Card)
- Organisms: Complex components (ApplicationCard, KanbanBoard)
- Templates: Page layouts
- Pages: Complete views with data
- Server State: Supabase queries with React Server Components
- Client State: React hooks (useState, useReducer)
- Form State: React Hook Form
- URL State: Next.js routing and search params
User Action → Component → API Route/Server Action → Supabase → Database
↓ ↓
UI Update ← React State ← Response ← RLS Check
users (managed by Supabase Auth)
- id (uuid, primary key)
- created_at
companies
- id (uuid, primary key)
- user_id (uuid, foreign key)
- name (text)
- website (text, optional)
- notes (text, optional)
- created_at (timestamp)
- updated_at (timestamp)
applications
- id (uuid, primary key)
- user_id (uuid, foreign key)
- company_id (uuid, foreign key)
- position (text)
- status (enum: wishlist, applied, interview, offer, rejected)
- salary_range (text, optional)
- location (text, optional)
- job_url (text, optional)
- notes (text, optional)
- applied_date (date, optional)
- created_at (timestamp)
- updated_at (timestamp)
All tables have RLS policies ensuring users can only access their own data:
-- Example policy
CREATE POLICY "Users can view their own applications"
ON applications FOR SELECT
USING (auth.uid() = user_id);- User visits login page
- Enters credentials (email/password)
- Supabase Auth validates and creates session
- Session stored in HTTP-only cookie
- Middleware validates session on protected routes
- User redirected to dashboard or login page
Core Principles:
- Glass morphism with realistic blur effects
- Depth through layering and shadows
- Fluid animations using spring physics
- Responsive typography based on 4pt grid
- 8pt spacing system
Color System:
- RGBA-based semantic colors
- Automatic light/dark mode adaptation
- Consistent opacity levels for glass effects
Components:
- All components follow design tokens
- Accessible by default (WCAG 2.1 AA)
- Mobile-first responsive design
- Business logic functions
- Validation schemas
- Utility functions
- Component rendering
- API routes
- Database operations
- Authentication flows
- Form submissions
- Business Logic: 80%+
- Components: 70%+
- Overall: 75%+
- Server Components: Reduce client-side JavaScript
- Image Optimization: Next.js Image component
- Code Splitting: Automatic route-based splitting
- Lazy Loading: Dynamic imports for heavy components
- Database Indexing: Optimized queries with proper indexes
- Vercel Analytics for performance metrics
- Error tracking via console logs
- Database query performance via Supabase dashboard
- Environment variables for secrets
- Row Level Security on all tables
- HTTP-only cookies for sessions
- CSRF protection via Supabase
- Input validation with Zod schemas
- SQL injection prevention via parameterized queries
- Automatic deployments from main branch
- Preview deployments for pull requests
- Environment variables configured in Vercel dashboard
- Edge runtime for optimal performance
- Version-controlled SQL migrations
- Applied via Supabase CLI
- Tested locally before production deployment
All code must pass before merging:
- ESLint (zero errors/warnings)
- TypeScript compilation (zero errors)
- All tests passing
- Build successful
- Create feature branch
- Implement with TDD
- Run quality gates
- Create pull request
- Code review
- Merge to main
- Automatic deployment
- Real-time collaboration
- Advanced analytics dashboard
- Email notifications
- Resume management
- Interview preparation tools
- Mobile app (React Native)
- Database connection pooling
- Caching layer (Redis)
- CDN for static assets
- Horizontal scaling via Vercel
- Database read replicas
See CONTRIBUTING.md for detailed development guidelines.