-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestfor hacktoberfestfor hacktoberfest
Description
🎯 Addon Information
Addon Name: Star History Charts
Category: GitHub Statistics
Difficulty: 🟢 Easy
Reference Links:
- Demo: https://star-history.com
- GitHub: https://github.com/star-history/star-history
- Documentation: https://github.com/star-history/star-history#readme
📝 Description
Star History generates beautiful charts showing the star growth of GitHub repositories over time. Perfect for showcasing project popularity and growth trends.
Example Use Cases:
- Show multiple project star histories side-by-side
- Compare your projects with competitors
- Demonstrate project growth in presentations
- Add visual proof of project success to README
✅ Implementation Checklist
UI Components
- Add "Star History" collapsible section under "GitHub Statistics"
- Create multi-repository input field (comma-separated)
- Add chart type selector (Date vs Timeline)
- Add theme toggle (Light/Dark)
- Implement live preview component
URL Generation
- Create
generateStarHistoryURL()function - Validate repository format (owner/repo)
- Handle multiple repositories
- Add theme parameter support
- Handle edge cases (invalid repos, too many repos)
Integration
- Add to markdown generator
- Integrate with storage system
- Add StarHistoryConfig type to profile types
- Test with existing GitHub statistics widgets
Preview & Polish
- Implement live preview with actual chart
- Add loading state while preview loads
- Handle preview errors gracefully
- Test in both dark and light themes
Documentation
- Add "How to find repo names" tooltip
- Link to Star History documentation
- Add example in help text
Testing
- Unit tests for URL generation
- Test with 1-5 repositories
- Test with invalid repository names
- Mobile responsive testing
- Accessibility testing
💻 Technical Details
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| repos | string[] | Yes | - | Array of repos in format ["owner/repo", ...] |
| type | string | No | Date | Chart type: "Date" or "Timeline" |
| theme | string | No | light | Theme: "light" or "dark" |
Generated URL Format
https://api.star-history.com/svg?repos=owner/repo1,owner/repo2&type=Date&theme=dark
Example Code
// URL Builder Function
interface StarHistoryParams {
repos: string[];
type?: 'Date' | 'Timeline';
theme?: 'light' | 'dark';
}
const generateStarHistoryURL = (params: StarHistoryParams): string => {
const searchParams = new URLSearchParams({
repos: params.repos.join(','),
type: params.type || 'Date',
});
if (params.theme === 'dark') {
searchParams.append('theme', 'dark');
}
return `https://api.star-history.com/svg?${searchParams}`;
};
// Validation
const validateRepoFormat = (repo: string): boolean => {
return /^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/.test(repo);
};🎨 UI Mockup
📊 GitHub Statistics [Collapse]
⭐ Star History
└─ [ ] Show Star History Chart
└─ Repositories (comma-separated):
[owner/repo1, owner/repo2, ...]
💡 Example: facebook/react, vuejs/vue
└─ Chart Type: ⚪ Date ⚪ Timeline
└─ Theme: ⚪ Light ⚪ Dark ⚪ Auto (match profile)
└─ Preview:
[Live chart preview or loading state]
Generated Markdown:
```markdown
[]
```
📸 Example Output
Markdown (Light Theme)
[](https://star-history.com/#facebook/react&vuejs/vue&Date)Markdown (Dark Theme with Picture Tag)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=facebook/react,vuejs/vue&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=facebook/react,vuejs/vue&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=facebook/react,vuejs/vue&type=Date" />
</picture>🔍 Acceptance Criteria
- User can enable/disable Star History
- User can enter 1-5 repositories
- Chart type selector works
- Theme selection works
- Live preview updates on input change
- Generated markdown is valid
- Works on mobile devices
- Accessible via keyboard
- Dark/light theme support
- Invalid repo format shows error
- Help tooltip present
- Links to Star History docs
🐛 Edge Cases to Consider
- Invalid repository format (missing slash, special chars)
- Too many repositories (>10)
- Repository doesn't exist
- Private repositories
- Very long repository names
- Empty input
- Whitespace in repo names
📚 Resources
- Similar Implementations: GitHub Stats widgets
- Star History API: No official API docs, URL-based
- Community Examples: https://github.com/rzashakeri/beautify-github-profile
💬 Questions?
Join our Discord for help: https://discord.gg/HHMs7Eg
📝 Notes for Contributors
Good first issue because:
- Simple URL generation (no complex API)
- Clear parameters and format
- No authentication required
- Good documentation available
- Similar patterns exist in codebase
Files to modify:
src/components/sections/github-stats-section.tsx- Add UIsrc/lib/markdown-generator.ts- Add markdown generationsrc/types/profile.ts- Add StarHistoryConfig typesrc/lib/validations.ts- Add repo format validation
Helpful patterns to reference:
- Look at
github-stats.tsxfor similar URL generation - Check existing form components in
src/components/forms/ - Follow theme pattern from other GitHub widgets
Testing your implementation:
- Try with your own repos
- Test with popular repos (facebook/react, microsoft/vscode)
- Verify theme switching works
- Check preview on mobile
- Test with invalid inputs
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestfor hacktoberfestfor hacktoberfest