A modern web application that generates beautiful, customizable GitHub statistics cards for your profile README.
GitHub Insights Generator allows you to:
- Enter any GitHub username
- Select from multiple themes (Dark, Light, Neon, Ocean)
- Customize which statistics to display
- Preview your stats card in real-time
- Copy embed code in multiple formats (SVG, HTML, Markdown)
- Use the generated card in your GitHub profile README
- ✅ Real-time GitHub API integration
- ✅ Multiple built-in themes
- ✅ Checkbox-based configuration panel
- ✅ Live preview rendering
- ✅ One-click code copy functionality
- ✅ Responsive design
- Total public repositories
- Total followers
- Total stars earned
- Top used programming languages
- Join date
- User location
- Top repositories
- And more...
- SVG - Recommended for best quality
- HTML - For embedding in web pages
- Markdown - For GitHub README files
- Node.js 18+
- npm or yarn
- GitHub account (optional, but needed to fetch stats)
- Clone the repository:
git clone <repository-url>
cd gitstate- Install dependencies:
npm install- Create
.env.localfile (optional but recommended):
# Get your token from: https://github.com/settings/tokens
GITHUB_TOKEN=your_token_here
NEXT_PUBLIC_APP_URL=http://localhost:3000- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
gitstate/
├── app/
│ ├── api/
│ │ ├── insights/[username]/ # SVG generation route
│ │ └── stats/[username]/ # JSON stats API route
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main page
├── components/
│ ├── CardPreview.tsx # Stats card preview
│ ├── DisplayOptions.tsx # Display options selector
│ ├── EmbedCodeDisplay.tsx # Embed code display & copy
│ ├── ThemeSelector.tsx # Theme selector
│ └── UsernameInput.tsx # GitHub username input
├── lib/
│ ├── card-generator.ts # SVG & embed code generation
│ └── github-api.ts # GitHub API integration
├── types/
│ └── github.ts # TypeScript type definitions
├── public/ # Static assets
├── package.json
├── tsconfig.json
└── README.md
- Framework: Next.js 16
- UI: React 19 with TypeScript
- Styling: Tailwind CSS
- Icons: Lucide React
- API Routes: Next.js API routes
- Data Fetching: Axios
- Caching: Next.js ISR (60 minutes)
- GitHub REST API: For user data, repositories, and statistics
Generates and returns an SVG statistics card
Query Parameters:
theme:dark|light|neon|ocean(default:dark)showRepositories:true|falseshowFollowers:true|falseshowStars:true|falseshowLanguages:true|falseshowJoinDate:true|falseshowLocation:true|false
Example:
GET /api/insights/octocat?theme=neon&showLanguages=true
Returns GitHub statistics as JSON
Example:
GET /api/stats/octocat
- Background:
#1a1a2e - Card:
#16213e - Text:
#eaeaea - Highlight:
#e94560
- Background:
#f5f5f5 - Card:
#ffffff - Text:
#333333 - Highlight:
#3498db
- Background:
#0a0e27 - Card:
#1a1f3a - Text:
#00ff88 - Highlight:
#00d9ff
- Background:
#0c1e3a - Card:
#1a3a52 - Text:
#a8d8f0 - Highlight:
#4db8ff
- Generate your stats card
- Select your preferred theme
- Copy the Markdown embed code
- Paste in your README.md:
<div align="center">
<img src="https://yoursite.com/api/insights/octocat?theme=dark" />
</div>- ✅ No API tokens exposed to client
- ✅ GitHub token stored in environment variables
- ✅ Rate limiting handled automatically
- ✅ Caching implemented
- ✅ Proper error handling
- Unauthenticated requests: 60 requests/hour
- Authenticated requests: 5,000 requests/hour
Configure your GitHub token in .env.local for higher limits.
vercel deployAdd to your hosting platform:
GITHUB_TOKEN(optional)NEXT_PUBLIC_APP_URL
MIT License - see LICENSE file for details
Built with ❤️ by Abir
Happy coding! 🚀