# Project export: Blueprint - Maximizing Creativity

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: Struggling to find your creative spark? We turn any hackathon URL into 7 original project ideas. Already have an idea? Our semantic AI verifies its originality before you build.
- Devpost: https://devpost.com/software/blueprint-maximizing-creativity
- GitHub: https://github.com/edrlu/Blueprint
- Video: https://www.youtube.com/embed/kQ2asovVRUA?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — Edward Lu (2 commits)

## Devpost submission (written by the team)

### Overview

About the Project

### Inspiration

Every hackathon participant faces the same two challenges: generating original, winning ideas and ensuring they're not accidentally recreating existing projects. After attending multiple hackathons and witnessing teams struggle with idea validation, we built Blueprint to solve both problems using advanced AI and semantic analysis. Traditional plagiarism detectors rely on keyword matching, leading to 70% false positives—flagging "AI chatbot for therapy" as similar to "AI chatbot for customer service" despite solving completely different problems. We knew there had to be a better way.

### What it does

Blueprint is a dual-purpose platform that empowers hackathon participants: Generate Winning Ideas: Enter any hackathon URL and receive 7 tailored, competition-ready project ideas. Our AI analyzes the hackathon rules, studies past winning projects, and generates ideas complete with implementation roadmaps, tech stacks, and judge appeal strategies. Verify Originality: Already have an idea? Our semantic plagiarism detector searches Devpost and GitHub in real-time, analyzing similarity across four dimensions—problem domain (35%), solution approach (40%), implementation details (15%), and use case (10%)—to give you an evidence-based originality score.

### How we built it

Frontend: React + Vite with real-time Server-Sent Events (SSE) for live progress updates as projects are discovered and analyzed. Backend: FastAPI with async/await architecture for concurrent processing. We implemented intelligent rate limiting with exponential backoff and 24-hour caching to respect API limits. AI Engine: Claude Sonnet 4 along with Gemini 2.5 flash powers our multi-stage analysis pipeline—first extracting hackathon requirements, then analyzing winning patterns, and finally generating ideas or evaluating semantic similarity. Web Scraping: Custom BeautifulSoup4 scrapers with smart duplicate detection and URL normalization. We search Devpost (hackathon-specific projects) and GitHub (open-source API implementations) using AI-generated search strategies that capture semantic meaning, not just keywords. Semantic Analysis: Our breakthrough four-dimensional weighted scoring system evaluates projects on problem-solution decomposition rather than keyword matching. We apply intelligent corrections for project age (ideas older than 2 years score 15% lower), domain saturation (common patterns like chatbots score 10% lower), and different solution approaches to the same problem (capped at 45% similarity to avoid false positives).

### Challenges we ran into

False Positives in Similarity Detection: Keyword-based matching flagged unrelated projects as similar. We solved this by implementing multi-dimensional semantic analysis that separately evaluates problem domain and solution approach, reducing false positives by 70%. API Rate Limiting: Scraping 100+ projects caused 429 errors. We implemented adaptive exponential backoff (1s → 2s → 4s → 8s), request pooling, and intelligent caching to stay within limits. Real-Time Streaming with Large Datasets: Users waited minutes without feedback. We implemented Server-Sent Events to stream projects as they're discovered, showing live progress bars and AI analysis updates. Context Window Limitations: Claude's 200K token limit couldn't handle 100 projects × 500 words each. We truncate descriptions to 300 words, analyze only the top 20 most relevant projects, and use batch processing with smart prioritization.

### Accomplishments we're proud of

70% reduction in false positives compared to traditional keyword-based plagiarism detection 10x faster processing with async/await concurrent architecture Real-time streaming updates for responsive user experience during long operations Multi-dimensional semantic analysis with four weighted factors for accurate similarity scoring Production-ready implementation with comprehensive error handling, rate limiting, and security best practices

### What we learned

Semantic NLP beats keyword matching: Understanding context and meaning is crucial for accurate similarity detection. Separately evaluating problem domain and solution approach dramatically improves accuracy. Weight distribution matters: Problem domain (35%) and solution approach (40%) are the most important factors in determining true similarity—implementation details alone don't indicate plagiarism. Temporal context is key: Ideas naturally evolve over time. Projects older than 2 years should be weighted less heavily in originality assessments. Streaming architecture improves UX: For operations taking 5-10 minutes, showing progressive results keeps users engaged and provides transparency into the AI's reasoning process. Multi-source validation: Combining Devpost (hackathon-specific) and GitHub (open-source) provides comprehensive coverage for detecting similar projects.

## README (from the GitHub repository)

# Blueprint - AI-Powered Hackathon Idea Generator & Fraud Detection System

