8000 GitHub - zeSchlausKwab/wavefunc: Internet Radio on nostr Β· GitHub
[go: up one dir, main page]

Skip to content
zeSchlausKwabPublic

About

Internet Radio on nostr

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Latest commit

Β 

History

309 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WaveFunc Radio

A Nostr-based internet radio directory and player with full-text search capabilities.

Features

  • 🎡 Radio Station Directory: Browse and discover internet radio stations on Nostr
  • πŸ” Full-Text Search: Search stations by name and description (NIP-50)
  • πŸ’Ύ SQLite Storage: Persistent event storage (just files!)
  • ⚑ Fast Search: Powered by Bluge full-text search engine
  • 🌐 Nostr Protocol: Built on the decentralized Nostr protocol
  • βš›οΈ Modern Frontend: React + TypeScript + Tailwind CSS
  • πŸš€ No Dependencies: No Docker or external databases needed

Project Structure

wavefunc-rewrite/
β”œβ”€β”€ relay/              # Khatru-based Nostr relay with search
β”‚   β”œβ”€β”€ main.go        # Relay implementation
β”‚   β”œβ”€β”€ setup.sh       # Automated setup script
β”‚   └── README.md      # Relay documentation
β”œβ”€β”€ src/               # Frontend application
β”‚   β”œβ”€β”€ components/    # React components
β”‚   └── lib/          # Utilities and hooks
└── scripts/          # Seed and generation scripts

Quick Start

1. Set up the Relay

The relay provides the backend Nostr relay with SQLite storage and full-text search:

cd relay
./setup.sh
make dev

This will:

  • Install Go dependencies
  • Create data directories
  • Start the relay on port 3334

For more details, see relay/README.md

2. Install Frontend Dependencies

bun install --frozen-lockfile

3. Start Development

# In one terminal: Start the relay
bun run relay

# In another terminal: Start the frontend
bun --hot src/index.tsx

Or use the combined dev command:

bun dev

Available Scripts

Frontend

  • bun dev - Start relay, import 100 real stations, and start ContextVM and frontend; preserve existing data
  • bun dev:no-seed - Start the same services without importing stations
  • bun run dev:frontend - Start only the frontend against existing services
  • bun dev:fake - Start relay with fake/test data instead of real stations
  • bun seed - Seed the relay with fake test data
  • bun start - Run in production mode
  • bun build - Build for production
  • bun run typecheck - Check application, scripts, and test types
  • bun run test - Run the automated test suite

Relay

  • bun run relay - Start the relay
  • bun run relay:kill - Stop this checkout's relay without deleting data
  • bun run relay:reset - Explicitly clear the local database and search index, then start the relay
  • cd relay && make dev - Run relay in development mode
  • cd relay && make reset-all - Reset all data

Tauri (Desktop & Mobile)

  • bun run tauri:dev - Start Tauri desktop development
  • bun run tauri:build - Build Tauri desktop application
  • bun run tauri:android - Initialize and run Android emulator
  • bun run tauri:android:build - Build Android APK

Migration

  • bun run migrate - Migrate 500 random stations from legacy database (default)
  • bun run migrate 50 - Migrate 50 random stations
  • bun run migrate 1000 - Migrate 1000 random stations

Note: Duplicate stations (same name + country) are automatically merged into single events with multiple streams.

See legacy-db/README.md for details on the legacy database structure and migration process.

Technology Stack

Backend (Relay)

  • Khatru - Nostr relay framework
  • Bluge - Full-text search engine
  • SQLite - Primary event storage (via eventstore/sqlite3)
  • Go 1.23+ - Programming language

Frontend

  • Bun - Fast JavaScript runtime & bundler
  • React 19 - UI framework
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS - Utility-first CSS framework
  • Applesauce v7 + RxJS - Nostr event store, relay transport, accounts, and wallet
  • shadcn/ui - UI component library

See the Applesauce v7 migration notes for runtime boundaries, relay policy, compatibility, and verification.

Configuration

Relay Configuration

The relay can be configured via command-line flags:

cd relay
go run . \
  --port 3334 \
  --db-path ./data/events.db \
  --search-path ./data/search

All data is stored in local files - no external configuration needed!

Development

The combined web and desktop launchers stop only their own process groups, fail if ports 3334 or 3000 are already occupied, and bound relay startup waits. Use dev:frontend with services you already started. Normal startup and shutdown preserve relay data; reset is explicit. Combined commands require macOS/Linux (or WSL) and Go; relay:kill also requires lsof.

Reset Everything

To start fresh:

bun run relay:reset # starts the cleared relay in this terminal
# In another terminal:
bun run seed

View Data

cd relay

# Events use LMDB; the search index uses Bleve.
ls -la data/

Android Development

The app automatically detects when running on Android and uses the correct relay URL:

  • Desktop/Web: ws://localhost:3334
  • Android Emulator: ws://10.0.2.2:3334 (Android's special IP to reach host machine)

To develop for Android:

  1. Ensure the relay is running on your host machine:

    bun run relay
  2. Start the Android emulator:

    bun run tauri:android

The app will automatically connect to the relay using the platform-appropriate URL. No additional configuration needed!

Event Kinds Supported

See SPEC.md for detailed specification.

  • 31237 - Radio Station Events
  • 30078 - Favorites Lists & Featured Station Lists
  • 31990 - NIP-89 Handler Events
  • 31989 - NIP-89 Recommendation Events
  • 1311 - Live Chat Messages
  • 1111 - Station Comments

NIP Support

The relay implements the following NIPs:

  • NIP-01: Basic protocol flow
  • NIP-09: Event deletion
  • NIP-11: Relay information document
  • NIP-12: Generic tag queries
  • NIP-15: End of stored events notice
  • NIP-16: Event treatment
  • NIP-20: Command results
  • NIP-22: Comment events
  • NIP-33: Parameterized replaceable events
  • NIP-40: Expiration timestamp
  • NIP-50: Search capability

License

See LICENSE file for details.

Contributing

Contributions are welcome! Please read the SPEC.md for the event structure specification.

About

Internet Radio on nostr

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0