Skip to content

bomac1193/Hooked

Repository files navigation

Hooked

Hooked is an API-first lab for spinning up ultra-high performing hooks for TikTok, Reels, Shorts, and YouTube long form. The MVP ships a dark, neon-tinged dashboard plus REST endpoints Idolforge (or any other app) can call directly.

Stack

  • Next.js 14 App Router + TypeScript
  • Tailwind CSS for the cyber/creator UI
  • Prisma + SQLite (easily portable to Postgres)
  • NextAuth Credentials flow with bcrypt hashing
  • OpenAI GPT-4o-mini integration (swap for any provider inside lib/services/aiClient.ts)
  • SQLite doesn’t support native enums/JSON, so arrays/enums are stored as JSON strings in Prisma models and hydrated via helper utilities.

Key features

  • Email/password auth (/signup, /login)
  • Dashboard showing avatars + latest hooks
  • Avatar builder with presets, tag inputs, and multi-platform focus selection
  • Hook Lab that generates 10-hook stacks per platform, saves results, and exposes them via API
  • Trend service abstraction with mocked data + LLM clustering (ready for real APIs)
  • External POST /api/hooks/generate for Idolforge or other partners (API key based)

Getting started

  1. Install deps (requires Node 18+):
    npm install
  2. Copy env template:
    cp .env.example .env
  3. Fill the env vars:
    • DATABASE_URL – e.g. file:./dev.db for local SQLite
    • NEXTAUTH_SECRET – any long random string
    • OPENAI_API_KEY – optional. Without it, mocked hooks are returned
    • HOOKED_API_KEY – secret token for external API access
  4. Prep the database:
    npx prisma migrate dev --name init
    (run npx prisma generate whenever the schema changes)
  5. Start the dev server:
    npm run dev
  6. Visit http://localhost:3000/signup to create your first account.

API

POST /api/hooks/generate

  • Internal (requires session cookie)
    {
      "avatarProfileId": "cuid",
      "platforms": ["TIKTOK", "YOUTUBE_SHORT"],
      "workingTitle": "",
      "description": "",
      "goal": "go viral",
      "useTrends": true
    }
    Responds with hooks persisted in Prisma. Each hook includes text, styleTags, predictedScore, trendAlignment, rationale, timestamps, etc.
  • External (API key mode)
    {
      "apiKey": "HOOKED_API_KEY",
      "avatarProfile": {
        "name": "Neon Cherub",
        "type": "AI_INFLUENCER",
        "toneOfVoice": "dark, poetic, seductive",
        "niche": "futuristic afro-club music",
        "likes": ["latex fashion", "underground raves"],
        "personalityTraits": ["mysterious", "witty", "rebellious"],
        "primaryLanguage": "English",
        "secondaryLanguages": ["French"],
        "platformFocus": ["YOUTUBE_SHORT", "TIKTOK"]
      },
      "contentIdea": {
        "platform": "TIKTOK",
        "workingTitle": "How I built my cyberpunk afro-rave sound",
        "description": "Breaking down my sound design for a new afro-futurist club track with distorted drums and alien vocals.",
        "goal": "go viral"
      },
      "useTrends": true
    }
    Responds with hook JSON but does not persist to the DB.

Other useful routes

  • POST /api/auth/signup – create user
  • GET /api/avatars / POST /api/avatars
  • GET /api/hooks – latest saved hooks for the authenticated user
  • GET /api/content-ideas – last 20 ideas + avatars

Services & extensibility

  • lib/services/trendService.ts – drop in real YouTube/TikTok APIs later; today it mocks trending topics and uses an LLM to map angles.
  • lib/services/hookGenerator.ts – core orchestrator pulling avatar/content/trend context, building the system prompt, parsing JSON, and saving output.
  • lib/services/aiClient.ts – single integration point for swapping out the AI vendor.

TODOs

  • Integrate real trend APIs + georegional filters
  • Rate limiting on /api/hooks/generate
  • Advanced scoring models + historical performance feedback
  • Multi-language hook output toggle
  • Avatar collaboration & sharing between teams

Running tests / lint

This MVP doesn’t ship tests yet. Before production hardening, add e2e coverage (Playwright) plus integration tests for the hook generator mocks, along with ESLint/Prettier in CI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages