A high-performance, asynchronous Rust application that collects engagement statistics from FIWARE GitHub repositories β including stargazers, contributors, forks, watchers, and issue authors.
This project parallelizes API calls across repositories and forks using Tokio and FuturesUnordered, ensuring efficient data retrieval even for large organizations such as FIWARE.
- β
Collects GitHub repository data:
- Stargazers (users who starred)
- Contributors (including forked repos)
- Watchers (subscribers)
- Issue authors
- β‘ Fully asynchronous using
tokioandreqwest - π Parallel processing across multiple repositories and forks
- π§± Built with the Axum web framework (includes a simple HTTP status route)
- π Handles GitHub rate limits gracefully (auto-sleep on 403)
- π Secure GitHub API access via personal token
| Component | Purpose |
|---|---|
| Rust | Core programming language |
| Axum | Lightweight async web server |
| Reqwest | HTTP client for GitHub API calls |
| Tokio | Async runtime |
| Futures | Parallel async task management |
| Serde / Serde JSON | JSON parsing and serialization |
| Dotenv | Environment variable management |
- Rust (v1.87.0+)
- A GitHub Personal Access Token (with
read:public_repopermissions) cargobuild tool
git clone https://github.com/yourusername/github-stats-collector.git
cd github-stats-collectorGITHUB_TOKEN=your_github_token_here
The program only reads public repository data, so it does not need write or admin permissions. There are two options to generate the token, either Personal Access Token (classic) or Fine-grained Tokens (recommended by GitHub)
When creating a Personal Access Token (classic):
- Go to β GitHub Settings β Developer Settings β Personal Access Tokens β Tokens (classic)
- Click βGenerate new token (classic)β. Set:
- Expiration: reasonable (e.g., 90 days or 1 year).
- Scopes: check only, read:public_repo (this grants access to read public repositoriesβ metadata)
Copy the generated token and save it securely. If you prefer Fine-grained Tokens (recommended by GitHub):
- Choose βFine-grained personal access tokenβ
- Under Repository access, select βAll public repositoriesβ
- Under Permissions β Repository Permissions, set:
- Metadata β Read-only
- Contents β Read-only
- Issues β Read-only (for issue authors)
- Pull requests β Read-only (optional)
- No other permissions are required.
Create a repos.json file in the data folder with the information of all organization/repository that we want to analyse:
[ "FIWARE/context.Orion-LD", "FIWARE/tutorials.Step-by-Step" ]
cargo run
Fetching stats for telefonicaid/fiware-orion... [telefonicaid/fiware-orion] Stargazers: 216, Developers: 107, Total Users: 480 Fetching stats for eProsima/Fast-DDS... [eProsima/Fast-DDS] Stargazers: 2610, Developers: 178, Total Users: 3272 Total FIWARE users: 10389 Total FIWARE developers: 751
The project includes a minimal Axum server that exposes a health-check route:
Response:
GitHub Stats Collector Running π
github-stats-collector/ βββ Cargo.toml βββ src/ β βββ main.rs βββ data/ β βββ repos.json βββ .env βββ README.md βββ ROADMAP.md
To take an overview of the Roadmap defined for this component, please take a look to the Roadmap.md document.
Pull requests, feature suggestions, and improvements are welcome! Please open an issue before submitting major changes.
Maintained by [Your Name or Organization] If you have questions, reach out via GitHub Issues or email.
This project is licensed under the Apache 2.0 License.