A service catalog hub for viewing all of your software infrastructure from various third party providers all in one place!
The idea for this project came to me at work, where I often struggled to get a clear view of all the infrastructure we had. It was frustrating to have to juggle 5+ different websites just to get the information I needed. CodeHub aims to solve this by consolidating everything into a single, consistent UI.
At the moment, CodeHub works by spinning up background tasks called 'Discovery Services' that will fetch all relevant data from your connected third parties. It then presents these via a unified portal that you can use to browse them. It’s designed to be deployed and run locally, such as in a Kubernetes cluster or on a local machine.
At the moment it is in its infancy, so the UI is very basic, but below are some screenshots taken (07-12-2024) of its current state.
CodeHub Portal
This folder contains the projects used for the Frontend part of CodeHub. It is currently written using Blazor and MudBlazor.
CodeHub Api
The CodeHub.Api folder is the other executable application in this project. It is the Api that is called from the portal.
Each platform is in its own folder in the CodeHub.Module project. Below is the current list of platforms that are supported:
- Azure
- Azure DevOps
- GitHub
- GitLab
Each module implements 2 shared interfaces that are used in the CodeHub.API to expose the data fetched from each platform:
- IDiscoveryService: This is responsible for kicking off background tasks for each registered platform to fetch all associated data
- IQueryService: This is responsible for querying the data back for a given platform. E.g. GetRepositories will return all cached repositories for that platform implementation
Each platform can be configured and enabled through the appsettings.json file. Each platform has its own required
way of of authenticating. For example, with DevOps you can use a Personal Access Token.
For Azure you just need to tell it to be enabled. It uses the DefaultArmCredential to authenticate.
See more information about what sources it gets authentication information from
here: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet
{
"AzureSettings": {
"IsEnabled": true,
"SubscriptionFilters": []
}
}For Azure DevOps below is an example. This example will enable the Azure DevOps platform and read the provided 'Organization' and 'PersonalAccessToken' fields.
{
"AzureDevOpsSettings": {
"Organization": "<INSERT YOUR ORGANIZATION NAME HERE>",
"PersonalAccessToken": "<INSERT YOUR PERSONAL ACCESS TOKEN HERE>",
"IsEnabled": true,
"ProjectFilters": []
}
}For GitHub you need to provide the AgentName (Name used in the Header for identifying request) and the Token.
{
"GitHubSettings": {
"AgentName": "<INSERT YOUR AGENT NAME HERE>",
"Token": "<INSERT YOUR TOKEN HERE>",
"IsEnabled": true
}
}For GitLab you need to provide the Host Url and the Token.
{
"GitLabSettings": {
"HostUrl": "<INSERT YOUR HOST URL HERE>",
"Token": "<INSERT YOUR TOKEN HERE>",
"IsEnabled": true
}
}This project uses docker files and docker compose to allow you to spin up the backend quickly. You can find the docker file within this root folder called 'Backend.Dockerfile'
Steps to run locally
- Clone this repository.
- Create an
appsettings.development.jsonfile in the root of the CodeHub.API project. It must contain the credentials and an enabled flag for each platform you want turned on. - Run
docker compose up backendin the root folder of the CodeHub project to spin up the backend project.
- GitHub, GitLab & Bitbucket for Git providers.
- Azure / AWS for cloud providers
- SonarCloud integration for security and static analysis
- Kubernetes API integration for monitoring your orchestration stack.
