Overview
AI Hackathon Guide is a React + TypeScript single-page application that showcases curated developer tools for AI hackathons. It includes an AI chat assistant powered by OpenAI that helps users find tools, compare options, and get a recommended tech stack. Deployed on Vercel, the frontend is a Vite-built React SPA; the backend is a single serverless function for chat.Three-Layer Architecture
The project is organized into three distinct layers:- Client (src/)
- Server (server/)
React frontend built with:
- Vite + React 19
- Tailwind v4
- TypeScript
App.tsx- Root layout and state managementcomponents/- Reusable UI componentscontent/sections.ts- Tool and section data
Content Data Model
All tool/section content lives insrc/content/sections.ts. Each Section has an id, title, and array of Tool objects.
Type Definitions
Adding Content
Adding a new tool or section means editingsrc/content/sections.ts - the UI and chat ranking pick it up automatically.
Chat Modes
The chat has two modes controlled by themode field in the request body:
- Default Mode
- Suggest-Stack Mode
General Q&A using
gpt-4o-mini with a short system prompt:Theming System
Dark/light theme is driven by adata-theme attribute on <html>.
CSS Custom Properties
All colors use CSS custom properties defined insrc/index.css:
Using Theme Variables
Components reference these via:- Inline
styleprops - Tailwind arbitrary values like
text-[var(--text-primary)]
Theme Toggle Implementation
Key UI Components
App.tsx
Root layout managing:- Sidebar (intro + “Suggest a stack” button)
- Main content area
- Chat modal
- Section state and chat state
ToolCarousel
Carousel with multiple navigation methods:- Keyboard (arrow keys)
- Swipe gestures
- Dot navigation
ToolCard
Expandable card showing:- Tool details
- Guide links
- Embedded YouTube videos
SectionPanel
Collapsible accordion for each tool category. Manages open/closed state and animates transitions.ChatPanel
Modal chat UI that:- Posts to
/api/chat - Renders markdown responses
- Supports both default and suggest-stack modes
- Handles tool context for contextual questions
Build Output
The build process produces:Routing
Configured invercel.json:
/api/*→ serverless functions- Everything else →
index.html(client-side routing)