Skip to content

websocket_sdk Free

WebSocket client abstraction with dart:io or Phoenix implementation.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
appNamestringThe name of your application
websocketLibraryenum (dart, phoenix)dartThe WebSocket library to use
isForMonorepobooleantrueWhether this is being generated as part of a monorepo

Usage

Interactive

bash
archipelago generate websocket_sdk

Non-interactive (CI)

bash
archipelago generate websocket_sdk --config my_config.json

Config Template

json
{
  "@appName": "The name of your application",
  "appName": "MyApp",
  "@websocketLibrary": "The WebSocket library to use (dart | phoenix)",
  "websocketLibrary": "dart",
  "@isForMonorepo": "Whether this is being generated as part of a monorepo",
  "isForMonorepo": true
}

Generated Structure

Always generated:

infrastructure/
└── websocket_sdk_api/
    ├── lib/
    │   ├── websocket_sdk_api.dart
    │   └── src/
    │       ├── client/
    │       │   └── websocket_client.dart
    │       ├── exceptions/
    │       │   ├── exceptions.dart
    │       │   ├── websocket_closed_exception.dart
    │       │   ├── websocket_connection_exception.dart
    │       │   ├── websocket_exception.dart
    │       │   └── websocket_send_exception.dart
    │       ├── interceptor/
    │       │   └── websocket_interceptor.dart
    │       ├── message/
    │       │   ├── websocket_message.dart
    │       │   └── websocket_message_type.dart
    │       └── state/
    │           └── connection_state.dart
    ├── pubspec.yaml
    └── README.md

When websocketLibrary is dart:

infrastructure/
└── websocket_sdk_dart/
    ├── lib/
    │   ├── websocket_sdk_dart.dart
    │   └── src/
    │       ├── client/
    │       │   └── dart_websocket_client.dart
    │       ├── config/
    │       │   └── websocket_config.dart
    │       └── di/
    │           ├── injector.dart
    │           ├── injector.module.dart
    │           └── register_module.dart
    ├── pubspec.yaml
    └── README.md

When websocketLibrary is phoenix:

infrastructure/
└── websocket_sdk_phoenix/
    ├── lib/
    │   ├── websocket_sdk_phoenix.dart
    │   └── src/
    │       ├── channel/
    │       │   └── phoenix_channel_manager.dart
    │       ├── client/
    │       │   └── phoenix_websocket_client.dart
    │       ├── config/
    │       │   └── phoenix_config.dart
    │       └── di/
    │           ├── injector.dart
    │           └── register_module.dart
    ├── pubspec.yaml
    └── README.md

Built by Banua Coder