{"id":15066444,"url":"https://github.com/wolfenrain/bolt","last_synced_at":"2025-04-10T13:42:52.261Z","repository":{"id":63321522,"uuid":"567013385","full_name":"wolfenrain/bolt","owner":"wolfenrain","description":" Lightning fast, strongly typed network protocol","archived":false,"fork":false,"pushed_at":"2023-09-04T19:39:38.000Z","size":137,"stargazers_count":44,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T12:21:45.800Z","etag":null,"topics":["dart","dart-package","dartlang","netcode","udp"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/wolfenrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-16T22:13:49.000Z","updated_at":"2025-03-20T20:47:27.000Z","dependencies_parsed_at":"2024-10-23T03:39:16.339Z","dependency_job_id":null,"html_url":"https://github.com/wolfenrain/bolt","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":"0.41666666666666663","last_synced_commit":"2b454edfdfbcc7afb05f2aa02919f01d57984e12"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfenrain%2Fbolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfenrain%2Fbolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfenrain%2Fbolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfenrain%2Fbolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfenrain","download_url":"https://codeload.github.com/wolfenrain/bolt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248226264,"owners_count":21068170,"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":["dart","dart-package","dartlang","netcode","udp"],"created_at":"2024-09-25T01:08:06.576Z","updated_at":"2025-04-10T13:42:52.239Z","avatar_url":"https://github.com/wolfenrain.png","language":"Dart","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/wolfenrain/bolt/main/assets/bolt_full.png\" height=\"320\" alt=\"bolt logo\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/wolfenrain/bolt/actions\"\u003e\u003cimg src=\"https://github.com/wolfenrain/bolt/actions/workflows/main.yaml/badge.svg\" alt=\"bolt\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/wolfenrain/bolt/actions\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/wolfenrain/bolt/main/coverage_badge.svg\" alt=\"coverage\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pub.dev/packages/very_good_analysis\"\u003e\u003cimg src=\"https://img.shields.io/badge/style-very_good_analysis-B22C89.svg\" alt=\"style: very good analysis\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-purple.svg\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## What is Bolt\n\nBolt is a network protocol written in Dart to send and receive strongly typed data objects. It is designed to be easy to use and to be as fast as possible.\n\nBolt is split into two parts, the `BoltClient` and the `BoltServer`. They both implement the `BoltProtocol`, which handles settings up the connection, verifying the connection is secure and sending/receiving data objects.\n \nEverything is abstracted away in these classes, this means that you can implement your own abstraction on top of Bolt by just extending from `BoltClient` and `BoltServer`.\n\nBolt works on the principal of shared code, this means that you write common code that is shared between both server and client. \n\n## Packages\n\n| Package                                                                                                | Pub                                                                                                                        |\n| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |\n| [bolt](https://github.com/wolfenrain/bolt/tree/main/packages/bolt)                                     | [![pub package](https://img.shields.io/pub/v/bolt.svg)](https://pub.dev/packages/bolt)                                     |\n| [bolt_udp_binding](https://github.com/wolfenrain/bolt/tree/main/packages/bolt_udp_binding)             | [![pub package](https://img.shields.io/pub/v/bolt_udp_binding.svg)](https://pub.dev/packages/bolt_udp_binding)             |\n| [bolt_websocket_binding](https://github.com/wolfenrain/bolt/tree/main/packages/bolt_websocket_binding) | [![pub package](https://img.shields.io/pub/v/bolt_websocket_binding.svg)](https://pub.dev/packages/bolt_websocket_binding) |\n\n## Documentation 📝\n\nFor documentation about Bolt, see the [docs](https://github.com/wolfenrain/bolt/tree/main/docs) section.\n\nAn example of Bolt can be found in the [example](https://github.com/wolfenrain/bolt/tree/main/example) directory.\n\n## Quick Start 🚀\n\n### Prerequisites 📝\n\nIn order to start using Bolt you must have the [Dart SDK][dart_install_link] installed on your machine.\n\n### Installing 🧑‍💻\n\nAdd `bolt` to your `pubspec.yaml`:\n\n```sh\n# 📦 Install bolt from pub.dev\ndart pub add bolt\n```\n\n### Creating a shared Data Object 💿\n\nCreate a shared Data Object for the client and server:\n\n```dart\nclass Ping extends DataObject {\n  const Ping(this.timestamp);\n\n  final int timestamp;\n\n  @override\n  List\u003cObject?\u003e get props =\u003e [timestamp];\n\n  static void register(BoltRegistry registry) {\n    registry.registerObject(\n      100,\n      DataResolver\u003cPing\u003e(Ping.new, [\n        Argument.positional\u003cPing, int\u003e((d) =\u003e d.timestamp, type: uint32),\n      ]),\n    );\n  }\n}\n```\n\n### Creating a Server 🏁\n\nDefine a server, register the data object and listen to messages:\n\n```dart\nclass ExampleServer extends BoltServer {\n  ExampleServer(super.address) {\n    Ping.register(registry);\n\n    on(_onPinged);\n  }\n\n  void _onPinged(Message\u003cPing\u003e message) {\n    // Do something on ping ...\n  }\n\n  @override\n  Future\u003cbool\u003e verifyAuth(Connection connection, String token) async {\n    return token == 'super_secure_token';\n  }\n}\n```\n\n### Creating a Client ✨\n\nDefine the client, register the data object and implement the `onConnected` method:\n\n```dart\nclass ExampleClient extends BoltClient {\n  ExampleClient(super.address, {super.server}) {\n    Ping.register(registry);\n  }\n\n  @override\n  void onConnected() {\n    send(Ping(DateTime.now().millisecondsSinceEpoch));\n  }\n}\n```\n\n[dart_install_link]: https://dart.dev/get-dart\n[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license_link]: https://opensource.org/licenses/MIT\n[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg\n[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfenrain%2Fbolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfenrain%2Fbolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfenrain%2Fbolt/lists"}