Generate winning hackathon project ideas by learning from past winners and detect project similarity using advanced semantic analysis algorithms.

## 🚀 Quick Start

```bash
# Run the startup script
start.bat
```

This will:
- Install dependencies
- Start the backend API server (port 8000)
- Start the frontend UI (port 5173+)
- Open your browser automatically

## ✨ Features

### 1. **AI-Powered Idea Generation**
- Analyzes past hackathon winners using Claude AI (Sonnet 4)
- Generates 7 tailored project ideas based on success patterns
- Creates detailed implementation guides with tech stack recommendations

### 2. **Fraud Detection & Similarity Analysis**
- Multi-dimensional semantic similarity scoring
- Searches GitHub and Devpost for similar projects
- AI-powered plagiarism detection with weighted algorithms
- Real-time originality scoring

### 3. **Beautiful Modern UI**
- Clean, professional interface built with React 18
- Real-time progress streaming
- Responsive design with smooth animations

---

## 🧮 Core Algorithms & Techniques

### **1. Semantic Similarity Detection (Multi-Dimensional Weighted Scoring)**

Our fraud detection system uses a sophisticated **4-dimensional weighted similarity algorithm** to detect true plagiarism versus keyword overlap:

```python
# Weighted Similarity Calculation
WEIGHTS = {
    'problem': 0.35,      # 35% - What problem is being solved?
    'solution': 0.40,     # 40% - How is it being solved?
    'implementation': 0.15, # 15% - Technical stack specifics
    'use_case': 0.10      # 10% - Target audience & application
}

final_similarity = Σ(dimension_score × weight) + corrections
```

**Correction Factors:**
- Projects >2 years old: -15 points (common ideas evolve independently)
- Saturated domains (chatbots, todo apps): -10 points
- Same problem but different solution: max score = 45
- Keyword match but different approach: max score = 30

**Risk Classification:**
- **HIGH**: ≥2 projects with score >80 AND same problem+solution
- **MEDIUM**: ≥1 project >75 OR ≥3 projects >60 with same problem
- **LOW**: All other cases

### **2. MD5 Hash-Based Deduplication**

Uses **cryptographic hashing** to detect exact duplicates:

```python
def generate_project_hash(description):
    normalized = ' '.join(description.lower().split())
    return hashlib.md5(normalized.encode()).hexdigest()
```

This eliminates false positives from projects appearing in multiple searches while preserving true similar-but-different projects.

### **3. TF-IDF Style Frequency Analysis**

For topic extraction from project descriptions:

```python
# Word Frequency Analysis (similar to TF-IDF)
words = extract_words(text)
word_freq = {word: count for word in words if word not in STOP_WORDS}
top_topics = sorted(word_freq.items(), key=lambda x: x[1], reverse=True)[:10]
```

Filters common stop words and extracts the 10 most significant terms from text content.

### **4. Intelligent Search Query Generation**

Uses Claude AI to generate **project-specific search strategies**:

1. **Problem/Goal Queries** (3 queries) - Core problem domain
2. **Category Queries** (3 queries) - Project classification
3. **Technology Queries** (2-3 queries) - Tech stack keywords

Optimized to be:
- Short (1-3 words)
- Broad (cast wide net)
- Simple (common terminology)

### **5. Multi-Source Aggregation & Ranking**

Searches across multiple platforms:

```
GitHub API → Projects (sorted by stars)
Devpost Search → Projects (multi-page scraping)
    ↓
Deduplication (MD5 hash)
    ↓
AI Semantic Analysis (weighted scoring)
    ↓
Ranked Results (by similarity score)
```

**Rate Limiting:**
- 2-second delay between Devpost page requests
- 1-second delay between search queries
- Caching to prevent duplicate API calls

### **6. Natural Language Processing (NLP)**

**Claude Sonnet 4** provides:
- **Semantic Understanding**: Distinguishes between keyword overlap vs true similarity
- **Pattern Recognition**: Identifies success patterns in winning projects
- **Creative Synthesis**: Combines insights to generate novel ideas
- **Contextual Analysis**: Understands hackathon rules and constraints

### **7. Web Scraping with DOM Parsing**

**BeautifulSoup4** HTML parsing:
- Structured data extraction (headings, links, images, tables)
- Tab detection and navigation
- Project gallery parsing
- Winner badge detection

**Regex Pattern Matching:**
```python
# Extract numbers from elements
r'(\d+)'

# Clean text content
r'\s+'  # Normalize whitespace
r'\b[a-zA-Z]{4,}\b'  # Extract meaningful words
```

### **8. Real-Time Streaming Architecture**

**Server-Sent Events (SSE)** for live progress updates:

