{"id":39847165,"url":"https://github.com/kossakovsky/notion-github-graph","last_synced_at":"2026-01-18T13:37:14.405Z","repository":{"id":218838188,"uuid":"747498536","full_name":"kossakovsky/notion-github-graph","owner":"kossakovsky","description":"Next.js application for embedding GitHub contribution graphs into Notion pages with customizable light/dark themes","archived":false,"fork":false,"pushed_at":"2025-10-31T23:47:05.000Z","size":452,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T01:16:16.148Z","etag":null,"topics":["contributions","github","nextjs","notion","react","typescript","vercel"],"latest_commit_sha":null,"homepage":"https://notion-github-graph.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kossakovsky.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-24T03:33:59.000Z","updated_at":"2025-10-31T23:47:43.000Z","dependencies_parsed_at":"2024-01-24T04:45:02.093Z","dependency_job_id":null,"html_url":"https://github.com/kossakovsky/notion-github-graph","commit_stats":null,"previous_names":["kossakovsky/notion-github-graph"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kossakovsky/notion-github-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kossakovsky%2Fnotion-github-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kossakovsky%2Fnotion-github-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kossakovsky%2Fnotion-github-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kossakovsky%2Fnotion-github-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kossakovsky","download_url":"https://codeload.github.com/kossakovsky/notion-github-graph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kossakovsky%2Fnotion-github-graph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["contributions","github","nextjs","notion","react","typescript","vercel"],"created_at":"2026-01-18T13:37:14.334Z","updated_at":"2026-01-18T13:37:14.394Z","avatar_url":"https://github.com/kossakovsky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notion GitHub Tracker\n\nA Next.js application that embeds GitHub contribution graphs into Notion pages with customizable themes.\n\n## Introduction\n\nNotion GitHub Tracker is a dynamic Next.js 15 application designed to seamlessly integrate GitHub user contribution data into Notion. This tool offers a convenient way to track and display GitHub contributions directly within a Notion page using GitHub's official GraphQL API.\n\n## Live Deployment\n\nThe project is deployed at [https://notion-github-graph.vercel.app/](https://notion-github-graph.vercel.app/)\n\n**URL Pattern:** `https://notion-github-graph.vercel.app/:username?theme=dark|light`\n\n- Replace `:username` with any GitHub username\n- Optional `theme` parameter: `dark` (default) or `light`\n\n**Example:** [https://notion-github-graph.vercel.app/kossakovsky?theme=dark](https://notion-github-graph.vercel.app/kossakovsky?theme=dark)\n\n### Screenshots\n\n#### Dark theme\n![Dark theme screenshot](https://i.imgur.com/hvSRiY1.png)\n\n#### Light theme\n![Light theme screenshot](https://i.imgur.com/4tNdzLW.png)\n\n## Features\n\n- **GitHub GraphQL API Integration** - Uses official GitHub API for reliable data fetching\n- **Dual Theme Support** - Light and dark themes that match GitHub's color palette\n- **Server-Side Rendering** - Fast initial page loads with Next.js SSR\n- **ISR Caching** - 1-hour cache revalidation for optimal performance\n- **Accessibility** - Full ARIA label support for screen readers\n- **SEO Optimized** - Dynamic metadata generation with Open Graph tags\n- **Error Handling** - User-friendly error messages for common issues\n- **Loading States** - Skeleton UI with pulse animation\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (version 18 or higher recommended)\n- npm, yarn, pnpm, or bun package manager\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/kossakovsky/notion-github-graph.git\ncd notion-github-graph\n```\n\n2. Install dependencies:\n```bash\nnpm install\n# or\nyarn install\n```\n\n3. Configure GitHub Token:\n```bash\n# Copy the example environment file\ncp env.example .env.local\n\n# Edit .env.local and add your GitHub Personal Access Token\n# Get your token at: https://github.com/settings/tokens\n# No special scopes are required - just create a token with public access\n```\n\n4. Start the development server:\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\n5. Open [http://localhost:3000](http://localhost:3000) in your browser\n\n### Available Commands\n\n```bash\n# Development server\nnpm run dev\n\n# Production build\nnpm run build\n\n# Start production server\nnpm start\n\n# Run ESLint\nnpm run lint\n```\n\n## Usage\n\n### Standalone Usage\n\nNavigate to the deployed URL with any GitHub username:\n\n```\nhttps://notion-github-graph.vercel.app/username?theme=dark\n```\n\nParameters:\n- `username` (required) - Any valid GitHub username\n- `theme` (optional) - Either `dark` or `light` (defaults to `dark`)\n\n### Notion Integration\n\nTo embed the contribution graph in Notion:\n\n1. In your Notion page, type `/embed` and select \"Embed\" block\n2. Paste the URL with your desired username:\n   ```\n   https://notion-github-graph.vercel.app/yourusername?theme=dark\n   ```\n3. Adjust the embed block size (recommended minimum width: 600px)\n4. The graph will update automatically every hour via ISR caching\n\n**Note:** Notion embeds may not display perfectly on mobile devices due to the fixed-width layout.\n\n## Technical Stack\n\n- **Framework:** Next.js 15.5.6 (App Router)\n- **Runtime:** React 19.2.0\n- **Language:** TypeScript 5\n- **Styling:** Tailwind CSS 3.4.18 + CSS Modules\n- **Data Source:** GitHub GraphQL API (authenticated)\n- **Deployment:** Vercel\n- **Analytics:** Vercel Analytics\n\n## Architecture\n\n### Project Structure\n\n```\nsrc/\n├── app/\n│   ├── layout.tsx              # Root layout with metadata\n│   ├── page.tsx                # Home page\n│   ├── globals.css             # Global styles\n│   └── [username]/\n│       ├── page.tsx            # Dynamic route for user graphs\n│       ├── page.module.css     # Contribution graph styles\n│       ├── loading.tsx         # Loading skeleton\n│       └── error.tsx           # Error boundary\n└── utils.ts                    # API and data transformation logic\n```\n\n### How It Works\n\n1. **Data Fetching:** When you visit `/:username`, the app queries GitHub's GraphQL API for the user's contribution calendar\n2. **Data Transformation:** Raw contribution data is transformed into a 52-week × 7-day grid layout\n3. **Rendering:** Contributions are displayed as colored squares with hover tooltips\n4. **Caching:** Results are cached for 1 hour using Next.js ISR (Incremental Static Regeneration)\n\n## API Rate Limits\n\nThe application uses GitHub's **authenticated GraphQL API**, which requires a Personal Access Token. Rate limits:\n\n- **Without token:** 60 requests per hour per IP address (will cause errors)\n- **With token:** 5,000 requests per hour per token\n\nThe 1-hour ISR caching significantly reduces API calls, making the token rate limit more than sufficient for most use cases.\n\n### Setting Up GitHub Token\n\n1. Go to [GitHub Settings \u003e Personal Access Tokens](https://github.com/settings/tokens)\n2. Click \"Generate new token\" → \"Generate new token (classic)\"\n3. Give it a descriptive name (e.g., \"Notion GitHub Graph\")\n4. **No scopes are required** for public data access\n5. Generate and copy the token\n6. Add it to your `.env.local` file:\n   ```\n   GITHUB_TOKEN=ghp_your_token_here\n   ```\n\nFor Vercel deployment, add the token as an environment variable in your project settings.\n\n## Contributing\n\nContributions are welcome! Here's how you can help:\n\n1. Fork the repository\n2. Create a 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### Development Notes\n\n- The project has no test suite configured - manual testing is required\n- The grid layout logic in `sortContributions()` (utils.ts) is complex and critical - test thoroughly when modifying\n- Server components use async/await for params (Next.js 15 requirement)\n\n## Known Limitations\n\n- **Not responsive** - Fixed-width grid doesn't adapt well to mobile screens\n- **Requires GitHub token** - Must configure GITHUB_TOKEN environment variable\n- **52-week fixed display** - Always shows exactly one year of data\n- **No contribution breakdown** - Shows total count only (no separation of commits, PRs, reviews)\n\n## Changelog\n\n### v0.2.0 (Current)\n\n**Major Changes:**\n- Migrated from web scraping to GitHub GraphQL API\n- Upgraded to Next.js 15 and React 19\n- Enhanced error handling with user-friendly messages\n- Added loading skeleton UI\n- Improved accessibility with full ARIA support\n- Added dynamic SEO metadata\n- Security: Username validation to prevent injection attacks\n\n**Dependency Updates:**\n- Next.js: 14.x → 15.5.6\n- React: 18.x → 19.2.0\n- Added: classnames, @vercel/analytics\n- Removed: cheerio (no longer needed)\n\n## License\n\n[Apache License 2.0](https://github.com/kossakovsky/notion-github-graph/blob/main/LICENSE)\n\n## Contact\n\n- **GitHub:** [kossakovsky](https://github.com/kossakovsky)\n- **Telegram:** [@kossakovsky](https://t.me/kossakovsky)\n\n## Acknowledgments\n\n- Built with [Next.js](https://nextjs.org/)\n- Data from [GitHub GraphQL API](https://docs.github.com/en/graphql)\n- Deployed on [Vercel](https://vercel.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkossakovsky%2Fnotion-github-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkossakovsky%2Fnotion-github-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkossakovsky%2Fnotion-github-graph/lists"}