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
2. Configure GitHub OAuth
Go to GitHub Developer Settings
Create a new OAuth App:
Homepage URL: http://localhost:3000
Callback URL: http://localhost:8080/api/auth/github/callback
Copy Client ID and Secret to .env
3. Start Database & Backend (Docker)
cd infra
docker-compose up -d
cd frontend
npm install # or: bun install
npm run dev # or: bun dev
Visit 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
![ Docker Activity] ( https://api.dockerheatmap.dev/api/heatmap/your-docker-username.svg )
< 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.go
cd frontend
npm install
npm run dev
cd 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 for Production
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