Highlights
Applications as First-Class Entities
- New applications table to group instances by product
- Automatic URL-safe slug generation (My App → my-app)
- Transparent migration of existing data
GitHub Integration
- Automatic GitHub stars capture (hourly refresh)
- GITHUB_TOKEN support to avoid rate limiting (60 → 5000 req/h)
- Manual refresh via admin API
Public SVG Badges
- /badge/{app}/instances - Active instances count
- /badge/{app}/version - Most used version
- /badge/{app}/metric/{name} - Aggregated metrics
- /badge/{app}/combined - Combined stats
- Shields.io flat-square style, customizable via query params
Dashboard Performance
- Lazy loading for long instance lists
- Server-side pagination with full-text search
- Modular Alpine.js architecture (separate stores/components)
New Features
| Feature | Description |
|---|---|
| applications table | Relational structure for app metadata |
| GitHub Stars | Auto-fetch with 1h cache and background scheduler |
| Custom logo | Configurable logo URL per application |
| Public SVG badges | 4 badge types embeddable in your READMEs |
| Node.js SDK | @btouchard/shm-sdk - Zero dependencies, Node 22+ |
| Lazy loading | Progressive instance loading (25/page) |
| Instance search | Filter by app, version, environment |
API Changes
New Endpoints
GET /api/v1/admin/applications
GET /api/v1/admin/applications/{slug}
PUT /api/v1/admin/applications/{slug}
POST /api/v1/admin/applications/{slug}/refresh-stars
GET /badge/{app}/instances
GET /badge/{app}/version
GET /badge/{app}/metric/{metric}
GET /badge/{app}/combined
Modifications
- GET /api/v1/admin/instances now supports ?app=, ?q=, ?offset=, ?limit=
- Instances now include app_slug in the response
Breaking Changes
None. Migration 002_applications.sql is additive and preserves all existing data.
Configuration
New optional environment variable:
GITHUB_TOKEN=ghp_xxx # For 5000 req/h instead of 60
Migration
Download the new migration
curl -sL https://raw.githubusercontent.com/btouchard/shm/main/migrations/002_applications.sql
-o migrations/002_applications.sql
Apply (migration is idempotent)
psql $DATABASE_URL -f migrations/002_applications.sql
Full Changelog: v1.1.0...v1.2.0