{"id":30716145,"url":"https://github.com/xqsit94/ghchart","last_synced_at":"2025-09-03T07:49:10.741Z","repository":{"id":311288639,"uuid":"1039659618","full_name":"xqsit94/ghchart","owner":"xqsit94","description":"Github Contribution Chart Generator built using Golang","archived":false,"fork":false,"pushed_at":"2025-08-21T17:08:58.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T08:34:56.999Z","etag":null,"topics":["github","github-api","github-contribution-graph","github-extension","github-reports"],"latest_commit_sha":null,"homepage":"https://ghchart.xqsit94.in","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xqsit94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-17T17:57:10.000Z","updated_at":"2025-08-21T18:01:03.000Z","dependencies_parsed_at":"2025-08-24T00:35:28.441Z","dependency_job_id":"8e233fb1-ecf5-4556-9d53-3a2a6811c1d0","html_url":"https://github.com/xqsit94/ghchart","commit_stats":null,"previous_names":["xqsit94/ghchart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xqsit94/ghchart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqsit94%2Fghchart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqsit94%2Fghchart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqsit94%2Fghchart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqsit94%2Fghchart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xqsit94","download_url":"https://codeload.github.com/xqsit94/ghchart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqsit94%2Fghchart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273410264,"owners_count":25100454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-api","github-contribution-graph","github-extension","github-reports"],"created_at":"2025-09-03T07:49:05.589Z","updated_at":"2025-09-03T07:49:10.721Z","avatar_url":"https://github.com/xqsit94.png","language":"HTML","readme":"# GitHub Charts API\n\n\u003e Fast, lightweight GitHub contribution charts with **light \u0026 dark theme support**\n\nGenerate beautiful GitHub contribution charts as transparent SVG images with support for both light and dark themes, custom colors, and seamless integration into any website or documentation.\n\n![GitHub Charts Demo](https://ghchart.xqsit94.in/xqsit94)\n\n## ✨ Features\n\n- 🎨 **Light \u0026 Dark Themes** - Automatic theme adaptation for any background\n- 🌈 **Custom Colors** - Any hex color or predefined themes\n- ⚡ **Lightning Fast** - Built with Go and optimized for performance\n- 🔍 **Transparent SVG** - Perfect integration with any design\n- 📱 **Interactive Demo** - Beautiful homepage with live theme switching\n- 🔗 **Simple API** - Clean, RESTful endpoints\n- ⚙️ **Zero Config** - Works out of the box\n\n## 🚀 Quick Start\n\n### Basic Usage\n```html\n\u003c!-- Light theme (default) --\u003e\n\u003cimg src=\"https://ghchart.xqsit94.in/username\" alt=\"GitHub Contributions\"\u003e\n\n\u003c!-- Dark theme --\u003e\n\u003cimg src=\"https://ghchart.xqsit94.in/dark:default/username\" alt=\"GitHub Contributions\"\u003e\n\n\u003c!-- Custom colors --\u003e\n\u003cimg src=\"https://ghchart.xqsit94.in/light:ff5722/username\" alt=\"GitHub Contributions\"\u003e\n\u003cimg src=\"https://ghchart.xqsit94.in/dark:6366f1/username\" alt=\"GitHub Contributions\"\u003e\n```\n\n### Markdown\n```markdown\n![GitHub Contributions](https://ghchart.xqsit94.in/username)\n![Dark Theme](https://ghchart.xqsit94.in/dark:default/username)\n![Custom Orange](https://ghchart.xqsit94.in/light:ff5722/username)\n```\n\n## 📖 API Reference\n\n### Light Theme (Default)\n```\nGET /{username}\nGET /{color}/{username}\nGET /{username}?theme=light\n```\n\n### Dark Theme\n```\nGET /dark:default/{username}\nGET /dark:{color}/{username}\nGET /{username}?theme=dark\n```\n\n### Theme + Color Format\n```\nGET /{theme:color}/{username}\n```\n\nWhere:\n- `theme` - `light` or `dark`\n- `color` - Hex color (without #) or special theme name\n- `username` - GitHub username\n\n### Examples\n\n| URL | Description |\n|-----|-------------|\n| `/octocat` | Default light theme |\n| `/dark:default/octocat` | Dark theme, default colors |\n| `/light:ff5722/octocat` | Light theme, orange colors |\n| `/dark:6366f1/octocat` | Dark theme, blue colors |\n| `/halloween/octocat` | Light theme, halloween colors |\n| `/dark:halloween/octocat` | Dark theme, halloween colors |\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd ghchart\n```\n\n2. Install dependencies:\n```bash\ngo mod tidy\n```\n\n3. Run the server:\n```bash\ngo run .\n```\n\nThe server will start on port 8080 by default, or use the `PORT` environment variable.\n\n## Deployment\n\n### Heroku\n1. Create a Procfile:\n```\nweb: ./ghchart\n```\n\n2. Deploy:\n```bash\ngit add .\ngit commit -m \"Initial commit\"\nheroku create your-app-name\ngit push heroku main\n```\n\n### Docker\n```dockerfile\nFROM golang:1.21-alpine AS builder\nWORKDIR /app\nCOPY go.mod go.sum ./\nRUN go mod download\nCOPY . .\nRUN go build -o ghchart .\n\nFROM alpine:latest\nRUN apk --no-cache add ca-certificates\nWORKDIR /root/\nCOPY --from=builder /app/ghchart .\nEXPOSE 8080\nCMD [\"./ghchart\"]\n```\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `PORT` | `8080` | Server port |\n| `DOMAIN_PREFIX` | `https://ghchart.xqsit94.in` | Domain prefix for frontend URLs |\n\n### Local Development Setup\n\n1. Copy the environment template:\n```bash\ncp .env.example .env\n```\n\n2. Edit `.env` with your local settings:\n```bash\n# For local development\nDOMAIN_PREFIX=http://localhost:8080\nPORT=8080\n```\n\n## 🎨 Color Schemes \u0026 Themes\n\n### Predefined Themes\n| Theme | Light Mode | Dark Mode | Description |\n|-------|------------|-----------|-------------|\n| `default` | GitHub green | Bright green | Classic GitHub colors |\n| `halloween` | Orange/yellow | Bright orange | Halloween theme |\n| `teal` | Teal/aqua | Bright teal | Ocean theme |\n\n### Custom Colors\nUse any hex color (without the `#`):\n- `ff5722` - Orange\n- `6366f1` - Blue\n- `8b5cf6` - Purple\n- `ef4444` - Red\n- `10b981` - Emerald\n\n### Theme Combinations\n```bash\n# Light theme examples\n/username                    # Default light\n/ff5722/username            # Orange light (legacy format)\n/light:ff5722/username      # Orange light (new format)\n/halloween/username         # Halloween light\n\n# Dark theme examples\n/dark:default/username      # Default dark\n/dark:ff5722/username       # Orange dark\n/dark:halloween/username    # Halloween dark\n\n# Query parameter format\n/username?theme=light       # Default light\n/username?theme=dark        # Default dark\n/ff5722/username?theme=dark # Orange dark\n```\n\n## 🌟 Advanced Usage\n\n### Responsive Design\n```html\n\u003c!-- Adapts to system theme --\u003e\n\u003cpicture\u003e\n  \u003csource srcset=\"https://ghchart.xqsit94.in/dark:default/username\"\n          media=\"(prefers-color-scheme: dark)\"\u003e\n  \u003cimg src=\"https://ghchart.xqsit94.in/username\" alt=\"GitHub Contributions\"\u003e\n\u003c/picture\u003e\n```\n\n### CSS Integration\n```css\n/* Light mode styling */\n.github-chart-light {\n  background: #ffffff;\n  border-radius: 8px;\n  padding: 16px;\n}\n\n/* Dark mode styling */\n.github-chart-dark {\n  background: #0d1117;\n  border-radius: 8px;\n  padding: 16px;\n}\n```\n\n### JavaScript Dynamic Loading\n```javascript\n// Dynamic theme switching\nfunction updateGitHubChart(username, isDark) {\n  const img = document.getElementById('github-chart');\n  const theme = isDark ? 'dark:default' : '';\n  const url = `https://ghchart.xqsit94.in/${theme}${theme ? '/' : ''}${username}`;\n  img.src = url;\n}\n```\n\n## 🛠️ Development\n\n### Local Development\n```bash\n# Run with hot reload (if using air)\nair\n\n# Or run directly\ngo run ./cmd/server\n\n# Run tests\ngo test ./...\n\n# Format code\ngo fmt ./...\n\n# Build for production\ngo build -o ghchart ./cmd/server\n```\n\n### Project Structure\n```\nghchart/\n├── cmd/server/          # Application entry point\n├── internal/\n│   ├── chart/          # Chart generation logic\n│   │   ├── colors.go   # Theme and color management\n│   │   └── generator.go # SVG generation\n│   ├── handlers/       # HTTP handlers\n│   └── services/       # GitHub API integration\n├── templates/          # HTML templates\n└── go.mod\n```\n\n### API Response Format\nAll endpoints return SVG content with appropriate headers:\n```\nContent-Type: image/svg+xml\nCache-Control: public, max-age=86400\n```\n\n## 🚀 Deployment\n\n### Heroku\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n```bash\n# Quick deploy\nheroku create your-app-name\ngit push heroku main\n```\n\n### Docker\n```bash\n# Build image\ndocker build -t ghchart .\n\n# Run container\ndocker run -p 8080:8080 ghchart\n```\n\n### Environment Variables\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `PORT` | `8080` | Server port |\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Inspired by the original [ghchart](https://github.com/2016rshah/githubchart-api) project\n- Built with [Go](https://golang.org/)\n- GitHub contribution data fetched from public GitHub pages\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqsit94%2Fghchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxqsit94%2Fghchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqsit94%2Fghchart/lists"}