Skip to content

Repository files navigation

cf_ai_hackmatch - HackMatch

AI-Powered RAPID Brainstorming Platform for Hackathon Teams

Overview

HackMatch guides hackathon teams through the proven RAPID framework, helping them go from idea chaos to clear MVP in 30 minutes instead of 3-5 hours of unstructured brainstorming.

Option 1 - Just use the deployed link (EASIEST): ✅https://main.hackmatch.pages.dev/

Option 2 - Run locally (REQUIRES CLOUDFLARE ACCOUNT):

wrangler login # ← MISSING from instructions! npm install npm run dev npx serve public -p 8080

Quick Start (3 Steps)

# 1. Install dependencies
npm install

# 2. Start backend (in Terminal 1)
npm run dev

# 3. Start frontend (in Terminal 2)
npx serve public -p 8080

Then open http://localhost:8080 in your browser!

Setup Instructions

Prerequisites

  • Node.js 18+
  • npm
  • Cloudflare account (for deployment)

Local Development

  1. Clone and Install:

    git clone <your-repo-url>
    cd cf_ai_hackmatch
    npm install
  2. Run Backend (Terminal 1):

    npm run dev

    Backend will be available at http://localhost:8788

  3. Run Frontend (Terminal 2):

    Option A - Using Python (Mac/Linux):

    cd public
    python3 -m http.server 8080

    Option B - Using npx (Works on all platforms):

    npx serve public -p 8080

    Frontend will be available at http://localhost:8080

  4. Test with Multiple Users: Open multiple browser windows/tabs to simulate a team collaborating in real-time.

How it works: The frontend automatically detects localhost and connects to the correct backend:

  • Local: http://localhost:8788 (HTTP) and ws://localhost:8788 (WebSocket)
  • Production: https://cf_ai_hackmatch.aadhavmanimurugan.workers.dev

Troubleshooting:

  • If port 8080 is in use: npx serve public -p 3000 (use different port)
  • If port 8788 is in use: wrangler will automatically choose another port
  • Make sure both backend and frontend servers are running

Project Structure

cf_ai_hackmatch/
├── src/
│   ├── index.ts              # Worker entry point
│   ├── HackMatchAgent.ts     # Main Durable Object (1,551 lines)
│   ├── schema.sql            # SQLite database schema (13 tables)
│   ├── ai/
│   │   ├── client.ts         # Workers AI integration
│   │   └── prompts.ts        # AI prompt templates
│   └── types/
│       ├── rapid.ts          # RAPID workflow types
│       └── room.ts           # Room state types
├── public/
│   └── index.html            # Frontend (standalone HTML/JS, 1,269 lines)
├── wrangler.toml             # Cloudflare Workers config
├── package.json
├── README.md                 # This file
└── PROMPTS.md                # AI prompts documentation

Deployment

Live Deployment

The application is currently deployed and accessible at:

Visit the frontend URL to start a brainstorming session!

Deploy Backend (Worker + Durable Object)

npm run deploy

This will deploy:

  • The HackMatch Worker (handles HTTP/WebSocket routing)
  • The HackMatchAgent Durable Object (manages room state and AI)
  • SQLite database (automatic with Durable Objects)
  • Workers AI integration (automatic)

Deploy Frontend (Cloudflare Pages)

Option 1 - Using Wrangler:

npx wrangler pages deploy public

Option 2 - Via Cloudflare Dashboard:

  1. Go to Cloudflare Dashboard → Pages
  2. Create new project
  3. Upload the public/ directory
  4. Deploy

The frontend at public/index.html is a complete interactive demo that connects to the deployed Worker.

Testing Locally

Terminal 1 - Start the Worker:

npm run dev

Terminal 2 - Serve the frontend:

cd public
python3 -m http.server 8080
# or: npx serve

Then open http://localhost:8080 in your browser.

Note: When testing locally, the WebSocket will connect to localhost:8788 (the wrangler dev server).

RAPID Framework (6 Stages)

  1. Review (3 min): Select hackathon challenges to focus on
  2. All Ideas (10 min): Silent brainstorming → group sharing with AI combinations
  3. Prioritize (5 min): Score ideas on feasibility with AI-powered objective scoring
  4. PRD (7 min): AI-guided 6-question Product Requirements Document creation
  5. Identify MVP (5 min): Drag features into Must/Nice/Out of Scope, AI suggests tech stack
  6. Decide (2 min): Final vote and export project summary

Technology Stack

  • Backend: Cloudflare Workers + Durable Objects
  • AI: Workers AI (Llama 3.1-8b-instruct)
  • Frontend: Standalone HTML/JavaScript (no framework)
  • Database: SQLite in Durable Objects (13 tables)
  • Real-time: WebSocket (via Durable Objects API)

This project was built for the Cloudflare AI assignment. See PROMPTS.md for all AI prompts used in development.

About

HackMatch

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages