Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/5t111111/github-readme-ai-generator
https://github.com/5t111111/github-readme-ai-generator
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/5t111111/github-readme-ai-generator
- Owner: 5t111111
- Created: 2023-03-24T08:05:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-24T08:39:38.000Z (over 1 year ago)
- Last Synced: 2024-04-13T16:15:51.423Z (7 months ago)
- Language: CSS
- Homepage: https://github-readme-ai-generator.vercel.app
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## GitHub Readme AI Generator
- https://youtu.be/kHsTp2LENUI
- https://github.com/jherr/github-openai-deferThis Next.js app (_with app directory_) leverages Defer using GitHub data as a prompt for OpenAI completion API.
## Getting started
### 1. Install the dependencies
```
yarn
```### 2. Deploy on Vercel and Defer
Make sure to get a [GitHub personal access token](https://github.com/settings/tokens) and [an OpenAI API Key](https://platform.openai.com/account/api-keys).
Then, [configure the application on Defer and Vercel](https://docs.defer.run/quickstart/next/).
## How it works
The Next.js API Route `/api/gitHubProfile/[usernameOrExecID]` is used as follow:
- Trigger a new generation: `POST /api/gitHubProfile/charlypoly`
- Get the status and result of a profile text generation: `GET /api/gitHubProfile/2MeNNf2OTVZP0MUrs1ghwXaUtm4`
The `generateGitHubProfile()` Defer background function handles fetching data from GitHub and forwarding the proper prompt to OpenAI.
Triggering an execution of `generateGitHubProfile()` is achieved by simply calling it from the Next.js API Route:
```ts
import { NextRequest, NextResponse } from "next/server";
import generateGitHubProfile from "@/defer/generateGitHubProfile";export async function POST(
_request: NextRequest,
{ params }: { params: { usernameOrExecId: string } }
) {
const ret = await generateGitHubProfile(params.usernameOrExecId);
return NextResponse.json(ret);
}
```