{"id":35067900,"url":"https://github.com/sonr-io/motr","last_synced_at":"2026-05-23T07:03:49.044Z","repository":{"id":318763654,"uuid":"1073203987","full_name":"sonr-io/motr","owner":"sonr-io","description":"🚧 Under Construction | JS Light Node for the Sonr Network","archived":false,"fork":false,"pushed_at":"2025-11-21T02:59:40.000Z","size":7634,"stargazers_count":1,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-20T15:22:45.485Z","etag":null,"topics":["cosmos","dids","sonr","wasm"],"latest_commit_sha":null,"homepage":"https://sonr.io/docs/motr","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonr-io.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":".github/AGENTS.md","dco":null,"cla":null}},"created_at":"2025-10-09T19:05:06.000Z","updated_at":"2025-11-20T19:53:05.000Z","dependencies_parsed_at":"2025-10-15T09:27:50.164Z","dependency_job_id":"8c4d6a20-f6ad-4621-b588-ff6048fdc742","html_url":"https://github.com/sonr-io/motr","commit_stats":null,"previous_names":["sonr-io/motr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sonr-io/motr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonr-io%2Fmotr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonr-io%2Fmotr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonr-io%2Fmotr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonr-io%2Fmotr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonr-io","download_url":"https://codeload.github.com/sonr-io/motr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonr-io%2Fmotr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33386079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cosmos","dids","sonr","wasm"],"created_at":"2025-12-27T11:38:58.617Z","updated_at":"2026-05-23T07:03:49.038Z","avatar_url":"https://github.com/sonr-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motr\n\n\u003e Multi-purpose WebAssembly monorepo powering secure cryptographic operations and decentralized identity for the Sonr ecosystem.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Version](https://img.shields.io/badge/Go-1.24.4+-00ADD8?logo=go)](https://go.dev/)\n[![TinyGo](https://img.shields.io/badge/TinyGo-0.39+-00ADD8?logo=go)](https://tinygo.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?logo=typescript)](https://www.typescriptlang.org/)\n[![Bun](https://img.shields.io/badge/Bun-1.3+-000000?logo=bun)](https://bun.sh/)\n\n## Overview\n\nMotr is a comprehensive WebAssembly-based monorepo that provides secure cryptographic operations, decentralized identity management, and a suite of web applications for the Sonr ecosystem. The architecture leverages Cloudflare Workers for edge computing and Go-compiled WASM for cryptographic operations.\n\n### Key Features\n\n- **🚀 Hono-based Worker** - Edge-deployed orchestrator serving multiple frontends with SSR\n- **🔐 Cryptographic Vault** - WASM-based secure key management with MPC and threshold cryptography\n- **🎭 DID Management** - Decentralized identity with WebAuthn integration via Enclave\n- **⚡ Vite Frontends** - Modern React apps for auth, console, profile, and search\n- **📦 Shared Packages** - Reusable TypeScript libraries and UI components\n\n## Repository Structure\n\n```\nmotr/\n├── apps/                    # Vite-based frontend applications\n│   ├── auth/               # Authentication \u0026 registration app\n│   ├── console/            # Developer console \u0026 admin interface\n│   ├── profile/            # User profile management\n│   └── search/             # Sonr network search\n│\n├── libs/                   # Go/WASM cryptographic libraries\n│   ├── enclave/           # DID \u0026 WebAuthn Durable Object worker\n│   └── vault/             # Cryptographic vault operations\n│\n├── pkgs/                   # TypeScript packages\n│   ├── config/            # Shared build \u0026 lint configs\n│   ├── react/             # React hooks \u0026 providers\n│   ├── sdk/               # Core TypeScript SDK\n│   └── ui/                # Shared UI components (shadcn)\n│\n├── src/                    # Cloudflare Worker (Hono-based)\n│   └── worker.ts          # Main orchestrator serving all frontends\n│\n├── docs/                   # Documentation \u0026 MDX content\n├── wrangler.toml          # Worker deployment configuration\n├── tsconfig.json          # Worker TypeScript config\n├── package.json           # Root workspace configuration\n└── turbo.json             # Turborepo build pipeline\n```\n\n## Quick Start\n\n### Prerequisites\n\n- **Bun** 1.3+ ([install](https://bun.sh/))\n- **Go** 1.24.4+ ([install](https://go.dev/dl/))\n- **TinyGo** 0.39+ ([install](https://tinygo.org/getting-started/install/))\n- **Wrangler** CLI (included in dependencies)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/sonr-io/motr.git\ncd motr\n\n# Install all dependencies (uses Bun workspaces)\nbun install\n\n# Build all packages and libraries\nturbo build\n```\n\n### Development\n\n```bash\n# Start main worker (serves all frontends via Hono)\nbun run dev\n\n# Start specific frontend app\nbun run dev:auth       # Authentication app\nbun run dev:console    # Console app\nbun run dev:profile    # Profile app\nbun run dev:search     # Search app\n\n# Start enclave worker (Durable Object)\ncd libs/enclave \u0026\u0026 wrangler dev\n\n# Start vault worker\ncd libs/vault \u0026\u0026 wrangler dev\n\n# Run tests\nturbo test            # All tests\nbun run test:all     # All package tests\n\n# Linting and formatting\nturbo lint           # Lint all packages\nturbo format         # Format all packages\nturbo check          # Type check all packages\n```\n\n## Architecture\n\n### 1. Cloudflare Worker (Hono)\n\nThe main orchestrator at `src/worker.ts` using [Hono framework](https://hono.dev/):\n\n**Features:**\n- 🎯 Smart routing based on subdomain, path, and session state\n- 📦 Static asset serving for all Vite-built frontends\n- 🔐 Session management with KV storage\n- 🔌 Service bindings to Enclave and Vault workers\n- 🚀 Built-in middleware (logger, etag, CORS)\n\n**Routing Strategy:**\n```typescript\n// Subdomain routing\nconsole.sonr.id/*  → Console app\nprofile.sonr.id/*  → Profile app\nsearch.sonr.id/*   → Search app\n\n// Path-based routing\n/console/*         → Console app\n/profile/*         → Profile app\n/search/*          → Search app\n\n// Session-based (authenticated users)\n/                  → Default app from user preferences\n\n// Default (unauthenticated)\n/                  → Auth app\n```\n\n**Development:**\n```bash\nbun run dev          # Start worker at http://localhost:5165\nbun run preview      # Test with remote bindings\nbun run logs         # Tail production logs\n```\n\n### 2. Frontend Applications\n\nModern React apps built with Vite and TanStack:\n\n#### Auth App (`apps/auth/`)\n- User registration and authentication\n- WebAuthn credential management\n- OAuth/OIDC flows\n- OTP verification\n\n#### Console App (`apps/console/`)\n- Developer dashboard\n- API key management\n- Service configuration\n- Analytics and monitoring\n\n#### Profile App (`apps/profile/`)\n- User profile management\n- DID document viewer\n- Credential management\n- Settings and preferences\n\n#### Search App (`apps/search/`)\n- Sonr network search\n- User discovery\n- Service discovery\n- Explorer interface\n\n**Tech Stack:**\n- React 19\n- TanStack Router, Query, Form\n- Vite 5\n- Tailwind CSS 4\n- TypeScript 5.9+\n\n**Development:**\n```bash\ncd apps/auth\nbun run dev          # Start dev server on port 3000\n\nbun run build        # Build for production\nbun run preview      # Preview production build\n```\n\n### 3. Cryptographic Libraries (Go/WASM)\n\n#### Enclave (`libs/enclave/`)\n\nDurable Object worker for decentralized identity:\n\n**Features:**\n- DID document management (did:snr method)\n- WebAuthn credential storage and verification\n- Cryptographic key operations\n- Identity recovery flows\n\n**Technology:**\n- Go → WASM via TinyGo\n- Cloudflare Durable Objects\n- Persistent state storage\n\n**Build:**\n```bash\ncd libs/enclave\nbun run build        # Compile Go to WASM\nwrangler deploy      # Deploy Durable Object\n```\n\n#### Vault (`libs/vault/`)\n\nService worker for cryptographic operations:\n\n**Features:**\n- Multi-party computation (MPC)\n- Threshold signature schemes\n- Multi-chain transaction signing\n- Secure key derivation\n- IPFS import/export\n\n**Supported Chains:**\n- Cosmos SDK chains\n- Ethereum/EVM chains\n- Solana\n- Bitcoin\n\n**Technology:**\n- Go → WASM via TinyGo\n- Service Worker runtime\n- Extism plugin system\n\n**Build:**\n```bash\ncd libs/vault\nbun run build        # Compile Go to WASM\n```\n\n### 4. TypeScript Packages\n\n#### SDK (`pkgs/sdk/`)\n\nCore TypeScript SDK for Sonr integration:\n\n```typescript\nimport { SonrClient, createVault } from '@sonr.io/sdk';\n\n// Initialize client\nconst client = new SonrClient({\n  rpcUrl: 'https://rpc.sonr.id',\n  restUrl: 'https://api.sonr.id',\n});\n\n// Create vault\nconst vault = await createVault({\n  name: 'my-vault',\n  password: 'secure-password',\n});\n\n// Sign transaction\nconst signature = await vault.sign({\n  chain: 'cosmos',\n  transaction: tx,\n});\n```\n\n**Features:**\n- Chain-agnostic transaction signing\n- DID management utilities\n- WebAuthn helpers\n- IPFS integration\n\n#### UI Components (`pkgs/ui/`)\n\nShared UI component library built on shadcn/ui:\n\n```typescript\nimport { Button, Card, Input } from '@sonr.io/ui';\n\nexport function MyComponent() {\n  return (\n    \u003cCard\u003e\n      \u003cInput placeholder=\"Enter value\" /\u003e\n      \u003cButton\u003eSubmit\u003c/Button\u003e\n    \u003c/Card\u003e\n  );\n}\n```\n\n**Features:**\n- 50+ accessible components\n- Tailwind CSS styling\n- Dark mode support\n- TypeScript strict mode\n\n#### React (`pkgs/react/`)\n\nReact-specific hooks and providers:\n\n```typescript\nimport { useSonr, SonrProvider } from '@sonr.io/react';\n\nfunction App() {\n  return (\n    \u003cSonrProvider config={config}\u003e\n      \u003cMyApp /\u003e\n    \u003c/SonrProvider\u003e\n  );\n}\n\nfunction MyApp() {\n  const { account, connect, disconnect } = useSonr();\n  // ...\n}\n```\n\n#### Config (`pkgs/config/`)\n\nShared build configurations:\n\n```typescript\n// vite.config.ts\nimport { createReactAppConfig } from '@sonr.io/config/vite/react-app';\n\nexport default createReactAppConfig();\n```\n\n```json\n// tsconfig.json\n{\n  \"extends\": \"../../pkgs/config/typescript/react-app.json\"\n}\n```\n\n## Build System\n\n### Turborepo Pipeline\n\n```bash\nturbo build          # Build all packages (respects dependencies)\nturbo test           # Run all tests in parallel\nturbo lint           # Lint all packages\nturbo dev            # Start all dev servers\n```\n\n**Build Order:**\n1. `@sonr.io/sdk` - Core SDK (no dependencies)\n2. `@sonr.io/ui` - UI components (depends on sdk)\n3. `@sonr.io/react` - React hooks (depends on ui)\n4. `libs/vault` \u0026 `libs/enclave` - WASM builds (parallel)\n5. Frontend apps - Vite builds (depends on react)\n6. Worker - TypeScript compilation (depends on all apps)\n\n### Scripts Reference\n\n#### Root Scripts\n\n```bash\n# Development\nbun run dev                    # Start main worker\nbun run dev:worker             # Start main worker (alias)\nbun run dev:auth               # Start auth app\nbun run dev:console            # Start console app\nbun run dev:profile            # Start profile app\nbun run dev:search             # Start search app\nbun run dev:all                # Start all in parallel\n\n# Building\nbun run build                  # Build all packages\nbun run build:apps             # Build only frontend apps\nbun run build:libs             # Build only WASM libraries\nbun run build:pkgs             # Build only TS packages\nbun run build:force            # Force rebuild ignoring cache\n\n# Testing\nbun run test                   # Run all tests\nbun run test:all               # Run tests in all packages\nbun run test:watch             # Run tests in watch mode\n\n# Quality\nbun run lint                   # Lint all packages\nbun run lint:fix               # Lint and auto-fix\nbun run format                 # Format all files\nbun run check                  # Run type checks\nbun run typecheck              # Run type checks (alias)\n\n# Deployment\nbun run deploy                 # Deploy main worker\nbun run deploy:staging         # Deploy to staging\nbun run deploy:production      # Deploy to production\nbun run preview                # Test with remote bindings\nbun run logs                   # Tail production logs\n\n# Maintenance\nbun run clean                  # Clean build artifacts\nbun run clean:cache            # Clean turbo cache\nbun run clean:turbo            # Clean turbo daemon\n```\n\n## Deployment\n\n### Single Worker Deployment\n\nAll frontend apps are served by a single Cloudflare Worker:\n\n```bash\n# Deploy to production\nbun run deploy\n\n# Deploy to staging\nbun run deploy:staging\n\n# Test before deploying\nbun run preview\n```\n\n**Deployment Process:**\n1. Build all frontend apps (`turbo build`)\n2. Compile worker TypeScript\n3. Wrangler bundles static assets\n4. Deploy to Cloudflare edge network\n\n### Environment Configuration\n\n```toml\n# wrangler.toml\nname = \"motr-orchestrator\"\nmain = \"src/worker.ts\"\ncompatibility_date = \"2025-01-11\"\n\n[env.production]\nroutes = [\n  { pattern = \"sonr.id/*\", custom_domain = true },\n  { pattern = \"*.sonr.id/*\", custom_domain = true }\n]\n\n[env.staging]\nname = \"motr-orchestrator-staging\"\nworkers_dev = true\n```\n\n### Durable Objects\n\nEnclave and Vault workers are deployed separately:\n\n```bash\n# Deploy enclave (Durable Object)\ncd libs/enclave \u0026\u0026 wrangler deploy\n\n# Deploy vault\ncd libs/vault \u0026\u0026 wrangler deploy\n```\n\n## Testing\n\n### Unit Tests\n\n```bash\n# All tests\nturbo test\n\n# Specific package\nbun --filter '@sonr.io/sdk' test\n\n# Watch mode\nturbo test -- --watch\n\n# Coverage\nturbo test -- --coverage\n```\n\n### Integration Tests\n\n```bash\n# End-to-end tests\nbun run test:e2e\n\n# Worker tests\nwrangler dev --test\n```\n\n## Documentation\n\n- **[WORKER_ARCHITECTURE.md](./docs/WORKER_ARCHITECTURE.md)** - Worker design and routing\n- **[WORKER_README.md](./docs/WORKER_README.md)** - Worker development guide\n- **[API Documentation](./docs/)** - API reference\n- **[Migration Guide](./MIGRATION.md)** - Architecture evolution\n\n## Contributing\n\nWe welcome contributions! Please follow these guidelines:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and linting (`turbo check \u0026\u0026 turbo test`)\n5. Commit your changes (conventional commits preferred)\n6. Push to your branch\n7. Open a Pull Request\n\n### Code Style\n\n- **TypeScript**: Oxlint + Biome formatting\n- **Go**: `gofmt` + `golangci-lint`\n- **Commits**: Conventional commits (`feat:`, `fix:`, `docs:`, etc.)\n\n## Security\n\n### Reporting Security Issues\n\n**DO NOT** open public issues for security vulnerabilities.\n\nEmail: security@sonr.io\n\n### Security Features\n\n- All cryptographic operations run in sandboxed WASM\n- Keys never leave the secure enclave\n- Multi-party computation for threshold operations\n- Zero-knowledge proofs for privacy-preserving operations\n- WebAuthn integration for passwordless authentication\n\n## Performance\n\n- **Edge Computing**: Cloudflare Workers in 300+ cities worldwide\n- **Cold Start**: \u003c 5ms worker execution time\n- **Build Size**: Optimized WASM bundles (\u003c 500KB)\n- **Caching**: Aggressive caching for static assets\n- **Code Splitting**: Route-based splitting for frontends\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) for details\n\n## Links\n\n- **Website**: [sonr.io](https://sonr.io)\n- **Documentation**: [docs.sonr.io](https://docs.sonr.io)\n- **GitHub**: [github.com/sonr-io/motr](https://github.com/sonr-io/motr)\n- **Discord**: [discord.gg/sonr](https://discord.gg/sonr)\n- **Twitter**: [@sonr_io](https://twitter.com/sonr_io)\n\n## Acknowledgments\n\nBuilt with outstanding open-source technologies:\n\n- [Hono](https://hono.dev/) - Ultrafast web framework\n- [TinyGo](https://tinygo.org/) - Go compiler for WebAssembly\n- [Extism](https://extism.org/) - Universal plugin system\n- [TanStack](https://tanstack.com/) - Modern React utilities\n- [Cloudflare Workers](https://workers.cloudflare.com/) - Edge computing platform\n- [Vite](https://vitejs.dev/) - Next generation frontend tooling\n- [Bun](https://bun.sh/) - Fast all-in-one JavaScript runtime\n- [shadcn/ui](https://ui.shadcn.com/) - Accessible component library\n\n---\n\n**Made with ❤️ by the Sonr Team**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonr-io%2Fmotr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonr-io%2Fmotr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonr-io%2Fmotr/lists"}