{"id":15371343,"url":"https://github.com/sultaniman/hive-state","last_synced_at":"2025-12-11T23:34:32.603Z","repository":{"id":57505070,"uuid":"259042911","full_name":"sultaniman/hive-state","owner":"sultaniman","description":"In-memory fleet state management","archived":false,"fork":false,"pushed_at":"2020-05-10T19:17:45.000Z","size":187,"stargazers_count":7,"open_issues_count":10,"forks_count":1,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-07T00:50:27.532Z","etag":null,"topics":["fleet","fleet-management","fleet-state","fleet-tracking","fleetops"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sultaniman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.me/SultanIman"]}},"created_at":"2020-04-26T13:52:50.000Z","updated_at":"2024-05-19T17:26:24.000Z","dependencies_parsed_at":"2022-09-19T09:50:51.395Z","dependency_job_id":null,"html_url":"https://github.com/sultaniman/hive-state","commit_stats":null,"previous_names":["hive-fleet/hive-state"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sultaniman/hive-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultaniman%2Fhive-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultaniman%2Fhive-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultaniman%2Fhive-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultaniman%2Fhive-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sultaniman","download_url":"https://codeload.github.com/sultaniman/hive-state/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultaniman%2Fhive-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672121,"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-12-11T02:00:11.302Z","response_time":56,"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":["fleet","fleet-management","fleet-state","fleet-tracking","fleetops"],"created_at":"2024-10-01T13:46:30.463Z","updated_at":"2025-12-11T23:34:32.584Z","avatar_url":"https://github.com/sultaniman.png","language":"Elixir","funding_links":["https://www.paypal.me/SultanIman"],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/travis/com/hive-fleet/hive-state/develop?style=for-the-badge)\n![Coverage](https://img.shields.io/coveralls/github/hive-fleet/hive-state/develop?style=for-the-badge)\n[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg?style=for-the-badge)](https://houndci.com)\n[![Hex.pm](https://img.shields.io/hexpm/l/hive?color=ff69b4\u0026label=License\u0026style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)\n\n\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eHive\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"https://raw.githubusercontent.com/hive-fleet/hive-state/develop/assets/logo.svg\"/\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\nEfficient in-memory fleet state management.\n\n\n## Installation 💾\n\nThis library can be installed by adding `hive` to the list of dependencies in\nyour `mix.exs`:\n\n```elixir\ndef deps do\n  [{:hive, \"~\u003e 0.0.1\"}]\nend\n```\n\nAdd `:hive` to `extra_applications` if necessary.\n\n\n## Usage 🚀\nOnce you have it running you can infleet, defleet, update positions, get h3 index for vehicles\n\n```elixir\nalias Hive.Vehicle\n\n# Infleet new vehicles\n{:ok, _pid} = Hive.infleet(\"autonomous-vehicle-id\")\n{:ok, _pid} = Hive.infleet(%Vehicle{id: \"autonomous-vehicle-id\"})\n{:ok, _pid} = Hive.infleet(\"normal-vehicle-id\")\n{:ok, _pid} = Hive.infleet(%Vehicle{id: \"normal-vehicle-id\"})\n\n# Defleet vehicles\n{:ok, _pid} = Hive.defleet(\"normal-vehicle-id\")\n{:ok, _pid} = Hive.defleet(%Vehicle{id: \"normal-vehicle-id\"})\n```\n\nIf we in-fleet only by `vehicle_id` then `%Vehicle{}` struct\nis created with default field values. We also can in-fleet giving\nfull `%Vehicle{}` with all parameters you want.\n\n\n### Structs\n\nHive has two structs `Vehicle` and `GeoPosition`\n\n```elixir\n%GeoPosition{\n  latitude: float(),\n  longitude: float(),\n  accuracy: float(),\n  altitude: float(),\n  altitude_accuracy: float(),\n  heading: float(),\n  speed: float()\n}\n\n%Vehicle{\n  id: String.t(),\n  vin: String.t() | nil,\n  name: String.t() | nil,\n  license_plate: String.t() | nil,\n  make: String.t() | nil,\n  model: String.t() | nil,\n  seat_count: non_neg_integer() | nil,\n  color: String.t() | nil,\n  online: boolean() | true,\n  has_passengers: boolean() | false,\n  is_sdc: boolean() | false,\n  position: GeoPosition.t() | nil,\n  telemetry: list() | []\n}\n```\n\nSupervision tree looks like\n![observer::Supervision tree](https://raw.githubusercontent.com/hive-fleet/hive-state/develop/assets/supervision-tree.png)\n\nFor more usage details please refer to https://hex.pm/packages/hive\n\n\n### H3 queries 🍪\n\nH3 integration is done via https://github.com/helium/erlang-h3 and at the moment the following\nfeatures are supported\n\n```elixir\n# Get hexagon index for vehicle or GeoPosition\nHive.H3.index(\"vehicle-uuid\")\nHive.H3.index(%GeoPosition{latitude: 48.8566, longitude: 2.3522})\n\n# H3 index to GeoPosition\nH3.index_to_geo(\"8928308280fffff\")\nH3.index_to_geo(617_700_169_958_293_503)\n\n# Get geo boundary\nH3.to_geo_boundary(\"8928308280fffff\")\nH3.to_geo_boundary(613_196_840_967_340_031)\n\n# Get kRing\nH3.k_ring(\"8928308280fffff\", 1)\nH3.k_ring(613_196_840_967_340_031, 1)\n```\n\nFor more see `Hive.H3` module documentation.\n\n\n## The future 🌈\n\nMore features and integrations with H3 will be available in the future\nat the moment the main goal is to stabilize the API and release\nthe first version with clear documentation how setup and use `Hive`.\n\n\n## Assets 💄\n\n1. Project logo is from https://www.flaticon.com/free-icon/honeycomb_1598428\n\n\u003ch2 align=\"center\"\u003eEnjoy!\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n        ✨ 🍰 ✨\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultaniman%2Fhive-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsultaniman%2Fhive-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultaniman%2Fhive-state/lists"}