{"id":50749881,"url":"https://github.com/grmkris/sonara","last_synced_at":"2026-06-11T00:30:36.440Z","repository":{"id":363681931,"uuid":"1219712575","full_name":"grmkris/sonara","owner":"grmkris","description":"Music made visible — a live AI visual stage the crowd drives through gasless Monad transactions","archived":false,"fork":false,"pushed_at":"2026-06-10T00:11:48.000Z","size":93298,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-06-10T00:12:23.924Z","etag":null,"topics":["account-abstraction","ai","generative-art","hackathon","livevisuals","monad","usdc","webgl"],"latest_commit_sha":null,"homepage":"https://dev.sonara.fm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grmkris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-24T06:34:51.000Z","updated_at":"2026-06-10T00:11:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/grmkris/sonara","commit_stats":null,"previous_names":["grmkris/sonara"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/grmkris/sonara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grmkris%2Fsonara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grmkris%2Fsonara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grmkris%2Fsonara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grmkris%2Fsonara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grmkris","download_url":"https://codeload.github.com/grmkris/sonara/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grmkris%2Fsonara/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34177445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["account-abstraction","ai","generative-art","hackathon","livevisuals","monad","usdc","webgl"],"created_at":"2026-06-11T00:30:35.614Z","updated_at":"2026-06-11T00:30:36.411Z","avatar_url":"https://github.com/grmkris.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonara — Music Made Visible\n\nBrowser-based realtime visualizer at [sonara.fm](https://sonara.fm). Text prompt, voice, or playing audio → continuously flowing AI-generated visuals. fal.ai FLUX.2 supplies keyframes; a WebGL2 displacement shader + feedback FBO carries continuity between them at 60 fps, driven by live audio features.\n\n## Stack\n\n- **Web** (`apps/web`): Next.js 16, React 19, Tailwind v4, Base UI (`@base-ui/react`), zustand, framer-motion, Meyda\n- **Server** (`apps/server`): Bun + Hono + native `Bun.serve` WebSocket, `@fal-ai/client`, evlog (`@sonara/logger`)\n- **Shared** (`packages/shared`): zod schemas + TS types for all events and state\n- **API** (`packages/api`): oRPC routers — HTTP `/rpc` (credits, auth) + WebSocket `/ws` session surface\n- **Test utils** (`packages/test-utils`): pglite helper for db-backed tests\n\n## Run\n\n```bash\ncp .env.example .env\n# required: FAL_KEY, AUDD_API_KEY, BETTER_AUTH_SECRET, DATABASE_URL\n\nbun install\nbun run dev\n```\n\n- Web: http://localhost:4470\n- Server: ws://localhost:4471/ws\n\n## Scripts\n\n- `bun run dev` — both apps in parallel (Turborepo)\n- `bun run dev:web` — web only\n- `bun run dev:server` — server only\n- `bun run typecheck` — strict TS across the workspace\n- `bun run lint` — oxlint across the workspace\n- `bun run ci:local` — lint + typecheck + test + build serially\n- `bun run db:start` / `db:stop` / `db:down` / `db:watch` — local Postgres via Docker\n\n## Local Postgres\n\nThe server's `runMigrations()` and the credits + auth queries need a local Postgres in dev. A Postgres 17 service is defined in `packages/db/docker-compose.yml` (port `54324`, named volume for persistence):\n\n```bash\nbun run db:start    # docker compose up -d\nbun run db:stop     # stop without removing the volume\nbun run db:down     # stop + remove containers (volume kept)\nbun run db:watch    # foreground tail\n```\n\nThe default `DATABASE_URL` in `.env.example` points at this instance. Production uses Railway Postgres (see `AGENTS.md` §Production).\n\n## Migrations\n\nDrizzle schema and migrations live in `packages/db`. After editing `packages/db/src/schema/*.db.ts`:\n\n```bash\nbun run --filter=@sonara/db db:generate\n```\n\nThis writes a new SQL file to `packages/db/drizzle/`. Commit it alongside the schema change. The server applies pending migrations on every boot via `runMigrations()` — no manual `db:push` or `db:migrate` step in dev or prod.\n\n## Architecture\n\nSee `ARCHITECTURE.md` for the current code tour — data flow, layer-by-layer map, and the tracked cleanup list. `INFRASTRUCTURE.md` is the deployment + topology map. `AGENTS.md` documents repo conventions for human + AI contributors.\n\n**In short:** the browser captures audio (file / mic / tab share), extracts ~15 features via Meyda + a hand-rolled analyzer at 60 Hz, upstreams them at 5 Hz over an oRPC WebSocket. The server session runs scene / voice-intent / song-recognition / credits logic and pushes frame URLs + state updates back through an `eventIterator`. The client renders via a WebGL2 displacement shader with feedback FBO, Kuwahara painterly pass, and reveal-from-noise gate.\n\n## Scope\n\n**Shipped:** text prompts (single-prompt scene), browser-speech voice → Gemini intent parser, tab-audio / mic capture, AudD-backed song recognition with Apple Music enrichment, WebGL2 renderer with 21 presets + 13 shader primitives + Papari–Kuwahara painterly pass, LFO drift, FBO feedback, preset cross-fade, single-frame `streamPreview` per trigger, image-anchor uploads (3-preset strength), demo image library + decks, BYOK fal key, email+password auth (Better Auth) + credit ledger + Dodo Payments hosted checkout for credit packs, canvas+audio MP4 capture from the HUD, public anon demo without signup, offline service worker.\n\n**Parked ideas** (not yet started): see `docs/mood-field-plan.md` (replace preset chip wall with a valence/arousal constellation), `docs/starter-decks.md` (drop the \"demo mode\" jargon), `docs/story-mode-and-image-library.md` (batch keyframes + persistent gallery), `docs/gesture-camera-input.md` (pointer/MIDI/webcam input), and `PLANS.md` (chat-platform clip sharing).\n\n**Open cleanup items:** see `ARCHITECTURE.md` smell list.\n\n## License\n\nCopyright © 2026 Kristjan Grm.\n\nLicensed under the [PolyForm Noncommercial License 1.0.0](LICENSE.md): you may use, copy, modify, and share this software for **noncommercial purposes** (personal projects, research, education, evaluation). **Any commercial use requires a separate license** — get in touch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrmkris%2Fsonara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrmkris%2Fsonara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrmkris%2Fsonara/lists"}