```python
async def stream_progress():
    yield f"data: {json.dumps({'status': 'Scraping...'})}\n\n"
    yield f"data: {json.dumps({'progress': 'Found 15 projects'})}\n\n"
    yield f"data: {json.dumps({'result': final_data})}\n\n"
```

Frontend receives updates in real-time without polling.

---

## 📊 Data Flow Architecture

```
User Input (Devpost URL)
    ↓
[Web Scraper] → Extract Rules & Winners
    ↓
[Data Processor] → Normalize & Structure
    ↓
[Claude AI Analyzer] → Pattern Recognition
    ↓
[Idea Generator] → Create 7 Novel Ideas
    ↓
[Breakdown Generator] → Detailed Implementation Guide
    ↓
Frontend Display
```

**For Fraud Detection:**
```
Project Description
    ↓
[Claude AI] → Generate Search Queries
    ↓
[Multi-Platform Search] → GitHub + Devpost
    ↓
[Hash Deduplication] → Remove Duplicates
    ↓
[Semantic Analysis] → 4D Weighted Scoring
    ↓
[Risk Classification] → HIGH/MEDIUM/LOW
    ↓
Detailed Report + Similar Projects
```

---

## 🛠️ Tech Stack

**Backend:**
- **Python 3.11+** - Core language
- **FastAPI** - High-performance async API framework
- **Anthropic Claude AI** (Sonnet 4) - Advanced language model for analysis
- **BeautifulSoup4** - HTML parsing and web scraping
- **Requests** - HTTP client for API calls
- **hashlib** - MD5 hashing for deduplication
- **Server-Sent Events (SSE)** - Real-time streaming

**Frontend:**
- **React 18** - UI framework
- **Vite** - Fast build tool
- **React Router** - Client-side routing
- **React Markdown** - Markdown rendering with syntax highlighting
- **Rehype Highlight** - Code syntax highlighting

**APIs & Services:**
- **GitHub REST API** - Repository search
- **Devpost** - Hackathon project data
- **Claude API** - Natural language processing

---

## 📁 Data Organization

All scraped data is organized into structured folders:

```
hackathon-data/
├── cal_hacks_12_0/              # Main hackathon
│   ├── rules.json               # Event rules & requirements
│   ├── ideas.txt                # Generated ideas (7)
│   └── breakdown_*.md           # Implementation guides
│
├── treehacks_2023/              # Past hackathon example
│   ├── project_winner_1.json   # Individual winner data
│   ├── project_winner_2.json
│   └── ...
│
└── hackmit_2024/                # Another past hackathon
    └── ...
```

---

## 🔥 Usage

### **Idea Generation (Web UI)**

1. Navigate to http://localhost:5173
2. Enter target hackathon URL (e.g., `https://cal-hacks-12-0.devpost.com`)
3. Click "Generate Ideas"
4. View 7 AI-generated project ideas
5. Click any idea for detailed implementation guide

### **Similarity Check (Fraud Detection)**

1. Navigate to http://localhost:5173/similarity
2. Enter Devpost project URL to analyze
3. System will:
   - Generate smart search queries
   - Search GitHub & Devpost
   - Analyze similarity with AI
   - Show fraud risk assessment
4. View detailed similarity scores for each match

---

## ⚙️ Setup

### **1. Configure API Keys (Required)**

```bash
# Copy the example environment file
cp .env.example .env

# Edit .env and add your Claude API key
# Get your key from: https://console.anthropic.com/
CLAUDE_API_KEY=your_key_here
```

### **2. Install Dependencies**

```bash
pip install -r requirements.txt
cd frontend && npm install
```

