Generate beautiful GitHub-style contribution heatmaps for your Docker Hub activity. Embed in your README and showcase your container contributions.
- π GitHub OAuth - Secure authentication with your GitHub account
- π Beautiful Heatmaps - GitHub-style SVG contribution graphs
- π Easy Embedding - Copy-paste URLs for README or any website
- π Secure Storage - AES-256 encrypted token storage (zero plaintext)
- β‘ Auto Refresh - Background jobs keep data up-to-date
- π‘ Public API - JSON endpoints for custom integrations
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, TypeScript, Tailwind CSS, shadcn/ui, TanStack Query, Zod |
| Backend | Go, GoFiber, GORM |
| Database | PostgreSQL |
| Auth | GitHub OAuth |
| Infrastructure | Docker, Docker Compose |
docker-heatmap/
βββ frontend/ # Next.js frontend
β βββ app/ # App router pages
β βββ components/ # UI components
β βββ lib/ # Utilities & API client
β βββ context/ # React contexts
β βββ hooks/ # Custom hooks
βββ backend/ # Go backend
β βββ cmd/ # Entry point
β βββ internal/
β βββ config/ # Configuration
β βββ database/ # Database connection
β βββ handlers/ # HTTP handlers
β βββ middleware/# Auth & rate limiting
β βββ models/ # GORM models
β βββ services/ # Business logic
β βββ utils/ # Utilities
β βββ worker/ # Background jobs
βββ infra/ # Infrastructure
β βββ docker-compose.yml
β βββ nginx/
βββ .env.example # Environment template
- Node.js 20+ (or Bun)
- Go 1.21+
- Docker & Docker Compose
- PostgreSQL (or use Docker)
git clone https://github.com/yourusername/docker-heatmap.git
cd docker-heatmap
# Copy environment template
cp .env.example .env- Go to GitHub Developer Settings
- Create a new OAuth App:
- Homepage URL:
http://localhost:3000 - Callback URL:
http://localhost:8080/api/auth/github/callback
- Homepage URL:
- Copy Client ID and Secret to
.env
cd infra
docker-compose up -dcd frontend
npm install # or: bun install
npm run dev # or: bun devVisit http://localhost:3000
| Variable | Description | Required |
|---|---|---|
GITHUB_CLIENT_ID |
GitHub OAuth Client ID | β |
GITHUB_CLIENT_SECRET |
GitHub OAuth Secret | β |
JWT_SECRET |
Secret for JWT signing | β |
ENCRYPTION_KEY |
32-char key for AES-256 | β |
DATABASE_URL |
PostgreSQL connection string | β |
FRONTEND_URL |
Frontend URL for CORS | β |
PORT |
Backend port (default: 8080) | β |
# JWT Secret
openssl rand -hex 32
# Encryption Key (exactly 32 characters)
openssl rand -base64 24 | head -c 32| Method | Endpoint | Description |
|---|---|---|
| GET | /api/auth/github |
Start GitHub OAuth |
| GET | /api/auth/github/callback |
OAuth callback |
| POST | /api/auth/logout |
Logout |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user/me |
Get current user |
| PUT | /api/user/me |
Update profile |
| GET | /api/user/embed |
Get embed codes |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/docker/connect |
Connect Docker Hub |
| GET | /api/docker/account |
Get connected account |
| DELETE | /api/docker/disconnect |
Disconnect account |
| POST | /api/docker/sync |
Trigger sync |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/heatmap/:username.svg |
SVG heatmap |
| GET | /api/activity/:username.json |
Activity JSON |
| GET | /api/profile/:username |
Profile data |
<img
src="https://api.dockerheatmap.dev/api/heatmap/your-docker-username.svg"
alt="Docker Activity"
/><a href="https://dockerheatmap.dev/profile/your-docker-username">
<img
src="https://api.dockerheatmap.dev/api/heatmap/your-docker-username.svg"
alt="Docker Activity"
/>
</a>cd backend
go mod download
go run cmd/main.gocd frontend
npm install
npm run devcd infra
docker-compose up --build- Create and configure
infra/.env.server:cp .env.example infra/.env.server # Edit infra/.env.server with production values - Run Docker Compose:
cd infra docker-compose up -d --build
ENVIRONMENT=production
FRONTEND_URL=https://dockerheatmap.dev
GITHUB_CALLBACK_URL=https://api.dockerheatmap.dev/api/auth/github/callback- Token Encryption: Docker Hub tokens are encrypted with AES-256-GCM
- OAuth State: CSRF protection with state tokens
- Rate Limiting: Different tiers for API, auth, and public endpoints with memory protection
- JWT Auth: Stateless authentication with 7-day expiry
- Security Headers: X-Content-Type-Options, X-Frame-Options, HSTS, Referrer-Policy
- Input Validation: Username format validation and token length checks
- XSS Prevention: SVG output is sanitized to prevent script injection
- Non-root Docker: Container runs as unprivileged user
- Production Guards: App fails to start with default secrets in production
- Request Limits: Body size limited to 1MB to prevent DoS
MIT License - see LICENSE for details.
Contributions are welcome! Please open an issue or submit a PR.
Made with β€οΈ for the Docker community