{"id":15288426,"url":"https://github.com/clustercockpit/cc-backend","last_synced_at":"2025-09-01T14:34:54.284Z","repository":{"id":38350007,"uuid":"183741194","full_name":"ClusterCockpit/cc-backend","owner":"ClusterCockpit","description":"Web frontend and API backend server for ClusterCockpit Monitoring Framework","archived":false,"fork":false,"pushed_at":"2025-08-12T15:57:08.000Z","size":10015,"stargazers_count":19,"open_issues_count":28,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-12T17:12:37.707Z","etag":null,"topics":["backend","golang","graphql","hpc","monitoring","rest-api","sveltejs"],"latest_commit_sha":null,"homepage":"https://www.clustercockpit.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClusterCockpit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-27T07:14:32.000Z","updated_at":"2025-06-04T09:36:55.000Z","dependencies_parsed_at":"2023-02-17T19:01:11.971Z","dependency_job_id":"22a9a769-b307-4713-b918-26cdfd2c0178","html_url":"https://github.com/ClusterCockpit/cc-backend","commit_stats":{"total_commits":1071,"total_committers":13,"mean_commits":82.38461538461539,"dds":0.676937441643324,"last_synced_commit":"ae53e87abac723635debce172e7d5458cdf89a32"},"previous_names":["clustercockpit/cc-jobarchive"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ClusterCockpit/cc-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClusterCockpit","download_url":"https://codeload.github.com/ClusterCockpit/cc-backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273140285,"owners_count":25052585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","golang","graphql","hpc","monitoring","rest-api","sveltejs"],"created_at":"2024-09-30T15:48:45.683Z","updated_at":"2025-09-01T14:34:54.256Z","avatar_url":"https://github.com/ClusterCockpit.png","language":"Go","readme":"# NOTE\n\nPlease have a look at the [Release\nNotes](https://github.com/ClusterCockpit/cc-backend/blob/master/ReleaseNotes.md)\nfor breaking changes!\n\n# ClusterCockpit REST and GraphQL API backend\n\n[![Build](https://github.com/ClusterCockpit/cc-backend/actions/workflows/test.yml/badge.svg)](https://github.com/ClusterCockpit/cc-backend/actions/workflows/test.yml)\n\nThis is a Golang backend implementation for a REST and GraphQL API according to\nthe [ClusterCockpit\nspecifications](https://github.com/ClusterCockpit/cc-specifications). It also\nincludes a web interface for ClusterCockpit. This implementation replaces the\nprevious PHP Symfony based ClusterCockpit web interface. The reasons for\nswitching from PHP Symfony to a Golang based solution are explained\n[here](https://github.com/ClusterCockpit/ClusterCockpit/wiki/Why-we-switched-from-PHP-Symfony-to-a-Golang-based-solution).\n\n## Overview\n\nThis is a Golang web backend for the ClusterCockpit job-specific performance\nmonitoring framework. It provides a REST API for integrating ClusterCockpit with\nan HPC cluster batch system and external analysis scripts. Data exchange between\nthe web front-end and the back-end is based on a GraphQL API. The web frontend\nis also served by the backend using [Svelte](https://svelte.dev/) components.\nLayout and styling are based on [Bootstrap 5](https://getbootstrap.com/) using\n[Bootstrap Icons](https://icons.getbootstrap.com/).\n\nThe backend uses [SQLite 3](https://sqlite.org/) as a relational SQL database by\ndefault. Optionally it can use a MySQL/MariaDB database server. While there are\nmetric data  backends for the InfluxDB and Prometheus time series databases, the\nonly tested and supported setup is to use cc-metric-store as the metric data\nbackend. Documentation on how to integrate ClusterCockpit with other time series\ndatabases will be added in the future.\n\nCompleted batch jobs are stored in a file-based job archive according to\n[this specification](https://github.com/ClusterCockpit/cc-specifications/tree/master/job-archive).\nThe backend supports authentication via local accounts, an external LDAP\ndirectory, and JWT tokens. Authorization for APIs is implemented with\n[JWT](https://jwt.io/) tokens created with public/private key encryption.\n\nYou find a detailed documentation on the [ClusterCockpit\nWebpage](https://clustercockpit.org).\n\n## Build requirements\n\nClusterCockpit requires a current version of the golang toolchain and node.js.\nYou can check `go.mod` to see what is the current minimal golang version needed.\nHomebrew and Archlinux usually have current golang versions. For other Linux\ndistros this often means that you have to install the golang compiler yourself.\nFortunately, this is easy with golang. Since much of the functionality is based\non the Go standard library, it is crucial for security and performance to use a\ncurrent version of golang. In addition, an old golang toolchain may limit the supported\nversions of third-party packages.\n\n## How to try ClusterCockpit with a demo setup\n\nWe provide a shell script that downloads demo data and automatically starts the\ncc-backend. You will need `wget`, `go`, `node`, `npm` in your path to\nstart the demo. The demo downloads 32MB of data (223MB on disk).\n\n```sh\ngit clone https://github.com/ClusterCockpit/cc-backend.git\ncd ./cc-backend\n./startDemo.sh\n```\n\nYou can also try the demo using the latest release binary.\nCreate a folder and put the release binary `cc-backend` into this folder.\nExecute the following steps:\n\n``` shell\n./cc-backend -init\nvim config.json (Add a second cluster entry and name the clusters alex and fritz)\nwget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-demo.tar\ntar xf job-archive-demo.tar\n./cc-backend -init-db -add-user demo:admin:demo -loglevel info\n./cc-backend -server -dev -loglevel info\n```\n\nYou can access the web interface at [http://localhost:8080](http://localhost:8080).\nCredentials for login are `demo:demo`.\nPlease note that some views do not work without a metric backend (e.g., the\nAnalysis, Systems and Status views).\n\n## How to build and run\n\nThere is a Makefile to automate the build of cc-backend. The Makefile supports\nthe following targets:\n\n* `make`: Initialize `var` directory and build svelte frontend and backend\nbinary. Note that there is no proper prerequisite handling. Any change of\nfrontend source files will result in a complete rebuild.\n* `make clean`: Clean go build cache and remove binary.\n* `make test`: Run the tests that are also run in the GitHub workflow setup.\n\nA common workflow for setting up cc-backend from scratch is:\n\n```sh\ngit clone https://github.com/ClusterCockpit/cc-backend.git\n\n# Build binary\ncd ./cc-backend/\nmake\n\n# EDIT THE .env FILE BEFORE YOU DEPLOY (Change the secrets)!\n# If authentication is disabled, it can be empty.\ncp configs/env-template.txt  .env\nvim .env\n\ncp configs/config.json .\nvim config.json\n\n#Optional: Link an existing job archive:\nln -s \u003cyour-existing-job-archive\u003e ./var/job-archive\n\n# This will first initialize the job.db database by traversing all\n# `meta.json` files in the job-archive and add a new user.\n./cc-backend -init-db -add-user \u003cyour-username\u003e:admin:\u003cyour-password\u003e\n\n# Start a HTTP server (HTTPS can be enabled in the configuration, the default port is 8080).\n# The --dev flag enables GraphQL Playground (http://localhost:8080/playground) and Swagger UI (http://localhost:8080/swagger).\n./cc-backend -server  -dev\n\n# Show other options:\n./cc-backend -help\n```\n\n## Project file structure\n\n* [`api/`](https://github.com/ClusterCockpit/cc-backend/tree/master/api)\ncontains the API schema files for the REST and GraphQL APIs. The REST API is\ndocumented in the OpenAPI 3.0 format in\n[./api/openapi.yaml](./api/openapi.yaml).\n* [`cmd/cc-backend`](https://github.com/ClusterCockpit/cc-backend/tree/master/cmd/cc-backend)\ncontains `main.go` for the main application.\n* [`configs/`](https://github.com/ClusterCockpit/cc-backend/tree/master/configs)\ncontains documentation about configuration and command line options and required\nenvironment variables. A sample configuration file is provided.\n* [`docs/`](https://github.com/ClusterCockpit/cc-backend/tree/master/docs)\ncontains more in-depth documentation.\n* [`init/`](https://github.com/ClusterCockpit/cc-backend/tree/master/init)\ncontains an example of setting up systemd for production use.\n* [`internal/`](https://github.com/ClusterCockpit/cc-backend/tree/master/internal)\ncontains library source code that is not intended for use by others.\n* [`pkg/`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg)\ncontains Go packages that can be used by other projects.\n* [`tools/`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools)\nAdditional command line helper tools.\n  * [`archive-manager`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools/archive-manager)\n  Commands for getting infos about and existing job archive.\n  * [`convert-pem-pubkey`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools/convert-pem-pubkey)\n  Tool to convert external pubkey for use in `cc-backend`.\n  * [`gen-keypair`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools/gen-keypair)\n  contains a small application to generate a compatible JWT keypair. You find\n  documentation on how to use it\n  [here](https://github.com/ClusterCockpit/cc-backend/blob/master/docs/JWT-Handling.md).\n* [`web/`](https://github.com/ClusterCockpit/cc-backend/tree/master/web)\nServer-side templates and frontend-related files:\n  * [`frontend`](https://github.com/ClusterCockpit/cc-backend/tree/master/web/frontend)\n  Svelte components and static assets for the frontend UI\n  * [`templates`](https://github.com/ClusterCockpit/cc-backend/tree/master/web/templates)\n  Server-side Go templates\n* [`gqlgen.yml`](https://github.com/ClusterCockpit/cc-backend/blob/master/gqlgen.yml)\nConfigures the behaviour and generation of\n[gqlgen](https://github.com/99designs/gqlgen).\n* [`startDemo.sh`](https://github.com/ClusterCockpit/cc-backend/blob/master/startDemo.sh)\nis a shell script that sets up demo data, and builds and starts `cc-backend`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclustercockpit%2Fcc-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclustercockpit%2Fcc-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclustercockpit%2Fcc-backend/lists"}