https://github.com/fusefairy/github-profile-repo-analytics
📊 GitHub repository traffic stats are automatically fetched and visualized as customizable SVG charts via GitHub Actions workflows, making it easy to embed the generated charts in your GitHub profile.
https://github.com/fusefairy/github-profile-repo-analytics
github-profile python3
Last synced: 6 months ago
JSON representation
📊 GitHub repository traffic stats are automatically fetched and visualized as customizable SVG charts via GitHub Actions workflows, making it easy to embed the generated charts in your GitHub profile.
- Host: GitHub
- URL: https://github.com/fusefairy/github-profile-repo-analytics
- Owner: FuseFairy
- License: mit
- Created: 2025-01-17T04:34:01.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-04-12T00:53:50.000Z (6 months ago)
- Last Synced: 2025-04-12T20:13:14.777Z (6 months ago)
- Topics: github-profile, python3
- Language: Python
- Homepage:
- Size: 101 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![github-profile-repo-analytics][socialify-image]][github-profile-repo-analytics--url]
This project automates the process of fetching and visualizing traffic data for **your public GitHub repositories** using GitHub Actions. It periodically retrieves metrics like views and clones and generates traffic charts in SVG format. The generated charts can be easily embedded in your GitHub profile or repository to track project activity.
## ✨Features
- 🌐Fetch traffic data from GitHub repositories
- 📈Visualize traffic data with customizable charts
- 🎨Support for different themes and background colors
- 🔃Data is automatically refreshed every day## 🌟Demo
Here’s an example of a traffic chart generated from a public GitHub repository:
```html
![]()
```
## 🚀How to Deploy Your Own Instance with GitHub Workflows
Click to expand deployment instructions
### 1. Create a Personal Access Token
- Go to [Personal access tokens (classic) page](https://github.com/settings/tokens).
- Create a **Personal access tokens (classic)** with **repo** and **user** permissions to access repository stats.
### 2. Fork the Repository
- Go to the GitHub repository for this project.
- Click **Fork** in the upper-right corner to create your own copy.
### 3. Set Up GitHub Secrets
- Go to your forked repository.
- Navigate to **Settings** > **Secrets and Variables** > **Actions** > **New repository secret**.
- Add the following secrets:
- **TOKEN**: Your personal access token that you created in Step 1.
- **USERNAME**: Your GitHub username.
### 4. Final
- Go to the **Actions Page** and press "Run Workflow" on the right side of the screen to generate images for the first time.
- Once complete, you can find the generated images in the *generated folder* under the `output` branch.
## 🛠 Configuration (config.yml)
This file allows you to customize the appearance of the generated traffic chart. You can modify the theme, dimensions, colors, and exclude specific repositories.
```yaml
theme: "tokyo-night" # The theme used for the chart. Available themes are defined in the "src/themes" folder.
height: 400 # The height of the chart in pixels.
width: 800 # The width of the chart in pixels.
radius: 20 # The corner radius for the chart's rectangular background.
ticks: 5 # The number of y-axis ticks on the chart.bg_color: "#00000000" # Background color of the chart in hex format. "#00000000" represents fully transparent black.
clones_color: null # Stroke color for the clones line. Set to a hex value (e.g., "#FF5733") or leave as `null` for default.
views_color: null # Stroke color for the views line. Set to a hex value (e.g., "#33FF57") or leave as `null` for default.
clones_point_color: null # Color for the clone data points on the chart. Set to a hex value or leave as `null` for default.
views_point_color: null # Color for the view data points on the chart. Set to a hex value or leave as `null` for default.exclude_repos: ["repo_1", "repo_2"] # A list of repository names to exclude from the chart. Set to `[]` to include all repositories.
```## 🎨Available Themes
Here are the currently available themes you can use for your traffic charts. The themes are stored in the `src/themes` directory. Feel free to contribute and add your own themes by submitting a pull request!
| Theme | Preview | Theme | Preview |
|---------------|-----------------|---------------|---------|
| `default` || `cyberpunk` |
|
| `dark-mode` || `ocean-depth` |
|
| `spring-fresh`|| `tokyo-night` |
|
### How to Add Your Own Theme 🖌️
1. Create a new JSON file for your theme in the `app/themes` directory.
2. **Follow the existing structure**:
Your theme JSON should follow this structure, where you can customize the `background_color`, `line_colors`, `text_color`, and `grid_color` for your theme:```json
{
"background_color": "#1a1b27",
"line_colors": {
"clones": "#8aadf466",
"views": "#cba6f766"
},
"point_colors": {
"clones": "#8aadf4",
"views": "#cba6f7"
},
"text_color": "#cdd6f4",
"grid_color": "#414868"
}
```3. Submit a pull request with your new theme.
Your contribution will help make this project even better! 🚀
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/FuseFairy/github-repo-traffic-stats/blob/main/LICENSE) file for details.
[socialify-image]: https://raw.githubusercontent.com/gist/FuseFairy/c233e02ce0225b8db2a093bdb71a4de0/raw/5f816da3d6360fcd61074f485740a6bcff0b3acc/github-profile-repo-analytics.svg
[github-profile-repo-analytics--url]: https://github.com/FuseFairy/github-profile-repo-analytics