### **3.

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 62 recognized source files, 341 KB.
- Anthropic (technology) — detected in the code
- CSS (language) — detected in the code
- FastAPI (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Google Gemini (technology) — claimed on Devpost, not found in the code
- AI coding agent: Claude Code — evidence: config files committed to the repository

## Codebase structure (from repository index)

### Files (120 of 185)

```
.claude/settings.local.json
.gitignore
api/__init__.py
api/config/__init__.py
api/config/constants.py
api/config/settings.example.py
api/orphaned/list_gemini_models.py
api/server.py
api/services/__init__.py
api/services/claude_analyzer.py
api/services/devpost_scraper.py
api/services/idea_generator.py
api/services/similarity_reports.py
api/tests/test_api_parsing.py
api/tests/test_breakdown_endpoint.py
api/tests/test_claude_api.py
api/tests/test_full_flow.py
api/tests/test_idea_generator.py
api/tests/test_scraping.py
api/utils/__init__.py
api/utils/data_utils.py
frontend/.gitignore
frontend/eslint.config.js
frontend/index.html
frontend/package.json
frontend/README.md
frontend/src/AnimatedList.css
frontend/src/AnimatedList.jsx
frontend/src/App.css
frontend/src/App.jsx
frontend/src/IdeaBreakdown.css
frontend/src/IdeaBreakdown.jsx
frontend/src/IdeasView.css
frontend/src/IdeasView.jsx
frontend/src/index.css
frontend/src/main.jsx
frontend/src/SimilarityView.css
frontend/src/SimilarityView.jsx
frontend/vite.config.js
hackathon-data/boilermake_x/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/boilermake_x/project_002_Insight.json
hackathon-data/boilermake_x/project_003_LectureBoost.json
hackathon-data/boilermake_x/project_004_Write_Right.json
hackathon-data/boilermake_x/project_005_Soundscape.json
hackathon-data/boilermake_x/project_006_AirQ.json
hackathon-data/boilermake_x/project_007_Ligo.json
hackathon-data/boilermake_x/project_008_Oh_Deere_Farms.json
hackathon-data/boilermake_x/project_009_hOStR.json
hackathon-data/boilermake_x/project_010_GottaGo.json
hackathon-data/cal_hacks_11_0/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/cal_hacks_11_0/project_002_Duet_Brainwaves_-_Live_Music.json
hackathon-data/cal_hacks_11_0/project_003_GhostWriter.json
hackathon-data/cal_hacks_11_0/project_004_SnackSnap_-_recycle_to_feed_your_pet.json
hackathon-data/cal_hacks_11_0/project_005_Talk_Tuah.json
hackathon-data/cal_hacks_11_0/project_006_Blockify.json
hackathon-data/cal_hacks_11_0/project_007_Unreal_EngJam.json
hackathon-data/cal_hacks_11_0/project_008_MafiAI.json
hackathon-data/cal_hacks_11_0/project_009_Resililink.json
hackathon-data/cal_hacks_11_0/project_010_TeachXR.json
hackathon-data/cal_hacks_12_0/rules.json
hackathon-data/hack_mit_2023/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hack_mit_2023/project_002_Muse.json
hackathon-data/hack_mit_2023/project_003_lettuce.json
hackathon-data/hack_mit_2023/project_004_BeeMovr.json
hackathon-data/hack_mit_2023/project_005_Handwriting_Teacher.json
hackathon-data/hack_mit_2023/project_006_Fluxus.json
hackathon-data/hack_mit_2023/project_007_Pathosense.json
hackathon-data/hack_mit_2023/project_008_PantryPuzzle.json
hackathon-data/hack_mit_2023/project_009_Catmosphere.json
hackathon-data/hack_mit_2023/project_010_InSightAI.json
hackathon-data/hackathon/rules.json
hackathon-data/hackharvard_2023/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hackharvard_2023/project_002_TeleSpeech.json
hackathon-data/hackharvard_2023/project_003_HackAnalyzer.json
hackathon-data/hackharvard_2023/project_004_TrustTrace.json
hackathon-data/hackharvard_2023/project_005_GREENTRaiL.json
hackathon-data/hackharvard_2023/project_006_WaterView.json
hackathon-data/hackharvard_2023/project_007_giraffestudy.json
hackathon-data/hackharvard_2023/project_008_SnipStudy.json
hackathon-data/hackharvard_2023/project_009_NavAlone.json
hackathon-data/hackharvard_2023/project_010_Edith.json
hackathon-data/hacknyu_2023/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hacknyu_2023/project_002_Soteria.json
hackathon-data/hacknyu_2023/project_003_PillID.json
hackathon-data/hacknyu_2023/project_004_College_Collage.json
hackathon-data/hacknyu_2023/project_005_Aly_HackNYU_23.json
hackathon-data/hacknyu_2023/project_006_ZenDoc.json
hackathon-data/hacknyu_2023/project_007_InteRax.json
hackathon-data/hacknyu_2023/project_008_UShare_-_campus_umbrella_borrowing_syste.json
hackathon-data/hacknyu_2023/project_009_Aloe_On-Chain_Reputation_System.json
hackathon-data/hacknyu_2023/project_010_FinLitFrenzy.json
hackathon-data/hackprinceton_spring_2024/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hackprinceton_spring_2024/project_002_EdZy.json
hackathon-data/hackprinceton_spring_2024/project_003_Interview_Wizard.json
hackathon-data/hackprinceton_spring_2024/project_004_Resume_ArchiTech.json
hackathon-data/hackprinceton_spring_2024/project_005_Immersive_Firefighter_Performance_Review.json
hackathon-data/hackprinceton_spring_2024/project_006_FarmShield.json
hackathon-data/hackprinceton_spring_2024/project_007_MediCognize.json
hackathon-data/hackprinceton_spring_2024/project_008_kepler.json
hackathon-data/hackprinceton_spring_2024/project_009_Learnin_Wave.json
hackathon-data/hackprinceton_spring_2024/project_010_Slo-Fashion.json
hackathon-data/hackru_spring_2024/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hackru_spring_2024/project_002_USA_heatmap.json
hackathon-data/hackru_spring_2024/project_003_Green_Habits.json
hackathon-data/hackru_spring_2024/project_004_Meal_Planner.json
hackathon-data/hackru_spring_2024/project_005_NutriPal.json
hackathon-data/hackru_spring_2024/project_006_AskAnon.json
hackathon-data/hackru_spring_2024/project_007_Restless_Learning.json
hackathon-data/hackru_spring_2024/project_008_RecipeSnap.json
hackathon-data/hackru_spring_2024/project_009_Dynamic_Vector_Based_Spotify_Recommendat.json
hackathon-data/hackru_spring_2024/project_010_Stroke_Guard.json
hackathon-data/hacktheburghx/project_001_Blog_______Insights_into_hackathon_plann.json
hackathon-data/hacktheburghx/project_002_NoteVec.json
hackathon-data/hacktheburghx/project_003_Airmed.json
hackathon-data/hacktheburghx/project_004_Perfect_DreamBerd_Interpreter.json
hackathon-data/hacktheburghx/project_005_FoodFriend.json
hackathon-data/hacktheburghx/project_006_bioCianoX.json
hackathon-data/hacktheburghx/project_007_Wotsitbot.json
hackathon-data/hacktheburghx/project_008_CosmicKube.json
hackathon-data/hacktheburghx/project_009_SpotOn_Billboards.json
[65 more files omitted for size]
```

### Dependencies

- frontend/package.json: @eslint/js@^9.36.0, @types/react@^19.1.16, @types/react-dom@^19.1.9, @vitejs/plugin-react@^5.0.4, eslint@^9.36.0, eslint-plugin-react-hooks@^5.2.0, eslint-plugin-react-refresh@^0.4.22, globals@^16.4.0, motion@^12.23.24, ogl@^1.0.11, react@^19.1.1, react-dom@^19.1.1, react-markdown@^10.1.0, react-router-dom@^7.9.4, rehype-highlight@^7.0.2, vite@^7.1.7
- requirements.txt: anthropic@>=0.18.0, beautifulsoup4@>=4.12.0, fastapi@>=0.104.0, google-generativeai@>=0.3.0, python-dotenv@>=1.0.0, requests@>=2.31.0, uvicorn@>=0.24.0

### Recent commits (newest first)

- completed-gitignore commit updates
- Initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### md/test_frontend_flow.md

```markdown
# Frontend Flow Test

## Current Status

✅ **Backend API** - Running on http://localhost:8000
✅ **Frontend** - Running on http://localhost:5174  
✅ **Ideas Parsing** - API correctly parses 5 ideas from generated file

## Test the Complete Flow

1. **Open Frontend**: http://localhost:5174

2. **Generate Ideas**:
   - Enter new hackathon URL: `https://cal-hacks-11-0.devpost.com`
   - (Optional) Add past hackathon URLs
   - Click "Generate Ideas"
   - Watch progress stream

3. **View Ideas**:
   - Click "View Ideas →" button
   - Should navigate to `/ideas` route
   - Should display 5 generated ideas with:
     - Title
     - Problem Statement
     - Solution Overview
     - Key Technologies (as tags)
     - Why It Wins (bullet points)
     - Inspired By
     - Implementation Roadmap (numbered steps)

## Expected Data Flow

```
User clicks "Generate Ideas"
    ↓
POST /generate → Backend
    ↓
SSE Stream with progress
    ↓
Final event: { status: 'Complete!', result: { ideas_file: 'path/to/file.txt' } }
    ↓
Frontend stores result.ideas_file
    ↓
User clicks "View Ideas →"
    ↓
Navigate to /ideas with state: { ideas_file: 'path/to/file.txt' }
    ↓
IdeasView fetches: GET /ideas/path/to/file.txt
    ↓
Backend parses file and returns JSON
    ↓
Frontend displays ideas in AnimatedList
```

## Verified

✅ Backend generates ideas file
✅ Backend sends ideas_file path in SSE
✅ Backend API endpoint parses ideas correctly
✅ Frontend navigation is set up
✅ IdeasView component fetches from API

## Next: Test in Browser

Open http://localhost:5174 and test the complete flow!

```

### md/SETUP_GITHUB.md

```markdown
# 🚀 Push to GitHub - Step by Step

## 1. Create GitHub Repository

1. Go to https://github.com/new
2. Repository name: `blueprint-hackathon-ai` (or whatever you want)
3. Description: "AI-powered hackathon idea generator with beautiful UI"
4. Make it **Public** or **Private**
5. **DO NOT** initialize with README (we already have one)
6. Click "Create repository"

## 2. Run These Commands

Open PowerShell in the Blueprint folder and run:

```bash
# Initialize git
git init

# Add all files
git add .

# Commit
git commit -m "Initial commit: Blueprint AI Hackathon Idea Generator"

# Connect to your repo (REPLACE WITH YOUR URL)
git remote add origin https://github.com/YOUR_USERNAME/blueprint-hackathon-ai.git

# Push
git branch -M main
git push -u origin main
```

## 3. Replace YOUR_USERNAME

In the command above, replace:
- `YOUR_USERNAME` with your actual GitHub username
- `blueprint-hackathon-ai` with your repo name if different

## Example

If your username is `johndoe`:
```bash
git remote add origin https://github.com/johndoe/blueprint-hackathon-ai.git
```

## 4. Done! 🎉

Your repo is now live at:
`https://github.com/YOUR_USERNAME/blueprint-hackathon-ai`

## ⚠️ Important Notes

- Your API key is **NOT** included (it's in `.gitignore`)
- Users will need to copy `config_settings.example.py` to `config_settings.py`
- Users will need to add their own Claude API key

## 📝 Update README

After pushing, you might want to:
1. Rename `PROJECT_SUMMARY.md` to `README.md`
2. Add screenshots
3. Add a demo video
4. Update the repo URL in the README

## 🔐 Security

✅ API keys are gitignored  
✅ Generated data folders are gitignored  
✅ Virtual environment is gitignored  
✅ Node modules are gitignored  

Safe to push!

```

### requirements.txt

```
requests>=2.31.0
beautifulsoup4>=4.12.0
anthropic>=0.18.0
fastapi>=0.104.0
uvicorn>=0.24.0
google-generativeai>=0.3.0
python-dotenv>=1.0.0

```

### frontend/package.json

```
{
  "name": "frontend",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "motion": "^12.23.24",
    "ogl": "^1.0.11",
    "react": "^19.1.1",
    "react-dom": "^19.1.1",
    "react-markdown": "^10.1.0",
    "react-router-dom": "^7.9.4",
    "rehype-highlight": "^7.0.2"
  },
  "devDependencies": {
    "@eslint/js": "^9.36.0",
    "@types/react": "^19.1.16",
    "@types/react-dom": "^19.1.9",
    "@vitejs/plugin-react": "^5.0.4",
    "eslint": "^9.36.0",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-refresh": "^0.4.22",
    "globals": "^16.4.0",
    "vite": "^7.1.7"
  }
}

```

### frontend/src/main.jsx

```javascript
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import './index.css'
import App from './App.jsx'
import IdeasView from './IdeasView.jsx'
import IdeaBreakdown from './IdeaBreakdown.jsx'
import SimilarityView from './SimilarityView.jsx'

createRoot(document.getElementById('root')).render(
  <StrictMode>
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<App />} />
        <Route path="/ideas" element={<IdeasView />} />
        <Route path="/breakdown" element={<IdeaBreakdown />} />
        <Route path="/similarity" element={<SimilarityView />} />
      </Routes>
    </BrowserRouter>
  </StrictMode>,
)

