Skip to content

Latest commit

 

History

History
102 lines (68 loc) · 2.16 KB

File metadata and controls

102 lines (68 loc) · 2.16 KB

⚙️ SETUP INSTRUCTIONS

Servers are Running! ✅

⚠️ Important: Configure OpenAI API Key

The error "Failed to generate hooks" is because you need to add your OpenAI API key.

Step 1: Get Your OpenAI API Key

  1. Go to https://platform.openai.com/api-keys
  2. Sign in or create an account
  3. Click "Create new secret key"
  4. Copy the key (it starts with sk-)

Step 2: Add the Key to Your .env File

  1. Open the file: server/.env

  2. Replace this line:

    OPENAI_API_KEY=your_openai_api_key_here
    

    With your actual key:

    OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxx
    
  3. Save the file

Step 3: Restart the Server

The servers are already running, but you need to restart them after adding the API key:

Option A - From your terminal:

# Stop the current session (Ctrl+C)
# Then run:
bun run dev

Option B - Let me restart it for you: Just let me know and I'll restart the servers.

Step 4: Test the App

  1. Go to http://localhost:5173
  2. Click "Generate Hooks"
  3. Enter a topic like "productivity tips for developers"
  4. Click "Generate Hooks"

You should now see 5 AI-generated hooks!


💰 OpenAI API Costs

  • GPT-5.2 costs ~$0.03 per request
  • Each hook generation = 1 request
  • Each hook analysis = 1 request
  • Your first $5 is free (on new accounts)

🔍 Troubleshooting

If you still see errors after adding the API key:

  1. Check the key is valid

    • Make sure it starts with sk-
    • No extra spaces or quotes
    • The key hasn't been deleted from OpenAI
  2. Check the .env file

    • File is in: server/.env
    • Format is: OPENAI_API_KEY=sk-your-key
    • No quotes around the key
  3. Restart the servers

    • The .env file is only read on startup
    • You must restart after changing it
  4. Check server logs

    • Look in the terminal where bun run dev is running
    • Any errors will appear there

✅ Once Configured

The app will:

  • Generate 5 unique hooks for any topic
  • Analyze hooks with scores 0-100
  • Provide detailed feedback
  • Save all hooks to history

Enjoy building better hooks! 🚀