GitHub Repos API
Fetch featured GitHub repositories with project details and statistics.
Overview
The GitHub Repos API fetches featured repositories from a GitHub account, providing project details, technology stacks, repository statistics, and live demo links. This endpoint is used to populate the projects section of the portfolio.
/api/github-repos Endpoint Details
URL
GET /api/github-repos Content Type
application/json Authentication
No authentication required for public repositories.
Response Format
Success Response (200)
Returns an array of repository objects with project details, technology stacks, and GitHub statistics.
Error Response (500)
Returns error message when GitHub API request fails.
Response Fields
title Repository name from GitHub
description Repository description from GitHub
tech Array of technology names derived from repository topics
github GitHub repository URL
stars Number of GitHub stars
Usage Examples
Fetch with JavaScript
Use GET request to fetch repository data for portfolio display.
Astro Component Usage
Fetch repositories in Astro components for server-side rendering.
Configuration
GitHub Username
The API is currently configured to fetch repositories from a specific GitHub username. To change this, modify the username in the API endpoint source code.
Featured Repositories
The endpoint filters repositories based on specific criteria such as stars, activity, and repository topics to show only featured projects.
Implementation Notes
GitHub API Integration
- Uses GitHub REST API v3 for repository data
- Fetches repository languages and statistics
- Processes repository topics as technology tags
- Handles rate limiting and error responses
Data Processing
- Filters repositories by criteria (stars, activity)
- Maps repository data to portfolio format
- Generates placeholder images for projects
- Extracts live demo URLs from repository metadata