Skip to content

ludovic/RepoHealth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Repo## โœจ Features

  • ๐Ÿค– ReAct AI Agent: Uses the ReAct pattern (Reasoning + Acting) to methodically analyze repositories
  • ๐Ÿ“Š Complete Analysis: Popularity, active maintenance, contributors, project health
  • ๐Ÿ› ๏ธ 4 GitHub Tools: Direct access to GitHub API through custom tools
  • ๐ŸŽจ Modern Interface: Responsive UI with Tailwind CSS and dark mode
  • ๐Ÿ“ˆ Health Score: Repository health score (0-100) with detailed breakdown
  • ๐Ÿ’ฌ Real-Time Streaming: Live visualization of the agent's thinking process
  • โšก Next.js 14: App Router, TypeScript, and modern optimizations

๐Ÿ“ธ Screenshots

Main Interface

RepoHealth Main Interface Clean and modern interface with real-time analysis progress

Real-Time Agent Thinking

Agent Thinking Process Watch the AI agent's reasoning process in real-time with the ReAct pattern

Health Score Analysis

Health Score Dashboard Comprehensive health score with detailed breakdown across multiple metrics

Complete Analysis Results

Analysis Results Detailed insights including popularity, maintenance, community, and recommendations

Note: To add your own screenshots, create a screenshots folder in the project root and add your images there.

๐ŸŽฏ Overview

The AI agent automatically analyzes:

  • โญ Popularity (stars, forks)
  • ๐Ÿ”ง Maintenance (recent activity, latest commits)
  • ๐Ÿ‘ฅ Community (contributors, diversity)
  • ๐Ÿ“š Documentation (README, license)

๐Ÿš€ Quick Start (2 minutes)t GitHub Repository Analyzer

๐Ÿฅ RepoHealth - AI-Powered GitHub Repository Health Analyzer

An intelligent web application that uses AI agents (LangChain.js + Gemini) to automatically analyze GitHub repositories and provide detailed health insights in real-time.

Next.js TypeScript LangChain License: MIT

โœจ Features

  • ๐Ÿค– ReAct AI Agent: Uses the ReAct pattern (Reasoning + Acting) to methodically analyze repositories
  • ๐Ÿ“Š Complete Analysis: Popularity, active maintenance, contributors, project health
  • ๐Ÿ› ๏ธ 4 GitHub Tools: Direct access to GitHub API through custom tools
  • ๐ŸŽจ Modern Interface: Responsive UI with Tailwind CSS and dark mode
  • ๐Ÿ“ˆ Health Score: Repository health score (0-100) with detailed breakdown
  • ๏ฟฝ๏ฟฝ Real-Time Streaming: Live visualization of the agent's thinking process
  • โšก Next.js 14: App Router, TypeScript, and modern optimizations

๐Ÿ“ธ Overview

The AI agent automatically analyzes:

  • โญ Popularity (stars, forks)
  • ๐Ÿ”ง Maintenance (recent activity, latest commits)
  • ๐Ÿ‘ฅ Community (contributors, diversity)
  • ๐Ÿ“š Documentation (README, license)

๐Ÿš€ Quick Start (2 minutes)

Prerequisites

Express Installation

