Plugins
Grit plugins are standalone Go packages that add specific functionality to your project. Each plugin is a drop-in module with Gin handlers, GORM models, and a Claude Code skill file so AI assistants know how to use it.
How Plugins Work
Grit plugins follow a consistent pattern: install the Go module, run the GORM auto-migration, configure with environment variables, and register routes. Each plugin includes a .claude/skills/ directory with a skill file that teaches AI assistants how to integrate and use the plugin.
// 1. Install// go get github.com/gritframework/grit-<plugin>// 2. Import and configureimport plugin "github.com/gritframework/grit-<plugin>"// 3. Run migrationsplugin.AutoMigrate(db)// 4. Create servicesvc := plugin.NewService(db, plugin.Config{...})// 5. Register routesplugin.RegisterRoutes(router.Group("/api"), svc)
Source Code: All plugins are open source at github.com/MUKE-coder/grit-plugins
WebSockets
grit-websockets
Real-time communication with hub pattern, rooms, broadcast, and auth middleware.
Features
- •WebSocket hub with connection management
- •Room-based messaging and broadcast
- •Auth middleware via query param token
- •Client read/write pump goroutines
Use Cases
go get github.com/gritframework/grit-websockets
import ws "github.com/gritframework/grit-websockets"hub := ws.NewHub()go hub.Run()r.GET("/ws", ws.AuthWebSocketHandler(hub, validateToken))
Stripe Payments
grit-stripe
Stripe integration for checkout sessions, subscriptions, customer portal, and webhook handling.
Features
- •Checkout sessions (one-time and recurring)
- •Subscription management (create, cancel, list)
- •Customer portal sessions
- •Webhook signature verification and routing
- •GORM models for payment tracking
Use Cases
Environment Variables
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETSTRIPE_SUCCESS_URLSTRIPE_CANCEL_URLgo get github.com/gritframework/grit-stripe
import gritstripe "github.com/gritframework/grit-stripe"client := gritstripe.NewClient(gritstripe.Config{SecretKey: os.Getenv("STRIPE_SECRET_KEY"),WebhookSecret: os.Getenv("STRIPE_WEBHOOK_SECRET"),SuccessURL: os.Getenv("STRIPE_SUCCESS_URL"),CancelURL: os.Getenv("STRIPE_CANCEL_URL"),})r.POST("/webhooks/stripe", gritstripe.WebhookHandler(handlers))
OAuth / Social Login
grit-oauth
OAuth2 social login with pre-configured providers for Google, GitHub, and Discord.
Features
- •Google, GitHub, Discord providers built-in
- •State parameter CSRF protection
- •OAuth account linking to existing users
- •Extensible for custom providers
- •GORM models for OAuth accounts
Use Cases
Environment Variables
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGITHUB_CLIENT_IDGITHUB_CLIENT_SECRETgo get github.com/gritframework/grit-oauth
import oauth "github.com/gritframework/grit-oauth"mgr := oauth.NewManager(oauth.Config{RedirectBaseURL: os.Getenv("OAUTH_REDIRECT_BASE"),})mgr.RegisterProvider("google", oauth.GoogleProvider(clientID, clientSecret))r.GET("/auth/:provider", mgr.RedirectHandler())r.GET("/auth/:provider/callback", mgr.CallbackHandler(onSuccess))
Notifications
grit-notifications
Multi-channel notification system: in-app, push (FCM), SMS (Twilio), and email digest.
Features
- •In-app notifications with read/unread tracking
- •Push notifications via Firebase Cloud Messaging
- •SMS via Twilio
- •Multi-channel send (same notification to multiple channels)
- •REST API for frontend notification bell
Use Cases
Environment Variables
FCM_SERVER_KEYTWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_FROM_NUMBERgo get github.com/gritframework/grit-notifications
import notify "github.com/gritframework/grit-notifications"svc := notify.NewService(db, notify.Config{FCMServerKey: os.Getenv("FCM_SERVER_KEY"),})notify.RegisterRoutes(api, svc)svc.Send(ctx, notify.Notification{UserID: userID, Channel: notify.InApp,Title: "New Comment", Body: "Someone commented on your post.",})
Full-Text Search
grit-search
Meilisearch integration with indexing, search queries, GORM auto-sync hooks, and Gin handlers.
Features
- •Meilisearch client wrapper
- •Document indexing and bulk sync
- •Search with filters, sorting, pagination
- •GORM hooks for auto-indexing on create/update/delete
- •Gin search endpoint handler
Use Cases
Environment Variables
MEILISEARCH_HOSTMEILISEARCH_API_KEYgo get github.com/gritframework/grit-search
import search "github.com/gritframework/grit-search"client, _ := search.NewClient(search.Config{Host: os.Getenv("MEILISEARCH_HOST"),APIKey: os.Getenv("MEILISEARCH_API_KEY"),})search.RegisterAutoIndex(db, client, &models.Post{}, "posts")r.GET("/api/search", search.SearchHandler(client, "posts"))
Video Processing
grit-video
Video upload, FFmpeg transcoding, thumbnail generation, and HLS adaptive streaming.
Features
- •Video upload with validation
- •FFmpeg transcoding to HLS (360p-1080p)
- •Adaptive bitrate master playlist
- •Thumbnail generation
- •Video info extraction (duration, resolution)
- •GORM models with processing status
Use Cases
Environment Variables
FFMPEG_PATHVIDEO_STORAGE_PATHVIDEO_MAX_UPLOAD_SIZEgo get github.com/gritframework/grit-video
import video "github.com/gritframework/grit-video"svc := video.NewService(db, video.Config{StoragePath: "./storage/videos",MaxUploadSize: 500 * 1024 * 1024,FFmpegPath: "ffmpeg",})video.RegisterRoutes(api, svc)
Video Conferencing
grit-conference
WebRTC signaling server with room management, participant tracking, and screen sharing support.
Features
- •WebRTC signaling via WebSocket
- •Room creation with participant limits
- •Screen sharing signals
- •Mute/unmute and video on/off controls
- •ICE/STUN/TURN server configuration
- •Room locking
Use Cases
go get github.com/gritframework/grit-conference
import conference "github.com/gritframework/grit-conference"svc := conference.NewService(conference.Config{MaxParticipants: 10,ICEServers: []conference.ICEServer{{URLs: []string{"stun:stun.l.google.com:19302"}},},})conference.RegisterRoutes(api, svc)
Outgoing Webhooks
grit-webhooks
Webhook subscription management, event dispatching, HMAC-SHA256 signing, and retry with exponential backoff.
Features
- •Webhook subscriptions with event filtering
- •HMAC-SHA256 signature headers
- •Exponential backoff retry (up to 5 attempts)
- •Background delivery workers
- •Delivery log with status tracking
- •Test and manual retry endpoints
Use Cases
Environment Variables
WEBHOOK_SIGNING_SECRETgo get github.com/gritframework/grit-webhooks
import webhooks "github.com/gritframework/grit-webhooks"svc := webhooks.NewService(db, webhooks.Config{SigningSecret: os.Getenv("WEBHOOK_SIGNING_SECRET"),MaxRetries: 5, WorkerCount: 4,})svc.Start()webhooks.RegisterRoutes(api, svc)// Dispatch from anywhere:svc.Dispatch("user.created", map[string]interface{}{"id": user.ID})
Internationalization
grit-i18n
Translation loading, locale detection middleware, pluralization, and API endpoints for frontend translation fetching.
Features
- •File-based translations (JSON/TOML)
- •Locale detection from headers, query params
- •String interpolation and pluralization
- •API endpoints for frontend translation fetching
- •DB-backed translation overrides
- •Gin middleware for locale context
Use Cases
go get github.com/gritframework/grit-i18n
import i18n "github.com/gritframework/grit-i18n"svc, _ := i18n.NewService(i18n.Config{DefaultLocale: "en",SupportedLocales: []string{"en", "fr", "es"},TranslationsDir: "./translations",})r.Use(i18n.LocaleMiddleware(svc))i18n.RegisterRoutes(api, svc)
Data Export
grit-export
PDF reports, Excel spreadsheets, and CSV exports with builder-pattern APIs and GORM integration.
Features
- •PDF generation with tables, headers, footers
- •Excel export with styling and multiple sheets
- •CSV generation
- •Builder pattern for all formats
- •GORM query to export bridge
- •Gin handler with format negotiation (?format=pdf|excel|csv)
Use Cases
go get github.com/gritframework/grit-export
import export "github.com/gritframework/grit-export"svc := export.NewService(export.Config{CompanyName: "Acme Inc"})queryFn := export.GORMExportHandler(db, &[]User{}, columns)r.GET("/api/users/export", export.ExportHandler(svc, queryFn))