{"id":15368789,"url":"https://github.com/astorije/ubeer","last_synced_at":"2025-04-15T13:09:44.993Z","repository":{"id":136165642,"uuid":"84755790","full_name":"astorije/ubeer","owner":"astorije","description":"🍻 Ubeer is a stupidly simple application to demonstrate the capabilities of GraphQL in Scala using Sangria and Akka HTTP","archived":false,"fork":false,"pushed_at":"2017-08-10T05:48:00.000Z","size":4532,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T13:09:25.706Z","etag":null,"topics":["akka-http","beer","graphql","sangria"],"latest_commit_sha":null,"homepage":"https://astori.fr/graphql-nescala","language":"CSS","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/astorije.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}},"created_at":"2017-03-12T20:39:06.000Z","updated_at":"2018-02-01T06:46:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e95593a-dc8a-4bb1-95cc-35d4cba1bffb","html_url":"https://github.com/astorije/ubeer","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"5b9f4d8471ede387d8254136c4c9bcb51c2827c5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astorije%2Fubeer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astorije%2Fubeer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astorije%2Fubeer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astorije%2Fubeer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astorije","download_url":"https://codeload.github.com/astorije/ubeer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249076542,"owners_count":21208812,"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":["akka-http","beer","graphql","sangria"],"created_at":"2024-10-01T13:31:49.484Z","updated_at":"2025-04-15T13:09:44.963Z","avatar_url":"https://github.com/astorije.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ubeer\n\nUbeer is a very simple client-server application where:\n\n- The server exposes a [GraphQL](http://graphql.org/) endpoint using [Sangria](http://sangria-graphql.org/) and Akka HTTP.\n- The client is a Vanilla JS application to locate breweries around you.\n\nIt was developed for a lightning talk I gave at\n[NE Scala NYC 2017](http://www.nescala.org/) on 24 March 2017. The slides of\nthis talk can be found at \u003chttps://astori.fr/graphql-nescala\u003e.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.youtube.com/watch?v=6ttypoLyRaU\"\u003e\n    \u003cimg width=\"400\" alt=\"screen shot 2017-08-10 at 01 42 35\" src=\"https://user-images.githubusercontent.com/113730/29156011-7c9b4ae2-7d6d-11e7-9c09-f98b5c51c72e.png\"\u003e\n    \u003cbr\u003e\n    \u003cem\u003eWatch the talk\u003c/em\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"The Ubeer client\" src=\"screenshots/ubeer.png\" width=\"400\"\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg alt=\"GraphiQL\" src=\"screenshots/graphiql.png\" width=\"400\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eThe Ubeer client \u0026amp; GraphiQL\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Client-Server architecture\" src=\"screenshots/client-server.png\" width=\"400\"\u003e\n  \u003cbr\u003e\n  \u003cimg alt=\"Data model\" src=\"screenshots/data-model.png\" width=\"400\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eBackend architecture\u003c/em\u003e\n\u003c/p\u003e\n\n## Running the project\n\nIn your console, run:\n\n```sh\nsbt run\n```\n\nThis will compile the project, load the JSON files in memory, print the GraphQL\nschema in the console and start the Akka HTTP server.\n\nOnce the server is started you can:\n\n- Play with the client app at \u003chttp://localhost:8080/ubeer/index.html\u003e.\n- Run queries interactively using [GraphiQL](https://github.com/graphql/graphiql)\n  at \u003chttp://localhost:8080/graphiql/index.html\u003e (see below for some examples).\n\n## Query examples\n\nThe following examples illustrate some capabilities GraphQL offers on this project.\n\nRunning these from the links given below assumes that you are running this\nproject locally (see above).\n\n### Arguments\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=%7B%0A%20%20beer(id%3A%20360)%20%7B%0A%20%20%20%20name%0A%20%20%20%20description(charLimit%3A%2050)%0A%20%20%7D%0A%7D%0A\u0026variables=\"\u003eRun this example\u003c/a\u003e\n\n```graphql\n{\n  beer(id: 360) {\n    name\n    description(charLimit: 50)\n  }\n}\n```\n\n[More information about arguments](http://graphql.org/learn/queries/#arguments)\n\n### Aliases\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=%7B%0A%20%20beerOne%3A%20beer(id%3A%20360)%20%7B%0A%20%20%20%20name%0A%20%20%7D%0A%20%20beerTwo%3A%20beer(id%3A%20440)%20%7B%0A%20%20%20%20name%0A%20%20%7D%0A%7D\u0026variables=\"\u003eRun this example\u003c/a\u003e\n\n```graphql\n{\n  beerOne: beer(id: 360) {\n    name\n  }\n  beerTwo: beer(id: 440) {\n    name\n  }\n}\n```\n\n[More information about aliases](http://graphql.org/learn/queries/#aliases)\n\n### Reusable fragments\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=%7B%0A%20%20beerOne%3A%20beer(id%3A%20360)%20%7B%0A%20%20%20%20...beerSummary%0A%20%20%7D%0A%20%20beerTwo%3A%20beer(id%3A%20440)%20%7B%0A%20%20%20%20...beerSummary%0A%20%20%7D%0A%7D%0A%0Afragment%20beerSummary%20on%20Beer%20%7B%0A%20%20name%0A%20%20brewery%20%7B%0A%20%20%20%20name%0A%20%20%7D%0A%7D%0A\u0026variables=\"\u003eRun this example\u003c/a\u003e\n\n```graphql\n{\n  beerOne: beer(id: 360) {\n    ...beerSummary\n  }\n  beerTwo: beer(id: 440) {\n    ...beerSummary\n  }\n}\n\nfragment beerSummary on Beer {\n  name\n  brewery {\n    name\n  }\n}\n```\n\n[More information about fragments](http://graphql.org/learn/queries/#fragments)\n\n### Variables\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=query%20(%24city%3A%20String)%20%7B%0A%20%20breweries(city%3A%20%24city)%20%7B%0A%20%20%20%20name%0A%20%20%20%20address%0A%20%20%20%20website%0A%20%20%7D%0A%7D%0A\u0026variables=%0A%7B%0A%09%22city%22%3A%20%22Brooklyn%22%0A%7D\"\u003eRun this example\u003c/a\u003e\n\n```graphql\nquery ($city: String) {\n  breweries(city: $city) {\n    name\n    address\n    website\n  }\n}\n```\n\nAnd in the *Query variables* tab:\n\n```json\n{\n  \"city\": \"Brooklyn\"\n}\n```\n\n[More information about variables](http://graphql.org/learn/queries/#variables)\n\n### Directives\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=query%20(%24skipBeers%3A%20Boolean!)%20%7B%0A%20%20breweries%20%7B%0A%20%20%20%20name%0A%20%20%20%20address%0A%20%20%20%20website%0A%20%20%20%20beers%20%40skip(if%3A%20%24skipBeers)%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20abv%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A\u0026variables=%7B%0A%20%20%22skipBeers%22%3A%20false%0A%7D\"\u003eRun this example\u003c/a\u003e\n\n```graphql\nquery ($skipBeers: Boolean!) {\n  breweries {\n    name\n    address\n    website\n    beers @skip(if: $skipBeers) {\n      name\n      abv\n    }\n  }\n}\n```\n\nAnd in the *Query variables* tab:\n\n```json\n{\n  \"skipBeers\": false\n}\n```\n\n[More information about directives](http://graphql.org/learn/queries/#directives)\n\n### Introspection\n\n\u003ca href=\"http://localhost:8080/graphiql/index.html?query=%7B%0A%20%20__schema%20%7B%0A%20%20%20%20types%20%7B%0A%20%20%20%20%20%20kind%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20description%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20__type(name%3A%20%22Beer%22)%20%7B%0A%20%20%20%20kind%0A%20%20%20%20name%0A%20%20%20%20description%0A%20%20%20%20fields%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20type%20%7B%0A%20%20%20%20%20%20%20%20kind%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20ofType%20%7B%0A%20%20%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20args%20%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20type%20%7B%0A%20%20%20%20%20%20%20%20%20%20kind%0A%20%20%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A\u0026variables=\"\u003eRun this example\u003c/a\u003e\n\n```graphql\n{\n  __schema {\n    types {\n      kind\n      name\n      description\n    }\n  }\n\n  __type(name: \"Beer\") {\n    kind\n    name\n    description\n    fields {\n      name\n      type {\n        kind\n        name\n        ofType {\n          name\n        }\n      }\n      args {\n        name\n        type {\n          kind\n          name\n        }\n      }\n    }\n  }\n}\n```\n\n[More information about introspection](http://graphql.org/learn/introspection/)\n\n## About the data\n\nThe [JSON data files](https://github.com/astorije/ubeer/tree/master/src/main/resources)\ncome from the [Open Beer Database](https://openbeerdb.com/) project, converted\nfrom CSV to JSON (with some cleanup and reformatting along the way) using\n[this tool](http://www.convertcsv.com/csv-to-json.htm).\n\nThanks to them for making these available!\n\nHowever, note that data in these files is dated from 2011, and I had to delete\nmore than half the beers whenever they were lacking a style, a brewery, etc.\nIf anyone knows of a more up-to-date and sanitized list of beers and breweries,\nlet me know!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastorije%2Fubeer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastorije%2Fubeer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastorije%2Fubeer/lists"}