A Go-based server that provides GitHub repository statistics and contributor information for the VTubersTV organization. This server acts as a proxy and analytics service for GitHub repositories, offering cached statistics and contributor data.
- Repository statistics including stars, forks, contributors, and commits
- Top contributors listing with contribution counts
- Language-specific color coding
- Caching system for improved performance
- GitHub repository redirection
- RESTful API endpoints
- Go 1.24.3 or higher
- GitHub Personal Access Token with appropriate permissions
- Clone the repository:
git clone https://github.com/VTubersTV/git-server.git
cd git-server
- Install dependencies:
go mod download
- Create a
.env
file in the root directory with your GitHub token:
GITHUB_TOKEN=your_github_token_here
Start the server:
go run src/main.go
The server will start on port 8080 by default.
GET /
: Redirects to the VTubersTV GitHub organizationGET /:repo
: Redirects to the specific repository on GitHubGET /stats
: Returns statistics for all public repositoriesGET /contributors
: Returns contributor statistics- Query parameter:
limit
(optional) - Number of top contributors to return
- Query parameter:
Stats endpoint response:
{
"repositories": [
{
"name": "repo-name",
"stars": 100,
"forks": 50,
"contributors": 10,
"commits": 500,
"license": "MIT",
"last_updated": "2024-03-20T12:00:00Z",
"description": "Repository description",
"language": "Go",
"language_color": "#00ADD8",
"open_issues": 5,
"default_branch": "main",
"topics": ["go", "api", "server"]
}
],
"totalStars": 100,
"totalForks": 50,
"totalContributors": 10,
"totalCommits": 500,
"githubUrl": "https://github.com/VTubersTV/"
}
The server uses the following configuration:
- Cache duration: 15 minutes
- Default port: 8080
- GitHub base URL: https://github.com/VTubersTV/
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the AGPL-3.0 License and the VTubers.TV Commercial License (VCL) v1.0. See the LICENSE and LICENSE-VCL files for details.