Integrations
Relevant source files
The following files were used as context for generating this wiki page:- README.md
- apps/web/core/components/pages/settings/team/integration-setting.tsx
- apps/web/core/hooks/integrations/use-github-integration.ts
- apps/web/core/services/server/requests/integrations/github.ts
- apps/web/core/components/pages/integration/github/page-component.tsx
- docker-compose.build.yml
- apps/desktop/i18n/en.json
Integrations are a core feature of the Ever Teams platform, designed to connect with third-party services and streamline workflows. This system allows users to link external tools, such as source code repositories and issue trackers, directly into their Ever Teams projects.
Currently, the primary and most developed integration is with GitHub. This allows for the synchronization of GitHub repositories and their issues with Ever Teams tasks, enhancing project management by bridging the gap between development and planning. Other integrations mentioned as planned include GitLab, Bitbucket, and JIRA.
Sources: README.md, apps/web/core/components/pages/settings/team/integration-setting.tsx
GitHub Integration
The GitHub integration enables teams to connect their GitHub repositories to projects within Ever Teams. This connection facilitates the synchronization of issues and provides configuration options for automatic task creation and updates.
Sources: apps/web/core/components/pages/settings/team/integration-setting.tsx:143-145, [apps/desktop/i18n/en.json:1130-1134]
Installation Flow
The installation process is an OAuth flow that authorizes the Ever Teams GitHub App to access a user's repositories.
- The user navigates to
Settings -> Team -> Integrationsand clicks the "Install" button for GitHub. - The application constructs a URL to the GitHub App installation page, including the current origin as a
stateparameter for redirection after installation. - The user is redirected to GitHub to authorize the application and select repositories for installation.
- After authorization, GitHub redirects the user back to the
/integration/githubpage within the Ever Teams application, providing aninstallation_idandsetup_actionas query parameters. - The
GitHubpage component captures these parameters and calls theinstallGitHubfunction to finalize the installation on the backend. - The user is then redirected to the team settings page, where the integration now appears as active.
The following sequence diagram illustrates the GitHub App installation flow.
Sources: apps/web/core/components/pages/settings/team/integration-setting.tsx:32-38, apps/web/core/components/pages/integration/github/page-component.tsx:43-55, apps/web/core/hooks/integrations/use-github-integration.ts:110-117, [apps/web/core/services/server/requests/integrations/github.ts:8-19]
Frontend Implementation
The frontend management of the GitHub integration is handled by a dedicated UI component, a React hook for logic, and global state atoms.
Integration Settings UI
The IntegrationSetting component, located in the team settings page, is the primary user interface for managing the GitHub integration.
- Display Status: Shows whether the GitHub integration is installed.
- Installation/Removal: Provides "Install" and "Remove" buttons to manage the integration lifecycle.
- Repository Selection: A dropdown menu allows users to select a specific GitHub repository to sync with the current project.
- Auto-Sync Configuration: Includes
Switchcontrols to enable or disable automatic task synchronization.
This component utilizes the useGitHubIntegration hook to interact with the backend and manage state.
Sources: apps/web/core/components/pages/settings/team/integration-setting.tsx
useGitHubIntegration Hook
This hook encapsulates all client-side logic for the GitHub integration. It uses @tanstack/react-query for efficient data fetching, caching, and mutations.
| Function / Property | Description |
|---|---|
metaData(integrationId) | Triggers a fetch for the GitHub integration metadata. |
getRepositories(id) | Triggers a fetch for the list of available GitHub repositories for the given integration. |
installGitHub(...) | Initiates the installation of the GitHub app via a backend call. |
syncGitHubRepository(...) | Syncs a selected GitHub repository with an Ever Teams project. |
integrationGithubMetadata | State property holding the fetched metadata (IGithubMetadata). |
integrationGithubRepositories | State property holding the list of repositories (IGithubRepositories). |
*Loading properties | Boolean flags (metadataLoading, repositoriesLoading, etc.) indicating the status of async operations. |
*Error properties | Hold error objects if a query or mutation fails. |
Sources: apps/web/core/hooks/integrations/use-github-integration.ts
Repository and Task Synchronization
Once the GitHub App is installed, users can sync a repository and configure how issues are synchronized as tasks.
Repository Syncing Flow
The diagram below shows the process of syncing a GitHub repository with an Ever Teams project.
Sources: apps/web/core/components/pages/settings/team/integration-setting.tsx:88-104, apps/web/core/hooks/integrations/use-github-integration.ts:141-165, [apps/web/core/services/server/requests/integrations/github.ts:108-124]
Task Auto-Sync Configuration
The settings UI provides granular control over how GitHub issues are synced.
- Auto Synk Tasks: A master switch to enable or disable all automatic task synchronization for the project. When enabled, it calls
editOrganizationProjectto update theisTasksAutoSyncflag. - Sync Tasks with specific Label: A switch to enable syncing only issues that have a specific label. This updates the
isTasksAutoSyncOnLabelflag. - Sync Tag Input: A text field to specify the exact GitHub label (
syncTag) to use for synchronization when the above option is enabled.
Sources: [apps/web/core/components/pages/settings/team/integration-setting.tsx:168-219, 252-261]
Backend API
The client-side hooks communicate with a set of dedicated server endpoints to manage the GitHub integration. These endpoints are defined as request functions that use a common serverFetch utility.
| Method | Endpoint | Description |
|---|---|---|
POST | /integration/github/install | Finalizes the GitHub App installation. |
POST | /integration/github/oauth | Handles the OAuth authorization callback. |
GET | /integration/github/{integrationId}/metadata | Retrieves metadata for an installed integration. |
GET | /integration/github/{integrationId}/repositories | Fetches repositories accessible by the integration. |
POST | /integration/github/repository/sync | Syncs a specific repository with a project. |
Sources: apps/web/core/services/server/requests/integrations/github.ts
Configuration
The GitHub integration requires specific environment variables to be set for the application to function correctly. These are typically configured in Docker Compose files.
| Variable | Description | Example Value |
|---|---|---|
NEXT_PUBLIC_GITHUB_APP_NAME | The name of the GitHub App to integrate with. | ever-github |
GITHUB_CLIENT_ID | The Client ID of the GitHub OAuth App. | (secret) |
GITHUB_CLIENT_SECRET | The Client Secret of the GitHub OAuth App. | (secret) |
Sources: docker-compose.build.yml:45-47, [docker-compose.demo.yml:33-35]