feat: vibenet stack — faucet, explorer, landing (Next.js port)#165
Draft
chunter-cb wants to merge 4 commits into
Draft
feat: vibenet stack — faucet, explorer, landing (Next.js port)#165chunter-cb wants to merge 4 commits into
chunter-cb wants to merge 4 commits into
Conversation
Ports the vibenet Rust/nginx stack to this Next.js app: - Landing page (/) with chain info, features, contracts - Faucet page + API routes (/faucet, /api/vibenet/faucet/*) using viem for signing, in-memory rate limiting per IP/address - Block explorer pages + API routes (/explorer/*, /api/vibenet/explorer/*) backed by better-sqlite3 (same schema as vibescan Rust crate) - Background indexer script (scripts/indexer.mjs) that backfills and subscribes to newHeads via WebSocket - Subdomain routing via proxy.ts: faucet.vibes.base.org → /faucet, explorer.vibes.base.org → /explorer - TIPS pages moved to /tips to free up root for vibenet landing - Dockerfile updated: self-contained build context, starts both Next.js server and background indexer Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
better-sqlite3 prepare() rejects SQL with multiple statements. Replace wipeAll prepared statement with a wipeDb() function that uses db.exec() which handles multi-statement SQL correctly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Switch Dockerfile from bun to npm (bun.lock lacked better-sqlite3) - Add apk build tools (python3/make/g++) for better-sqlite3 native compile - Add .dockerignore to exclude node_modules/.next/tmp from build context - Fix proxy.ts: skip /api/* paths in subdomain rewrites so API routes work correctly when called from faucet/explorer subdomains Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
next start (non-standalone) + full node_modules lets indexer.mjs resolve viem and better-sqlite3 without special packaging. For a devnet image the extra layer size is not a concern. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the vibenet stack from
base/base(Rust/nginx) into this Next.js app.vibes.base.org→/) — readsconfig.json+contracts.jsonfrom mounted volumes, chain connect card, wallet addfaucet.vibes.base.org→/faucet) — ETH drip + USDV mint via viem, per-IP/address in-memory rate limiting matching Rust cooldown semanticsexplorer.vibes.base.org→/explorer) — SQLite-backed (same schema as vibescan Rust crate), address activity index, backfill + live newHeads subscriptionscripts/indexer.mjs) — runs alongside Next.js in Docker viascripts/start.shsrc/proxy.ts) —faucet.*andexplorer.*rewrite to/faucetand/explorerpaths/tipsto free the root for vibenet landingui/prefix), starts indexer + serverArchitecture decisions
better-sqlite3(native, synchronous) used for SQLite in API routes — correct for a single-instance devnetTest plan
npx tsc --noEmit— cleannpx @biomejs/biome check src/— clean/,/faucet,/explorer,/tips) return 200{"blocks":0,"txs":0,"addresses":0}(SQLite schema init works){}gracefully when no volume mountedjust vibefrom base/base)just vibeFollow-up needed in base/base
Update
etc/vibenet/docker-compose.vibenet.ymlto:vibenet-faucet+vibescanservices withnext-app(builds from../../ui)nginx-gatewayservicebase-client:8546port directly for WebSocket RPC🤖 Generated with Claude Code