{"id":20597732,"url":"https://github.com/triggerdotdev/nextjs-realtime-simple-demo","last_synced_at":"2025-09-26T07:32:04.650Z","repository":{"id":259618880,"uuid":"878685912","full_name":"triggerdotdev/nextjs-realtime-simple-demo","owner":"triggerdotdev","description":"A Trigger.dev Realtime + React hooks + Next.js App Router demo","archived":false,"fork":false,"pushed_at":"2024-10-26T21:25:52.000Z","size":189,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-07T16:54:45.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/triggerdotdev.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}},"created_at":"2024-10-25T21:24:38.000Z","updated_at":"2025-01-02T09:55:19.000Z","dependencies_parsed_at":"2024-10-26T23:15:17.924Z","dependency_job_id":"ddbab7a7-bbc7-44ed-9850-8182affbd380","html_url":"https://github.com/triggerdotdev/nextjs-realtime-simple-demo","commit_stats":null,"previous_names":["triggerdotdev/nextjs-realtime-simple-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triggerdotdev%2Fnextjs-realtime-simple-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triggerdotdev%2Fnextjs-realtime-simple-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triggerdotdev%2Fnextjs-realtime-simple-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triggerdotdev%2Fnextjs-realtime-simple-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triggerdotdev","download_url":"https://codeload.github.com/triggerdotdev/nextjs-realtime-simple-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234296428,"owners_count":18810001,"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","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":[],"created_at":"2024-11-16T08:23:42.360Z","updated_at":"2025-09-26T07:32:04.268Z","avatar_url":"https://github.com/triggerdotdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a [Next.js](https://nextjs.org) demo project that uses [Trigger.dev Realtime](https://trigger.dev/docs/realtime) and the Trigger.dev [React Hooks](https://trigger.dev/docs/frontend/react-hooks) to perform a background task that updates the page in real-time.\n\n## Getting Started\n\nIf you haven't already, sign up for a free account at [Trigger.dev](https://trigger.dev) and create a new project. Update the project reference in `trigger.config.ts` with your project's reference.\n\nThen, copy the `.env.local.example` file to `.env.local` and update the `TRIGGER_API_KEY` with your API key and the `OPENAI_API_KEY` with your OpenAI API key.\n\n```bash\nTRIGGER_API_KEY=your-api-key\nOPENAI_API_KEY=your-openai-api-key\n```\n\nNext, run the Next.js development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n\nAnd in a new terminal window, run the Trigger.dev CLI:\n\n```bash\nnpx trigger.dev@latest dev\n```\n\n### Relevant Files\n\n- `src/trigger/tasks.ts`: Where our `generateFunctionDocs` background task is defined.\n- `src/lib/metadataStore.ts`: Wraps the run metadata with type-safe access.\n- `src/app/page.tsx`: The main page that invokes the server action function that triggers the background task.\n- `src/app/actions.ts`: The server action function that triggers the background task and redirects to `/runs/[id]`.\n- `src/app/runs/[id]/page.tsx`: The page that displays the status of the background task and the result when it's done.\n- `src/app/hooks/useGenerateFunctionDocs.ts`: A custom React Hook that uses the Trigger.dev React Hooks to fetch the function documentation in real-time.\n- `src/app/components/GenerateFunctionDocs.tsx`: A component that uses the `useGenerateFunctionDocs` hook to display the function documentation in real-time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriggerdotdev%2Fnextjs-realtime-simple-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriggerdotdev%2Fnextjs-realtime-simple-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriggerdotdev%2Fnextjs-realtime-simple-demo/lists"}