GitLens.AI is a full-stack web application that offers AI-powered insights into GitHub profiles. It provides a detailed analysis of a user's coding activities, generates repository recommendations, and features an interactive 3D globe to visualize the user's global presence.
This project is designed to provide a comprehensive and visually engaging analysis of GitHub users. By leveraging a combination of machine learning models and the Google Gemini API, GitLens.AI goes beyond simple statistics to offer a deeper understanding of a developer's skills and interests. The application is built with a modern tech stack, featuring a Next.js frontend, a Python backend for recommendations, and a visually appealing interface with 3D elements.
- GitHub Profile Analysis: Fetches and displays a user's public profile information (avatar, bio, followers, etc.).
- Repository Insights: Shows a user's top repositories, sorted by stars.
- Language Analysis: Calculates and displays the user's most frequently used programming languages in a pie chart.
- AI-Powered Summary: Uses the Google Gemini API to generate a natural language summary of the user's coding strengths, domains of expertise, and primary languages.
- Repository Recommendations: A Python-based service that uses a Graph Neural Network (GNN) and sentence transformers to recommend new repositories to the user.
- Interactive 3D Globe: A 3D globe on the homepage to visualize the user's global presence.
- Responsive UI: Clean, minimal, and responsive interface built with Tailwind CSS and shadcn/ui.
- Frontend Framework: Next.js (App Router)
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- 3D Graphics: Three.js and @react-three/fiber
- AI/LLM: Google Gemini API
- Recommendation Service:
- Framework: FastAPI
- ML Models: PyTorch, Sentence-Transformers, Scikit-learn
- Data: GitHub REST API
- Charting: Recharts
- Deployment: Vercel
Follow these instructions to get a local copy up and running.
-
Clone the repository:
git clone https://github.com/your-username/gitlens.ai.git cd gitlens.ai
-
Install the required frontend dependencies:
npm install
-
Install the required backend dependencies:
pip install -r requirements.txt
To run the application, you need to set up your environment variables. Create a file named .env.local
in the root of your project and add your Google Gemini API key.
GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
GITHUB_TOKEN="YOUR_GITHUB_TOKEN"
-
Start the frontend development server:
npm run dev
Open http://localhost:3000 in your browser to see the application.
-
Start the backend recommendation service:
uvicorn recommendation_service:app --reload
The backend service will be running on http://localhost:8000.
- Navigate to the homepage.
- Click the "Analyze Profile" button.
- Enter a valid GitHub username in the input field.
- Click the "Analyze" button or press Enter.
- The application will navigate to a new page and display the complete analysis of the user's profile.
- To get repository recommendations, use the "Compare Profiles" feature (Note: This feature is still under development).
The project is organized as follows:
/src
├── app/
│ ├── api/
│ │ ├── analyze/route.ts # Gemini API route
│ │ └── github/[username]/route.ts # GitHub API route
│ ├── user/[username]/page.tsx # Dynamic page for displaying results
│ ├── layout.tsx # Root layout
│ └── page.tsx # Homepage
├── components/
│ └── ui/ # shadcn/ui components
├── lib/
│ └── utils.ts # Utility functions
└── types.ts # TypeScript type definitions
/recommendation_service.py # Python backend for recommendations
/build_text_embeddings.py # Script to build text embeddings
/rgcn_model.pt # Pre-trained GNN model
/repo_embeddings.pt # Repository embeddings
/text_embeddings.npy # Text embeddings
The easiest way to deploy this Next.js app is to use the Vercel Platform. Make sure to set up the GEMINI_API_KEY
and GITHUB_TOKEN
environment variables in your Vercel project settings. The Python backend will need to be deployed separately (e.g., on a service like Heroku or AWS).