| theme | background | class | highlighter | lineNumbers | info | drawings | transition | title | |
|---|---|---|---|---|---|---|---|---|---|
default |
text-center |
shiki |
false |
## IlliniHunt Mental Model
A comprehensive guide to understanding the Product Hunt-style platform for University of Illinois
|
|
slide-left |
IlliniHunt Mental Model |
A comprehensive guide for vibe coding on the University of Illinois project discovery platform
Press Space for next page
Product Hunt for University of Illinois
- 🎓 University-Focused: @illinois.edu authentication only
- 🎯 Problem-Centered: Categories based on problems solved
- 💬 Community Engagement: Voting, comments, collections
- 📱 Mobile-First: Responsive design
- React 18 + TypeScript
- Vite for build tooling
- Tailwind CSS + shadcn/ui
- React Router for routing
- React Hook Form + Zod validation
- Supabase (PostgreSQL + Auth)
- Row Level Security (RLS)
- Real-time subscriptions
- Google OAuth with domain restrictions
::right::
- Vercel for hosting
- GitHub Actions for CI/CD
- TypeScript strict mode
- ESLint for code quality
- UIUC Orange:
#FF6B35 - UIUC Blue:
#13294B - Lucide React icons
- Mobile-first responsive design
users (extends Supabase auth.users)
├── id, email, username, full_name
├── avatar_url, bio, github_url
├── year_of_study, department
projects (main content)
├── name, tagline, description
├── category_id, user_id
├── upvotes_count, comments_count
votes (user voting)
├── user_id, project_id (unique)
comments (threaded discussions)
├── content, user_id, project_id
├── parent_id, thread_depthcategories (8 problem-focused)
├── Learning & Education Tools 🎓
├── Social & Communication 👥
├── Productivity & Organization 📅
├── Health & Wellness ❤️
├── Creative & Entertainment 🎨
├── Research & Data Analysis 📊
├── Business & Entrepreneurship 📈
└── Emerging Technology ⚡
collections & bookmarks
├── collections: user_id, name, is_public
├── bookmarks: user_id, project_id
└── collection_projects: many-to-many/- HomePage: Hero + Featured + Categories/project/:id- ProjectDetailPage: Full project view/user/:id- UserProfilePage: Public user profile
/submit- SubmitProjectPage: Project submission/dashboard- DashboardPage: Project management/profile/edit- EditProfilePage: Profile editing/edit-project/:id- EditProjectPage: Project editing/collections- CollectionsPage: Collection management
::right::
HomePage → Category → ProjectGrid → ProjectCard → ProjectDetail
Login → SubmitProject → ProjectForm → Success → Redirect
ProjectDetail → Vote/Comment/Bookmark → Real-time Updates
Dashboard → Stats → Edit/Delete → Profile Management
- Optimistic UI: Immediate vote count updates
- Real-time sync:
RealtimeVotesContextmanages live updates - Error handling: Rollback on failure, sync validation
- Database triggers: Auto-update
upvotes_count
- Threaded comments: 3 levels deep
- Soft deletion:
is_deletedflag - Real-time updates: New comments appear live
// Context providers
AuthProvider // User authentication
ErrorProvider // Global error handling
RealtimeVotesProvider // Live vote updates
AuthPromptProvider // Auth prompts
// Custom hooks
useAuth() // Authentication state
useRealtimeVotes() // Vote management
useWindowSize() // Responsive utilitiesGoogle OAuth → @illinois.edu validation →
User profile creation → Session management
- Users: View all, update own profile
- Projects: Public read, own CRUD operations
- Votes/Comments: Own operations only
- Collections: Own collections, public visible
::right::
const ProtectedRoute = ({ children }) => {
const { user, loading } = useAuth()
if (loading) return <LoadingSpinner />
if (!user) return <Navigate to="/" />
return <>{children}</>
}- 🔴 RLS disabled on comments table
- 🔴 Client-side only domain restriction
- 🔴 20+ redundant auth calls per page load
- Colors: UIUC Orange (
#FF6B35), UIUC Blue (#13294B) - Components: shadcn/ui primitives
- Icons: Lucide React icons
- Responsive: Mobile-first with Tailwind
- ProjectCard: Main project display with voting overlay
- VoteButton: Optimistic voting with real-time sync
- ProjectForm: Comprehensive submission/editing
- CommentList: Threaded comment display
- UserMenu: Profile dropdown navigation
// Global error boundary
<ErrorBoundary>
<App />
</ErrorBoundary>
// Service error handling
const { handleServiceError, showSuccess } = useError()
// Toast notifications
<Toaster position="top-right" richColors />- Code splitting: Lazy-loaded pages
- Preloading: Critical routes on interaction
- Debouncing: Search queries (300ms)
- Caching: Profile data in localStorage
// database.ts - Abstracts all Supabase operations
export const ProjectsService = {
getProjects: (filters) => supabase.from('projects').select('*'),
createProject: (data) => supabase.from('projects').insert(data),
voteProject: (id) => supabase.from('votes').insert({project_id: id}),
// ... more methods
}// React Hook Form + Zod validation
const form = useForm<ProjectFormData>({
resolver: zodResolver(projectSchema)
})
const onSubmit = async (data) => {
// Optimistic UI updates
// Service calls
// Error handling
}// RealtimeVotesContext
const { getVoteData, updateVoteCount, updateUserVote } = useRealtimeVotesContext()
// Subscribe to vote changes
useEffect(() => {
const subscription = supabase
.channel('votes')
.on('postgres_changes', { event: '*', schema: 'public', table: 'votes' },
handleVoteChange)
.subscribe()
return () => subscription.unsubscribe()
}, [])- Check existing patterns: Look at similar components first
- Use service layer: Add functions to
database.ts - Follow RLS: Ensure proper security policies
- Optimistic UI: Update UI immediately, handle errors gracefully
- Real-time: Consider if feature needs live updates
- Protected content: Wrap in
ProtectedRoute - Loading states: Use consistent loading spinners
- Error handling: Use
useErrorhook for consistent UX - Form validation: Use Zod schemas with React Hook Form
- Real-time data: Use
useRealtimeVotesContextfor vote-related features
src/
├── components/ # Reusable UI components
│ ├── auth/ # Authentication components
│ ├── project/ # Project-related components
│ ├── comment/ # Comment system components
│ └── ui/ # shadcn/ui primitives
├── contexts/ # React Context providers
├── hooks/ # Custom React hooks
├── lib/ # Utilities and configurations
├── pages/ # Route components
└── types/ # TypeScript type definitions
npm run dev # Start development server
npm run build # Production build
npm run type-check # TypeScript validation
npm run lint # ESLint check- 🔴 Performance: 20+ redundant auth calls per page load
- 🔴 Security: RLS disabled on comments table
- 🔴 Auth: Client-side only domain restriction
- 🟡 Voting: Potential sync issues with optimistic updates
- Loading screens for logged-in users
- Frozen submit buttons
- Redundant database calls
- Missing rate limiting
- 🔮 Course Integration: Connect projects to UIUC courses
- 🔮 Faculty Collaboration: Professor and research mentor features
- 🔮 Industry Partnerships: Connect projects to career opportunities
- 🔮 Mobile App: Native iOS/Android applications
- 🔮 Advanced Search: Tag system and enhanced filtering
- 🔮 Admin Panel: Content moderation and featured project curation
- Context-driven state management
- Service layer abstraction
- Optimistic UI updates
- Real-time subscriptions
- Protected routes with auth guards
- Mobile-first design
- Problem-focused categorization
- Community-driven engagement
- University-specific features
- AI-assisted development workflow
🎓
IlliniHunt Mental Model Complete
You now have the complete mental model for vibe coding on IlliniHunt!
Happy Coding! 🚀