```

### api/server.py

```python
"""
FastAPI server for Blueprint idea generator
"""

from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import StreamingResponse
from pydantic import BaseModel
from typing import Optional, List
import asyncio
import json
from api.services.idea_generator import IdeaGenerator
from api.services.similarity_reports import HackathonFraudDetector
from api.config.settings import CLAUDE_API_KEY, GEMINI_API_KEY
import anthropic
import google.generativeai as genai

app = FastAPI(title="Blueprint API")

# Enable CORS for frontend
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # Allow all origins for development
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

class GenerateRequest(BaseModel):
    hackathon_url: str
    past_hackathons: Optional[List[str]] = None

async def generate_ideas_stream(hackathon_url: str, past_hackathons: Optional[List[str]] = None):
    """Stream progress updates while generating ideas"""
    
    try:
        # Send initial status
        yield f"data: {json.dumps({'status': 'Initializing...', 'progress': 'Setting up generator'})}\n\n"
        await asyncio.sleep(0.1)
        
        # Create generator
        generator = IdeaGenerator(
            new_hackathon_url=hackathon_url,
            past_hackathon_urls=past_hackathons
        )
        
        yield f"data: {json.dumps({'status': 'Setting up Claude AI...', 'progress': 'Configuring AI'})}\n\n"
        await asyncio.sleep(0.1)
        
        # Setup Claude
        if not generator.setup_claude(CLAUDE_API_KEY):
            yield f"data: {json.dumps({'error': 'Failed to setup Claude API'})}\n\n"
            return
        
        yield f"data: {json.dumps({'status': 'Scraping new hackathon rules...', 'progress': 'Extracting rules and requirements'})}\n\n"
        await asyncio.sleep(0.1)

        # Scrape new hackathon rules
        rules_data = generator.scrape_new_hackathon_rules()

        # Check if scraping failed (403/404 or invalid link)
        if not rules_data or len(rules_data) == 0:
            yield f"data: {json.dumps({'error': 'Invalid link. Unable to access the hackathon page (403/404 error or invalid URL)'})}\n\n"
            return

        yield f"data: {json.dumps({'status': 'Rules scraped successfully', 'progress': 'Found hackathon requirements'})}\n\n"
        await asyncio.sleep(0.1)
        
        # Get past hackathons
        if not generator.past_hackathon_urls:
            yield f"data: {json.dumps({'status': 'Using default past hackathons...', 'progress': 'Selecting 5 popular hackathons'})}\n\n"
            generator.past_hackathon_urls = generator.get_default_hackathons()
            await asyncio.sleep(0.1)
        
        yield f"data: {json.dumps({'status': 'Scraping past hackathon winners...', 'progress': f'Analyzing {len(generator.past_hackathon_urls)} hackathons'})}\n\n"
        await asyncio.sleep(0.1)
        
        # Scrape past hackathons
        winners_data = []
        for i, url in enumerate(generator.past_hackathon_urls, 1):
            yield f"data: {json.dumps({'status': f'Scraping hackathon {i}/{len(generator.past_hackathon_urls)}', 'progress': f'Analyzing {url}'})}\n\n"
            await asyncio.sleep(0.1)
            
            winners = generator.scrape_past_hackathon_winners(url)
            if winners:
                winners_data.append(winners)
        
        yield f"data: {json.dumps({'status': 'Generating ideas with Claude AI...', 'progress': 'Synthesizing winning patterns'})}\n\n"
        await asyncio.sleep(0.1)
        
        # Generate ideas
        try:
            print(f"[DEBUG] Calling Claude with {len(winners_data)} hackathons of data")
            print(f"[DEBUG] Rules data size: {len(str(rules_data))} chars")
            print(f"[DEBUG] Winners data size: {len(str(winners_data))} chars")
            
            ideas = generator.generate_ideas_with_claude(rules_data, winners_data)
            print(f"[DEBUG] Claude returned {len(ideas) if ideas else 0} characters")
            
            if not ideas or len(ideas) < 100:
                error_msg = f"Claude returned insufficient content ({len(ideas) if ideas else 0} chars). Check: 1) API key is valid, 2) Not rate limited, 3) Model name is correct"
                print(f"[ERROR] {error_msg}")
                yield f"data: {json.dumps({'error': error_msg})}\n\n"
                return
            
            # Verify file was created
            ideas_file = f"{generator.output_dir}/ideas.txt"
            import os
            if not os.path.exists(ideas_file):
                print(f"[ERROR] Ideas file was not created at {ideas_file}")
                yield f"data: {json.dumps({'error': 'Ideas file was not created'})}\n\n"
                return

            print(f"[SUCCESS] Ideas file created: {ideas_file}")
            result = {
                'output_dir': generator.output_dir,
                'ideas_file': ideas_file
            }
            yield f"data: {json.dumps({'status': 'Complete!', 'result': result})}\n\n"
            
        except Exception as e:
            print(f"[ERROR] Claude API error: {e}")
            import traceback
            traceback.print_exc()
            yield f"data: {json.dumps({'error': f'Claude API error: {str(e)}'})}\n\n"
            
    except Exception as e:
        yield f"data: {json.dumps({'error': str(e)})}\n\n"

