{"id":26899781,"url":"https://github.com/dlukt/graphql-backend-starter","last_synced_at":"2026-04-06T08:01:50.898Z","repository":{"id":285394144,"uuid":"957916194","full_name":"dlukt/graphql-backend-starter","owner":"dlukt","description":"GraphQL backend with gqlgen and ent, starter project","archived":false,"fork":false,"pushed_at":"2025-09-23T21:47:22.000Z","size":20181,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T22:24:42.480Z","etag":null,"topics":["backend","ent","graphql","graphql-server","postgresql","sqlite","starter","starter-project","starter-template","template"],"latest_commit_sha":null,"homepage":"","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/dlukt.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-31T11:02:12.000Z","updated_at":"2025-09-23T21:47:25.000Z","dependencies_parsed_at":"2025-04-18T13:35:29.899Z","dependency_job_id":"16507780-0219-4719-b332-8d23099009bb","html_url":"https://github.com/dlukt/graphql-backend-starter","commit_stats":null,"previous_names":["dlukt/graphql-backend-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dlukt/graphql-backend-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fgraphql-backend-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fgraphql-backend-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fgraphql-backend-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fgraphql-backend-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlukt","download_url":"https://codeload.github.com/dlukt/graphql-backend-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fgraphql-backend-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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","ent","graphql","graphql-server","postgresql","sqlite","starter","starter-project","starter-template","template"],"created_at":"2025-04-01T06:53:23.819Z","updated_at":"2026-04-06T08:01:50.881Z","avatar_url":"https://github.com/dlukt.png","language":"Go","readme":"# gqlgen with ent starter\n\nThis repository is a gqlgen with ent backend starter template.\nInitial configuration is time-consuming and complicated.\nThis is here to make things easier and help people get started with GraphQL and ent.\n\n## Assumptions\n\n- You use [Keycloak](https://www.keycloak.org/) as the OIDC IDP.\n  It can be used with any IDP, but a custom viewer would need to be constructed.\n  You will have to add the audience in Keycloak to the token, because Keycloak is dumb like that.\n- [xid](https://github.com/rs/xid) is used for globally unique IDs\n- The `Profile` schema is the root of your related entities.\n- Schema introspection is enabled\n- PostgreSQL is used as the database. Optionally SQLite in-memory mode can be used or development purposes.\n- The Schema is automigrated on each graphql run.\n- Relay is used to provide filtering, ordering and pagination\n\n## How to run the backend\n\n### dev mode with SQLite\n\n```bash\ngo run main.go graphql --sqlite=true --debug=true\n```\n\n### dev mode with PostgreSQL\n\n```bash\ngo run main.go graphql \\\n--debug=true \\\n--db_uri=\"postgres://root:password@localhost:port/?sslmode=disable\"\n\n#or\n\ngo run main.go graphql \\\n--debug=true \\\n--db_user=\"username\" \\\n--db_password=\"password\" \\\n--db_name=\"database name\" \\\n--db_host=\"localhost\" \\\n--db_port=\"5432\"\n```\n\n## Getting started\n\nLet's assume your project is at github.com/user/repo\n\n### 1. Clone the repository\n\n```bash\nmkdir -p ~/go/src/github.com/user\ncd ~/go/src/github.com/user\ngit clone https://github.com/dlukt/graphql-backend-starter.git repo\ncd repo\n```\n\n### 2. Replace the original repository name with your repository name\n\n```bash\nchmod +x ./update-repo.sh\n./update-repo.sh github.com/user/repo\n```\n\n### 3. remove all \"starter\" occurences and replace with your repo name\n\n```bash\n# remember, repo is your repo name\nrm graph/generated/starter.generated.go\nmv starter.graphql repo.graphql\nmv graph/starter.resolvers.go graph/repo.resolvers.go\n```\n\nedit `gqlgen.yml` and replace the `- starter.graphql` with your `- repo.graphql`\n\n```yaml\nschema:\n  - ent.graphql\n  - repo.graphql\n```\n\nRegenerate\n\n```bash\ngo generate ./...\n```\n\nChange the project name in `cmd/root.go`, line 22.\n\n### 4. Change the git repo url\n\n```bash\nrm -rf .git\ngit init\ngit add .\ngit remote add origin github.com/user/repo\ngit commit -m 'initial'\ngit push -u origin master\n```\n\n## Adding new entities\n\n```bash\nalias ent='go run -mod=mod entgo.io/ent/cmd/ent'\n```\n\n`cd` into your project root.\n\n```bash\nent new Entity # capitalization matters\n```\n\nadd the new entity to `gqlgen.yml`\n\n```yaml\nautobind:\n  - github.com/user/repo/ent\n  - github.com/user/repo/ent/profile\n  - github.com/user/repo/ent/entity\n```\n\nand edit the `ent/schema/entity.go` file.\nAfterwards, regenerate all the things.\n\n```bash\ngo generate ./...\n```\n\n## OIDC\n\nUses [OIDC Middleware Guard](https://github.com/deicod/oidcmw) and its viewer with helper functions.\nIt assumes a Keycloak claims structure.\nIf you need the claims `viewer.RawClaims` which returns a `map[string]any`.\n\n## Further reading\n\n[Ent.io GraphQL Tutorial](https://entgo.io/docs/tutorial-todo-gql)\n\n[React Relay](https://relay.dev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlukt%2Fgraphql-backend-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlukt%2Fgraphql-backend-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlukt%2Fgraphql-backend-starter/lists"}