Skip to content

application that transforms GitHub data into stunning Chart.js visualizations of commits, pull requests, and contributor activity. Securely integrated with the GitHub API, Oktokit library, and gemini, it also introduces a developer community chat where open-source contributors can collaborate and share insights

License

Notifications You must be signed in to change notification settings

Jeelislive/Github-Analyzer

Repository files navigation

GitHub Analyzer

License Next.js TypeScript PRs Welcome GitHub contributors GitHub stars GitHub forks

A Next.js application that analyzes GitHub repositories and presents AI-powered insights, architecture visualizations, and project health metrics through a modern dashboard.

Features β€’ Getting Started β€’ Documentation β€’ Contributing β€’ Community


πŸ“Έ Screenshots

Dashboard Overview
AI-Powered Repository Analysis Dashboard
View More Screenshots
Analytics View
Detailed Analytics and Insights

Repository Analyzer
Repository Analysis Interface

✨ Features

  • πŸ€– AI-Powered Insights - Comprehensive dashboard with Overview, Team, Business, and Recommendations tabs
  • πŸ—οΈ Architecture Visualization - Mermaid-based diagrams and dependency mapping
  • πŸ” GitHub OAuth - Secure authentication using NextAuth and Prisma
  • πŸ’Ύ PostgreSQL Database - Persistent storage via Prisma ORM
  • 🎨 Modern UI - Beautiful interface with Tailwind CSS and Radix UI
  • πŸ“Š Analytics Dashboard - Contribution heatmaps, streak tracking, and activity metrics
  • πŸ”„ Graceful Fallback - Works with sample data when AI key is not configured

πŸ› οΈ Tech Stack

Category Technologies
Framework Next.js 15 (App Router)
Language TypeScript 5.x
UI/Styling Tailwind CSS, Radix UI, Lucide Icons
Authentication NextAuth.js with GitHub Provider
Database PostgreSQL, Prisma ORM
Visualization Chart.js, D3.js, Mermaid
AI Google Generative AI (Gemini) - Optional

πŸš€ Getting Started

Prerequisites

  • Node.js 18.18+ (recommended 20+)
  • npm 9+ or pnpm/yarn
  • PostgreSQL 13+
  • GitHub OAuth App (Client ID and Secret)

Installation & Setup

  1. Clone the repository

    git clone https://github.com/Jeelislive/Github-Analyzer.git
    cd Github-Analyzer
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the project root:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/github_analyzer"
    
    # NextAuth
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-strong-random-secret"
    
    # GitHub OAuth (required)
    GITHUB_ID="your-github-client-id"
    GITHUB_SECRET="your-github-client-secret"
    
    # Gemini AI (optional)
    GEMINI_API_KEY="your-gemini-api-key"
  4. Configure GitHub OAuth

    Create a GitHub OAuth App at GitHub Developer Settings:

    • Homepage URL: http://localhost:3000
    • Authorization callback URL: http://localhost:3000/api/auth/callback/github

    Copy the Client ID and Secret to your .env.local file.

  5. Set up the database

    npx prisma generate
    npx prisma migrate dev
  6. Run the development server

    npm run dev
  7. Open your browser

    Navigate to http://localhost:3000 πŸŽ‰


πŸ“– How It Works

  1. Authentication - Sign in with GitHub using NextAuth (configured in src/lib/auth.ts)
  2. Repository Input - Enter any GitHub repository URL on the homepage
  3. AI Analysis - The system analyzes code structure, dependencies, and metrics
  4. Visualization - View insights through an interactive dashboard with multiple tabs:
    • Overview: Health scores, metrics, technologies, and project purpose
    • Team Insights: Activity and collaboration patterns
    • Business: Value and risk analysis
    • Recommendations: Automated improvement suggestions

Note: If GEMINI_API_KEY is not configured, the app uses fallback data to maintain functionality.


πŸ“‚ Project Structure

Github-Analyzer/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router pages & API routes
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                 # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ dashboard/          # Dashboard-specific components
β”‚   β”‚   └── sections/           # Landing page sections
β”‚   └── lib/
β”‚       β”œβ”€β”€ auth.ts             # NextAuth configuration
β”‚       └── prisma.ts           # Prisma client
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma           # Database schema
β”‚   └── migrations/             # Database migrations
β”œβ”€β”€ public/                     # Static assets & icons
└── README.md

πŸ”§ Available Scripts

Command Description
npm run dev Start development server with Turbopack
npm run build Build the application for production
npm start Start the production server
npm run lint Run ESLint checks

❓ Troubleshooting

Authentication callback error
Verify that your GitHub OAuth app callback URL matches http://localhost:3000/api/auth/callback/github and that GITHUB_ID and GITHUB_SECRET are correctly set in .env.local.
Database connection issues
Check that your DATABASE_URL is correct and PostgreSQL is running. Run npx prisma migrate dev to apply migrations.
Missing AI insights
The app works without GEMINI_API_KEY using fallback data. To enable AI features, get an API key from Google AI Studio.
Build or type errors
Run npm run lint and ensure you're using Node.js 18.18+. Try reinstalling dependencies with npm install.

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Ways to Contribute

  • πŸ› Report Bugs - Use our issue templates
  • ✨ Suggest Features - Share your ideas for improvements
  • πŸ“ Improve Documentation - Help make our docs better
  • πŸ”§ Submit Pull Requests - Fix bugs or add new features

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run npm run lint to ensure code quality
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Guidelines

  • Keep PRs focused on a single feature or fix
  • Add tests or sample data where applicable
  • Update relevant documentation
  • Ensure npm run lint passes before submitting
  • For major changes (auth, database schema, analysis pipeline), include a migration plan

πŸ‘₯ Community

Join Our Open Source Community! 🌟

We believe in the power of open source and collaborative development. This project thrives because of amazing contributors like you!

Contributors Stargazers Forks Issues Pull Requests

πŸŽ‰ Thanks to All Contributors

Contributors

Made with ❀️ by developers, for developers

⭐ Star this repo β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature


πŸ”’ Security

  • 🚫 Never commit .env* files or secrets to version control
  • πŸ”„ Rotate OAuth credentials immediately if exposed
  • πŸ” Use a strong, randomly generated NEXTAUTH_SECRET in production
  • πŸ“‹ Review the Security Policy for reporting vulnerabilities

πŸ“„ License

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


πŸ™ Acknowledgements

This project is built with amazing open-source technologies:


Built with πŸ’™ by the open-source community

If you find this project helpful, consider giving it a ⭐!

Star History Chart

About

application that transforms GitHub data into stunning Chart.js visualizations of commits, pull requests, and contributor activity. Securely integrated with the GitHub API, Oktokit library, and gemini, it also introduces a developer community chat where open-source contributors can collaborate and share insights

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published