@app.post("/generate")
async def generate_ideas(request: GenerateRequest):
    """Generate hackathon ideas endpoint"""
    print(f"[API] Received request: {request.hackathon_url}")
    return StreamingResponse(
        generate_ideas_stream(request.hackathon_url, request.past_hackathons),
        media_type="text/event-stream",
        headers={
            "Cache-Control": "no-cache",
            "X-Accel-Buffering": "no"
        }
    )

@app.get("/health")
async def health_check():
    """Health check endp
[truncated — 16592 more characters]
```

### frontend/src/App.jsx

```javascript
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import './App.css';

function App() {
  const navigate = useNavigate();
  const [hackathonUrl, setHackathonUrl] = useState('');
  const [isGenerating, setIsGenerating] = useState(false);
  const [status, setStatus] = useState('');
  const [progress, setProgress] = useState([]);
  const [result, setResult] = useState(null);
  const [error, setError] = useState('');

  useEffect(() => {
    document.title = 'Blueprint - AI Hackathon Idea Generator';
  }, []);

  const handleSubmit = async (e) => {
    e.preventDefault();

    if (!hackathonUrl.trim()) {
      setError('Please enter a hackathon URL');
      return;
    }

    setIsGenerating(true);
    setError('');
    setProgress([]);
    setResult(null);
    setStatus('Starting idea generation...');

    try {
      const response = await fetch('http://localhost:8000/generate', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ hackathon_url: hackathonUrl }),
      });

      if (!response.ok) throw new Error('Failed to generate ideas');

      const reader = response.body.getReader();
      const decoder = new TextDecoder();

      while (true) {
        const { done, value } = await reader.read();
        if (done) break;

        const chunk = decoder.decode(value);
        const lines = chunk.split('\n');

        for (const line of lines) {
          if (line.startsWith('data: ')) {
            const data = JSON.parse(line.slice(6));
            if (data.status) setStatus(data.status);
            if (data.progress) setProgress(prev => [...prev, data.progress]);
            if (data.result) {
              setResult(data.result);
              setStatus('Ideas generated successfully!');
            }
            if (data.error) {
              setError(data.error);
              setStatus('Error occurred');
            }
          }
        }
      }
    } catch (err) {
      setError(err.message);
      setStatus('Failed to generate ideas');
    } finally {
      setIsGenerating(false);
    }
  };

  return (
    <div>
      <header className="header">
        <div className="container">
          <div className="header-inner">
            <div className="logo" onClick={() => navigate('/')} style={{ cursor: 'pointer' }}>
              <span className="logo-icon"></span>
              <span>Blueprint</span>
            </div>
          </div>
        </div>
      </header>

      <main>
        <section className="hero">
          <div className="container">
            <h1 className="hero-title">Generate Winning Hackathon Ideas</h1>
            <p className="hero-subtitle">
              AI-powered idea generation that learns from past hackathon winners to create tailored project concepts for your next competition
            </p>
          </div>
        </section>

        <section className="form-section">
          <div className="container">
            <form onSubmit={handleSubmit}>
              <div className="form-group">
                <input
                  type="url"
                  value={hackathonUrl}
                  onChange={(e) => setHackathonUrl(e.target.value)}
                  placeholder="Enter hackathon URL (e.g., https://cal-hacks-12-0.devpost.com)"
                  className="form-input"
                  disabled={isGenerating}
                  required
                />
                <button type="submit" className="btn btn-primary btn-large" disabled={isGenerating}>
                  {isGenerating ? (
                    <>
                      <span className="loading-spinner"></span>
                      Generating...
                    </>
                  ) : (
                    'Generate Ideas'
                  )}
                </button>
              </div>
              {error && <div className="form-error">{error}</div>}
            </form>
          </div>
        </section>

        {status && (
          <section className="status-card fade-in">
            <div className="status-content">
              {isGenerating && <span className="loading-spinner"></span>}
              <span className="status-text">{status}</span>
            </div>
          </section>
        )}

        {progress.length > 0 && (
          <section className="progress-card fade-in">
            <h3 className="progress-title">Progress</h3>
            <div className="progress-list">
              {progress.map((item, index) => (
                <div key={index} className="progress-item">
                  <span className="progress-dot"></span>
                  <span>{item}</span>
                </div>
              ))}
            </div>
          </section>
        )}

        {result && (
          <section className="result-card fade-in">
            <h2 className="result-title">Ideas Generated Successfully</h2>
            <p className="result-subtitle">7 tailored project ideas ready for you</p>
            <div className="result-details">
              <div className="result-detail-item">
                <span className="result-detail-label">Output Directory</span>
                <code className="result-detail-value">{result.output_dir}</code>
              </div>
              <div className="result-detail-item">
                <span className="result-detail-label">Ideas File</span>
                <code className="result-detail-value">{result.ideas_file}</code>
              </div>
            </div>
            <button
              onClick={() => navigate('/ideas', { state: { ideas_file: result.ideas_file } })}
              className="btn btn-primary btn-large"
              style={{ width: '100%' }}
            >
              View Your Ideas
            </button>
          </section>
        )}

        {!isGenerating && !result && (
          <>
            <section className="features">
              <div className="container">
[truncated — 2169 more characters]
```

### api/__init__.py

```python
"""API package for Blueprint idea generator"""

```

### frontend/vite.config.js

```javascript
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
})

```

### frontend/index.html

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Blueprint</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.jsx"></script>
  </body>
</html>

```

[52 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]