{"id":31813664,"url":"https://github.com/haskell-miso/miso-geolocation","last_synced_at":"2025-10-11T08:20:36.252Z","repository":{"id":314180722,"uuid":"1054499620","full_name":"haskell-miso/miso-geolocation","owner":"haskell-miso","description":"🍜 📍 Geolocation API example with miso","archived":false,"fork":false,"pushed_at":"2025-09-11T00:40:56.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-11T03:05:09.541Z","etag":null,"topics":["geolocation","geolocation-api","haskell","miso"],"latest_commit_sha":null,"homepage":"https://geolocation.haskell-miso.org/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-miso.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},"funding":{"open_collective":"miso","github":["dmjio"]}},"created_at":"2025-09-10T23:53:00.000Z","updated_at":"2025-09-11T00:41:00.000Z","dependencies_parsed_at":"2025-09-11T03:19:54.774Z","dependency_job_id":null,"html_url":"https://github.com/haskell-miso/miso-geolocation","commit_stats":null,"previous_names":["haskell-miso/miso-geolocation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/haskell-miso/miso-geolocation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-miso%2Fmiso-geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-miso%2Fmiso-geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-miso%2Fmiso-geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-miso%2Fmiso-geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-miso","download_url":"https://codeload.github.com/haskell-miso/miso-geolocation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-miso%2Fmiso-geolocation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006769,"owners_count":26084148,"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-10-11T02:00:06.511Z","response_time":55,"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":["geolocation","geolocation-api","haskell","miso"],"created_at":"2025-10-11T08:20:34.638Z","updated_at":"2025-10-11T08:20:36.246Z","avatar_url":"https://github.com/haskell-miso.png","language":"Haskell","funding_links":["https://opencollective.com/miso","https://github.com/sponsors/dmjio"],"categories":[],"sub_categories":[],"readme":":ramen: 📍 miso-geolocation\n====================\n\nA [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API) example. See live [here](https://geolocation.haskell-miso.org).\n\n\u003e [!TIP] \n\u003e This requires installing [nix](https://nixos.org) with [Nix Flakes](https://wiki.nixos.org/wiki/Flakes) enabled.\n\u003e Although not required, we recommend using [miso's binary cache](https://github.com/dmjio/miso?tab=readme-ov-file#binary-cache).\n\n### Example\n\n```haskell\n-----------------------------------------------------------------------------\ndata Action\n  = GetLocation\n  | ErrorLocation GeolocationError\n  | SetLocation Geolocation\n  deriving (Show, Eq)\n-----------------------------------------------------------------------------\n#ifdef WASM\nforeign export javascript \"hs_start\" main :: IO ()\n#endif\n-----------------------------------------------------------------------------\nmain :: IO ()\nmain = run $ startApp app\n-----------------------------------------------------------------------------\ntype Model = Maybe Geolocation\n-----------------------------------------------------------------------------\napp :: App Model Action\napp = (component Nothing updateModel viewModel)\n#ifndef WASM\n  { styles =\n    [ Href \"assets/style.css\"\n    ]\n  }\n#endif\n-----------------------------------------------------------------------------\nupdateModel :: Action -\u003e Transition Model Action\nupdateModel = \\case\n  GetLocation -\u003e do\n    geolocation SetLocation ErrorLocation\n  SetLocation location -\u003e do\n    this ?= location\n  ErrorLocation (GeolocationError _ err) -\u003e\n    io_ (consoleError err)\n```\n\n### Development\n\nCall `nix develop` to enter a shell with [GHC 9.12.2](https://haskell.org/ghc)\n\n```bash\n$ nix develop --experimental-features nix-command --extra-experimental-features flakes\n```\n\nOnce in the shell, you can call `cabal run` to start the development server and view the application at http://localhost:8080\n\n### Build (Web Assembly)\n\n```bash\n$ nix develop .#wasm --command bash -c \"make\"\n```\n\n### Build (JavaScript)\n\n```bash\n$ nix develop .#ghcjs --command bash -c \"build\"\n```\n\n### Serve\n\nTo host the built application you can call `serve`\n\n```bash\n$ nix develop .#wasm --command bash -c \"serve\"\n```\n\n### Clean\n\n```bash\n$ nix develop .#wasm --command bash -c \"make clean\"\n```\n\nThis comes with a GitHub action that builds and auto hosts the example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-miso%2Fmiso-geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-miso%2Fmiso-geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-miso%2Fmiso-geolocation/lists"}