-
Notifications
You must be signed in to change notification settings - Fork 6
add nextjs #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
add nextjs #2
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/versions | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # env files (can opt-in for committing if needed) | ||
| .env* | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,120 +1,36 @@ | ||
| # 🚀 ReadmeGenAI | ||
| This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). | ||
|
|
||
| **ReadmeGenAI** is an automated documentation engine that transforms GitHub repository data into professional, high-quality `README.md` files. By analyzing your project's codebase, dependencies, and metadata via the GitHub API, it uses Large Language Models (LLMs) to draft comprehensive documentation in seconds. | ||
| ## Getting Started | ||
|
|
||
| [**Explore the Demo »**](https://readmegenai.vercel.app) | ||
| First, run the development server: | ||
|
|
||
| --- | ||
| ```bash | ||
| npm run dev | ||
| # or | ||
| yarn dev | ||
| # or | ||
| pnpm dev | ||
| # or | ||
| bun dev | ||
| ``` | ||
|
|
||
| ## 📑 Table of Contents | ||
| * [About the Project](#about-the-project) | ||
| * [Key Features](#key-features) | ||
| * [Tech Stack](#tech-stack) | ||
| * [Getting Started](#getting-started) | ||
| * [Architecture Flow](#architecture-flow) | ||
| * [Roadmap](#roadmap) | ||
| * [Contributing](#contributing) | ||
| * [License](#license) | ||
| Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
|
||
| --- | ||
| You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
|
||
| ## 🧐 About the Project | ||
| This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
|
|
||
| Writing documentation is often the most neglected part of the development cycle. **ReadmeGenAI** bridges the gap between "code complete" and "documentation complete." | ||
| ## Learn More | ||
|
|
||
| Unlike generic AI prompts, this tool specifically scrapes your `package.json`, language distribution, and repository description to provide the AI with context-aware data, ensuring the generated README is accurate and relevant to your actual tech stack. | ||
| To learn more about Next.js, take a look at the following resources: | ||
|
|
||
| ## ✨ Key Features | ||
| - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
| - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
|
||
| * **Repo-to-Readme:** Just paste a URL; the engine handles the rest. | ||
| * **Contextual Intelligence:** Automatically detects frameworks, libraries, and project intent. | ||
| * **Live Preview:** Real-time Markdown rendering using `react-markdown`. | ||
| * **One-Click Copy:** Seamlessly move your new documentation into your local editor. | ||
| * **Developer-Centric:** Built with Type Safety and Serverless architecture. | ||
| You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
|
|
||
| ## 🛠 Tech Stack | ||
| ## Deploy on Vercel | ||
|
|
||
| | Layer | Technology | | ||
| | :--- | :--- | | ||
| | **Frontend** | [Next.js 15](https://nextjs.org/), TypeScript | | ||
| | **Styling** | [Tailwind CSS](https://tailwindcss.com/) | | ||
| | **Backend** | Next.js API Routes (Node.js) | | ||
| | **AI Intelligence** | OpenAI GPT-3.5 / GPT-4 | | ||
| | **Data Source** | [GitHub REST API](https://docs.github.com/en/rest) | | ||
| | **Deployment** | [Vercel](https://vercel.com/) | | ||
| The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
|
||
| --- | ||
|
|
||
| ## 🚀 Getting Started | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| * A GitHub [Personal Access Token](https://github.com/settings/tokens) (for higher rate limits). | ||
| * An [OpenAI API Key](https://platform.openai.com/api-keys). | ||
|
|
||
| ### Installation | ||
|
|
||
| 1. **Clone the Repo** | ||
| ```bash | ||
| git clone [https://github.com/your-username/readmegenai.git](https://github.com/your-username/readmegenai.git) | ||
| cd readmegenai | ||
| ``` | ||
|
|
||
| 2. **Install Dependencies** | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 3. **Environment Variables** | ||
| Create a `.env.local` file in the root directory: | ||
| ```env | ||
| GITHUB_TOKEN=your_github_token | ||
| OPENAI_API_KEY=your_openai_key | ||
| ``` | ||
|
|
||
| 4. **Run Development Server** | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🏗 Architecture Flow | ||
|
|
||
| The application follows a streamlined data pipeline to ensure accuracy: | ||
|
|
||
| 1. **Ingestion:** User submits a GitHub URL. | ||
| 2. **Parsing:** `parseRepoUrl.ts` extracts the owner and repository name. | ||
| 3. **Data Fetching:** `/api/fetchRepo` queries GitHub for metadata and `package.json` content. | ||
| 4. **AI Processing:** `/api/generateReadme` feeds a structured prompt into the AI engine. | ||
| 5. **Rendering:** The frontend receives the Markdown string and renders it via `MarkdownPreview.tsx`. | ||
|
|
||
| --- | ||
|
|
||
| ## 🗺 Roadmap | ||
|
|
||
| - [x] **Phase 1:** MVP with URL input and Markdown copy. | ||
| - [ ] **Phase 2:** GitHub OAuth integration for one-click "Commit to Repo." | ||
| - [ ] **Phase 3:** Multiple visual templates (Minimalist, Corporate, Creative). | ||
| - [ ] **Phase 4:** Support for local LLMs (GPT4All / Ollama) for privacy-conscious users. | ||
|
|
||
| --- | ||
|
|
||
| ## 🤝 Contributing | ||
|
|
||
| Contributions are what make the open-source community such an amazing place to learn, inspire, and create. | ||
|
|
||
| 1. Fork the Project. | ||
| 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`). | ||
| 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`). | ||
| 4. Push to the Branch (`git push origin feature/AmazingFeature`). | ||
| 5. Open a Pull Request. | ||
|
|
||
| --- | ||
|
|
||
| ## 📄 License | ||
|
|
||
| Distributed under the MIT License. See `LICENSE` for more information. | ||
|
|
||
| --- | ||
| *Built with ❤️ by the ReadmeGenAI Team* | ||
| Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| @import "tailwindcss"; | ||
|
|
||
| :root { | ||
| --background: #ffffff; | ||
| --foreground: #171717; | ||
| } | ||
|
|
||
| @theme inline { | ||
| --color-background: var(--background); | ||
| --color-foreground: var(--foreground); | ||
| --font-sans: var(--font-geist-sans); | ||
| --font-mono: var(--font-geist-mono); | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { | ||
| :root { | ||
| --background: #0a0a0a; | ||
| --foreground: #ededed; | ||
| } | ||
| } | ||
|
|
||
| body { | ||
| background: var(--background); | ||
| color: var(--foreground); | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import type { Metadata } from "next"; | ||
| import { Geist, Geist_Mono } from "next/font/google"; | ||
| import "./globals.css"; | ||
|
|
||
| const geistSans = Geist({ | ||
| variable: "--font-geist-sans", | ||
| subsets: ["latin"], | ||
| }); | ||
|
|
||
| const geistMono = Geist_Mono({ | ||
| variable: "--font-geist-mono", | ||
| subsets: ["latin"], | ||
| }); | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Create Next App", | ||
| description: "Generated by create next app", | ||
| }; | ||
|
|
||
| export default function RootLayout({ | ||
| children, | ||
| }: Readonly<{ | ||
| children: React.ReactNode; | ||
| }>) { | ||
| return ( | ||
| <html lang="en"> | ||
| <body | ||
| className={`${geistSans.variable} ${geistMono.variable} antialiased`} | ||
| > | ||
| {children} | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import Image from "next/image"; | ||
|
|
||
| export default function Home() { | ||
| return ( | ||
| <div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black"> | ||
| <main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start"> | ||
| <Image | ||
| className="dark:invert" | ||
| src="/next.svg" | ||
| alt="Next.js logo" | ||
| width={100} | ||
| height={20} | ||
| priority | ||
| /> | ||
| <div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left"> | ||
| <h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50"> | ||
| To get started, edit the page.tsx file. | ||
| </h1> | ||
| <p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400"> | ||
| Looking for a starting point or more instructions? Head over to{" "} | ||
| <a | ||
| href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" | ||
| className="font-medium text-zinc-950 dark:text-zinc-50" | ||
| > | ||
| Templates | ||
| </a>{" "} | ||
| or the{" "} | ||
| <a | ||
| href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" | ||
| className="font-medium text-zinc-950 dark:text-zinc-50" | ||
| > | ||
| Learning | ||
| </a>{" "} | ||
| center. | ||
| </p> | ||
| </div> | ||
| <div className="flex flex-col gap-4 text-base font-medium sm:flex-row"> | ||
| <a | ||
| className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]" | ||
| href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| <Image | ||
| className="dark:invert" | ||
| src="/vercel.svg" | ||
| alt="Vercel logomark" | ||
| width={16} | ||
| height={16} | ||
| /> | ||
| Deploy Now | ||
| </a> | ||
| <a | ||
| className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]" | ||
| href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| Documentation | ||
| </a> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { defineConfig, globalIgnores } from "eslint/config"; | ||
| import nextVitals from "eslint-config-next/core-web-vitals"; | ||
| import nextTs from "eslint-config-next/typescript"; | ||
|
|
||
| const eslintConfig = defineConfig([ | ||
| ...nextVitals, | ||
| ...nextTs, | ||
| // Override default ignores of eslint-config-next. | ||
| globalIgnores([ | ||
| // Default ignores of eslint-config-next: | ||
| ".next/**", | ||
| "out/**", | ||
| "build/**", | ||
| "next-env.d.ts", | ||
| ]), | ||
| ]); | ||
|
|
||
| export default eslintConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import type { NextConfig } from "next"; | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| /* config options here */ | ||
| }; | ||
|
|
||
| export default nextConfig; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.