Latest Release
- Repository: 0ceanSlim/grain
- Published on: 2025-08-14 14:49:44 UTC
- Version Tag: v0.4.12
- By: 0ceanSlim
- On GitHub: 0ceanSlim/grain/releases
Major API Overhaul & Offline Frontend Support
Released: August 14, 2025
Commit:b5e37bd
Full Changelog: https://github.com/0ceanSlim/grain/compare/v0.4.11...v0.4.12🔄 Major API Redesign
Complete Key Management API Overhaul 🔑
- Rebuilt all key endpoints with improved consistency and functionality
- New unified key operations supporting all formats (hex, npub, nsec) with auto-detection
- Enhanced key validation with detailed error responses and type detection
- Streamlined key conversion between formats with single endpoints
New Key API Structure:
GET /api/v1/keys/generate # Generate new keypair
GET /api/v1/keys/derive/{key} # Derive public from private
GET /api/v1/keys/convert/public/{key} # Convert hex ↔ npub
GET /api/v1/keys/convert/private/{key} # Convert hex ↔ nsec
GET /api/v1/keys/validate/{key} # Validate any key type
Enhanced Client Relay Management 🌐
- Complete relay API rewrite with improved endpoint naming and functionality
- Protocol auto-detection - automatically tries
wss://then falls back tows:// - Granular permissions - configure read/write permissions per relay
- Domain-based endpoints - cleaner URLs using domain names instead of full URLs
- Improved status reporting with connection health and latency information
New Relay API Structure:
GET /api/v1/ping/{domain} # Ping relay with auto-protocol detection
POST /api/v1/client/connect/{domain} # Connect with permissions
POST /api/v1/client/disconnect/{domain} # Disconnect relay
GET /api/v1/client/relays # Get relay status with optional ping
Session & Cache System Redesign 💾
- Completely rebuilt cache/session management for better consistency
- Improved data synchronization between user sessions and relay connections
- Enhanced session persistence with better error handling
- Streamlined cache refresh with manual refresh capabilities
🌐 Complete Offline Frontend Support
Self-Contained Web Interface 📱
- Bundled CSS framework - Tailwind CSS now built and minified into releases
- Local JavaScript dependencies - HTMX and Hyperscript downloaded and bundled
- Zero external dependencies - frontend works entirely offline in air-gapped networks
- Improved build process with automatic dependency management
Build System Improvements: - Automatic Tailwind CSS compilation and minification - HTMX and Hyperscript dependency downloading during build - Single binary deployment with all frontend assets included - No CDN dependencies - fully self-contained operation
Enhanced UI Functionality ✨
- Client relay management UI - add/remove relays directly from web interface
- Improved relay status display with real-time connection health
- Enhanced mailbox management with better read/write relay organization
- Consistent styling with properly bundled CSS framework
🔧 Development & Build Improvements
Cross-Platform Development Support 🛠️
- Improved Makefile compatibility across Windows, macOS, and Linux
- Better terminal support regardless of shell or development environment
- Enhanced build consistency with platform-agnostic commands
- Streamlined development workflow with reliable build processes
Testing & Documentation Updates 📚
- Updated API documentation reflecting all new endpoint structures
- Enhanced test documentation with better cross-platform instructions
- Improved development guides with clearer setup procedures
- Better error handling in development and testing environments
🐛 Critical Fixes
Database Connection Stability 💪
- Fixed global database client - resolved critical connection issues
- Improved connection reliability with better error handling
- Enhanced reconnection logic preventing service interruption
API Authentication Improvements 🔒
- Removed unnecessary auth requirements from client relay endpoints
- Streamlined authentication flow for better user experience
- Fixed permission handling in relay management operations
⚙️ Migration from v0.4.11
Smooth Upgrade Path 🚀
```bash
Backup current setup
cp config.yml config.yml.backup
Replace executable - configs remain compatible
mv grain grain.old
Extract new v0.4.12 release
New frontend assets are bundled - no additional setup needed
```
API Migration Notes ⚠️
- Key endpoints changed - update any custom integrations using old key API
- Relay endpoints restructured - client applications may need endpoint updates
- Response formats improved - more consistent JSON structures across all endpoints
🎯 Before vs After This Release
Before v0.4.12 ❌
- Key API was inconsistent across different operations
- Frontend required internet connection for CSS/JS dependencies
- Relay management was complex with full URL requirements
- Development builds were platform-specific and unreliable
- Client relay management required API calls, no UI
After v0.4.12 ✅
- Unified key API with auto-format detection and conversion
- Complete offline frontend operation with bundled dependencies
- Simple domain-based relay management with auto-protocol detection
- Cross-platform development with consistent build processes
- Full client relay management through web interface
🌟 Release Highlights
This major update transforms GRAIN into a truly self-contained, offline-capable Nostr relay with a completely redesigned API and enhanced web interface.
Key Improvements:
- API Consistency - Complete overhaul creating unified, predictable endpoints
- Offline Operation - Zero external dependencies for frontend functionality
- Developer Experience - Cross-platform build system with improved reliability
- User Interface - Full relay management capabilities through web UI
- Production Ready - Enhanced stability and self-contained deployment
🚀 Production Impact
Improved Deployment Options
- Air-gapped networks - complete offline operation capability
- Simplified deployment - single binary with all assets bundled
- Reduced maintenance - no external dependency management required
Enhanced Developer Experience
- Consistent API - predictable endpoint structure and responses
- Better documentation - comprehensive API reference with examples
- Cross-platform development - reliable builds on any system
This release represents a significant milestone in GRAIN's development, providing a robust, self-contained relay solution with a modern API design and complete offline capabilities. The improved build system and cross-platform compatibility make GRAIN more accessible to developers and operators across all environments. 🌾
Full Changelog: https://github.com/0ceanSlim/grain/compare/v0.4.11...v0.4.12
Data updated on: 2025-11-24 16:43 UTC