Skip to content

feat: multi-team support with team-scoped resources and setup flow#18

Open
Jacxk wants to merge 12 commits into
mainfrom
feat/COOL-49-team-selection
Open

feat: multi-team support with team-scoped resources and setup flow#18
Jacxk wants to merge 12 commits into
mainfrom
feat/COOL-49-team-selection

Conversation

@Jacxk
Copy link
Copy Markdown
Owner

@Jacxk Jacxk commented Jan 28, 2026

Add team selection and filter all Coolify resources by the selected team.

Team selection

  • New setup step at /setup/team; users must pick a team before entering the app.
  • Team can be changed later in Settings → Team Selection.
  • Selected team is stored in AsyncStorage (TEAM_STORAGE_KEY).

Team-scoped data

  • All list and single fetchers filter by current team via filterResourceByTeam / filterResourcesByTeam in lib/utils.ts.
  • Applied to: Applications, Databases, Services, Servers, Projects, Resources, Private Keys.
  • Single-resource queries may return null when the resource is not in the selected team.

Other

  • lib/storage.ts: getCurrentTeam() helper.
  • Root index redirects to /setup/team when no team is selected.

Note

Medium Risk
Changes core data-fetching semantics across many resource types and introduces null returns for single-resource queries, which can break screens that assume data is always present; also adds a new required setup step affecting navigation/boot flow.

Overview
Adds multi-team support by introducing a persisted current team selection and enforcing team-scoped data throughout the app.

A new /setup/team step is inserted into the setup flow and the root redirect now blocks entry to /main until a team is chosen; Settings gains a team selector to switch teams later (stored in AsyncStorage via TEAM_STORAGE_KEY).

All major resource fetchers (applications, databases, services, servers, projects, private keys, and aggregated resources) now filter lists and single-item queries by the selected team using new filterResourceByTeam/filterResourcesByTeam helpers, which can cause single-resource queries/hooks to return null when the resource is out-of-team; some optimistic update handlers were tightened to avoid invalidation/context issues.

Written by Cursor Bugbot for commit 8afb67b. This will update automatically on new commits. Configure here.

Comment thread hooks/useSetup.ts Outdated
Comment thread app/setup/team.tsx
Comment thread hooks/useSetup.ts
Comment thread lib/storage.ts
Comment thread lib/utils.ts
Comment thread hooks/useSetup.ts
Comment thread api/projects.ts Outdated
Comment thread api/servers.ts Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread api/projects.ts
}
}),
);
const validProjects = projectsWithTeam.filter((p) => p !== null);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking N+1 queries cause slow project list loading

High Severity

The getProjects function now uses await Promise.all() to fetch each project individually via getProject(), blocking until all N requests complete. Previously, prefetchQuery initiated background fetches without blocking the list return. This N+1 query pattern causes the project list to load significantly slower as the number of projects increases.

Fix in Cursor Fix in Web

Comment thread app/index.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant