Skip to content

AI-powered documentation generator for any GitHub repository. Turn code into beautiful docs in seconds!

License

Notifications You must be signed in to change notification settings

shubhamsharma-10/CodeNarrator

Repository files navigation

CodeNarrator

AI-Powered Documentation Generator for GitHub Repositories

Turn any GitHub repository into professional documentation in seconds!

Deployed on Vercel Vercel AI SDK CodeRabbit Next.js 16 License: MIT


๐Ÿ† Built for WeMakeDevs Hackathon 2025

Live Demo โ€ข Features โ€ข Demo โ€ข Tech Stack โ€ข Architecture โ€ข Quick Start


๐Ÿ“น Demo

Watch Demo

๐Ÿ‘† Click to watch the full demo on YouTube


๐ŸŽฏ Problem Statement

The Documentation Crisis in Software Development

Documentation is the most neglected yet crucial part of any software project.

The Problem Impact
๐Ÿ“š Writing docs is time-consuming Developers skip it entirely
๐Ÿ”„ Docs become outdated quickly Users get confused, issues pile up
๐Ÿ˜ด It's tedious and boring Quality suffers, incomplete information
๐Ÿ†• New contributors struggle Onboarding takes weeks instead of days

The Statistics

  • 91% of developers say good documentation is important
  • Only 44% of projects have adequate documentation
  • Poor documentation costs companies $62 billion annually in developer time

๐Ÿ’ก Our Solution

CodeNarrator uses AI to analyze your entire GitHub repository and generate professional-grade documentation instantly.

How It Solves the Problem

Problem CodeNarrator Solution
Time-consuming โšก Generate docs in seconds, not hours
Outdated docs ๐Ÿ”„ Regenerate anytime with one click
Boring to write ๐Ÿค– AI does the heavy lifting
Missing context ๐Ÿ” AI analyzes entire codebase for accuracy

Features

Core Features

Feature Description
๐Ÿ”— Universal GitHub Support Works with any public GitHub repository
๐Ÿค– AI-Powered Analysis Analyzes code structure, dependencies, languages, and patterns
โšก Real-time Streaming Watch documentation generate live character by character
๐Ÿ“„ 4 Documentation Types README, Installation Guide, API Docs, Contributing Guide
๐Ÿ‘๏ธ Preview/Raw Toggle Switch between beautifully rendered markdown and raw code
๐Ÿ“‹ One-Click Copy Copy generated documentation to clipboard instantly
๐Ÿ’พ Download as Markdown Export documentation as .md files
๐ŸŒ™ Dark Mode UI Modern, eye-friendly dark interface

Screenshots

Landing Page

Landing Page

Repository Input

Input Page

Preview Mode & Raw Mode

Preview Mode Raw Mode


๐Ÿ› ๏ธ Tech Stack

Frontend

Technology Purpose
Next.js 16 React framework with App Router
React 19 UI library
Tailwind CSS Utility-first CSS framework
shadcn/ui Accessible component library
Lucide Icons Beautiful icon set

AI & Backend

Technology Purpose
Vercel AI SDK Streaming AI responses (@ai-sdk/openai)
OpenRouter AI model gateway
LLaMA 3.2 Large language model for generation
GitHub REST API Repository analysis and data fetching

DevOps & Quality

Technology Purpose
Vercel Deployment and hosting
CodeRabbit AI-powered code reviews
TypeScript Type safety
ESLint Code linting

Architecture

System Overview

Architecture

Data Flow

Data Flow

๐ŸŽฎ How It Works

Step-by-Step Process

Step 1: Paste Repository URL

Enter any public GitHub repository URL. The app validates the URL format in real-time.

Step 2: Repository Analysis

Our backend fetches and analyzes:

  • ๐Ÿ“Š Repository metadata (stars, forks, language, topics)
  • ๐Ÿ“ File structure (up to 100 files)
  • ๐Ÿ”ค Language breakdown (percentages)
  • ๐Ÿ“„ Key files content (README, package.json, etc.)

Step 3: Select Documentation Type

Choose from 4 documentation types:

Type What It Generates
README Project overview, features, quick start, structure
Installation Prerequisites, step-by-step setup, troubleshooting
API Docs Endpoints, request/response formats, examples
Contributing How to contribute, PR process, code standards

Step 4: AI Generation

The AI processes the repository context and generates documentation with:

  • Real-time streaming (see text appear live)
  • Proper markdown formatting
  • Code examples and snippets
  • Best practices included

Step 5: Preview & Export

  • Preview Mode: See beautifully rendered markdown
  • Raw Mode: View/edit the markdown source
  • Copy: One-click clipboard copy
  • Download: Save as .md file

