$ show coollabsio/coolify
Coolify is a self-hosted Platform-as-a-Service (PaaS) that enables users to deploy and manage applications, databases, and services on their own infrastructure. It serves as an open-source alternative to Heroku, Netlify, or Vercel, supporting Docker-based deployments with Git integration (GitHub, GitLab, Gitea, Bitbucket), multiple build packs (Railpack, Nixpacks), and one-click service templates. The system manages servers, reverse proxies (Traefik/Caddy), SSL certificates, scheduled backups, and multi-channel notifications (email, Discord, Slack, Telegram, Pushover, webhook). The architecture is a Laravel monolith with a Livewire + Alpine.js frontend for the v4 UI and a React + TypeScript canvas-based interface for the v5 UI. Background jobs are handled by Laravel Horizon with dedicated queues for deployments, cron tasks, and reconciliation. Real-time updates use Soketi (a Pusher-compatible WebSocket server) and Laravel Echo. The system integrates with cloud providers (Hetzner, Vultr, DigitalOcean) for server provisioning and Stripe for subscription billing. A Model Context Protocol (MCP) server exposes resources and tools for AI assistant integration. Key data flows include: webhook ingestion from Git providers triggering deployment jobs, SSH-based remote command execution on managed servers, Docker Compose parsing and environment variable injection, database backup scheduling with S3 storage, and proxy configuration generation. The v5 architecture introduces a control-plane/agent split with Flux (HTTP socket) and coold (gRPC) components for improved scalability and isolation. External dependencies include Docker, PostgreSQL, Redis, Soketi, Stripe API, cloud provider APIs, and various notification service endpoints. The codebase is actively developed with frequent schema migrations and a dual v4/v5 code path, indicating ongoing architectural evolution.
The LLM identified 6 files worth highlighting for reuse:
Implements a generic 2D collision resolution algorithm for positioning resource cards on a canvas. Exports `resolveCanvasNodeLayout` and `resolveCanvasNodePosition` functions that handle overlapping rectangles by shifting nodes to the nearest non-colliding position. The algorithm is self-contained, uses only basic geometry, and can be extracted into any project requiring automatic layout of draggable elements (e.g., diagram editors, dashboards). Demonstrates non-obvious skill in spatial reasoning and efficient collision resolution.
Provides a unified `runOptimisticUpdate` function that encapsulates the optimistic update lifecycle: apply a temporary state change, execute an async operation, and either commit or rollback with a notification callback. The pattern is framework-agnostic (no React or Vue dependency) and can be reused in any JavaScript project to reduce UI latency. Includes TypeScript generics for type safety and supports custom rollback logic.
Compares two application configuration snapshots (before and after a change) and produces a structured diff indicating which fields changed and whether a rebuild or redeploy is required. The diff is used to warn users about pending changes and to decide if a full deployment is necessary. The class is self-contained, uses a `ConfigurationDiffer` helper, and can be extracted to any system that needs to track configuration drift and trigger actions based on changes.
Parses Docker image references into structured components: registry URL, image name, tag, and SHA256 digest. Handles edge cases like implicit Docker Hub references, port-based registry URLs, and digest-only references. The parser is stateless, well-tested, and can be reused in any PHP project that needs to validate or decompose Docker image strings. Demonstrates careful handling of the Docker image specification.
A Laravel validation rule that accepts either a valid cloud-config YAML document or a plain bash script. It attempts to parse the input as YAML and checks for required cloud-init keys (`runcmd`, `packages`, `users`, etc.) or falls back to treating it as a shell script. The rule is self-contained, uses Symfony YAML parser, and can be extracted to any PHP project needing cloud-init validation. Demonstrates practical handling of multi-format input.
A Laravel Eloquent trait that adds a `noindex` flag to domain models (Application, ServiceApplication) and provides a `scopeWithNoindexDomains` scope. It normalizes the `noindex` attribute by checking both the model's own flag and a global instance setting. The trait is small, focused, and can be reused in any Laravel project that needs to manage per-domain SEO indexing preferences with a fallback to global defaults.