Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #49 merged: refactor: remove CoolifyResource model, derive app UUID from API

Summary

  • BREAKING CHANGE: Removes database storage for Coolify resource info
  • Application UUIDs are now derived from the Coolify API by matching the current git repository
  • Only COOLIFY_PROJECT_UUID is stored in .env, everything else is fetched from API

Changes

  • Remove CoolifyResource model and migration
  • Add Coolify::getApplicationUuid() that fetches apps from API and matches by git repo
  • Add Coolify::getCurrentGitRepository() helper
  • Update ProvisionCommand to write COOLIFY_PROJECT_UUID to .env instead of database
  • Update all commands (DeployCommand, LogsCommand, StatusCommand, RestartCommand, RollbackCommand) to use Coolify::getApplicationUuid()
  • Update DashboardStatsController to derive app info from API
  • Simplify EnvironmentController (multi-environment support removed)
  • Update all tests for new architecture

Why

The previous approach of storing Coolify details in a local database was flawed because:

  1. Running migrate:fresh --seed would wipe the Coolify configuration
  2. The data was redundant - it can all be derived from the Coolify API
  3. Simpler architecture: just store the project UUID in .env and fetch everything else

Test plan

  • All 230 tests pass
  • Lint passes
+358
additions
-463
deletions
29
files changed