- ๐ค 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
Clean and modern interface with real-time analysis progress
Watch the AI agent's reasoning process in real-time with the ReAct pattern
Comprehensive health score with detailed breakdown across multiple metrics
Detailed insights including popularity, maintenance, community, and recommendations
Note: To add your own screenshots, create a
screenshotsfolder in the project root and add your images there.
The AI agent automatically analyzes:
- โญ Popularity (stars, forks)
- ๐ง Maintenance (recent activity, latest commits)
- ๐ฅ Community (contributors, diversity)
- ๐ Documentation (README, license)
An intelligent web application that uses AI agents (LangChain.js + Gemini) to automatically analyze GitHub repositories and provide detailed health insights in real-time.
- ๐ค 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
The AI agent automatically analyzes:
- โญ Popularity (stars, forks)
- ๐ง Maintenance (recent activity, latest commits)
- ๐ฅ Community (contributors, diversity)
- ๐ Documentation (README, license)
```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