```bash

# 1. Clone the repository
git clone https://github.com/your-username/repohealth.git
cd repohealth

# 2. Install dependencies
npm install

# 3. Configure API keys
cp .env.local.template .env.local
# Edit .env.local and add your Gemini key

# 4. Launch the application
npm run dev

# 5. Open http://localhost:3000
\`\`\`

### API Keys Configuration

Create a \`.env.local\` file at the project root:

\`\`\`env
# REQUIRED - Get it for free at https://makersuite.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key

# OPTIONAL - Increases limit from 60 to 5000 requests/hour
# Create at https://github.com/settings/tokens (scope: public_repo)
GITHUB_TOKEN=your_github_token
\`\`\`

### Installation Verification

To verify everything is working:

\`\`\`bash
# Test configuration
./test-project.sh

# If OK, start the server
npm run dev
\`\`\`

## ๐ŸŽฏ Usage

### Simple Interface

1. **Enter the URL** of a GitHub repository in the input field
   \`\`\`
   https://github.com/owner/repository
   \`\`\`

2. **Click "๐Ÿš€ Analyze"** or use the example buttons

3. **Watch the agent work** in real-time:
   - ๐Ÿ’ญ **Thoughts**: Agent's reasoning process
   - ๐ŸŽฌ **Actions**: Tools being called (get_repository_info, etc.)
   - ๐Ÿ‘€ **Observations**: Tool results
   - ๐Ÿ“ **Steps**: Analysis progress

4. **Receive complete analysis** with:
   - ๐Ÿ“Š Health Score (0-100) with breakdown
   - โญ Popularity and adoption
   - ๐Ÿ”ง Maintenance status
   - ๐Ÿ‘ฅ Community activity
   - ๐Ÿ“š Documentation quality
   - ๐Ÿ’ก Recommendations

### Example Repositories to Test

| URL | Description |
|-----|-------------|
| \`https://github.com/langchain-ai/langchainjs\` | ๐Ÿค– Modern AI framework |
| \`https://github.com/vercel/next.js\` | โšก Popular React framework |
| \`https://github.com/facebook/react\` | โš›๏ธ Reference UI library |
| \`https://github.com/microsoft/vscode\` | ๐Ÿ’ป Open source code editor |

## ๐Ÿ—๏ธ Architecture

### Tech Stack

| Category | Technology | Usage |
|----------|------------|-------|
| **Framework** | Next.js 14 | App Router, SSR, API Routes |
| **Language** | TypeScript | Type safety, autocomplete |
| **AI** | LangChain.js + Gemini 2.0 Flash | ReAct agent, custom tools |
| **API** | Octokit | GitHub REST API v3 |
| **Styling** | Tailwind CSS | Modern and responsive design |
| **Validation** | Zod | Tool schema validation |

### Project Structure

\`\`\`
repohealth/
โ”œโ”€โ”€ ๐ŸŽจ INTERFACE (app/)
โ”‚   โ”œโ”€โ”€ page.tsx                    # Main page with form
โ”‚   โ”œโ”€โ”€ layout.tsx                  # Layout with SEO metadata
โ”‚   โ”œโ”€โ”€ globals.css                 # Global Tailwind styles
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ HealthScore.tsx         # Health Score component
โ”‚   โ””โ”€โ”€ api/
โ”‚       โ””โ”€โ”€ analyze/
โ”‚           โ””โ”€โ”€ route.ts            # API endpoint with streaming
โ”‚
โ”œโ”€โ”€ ๐Ÿค– AI LOGIC (lib/)
โ”‚   โ”œโ”€โ”€ agent.ts                    # LangChain Agent + Gemini
โ”‚   โ”œโ”€โ”€ github-tools.ts             # 4 custom GitHub tools
โ”‚   โ”œโ”€โ”€ health-score.ts             # Health score calculation
โ”‚   โ””โ”€โ”€ utils.ts                    # Utility functions
โ”‚
โ”œโ”€โ”€ ๐ŸŽฃ HOOKS (hooks/)
โ”‚   โ””โ”€โ”€ useStreamingAnalysis.ts     # React hook for streaming
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ TYPES (types/)
โ”‚   โ””โ”€โ”€ index.ts                    # TypeScript definitions
โ”‚
โ”œโ”€โ”€ โš™๏ธ CONFIGURATION
โ”‚   โ”œโ”€โ”€ package.json                # 455+ dependencies
โ”‚   โ”œโ”€โ”€ tsconfig.json               # Strict TypeScript config
โ”‚   โ”œโ”€โ”€ tailwind.config.ts          # Custom Tailwind config
โ”‚   โ”œโ”€โ”€ next.config.js              # Optimized Next.js config
โ”‚   โ”œโ”€โ”€ .eslintrc.json              # Linting rules
โ”‚   โ””โ”€โ”€ .env.local.template         # Environment variables template
โ”‚
โ””โ”€โ”€ ๐Ÿ“š DOCUMENTATION
    โ”œโ”€โ”€ README.md                   # This file
    โ””โ”€โ”€ LICENSE                     # MIT License
\`\`\`

### The 4 AI Agent Tools

The agent has a complete "toolbox":

#### 1. **\`get_repository_info\`** - Repository Metadata
\`\`\`typescript
// Retrieves essential information
{
  name: string,
  stars: number,              // โญ Popularity
  forks: number,              // ๏ฟฝ๏ฟฝ Engagement
  open_issues: number,        // ๐Ÿ› Open issues
  language: string,           // ๐Ÿ’ป Main language
  created_at: string,         // ๐Ÿ“… Creation date
  updated_at: string,         // ๐Ÿ”„ Last update
  topics: string[],           // ๐Ÿท๏ธ Project tags
  license: string,            // ๐Ÿ“œ License
}
\`\`\`

#### 2. **\`get_readme_content\`** - README Content
\`\`\`typescript
// Extracts and decodes README.md
// - Automatically decoded from base64
// - Truncated to 3000 characters if too long
// - Best source for understanding the project
\`\`\`

#### 3. **\`get_recent_activity\`** - Recent Activity
\`\`\`typescript
// Checks for active maintenance
{
  last_commit_date: string,      // ๐Ÿ“… Last commit date
  last_commit_message: string,   // ๐Ÿ’ฌ Commit message
  last_commit_author: string,    // ๐Ÿ‘ค Author
  recent_commits: CommitInfo[]   // ๐Ÿ“Š Last 5 commits
}
\`\`\`

#### 4. **\`get_top_contributors\`** - Top Contributors
\`\`\`typescript
// Lists main contributors
{
  total_contributors: number,     // ๐Ÿ‘ฅ Total count
  top_contributors: [             // ๐Ÿ† Top 10
    {
      username: string,
      contributions: number
    }
  ]
}
\`\`\`

### The ReAct Pattern in Action

The agent follows a **Thought โ†’ Action โ†’ Observation** cycle:

\`\`\`
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. ๐Ÿ’ญ THOUGHT                                    โ”‚
โ”‚    "I need to analyze the repo's popularity"   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. ๐ŸŽฌ ACTION                                     โ”‚
โ”‚    Calls: get_repository_info(owner, repo)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. ๐Ÿ‘€ OBSERVATION                                โ”‚
โ”‚    Receives: { stars: 10500, forks: 2000, ... }โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 4. ๐Ÿ’ญ THOUGHT                                    โ”‚
โ”‚    "10500 stars = very popular!                 โ”‚
โ”‚     Let's check maintenance now..."             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 5. ๐ŸŽฌ ACTION                                     โ”‚
โ”‚    Calls: get_recent_activity(owner, repo)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 6. ๐Ÿ‘€ OBSERVATION                                โ”‚
โ”‚    Receives: { last_commit_date: "2025-10-05" }โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 7. โœ… FINAL ANSWER                               โ”‚
โ”‚    Generates complete structured analysis       โ”‚
โ”‚    with Health Score and recommendations        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
\`\`\`

This cycle is **visible in real-time** in the interface thanks to streaming!

## ๐Ÿ› ๏ธ Development

### Available Scripts

\`\`\`bash
# Development
npm run dev          # Start development server (port 3000)
npm run build        # Create optimized production build
npm run start        # Start production server
npm run lint         # Check code with ESLint

# Tests and Debugging
./test-project.sh    # Configuration test script
./init-git.sh        # Git initialization script
\`\`\`

## ๐Ÿค Contributing

Contributions are welcome! Feel free to:

1. Fork the project
2. Create a 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

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.

## ๐Ÿ™ Acknowledgments

- [LangChain.js](https://github.com/langchain-ai/langchainjs) - Powerful framework for AI agents
- [Google Gemini](https://deepmind.google/technologies/gemini/) - Performant and free language model
- [Octokit](https://github.com/octokit/octokit.js) - Official GitHub API client
- [Next.js](https://nextjs.org/) - The best React framework
- [Tailwind CSS](https://tailwindcss.com/) - Modern utility-first CSS
- The open source community ๐Ÿ’™

---

<div align="center">

**Made with ๐Ÿ’œ by the community**

[โญ Star this project](../../stargazers) โ€ข [๐Ÿ› Report a bug](../../issues) โ€ข [๐Ÿ’ก Suggest a feature](../../issues/new)

</div>

---

**Last updated**: October 2025 | **Version**: 1.0.0

About

๐Ÿฅ AI-Powered GitHub Repository Health Analyzer using LangChain.js and Gemini 2.5 Flash

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages