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_hereThe 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 runFetching 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: 751The 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.