|
| 1 | +# WebSDR |
| 2 | + |
| 3 | +[WebSDR](https://github.com/wavelet-lab/websdr) is an open-source TypeScript monorepo that provides libraries and tools for building web applications that work with Software Defined Radios (SDR) using WebUSB and related browser/node tooling. |
| 4 | + |
| 5 | +⚠️ This project is under active development. Some features are experimental and APIs may change. |
| 6 | + |
| 7 | +## What is WebSDR? |
| 8 | + |
| 9 | +WebSDR contains utilities, UI components, backend modules, and small test apps to make it easier to build browser-based SDR applications and tooling. The primary goal is to enable interaction with SDR devices connected over USB from web applications (via WebUSB), and to provide supporting building blocks for dashboards, demos, and server-side microservices. |
| 10 | + |
| 11 | +Core capabilities include: |
| 12 | +- WebUSB device management (requesting devices, selecting devices in UI components). |
| 13 | +- A small Vue 3 component library for dashboards and controls (dropdowns, lists, inputs, log viewers). |
| 14 | +- NestJS modules for microservices (authentication, API scaffolding) useful for backend parts of an SDR web platform. |
| 15 | +- Utility modules: circular buffers, data conversion helpers, string utilities, time helpers and promise helpers used across frontend and backend. |
| 16 | + |
| 17 | +## Repository layout |
| 18 | + |
| 19 | +Top-level structure (important folders): |
| 20 | + |
| 21 | +``` |
| 22 | +packages/ |
| 23 | +├─ core/ # Shared domain types, utilities, constants |
| 24 | +├─ frontend-core/ # Front-end utilities and WebUSB adapters |
| 25 | +├─ vue3-components/ # Reusable Vue 3 UI components and styles |
| 26 | +├─ nestjs-microservice/ # NestJS modules (auth, API helpers, microservice wiring) |
| 27 | +test-apps/ # Small example/test applications and scripts |
| 28 | +``` |
| 29 | + |
| 30 | +Brief package descriptions: |
| 31 | +- `packages/core` — Core shared library with domain types, utilities, constants and radio-related helpers. |
| 32 | +- `packages/frontend-core` — Front-end core utilities, WebUSB adapters, and services used by client apps. |
| 33 | +- `packages/vue3-components` — Vue 3 component library (examples: `SdrInput`, `Dropdown`, `List`, `LogArea`). Built with Vite; ships TypeScript types and styles. |
| 34 | +- `packages/nestjs-microservice` — NestJS integration and helper modules; main entry is `WebSDRModule` (configurable via environment variables such as `WEBSDR_*`). |
| 35 | +- `test-apps` — Small scripts and demo pages used to test low-level functionality (e.g., `usb-test.ts`). |
| 36 | + |
| 37 | +## Quick setup |
| 38 | + |
| 39 | +Install dependencies for the workspace: |
| 40 | + |
| 41 | +```bash |
| 42 | +npm install |
| 43 | +``` |
| 44 | + |
| 45 | +Build the packages: |
| 46 | + |
| 47 | +```bash |
| 48 | +npm run build |
| 49 | +``` |
| 50 | + |
| 51 | +Run tests (runs workspace tests): |
| 52 | + |
| 53 | +```bash |
| 54 | +npm run test |
| 55 | +``` |
| 56 | + |
| 57 | +Run all tests |
| 58 | +```bash |
| 59 | +npm run test:all |
| 60 | +``` |
| 61 | + |
| 62 | +Run all tests and watch for changes |
| 63 | +```bash |
| 64 | +npm run test:watch |
| 65 | +``` |
| 66 | + |
| 67 | +Run coverage check |
| 68 | +```bash |
| 69 | +npm run test:coverage |
| 70 | +``` |
| 71 | + |
| 72 | +## Running test applications |
| 73 | + |
| 74 | +Example test apps live in `test-apps`. To run them: |
| 75 | + |
| 76 | +```bash |
| 77 | +cd test-apps |
| 78 | +npm install |
| 79 | +npm run test:usb # runs the USB test script (requires appropriate permissions/flags) |
| 80 | +``` |
| 81 | + |
| 82 | +Note: WebUSB requires HTTPS or localhost and browser support. Running tests that access USB devices may require additional browser flags or permissions. |
| 83 | + |
| 84 | +## Environment / Configuration |
| 85 | + |
| 86 | +- `packages/nestjs-microservice` reads configuration from environment variables (prefixed with `WEBSDR_` in places). See the module entry and code for exact variable names. |
| 87 | + |
| 88 | +## License |
| 89 | + |
| 90 | +WebSDR is [MIT licensed](https://github.com/wavelet-lab/websdr/blob/main/LICENSE) |
0 commit comments