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
- π€ 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
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 |
- Node.js 18.18+ (recommended 20+)
- npm 9+ or pnpm/yarn
- PostgreSQL 13+
- GitHub OAuth App (Client ID and Secret)
-
Clone the repository
git clone https://github.com/Jeelislive/Github-Analyzer.git cd Github-Analyzer
-
Install dependencies
npm install
-
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"
-
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. - Homepage URL:
-
Set up the database
npx prisma generate npx prisma migrate dev
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000 π
- Authentication - Sign in with GitHub using NextAuth (configured in
src/lib/auth.ts
) - Repository Input - Enter any GitHub repository URL on the homepage
- AI Analysis - The system analyzes code structure, dependencies, and metrics
- 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.
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
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 |
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
.
We welcome contributions from the community! Here's how you can help:
- π 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run
npm run lint
to ensure code quality - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to your branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- 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
We believe in the power of open source and collaborative development. This project thrives because of amazing contributors like you!
Made with β€οΈ by developers, for developers
β Star this repo β’ π Report Bug β’ π‘ Request Feature
- π« 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
This project is licensed under the MIT License - see the LICENSE file for details.
This project is built with amazing open-source technologies:
- Next.js - React framework for production
- NextAuth.js - Authentication for Next.js
- Prisma - Next-generation ORM
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible components
- Chart.js - Simple yet flexible charting
- D3.js - Data visualization library
- Mermaid - Diagram and flowchart generation
- Google Generative AI - Gemini AI SDK