A web application that analyzes public GitHub repositories and presents insights using the GitHub API.
- Input field for GitHub repository URL
- Fetches and displays repository metadata (name, stars, forks, etc.)
- Shows contributor and commit activity data
- Visualizes commit frequency and other metrics
- Handles rate-limiting and API errors gracefully
- FastAPI - High-performance Python web framework
- PyGithub - Python library for GitHub API
- Pydantic - Data validation and settings management
- Uvicorn - ASGI server
- React - JavaScript library for building user interfaces
- Chart.js - JavaScript charting library
- Bootstrap - CSS framework
- Axios - Promise-based HTTP client
- Docker and Docker Compose
- GitHub Personal Access Token (optional, for higher API rate limits)
- Clone this repository
- (Optional) Create a
.env
file in the root directory with your GitHub token:GITHUB_TOKEN=your_github_personal_access_token
- Build and start the containers:
docker-compose up -d
- Access the application at
http://localhost:3000
- Navigate to the backend directory:
cd backend
- Install dependencies:
pip install -r requirements.txt
- (Optional) Set GitHub token as environment variable:
# Windows set GITHUB_TOKEN=your_github_personal_access_token # Linux/Mac export GITHUB_TOKEN=your_github_personal_access_token
- Start the FastAPI server:
uvicorn main:app --reload
- The API will be available at
http://localhost:8000
- API documentation:
http://localhost:8000/docs
- API documentation:
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm start
- The frontend will be available at
http://localhost:3000
GET /
- Root endpoint to check if API is runningPOST /api/repo
- Get basic information about a GitHub repositoryPOST /api/contributors
- Get contributors for a GitHub repositoryPOST /api/commit-activity
- Get commit activity for a GitHub repositoryGET /api/rate-limit
- Get current GitHub API rate limit status
This application uses the GitHub REST API which has rate limits:
- For unauthenticated requests: 60 requests per hour
- For authenticated requests: 5,000 requests per hour
To increase the rate limit, provide a GitHub personal access token in the .env
file.
github-repo-analyzer-fastapi/
├── backend/ # FastAPI backend
│ ├── main.py # Main application file
│ ├── requirements.txt # Python dependencies
│ └── Dockerfile # Backend Docker configuration
├── frontend/ # React frontend
│ ├── public/ # Static files
│ ├── src/ # React source code
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── App.js # Main App component
│ │ └── index.js # Entry point
│ ├── package.json # NPM dependencies
│ ├── Dockerfile # Frontend Docker configuration
│ └── nginx.conf # Nginx configuration for production
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation