- π€ 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