Full-stack Next.js app that generates internal release notes by pulling live commit data from GitHub and summarising it with the OpenAI GPT-5 model via the Vercel AI SDK.
- Single endpoint (
GET /deploy-report) that validates the requested date window and enforces a 30-day cap. - Live GitHub fetch using the provided access token; merge commits are automatically filtered out.
- LLM summary generation via Vercel AI SDK +
openai/gpt-5, returning semantic HTML without background jobs. - Responsive React UI that matches the original colour palette while upgrading to the Next.js app router.
- Spec-compliant error handling for validation, rate limits, upstream failures, and the 120 s timeout budget.
-
Install dependencies
npm install
-
Configure environment variables
cp .env.local.example .env.local # then edit .env.local with real valuesRequired keys:
GITHUB_TOKEN– token with read access to the target repoGITHUB_REPO–OWNER/REPOOPENAI_API_KEY– OpenAI API key with access to GPT-5 (Responses API)OPENAI_MODEL– e.g.gpt-5(falls back toOPENAI_REALTIME_MODELfor backwards compatibility).
Use the bare model name—any provider prefix likeopenai/is stripped automatically.
-
Run locally
npm run dev
The app serves both the UI and the
/deploy-reportroute athttp://localhost:3000.
GET /deploy-report?start=YYYY-MM-DD&end=YYYY-MM-DD
- Validates input format, enforces
start <= end, and rejects ranges > 30 days (413). - Queries GitHub commits in
[startT00:00:00Z, endT23:59:59Z], paginatingper_page=100. - Drops merge commits (multiple parents or messages that begin with “Merge”).
- Builds compact bullets and requests a semantic HTML report from OpenAI GPT-5 via Vercel AI SDK.
{
"repo": "OWNER/REPO",
"start": "YYYY-MM-DD",
"end": "YYYY-MM-DD",
"commits": [
{
"sha": "string",
"date": "ISO-8601",
"author": { "login": "string|null", "name": "string|null" },
"message": "full commit message",
"summary_line": "first line of message",
"is_merge": false
}
],
"summary_html": "<section>...</section>",
"meta": {
"commit_count": 0,
"model": "string",
"generated_at": "ISO-8601",
"source": "github_live"
}
}400– Missing or invalid dates,start > end413– Date span over 30 days429– GitHub secondary rate limit surfaced502– Upstream provider failure (GitHub/OpenAI)504– Total processing time exceeded 120 s
- Retains the original layout, palettes, and interaction patterns.
- Uses React state to handle validation, loaders, error surfaces, and empty states.
- Inserts the
summary_htmlblock withdangerouslySetInnerHTML; keep upstream prompt constrained to semantic HTML.
- Local smoke test:
npm run dev, hithttp://localhost:3000/deploy-report?start=YYYY-MM-DD&end=YYYY-MM-DD. - Timeout budget: ensure repos with large commit history stay under 120 s; adjust the GitHub token’s rate limit if needed.
- Vercel deploy: the project is App Router–ready. Add the four environment variables in the project settings before deploying.
Internal project – all rights reserved.