{"id":27881856,"url":"https://github.com/src-d/gitbase-web","last_synced_at":"2025-05-05T05:05:47.717Z","repository":{"id":57501223,"uuid":"129398671","full_name":"src-d/gitbase-web","owner":"src-d","description":"gitbase web client; source{d} CE comes with a new UI, check it at https://docs.sourced.tech/community-edition/","archived":false,"fork":false,"pushed_at":"2019-10-09T11:35:34.000Z","size":12345,"stargazers_count":57,"open_issues_count":30,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-05T05:05:40.820Z","etag":null,"topics":["git","gitbase","sql","web-client"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/src-d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-13T12:22:47.000Z","updated_at":"2023-09-19T11:40:39.000Z","dependencies_parsed_at":"2022-09-14T19:41:16.790Z","dependency_job_id":null,"html_url":"https://github.com/src-d/gitbase-web","commit_stats":null,"previous_names":["src-d/gitbase-playground"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgitbase-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgitbase-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgitbase-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgitbase-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/gitbase-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442486,"owners_count":21748451,"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","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":["git","gitbase","sql","web-client"],"created_at":"2025-05-05T05:05:47.075Z","updated_at":"2025-05-05T05:05:47.703Z","avatar_url":"https://github.com/src-d.png","language":"Go","readme":"[![Build Status](https://travis-ci.com/src-d/gitbase-web.svg?branch=master)](https://travis-ci.com/src-d/gitbase-web)\n[![codecov.io](https://codecov.io/github/src-d/gitbase-web/coverage.svg)](https://codecov.io/github/src-d/gitbase-web)\n\n# Gitbase Web\n\nApplication to query Git repositories using SQL. Powered by [gitbase](https://github.com/src-d/gitbase), it allows to perform SQL queries on the Git history and the [Universal AST](https://doc.bblf.sh/) of the code itself.\n\n![Screenshot](.github/screenshot.png?raw=true)\n\n# Usage\n\n## With Docker Compose\n\nThe easiest way to run Gitbase Web and its dependencies is using [Docker Compose](https://docs.docker.com/compose/install/).\n\nThe first step is to populate a directory with some Git repositories to be served by gitbase before running it. For example:\n\n```bash\n$ mkdir $HOME/repos\n$ cd $HOME/repos\n$ git clone git@github.com:src-d/gitbase.git\n$ git clone git@github.com:bblfsh/bblfshd.git\n$ git clone git@github.com:src-d/gitbase-web.git\n```\n\nNext you will need to download the `docker-compose.yml` file from this repository and run `docker-compose up`. This tool will run three different containers: the gitbase-web frontend itself, gitbase, and bblfshd. To kill the running containers use `Ctrl+C`.\n\n```bash\n$ wget https://raw.githubusercontent.com/src-d/gitbase-web/master/docker-compose.yml\n$ docker-compose pull\n$ GITBASEPG_REPOS_FOLDER=$HOME/repos docker-compose up --force-recreate\n```\n\nThe server should be now available at [http://localhost:8080](http://localhost:8080).\n\nIn case there are any containers left, you can use\n```bash\ndocker-compose down\n```\nfor cleanup.\n\n## Without Docker Compose\n\nThe application will run the queries against a [gitbase](https://docs.sourced.tech/gitbase) server, and will request UASTs to a [bblfsh](https://doc.bblf.sh/) server. Make sure both are properly configured.\n\nThen you can choose to run the web client either as a docker container, or as a binary.\n\n### As a Docker\n\n```bash\n$ docker pull srcd/gitbase-web:latest\n$ docker run -d \\\n    --publish 8080:8080 \\\n    --env GITBASEPG_DB_CONNECTION=\"root@tcp(\u003cgitbase-ip\u003e:3306)/none\" \\\n    --env GITBASEPG_BBLFSH_SERVER_URL=\"\u003cbblfshd-ip\u003e:9432\" \\\n    srcd/gitbase-web:latest\n```\n\n### As a Binary\n\nDownload the binary from our [releases section](https://github.com/src-d/gitbase-web/releases), and run it:\n\n```bash\n$ export GITBASEPG_DB_CONNECTION=\"root@tcp(\u003cgitbase-ip\u003e:3306)/none\"\n$ export GITBASEPG_BBLFSH_SERVER_URL=\"\u003cbblfshd-ip\u003e:9432\"\n$ ./gitbase-web serve\n```\n\n# Configuration\n\nAny of the previous execution methods accept configuration through the following environment variables or CLI arguments.\n\n| Variable | Argument | Default value | Meaning |\n| -- | -- | -- | -- |\n| `GITBASEPG_HOST` | `--host` | `0.0.0.0` | IP address to bind the HTTP server |\n| `GITBASEPG_PORT` | `--port` | `8080` | Port to bind the HTTP server |\n| `GITBASEPG_SERVER_URL` | `--server` | | URL used to access the application in the form `HOSTNAME[:PORT]`. Leave it unset to allow connections from any proxy or public address |\n| `GITBASEPG_DB_CONNECTION` | `--db` | `root@tcp(localhost:3306)/none?maxAllowedPacket=4194304` | gitbase connection string. Use the DSN (Data Source Name) format described in the [Go MySQL Driver docs](https://github.com/go-sql-driver/mysql#dsn-data-source-name). |\n| `GITBASEPG_CONN_MAX_LIFETIME` | `--conn-max-lifetime` | `30` | Maximum amount of time a SQL connection may be reused, in seconds. Make sure this value is lower than the timeout configured in the gitbase server, set with [`GITBASE_CONNECTION_TIMEOUT`](https://docs.sourced.tech/gitbase/using-gitbase/configuration#environment-variables) |\n| `GITBASEPG_BBLFSH_SERVER_URL` | `--bblfsh` | `127.0.0.1:9432` | Address where bblfsh server is listening |\n| `GITBASEPG_SELECT_LIMIT` | `--select-limit` | `100` | Default `LIMIT` forced on all the SQL queries done from the UI. Set it to 0 to remove any limit |\n| `GITBASEPG_FOOTER_HTML` | `--footer` | | Allows to add any custom html to the page footer. It must be a string encoded in base64. Use it, for example, to add your analytics tracking code snippet  |\n| `LOG_LEVEL` | `--log-level=`  | `info` | Logging level (`info`, `debug`, `warning` or `error`) |\n| `LOG_FORMAT` | `--log-format=`  |  | log format (`text` or `json`), defaults to `text` on a terminal and `json` otherwise |\n| `LOG_FIELDS` | `--log-fields=`  |  | default fields for the logger, specified in json |\n| `LOG_FORCE_FORMAT` | `--log-force-format` | | ignore if it is running on a terminal or not |\n\n\n# Contribute\n\n[Contributions](https://github.com/src-d/gitbase-web/issues) are more than welcome, if you are interested please take a look to our [Contributing Guidelines](docs/CONTRIBUTING.md). There you will also find information on how to build and run the project from sources.\n\n# Code of Conduct\n\nAll activities under source{d} projects are governed by the [source{d} code of conduct](https://github.com/src-d/guide/blob/master/.github/CODE_OF_CONDUCT.md).\n\n# License\n\nGPL v3.0, see [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgitbase-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Fgitbase-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgitbase-web/lists"}