{"id":30145208,"url":"https://github.com/hookdeck/deepwork","last_synced_at":"2025-08-11T08:11:21.859Z","repository":{"id":308882295,"uuid":"1034413312","full_name":"hookdeck/deepwork","owner":"hookdeck","description":"DeepWork is a web application that demonstrates the power of combining OpenAI's Deep Research API with the Hookdeck Event Gateway to support highly reliable and scalable asynchronous workflows and background jobs.","archived":false,"fork":false,"pushed_at":"2025-08-08T12:58:22.000Z","size":190,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T13:33:57.913Z","etag":null,"topics":["asyncronous-jobs","background-jobs","background-workers","hookdeck","nextjs","openai","openai-api","typescript","webhooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hookdeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T10:54:30.000Z","updated_at":"2025-08-08T13:06:48.000Z","dependencies_parsed_at":"2025-08-08T13:34:00.864Z","dependency_job_id":"6113928a-b818-4c08-9f55-8907a363c601","html_url":"https://github.com/hookdeck/deepwork","commit_stats":null,"previous_names":["hookdeck/deepwork"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/hookdeck/deepwork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fdeepwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fdeepwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fdeepwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fdeepwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hookdeck","download_url":"https://codeload.github.com/hookdeck/deepwork/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fdeepwork/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269850366,"owners_count":24485177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncronous-jobs","background-jobs","background-workers","hookdeck","nextjs","openai","openai-api","typescript","webhooks"],"created_at":"2025-08-11T08:11:19.747Z","updated_at":"2025-08-11T08:11:21.838Z","avatar_url":"https://github.com/hookdeck.png","language":"TypeScript","readme":"# DeepWork: OpenAI Deep Research + Hookdeck Event Gateway\n\nDeepWork is a web application that demonstrates the power of combining [OpenAI's Deep Research](https://platform.openai.com/docs/guides/deep-research) API with the [Hookdeck Event Gateway](https://hookdeck.com/event-gateway) to support highly reliable and scalable asynchronous workflows and background jobs.\n\nThe application enables users to submit complex research questions to OpenAI's Deep Research service, which runs asynchronously in the background. Hookdeck manages both the outbound API requests (via queue) and inbound webhook responses, providing complete visibility into the entire research workflow.\n\n## Features\n\n- **Asynchronous Research**: Submit long-running research tasks to OpenAI without blocking the UI.\n- **Request Queuing**: Outbound requests to OpenAI are queued through Hookdeck for resilience and visibility.\n- **Reliable Webhooks**: Hookdeck ensures reliable delivery of OpenAI's webhook responses.\n- **Event Timeline**: View a detailed timeline of both outbound requests and inbound webhooks for each research task.\n- **Simple Authentication**: A straightforward demo authentication system using NextAuth.js.\n- **Serverless-first**: Built with Next.js and designed for deployment on Vercel.\n\n## Architecture\n\n```mermaid\ngraph TB\n    subgraph \"DeepWork Application\"\n        UI[Next.js Web UI]\n        API[Next.js API Routes]\n        KV[Vercel KV Store]\n    end\n\n    subgraph \"Hookdeck Infrastructure\"\n        subgraph \"Connection: openai-queue\"\n            SourceA[Source A\u003cbr/\u003eQueue Endpoint]\n            DestA[Destination\u003cbr/\u003eOpenAI API]\n        end\n\n        subgraph \"Connection: openai-webhook\"\n            SourceB[Source B\u003cbr/\u003eWebhook Endpoint]\n            DestB[Destination\u003cbr/\u003e/api/webhooks/openai]\n        end\n    end\n\n    subgraph \"OpenAI\"\n        DeepResearch[Deep Research API\u003cbr/\u003eBackground Mode]\n    end\n\n    UI --\u003e API\n    API --\u003e KV\n    API --\u003e SourceA\n    SourceA --\u003e DestA\n    DestA --\u003e DeepResearch\n    DeepResearch --\u003e SourceB\n    SourceB --\u003e DestB\n    DestB --\u003e API\n    API --\u003e KV\n```\n\n## Tech Stack\n\n| Component      | Technology               | Purpose                                               |\n| -------------- | ------------------------ | ----------------------------------------------------- |\n| Language       | TypeScript               | Type-safe development throughout                      |\n| Framework      | Next.js 14+ (App Router) | Modern React framework with API routes                |\n| Authentication | NextAuth.js              | Simple demo authentication                            |\n| Data Store     | Vercel KV                | Serverless Redis for persistence                      |\n| Event Gateway  | Hookdeck Event Gateway   | Event Gateway infrastructure for queuing and webhooks |\n| AI Service     | OpenAI Deep Research     | Long-running research capabilities                    |\n| Deployment     | Vercel                   | Serverless deployment platform                        |\n| Polling        | SWR                      | Data fetching with automatic revalidation             |\n\n## Getting Started\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/en/) (v18 or newer)\n- A [Hookdeck](https://hookdeck.com/) account and API Key.\n- An [OpenAI](https://openai.com/) account and API Key.\n\n### 1. Installation\n\nClone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/hookdeck/deepwork.git\ncd deepwork\nnpm install\n```\n\n### 2. Environment Setup\n\nThis project uses a setup script to configure your local environment.\n\n```bash\nnpm run setup:dev\n```\n\nThe script will prompt you for your Hookdeck and OpenAI API keys and create a `.env.local` file with the necessary environment variables.\n\n### 3. Start the Development Server\n\nOnce the setup is complete, start the development server:\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) in your browser to see the application.\n\n### 4. Set up Hookdeck for Local Development\n\nTo receive webhooks from OpenAI locally, you need to use the Hookdeck CLI.\n\nFirst, log in to your Hookdeck account:\n\n```bash\nnpm run hookdeck:login\n```\n\nThen, start listening for webhooks:\n\n```bash\nnpm run hookdeck:listen\n```\n\nThis command forwards webhooks for the `openai-webhook` source to your local development server. The `setup:dev` script will have already configured the necessary Hookdeck connections for you.\n\n## Available Scripts\n\n- `npm run dev`: Starts the Next.js development server.\n- `npm run build`: Builds the application for production.\n- `npm run start`: Starts a production server.\n- `npm run lint`: Lints the codebase.\n- `npm run setup:dev`: Guides you through setting up your `.env.local` file.\n- `npm run hookdeck`: Access the Hookdeck CLI.\n- `npm run hookdeck:login`: Log in to your Hookdeck account.\n- `npm run hookdeck:listen`: Start forwarding webhooks to your local server.\n\n## Production Deployment (TODO)\n\nThis application is designed for deployment on [Vercel](https://vercel.com/).\n\n- [ ] Configure production environment variables in Vercel.\n- [ ] Set up a production Vercel KV store.\n- [ ] Update `NEXTAUTH_URL` to the production URL.\n- [ ] Ensure the OpenAI webhook is configured with the production Hookdeck source URL.\n\n## Learn More\n\nTo learn more about the technologies used in this project, see the following resources:\n\n- [Hookdeck Documentation](https://hookdeck.com/docs) - learn about Hookdeck's features.\n- [OpenAI API Documentation](https://platform.openai.com/docs/api-reference) - learn about the OpenAI API.\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fdeepwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhookdeck%2Fdeepwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fdeepwork/lists"}