๐Ÿš€ Quick Start

Prerequisites

Requirement Version
Node.js 18.0 or higher
npm 9.0 or higher
OpenRouter API Key Get free key

Installation

# 1. Clone the repository
git clone https://github.com/shubhamsharma-10/CodeNarrator.git

# 2. Navigate to project directory
cd CodeNarrator

# 3. Install dependencies
npm install

# 4. Set up environment variables
cp .env.example .env.local

Environment Variables

Create a .env.local file with:

OPENROUTER_API_KEY=your_openrouter_api_key_here

GITHUB_TOKEN=your_github_token_here

Run Locally

# Start development server
npm run dev

Open http://localhost:3000 in your browser

Build for Production

# Create production build
npm run build

# Start production server
npm start

๐Ÿ“ Project Structure

CodeNarrator/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”œโ”€โ”€ analyze/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ route.ts          # GitHub repository analysis endpoint
โ”‚   โ”‚   โ””โ”€โ”€ generate/
โ”‚   โ”‚       โ””โ”€โ”€ route.ts          # AI documentation generation with streaming
โ”‚   โ”œโ”€โ”€ generate/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx              # Repository URL input page
โ”‚   โ”‚   โ””โ”€โ”€ results/
โ”‚   โ”‚       โ””โ”€โ”€ page.tsx          # Documentation results with Preview/Raw
โ”‚   โ”œโ”€โ”€ page.tsx                  # Landing page
โ”‚   โ”œโ”€โ”€ layout.tsx                # Root layout
โ”‚   โ””โ”€โ”€ globals.css               # Global styles + markdown preview CSS
โ”‚
โ”œโ”€โ”€ components/
โ”‚   โ””โ”€โ”€ ui/                       # shadcn/ui components
โ”‚       โ”œโ”€โ”€ button.tsx
โ”‚       โ”œโ”€โ”€ input.tsx
โ”‚       โ””โ”€โ”€ tabs.tsx
โ”‚
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ github.ts                 # GitHub API utilities
โ”‚   โ””โ”€โ”€ utils.ts                  # Helper functions
โ”‚
โ”œโ”€โ”€ public/                       # Static assets
โ”‚
โ”œโ”€โ”€ .coderabbit.yaml              # CodeRabbit configuration
โ”œโ”€โ”€ .env.example                  # Environment variables template
โ”œโ”€โ”€ package.json                  # Dependencies
โ””โ”€โ”€ README.md                     # You are here!

๐Ÿ† Hackathon Submission

โšก Vercel Track - The Stormbreaker Deployment Award

Requirement Status Evidence
Deployed on Vercel โœ… code-narrator-one.vercel.app
Uses Vercel AI SDK โœ… @ai-sdk/openai with streaming
Live & Working โœ… Publicly accessible
Vercel Deployment

๐Ÿฐ CodeRabbit Track - The Captain Code Award

Requirement Status Evidence
CodeRabbit Configured โœ… .coderabbit.yaml in repo
PR Reviews โœ… 6+ PRs reviewed by CodeRabbit
Following Suggestions โœ… Visible in PR history
CodeRabbit Dashboard

Pull Request History with CodeRabbit

PR Feature CodeRabbit Review
#1 Project Setup โœ… Reviewed
#2 GitHub URL Input โœ… Reviewed
#3 GitHub API Integration โœ… Reviewed
#4 AI Documentation Engine โœ… Reviewed
#5 Markdown Preview โœ… Reviewed
#6 UI Polish โœ… Reviewed

๐Ÿ”ฎ Future Roadmap

Feature Description Priority
๐Ÿ” Private Repos Support for private repositories with OAuth High
๐Ÿ“Š Multi-file Docs Generate entire documentation suites High
๐ŸŽจ Themes Light mode and custom themes Medium
๐Ÿ“ Edit & Save Edit generated docs before download Medium
๐Ÿ“š History Save and revisit generated documentation Medium
๐ŸŒ i18n Multi-language documentation generation Low

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide.

Quick Contribute

# Fork and clone
git clone https://github.com/shubhamsharma-10/CodeNarrator.git

# Create feature branch
git checkout -b feat/amazing-feature

# Make changes and commit
git commit -m "feat: add amazing feature"

# Push and create PR
git push origin feat/amazing-feature

Code of Conduct

Please read our Code of Conduct before contributing.


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments


Built with โค๏ธ by Shubham Sharma

๐Ÿ† WeMakeDevs Hackathon 2025


โญ Star this repo if you find it useful!

About

AI-powered documentation generator for any GitHub repository. Turn code into beautiful docs in seconds!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published