Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2025bf6
feat: vibenet stack — faucet, explorer, landing page (Next.js port)
chunter-cb May 14, 2026
fdf1529
fix: indexer wipeAll — use db.exec() for multi-statement reset
chunter-cb May 14, 2026
ea17917
fix: Dockerfile native deps, .dockerignore, proxy subdomain routing
chunter-cb May 14, 2026
fc39eb0
fix: drop standalone output, copy full node_modules for indexer
chunter-cb May 14, 2026
f392def
feat: NFV faucet button, explorer search, landing page bug fixes
chunter-cb May 15, 2026
a195c40
fix: correct ERC-20/721 Transfer topic constant in indexer
chunter-cb May 15, 2026
5aadff5
style: port the original vibenet visual design (Base Blue, dark theme)
chunter-cb May 15, 2026
332e50b
style(faucet): rewrite to match original 2-pill design
chunter-cb May 15, 2026
0260b26
style(explorer): balance the two lists, drop # from block numbers,
chunter-cb May 15, 2026
21896a1
style(explorer): align with original tx + address detail templates
chunter-cb May 15, 2026
66f8c85
feat(explorer): tx Type indicator, full input/log data, live-row anim…
chunter-cb May 15, 2026
52f8b15
style(explorer): shared header with search bar on every page
chunter-cb May 15, 2026
432c0e9
docs: add README explaining how to run base/ui locally
chunter-cb May 15, 2026
1149b76
fix(ci): regenerate bun.lock, fix lint failures
chunter-cb May 15, 2026
4bdc0c4
ci: switch from bun to npm for install + scripts
chunter-cb May 15, 2026
0a6c61f
ci: revert to bun (with the now-current bun.lock)
chunter-cb May 15, 2026
ff2351d
ci: cache bun install dir between runs
chunter-cb May 15, 2026
347bf6d
ci: run jobs inside oven/bun:1.3.14 container
chunter-cb May 17, 2026
fd60c41
ci: revert workflow to original team config
chunter-cb May 17, 2026
e05bd2f
fix(ci): pin bun to 1.2.20, regen bun.lock, consolidate contracts pat…
chunter-cb May 17, 2026
994f2e4
ci: remove step-security/harden-runner to test if it's blocking bun
chunter-cb May 18, 2026
870efdb
ci: try npm without harden-runner
chunter-cb May 18, 2026
aac7edc
fix(ci): restore bun install path
chunter-cb May 18, 2026
daeb846
feat(vibenet): own the full devnet integration in base/ui
chunter-cb May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.next
node_modules
npm-debug.log*
.env*.local
/tmp
*.db
6 changes: 3 additions & 3 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
bun-version: 1.2.20
- run: cp .env.example .env
- run: bun install --frozen-lockfile
- run: bun run lint
Expand All @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
bun-version: 1.2.20
- run: cp .env.example .env
- run: bun install --frozen-lockfile
- run: bun run tsc --noEmit
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
bun-version: 1.2.20
- run: cp .env.example .env
- run: bun install --frozen-lockfile
- run: bun run build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# vibenet host-specific secrets (FAUCET_PRIVATE_KEY etc.)
/docker/vibenet/env
43 changes: 33 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,55 @@
FROM oven/bun:1 AS deps
FROM oven/bun:1.2.20 AS deps
WORKDIR /app
COPY ui/package.json ui/bun.lock ./
# better-sqlite3 requires native compilation
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile

FROM oven/bun:1 AS builder
FROM oven/bun:1.2.20 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY ./ui .
COPY . .

ENV NEXT_TELEMETRY_DISABLED=1

RUN bun run build

FROM node:20-alpine AS runner
FROM node:20-bookworm-slim AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

# Match libc with the deps stage (oven/bun:1.2.20 is debian-based) so the
# native better-sqlite3 binary built in deps is loadable here. We still
# need to rebuild it against Node's V8 ABI below since bun's V8 ABI
# differs from Node 20's.
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN mkdir .next
RUN chown nextjs:nodejs .next
RUN mkdir -p .next /data
RUN chown nextjs:nodejs .next /data

# Full node_modules (not standalone) so indexer.mjs can resolve viem + better-sqlite3
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/docker/migrations ./docker/migrations

# Rebuild better-sqlite3 against Node's V8 ABI (bun's V8 has a different
# NODE_MODULE_VERSION so the binary from deps won't load under `node`).
RUN cd node_modules/better-sqlite3 && npm rebuild better-sqlite3 \
&& cd /app

RUN chown -R nextjs:nodejs node_modules && chmod +x scripts/start.sh

USER nextjs

Expand All @@ -35,4 +58,4 @@ EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

CMD ["node", "server.js"]
CMD ["sh", "scripts/start.sh"]
150 changes: 150 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# base/ui — Next.js app + vibenet devnet integration.
#
# All `vibe*` recipes compose this repo's docker/vibenet/ overlay on top
# of the base/base devnet (sibling repo at ../base). They use
# `--project-directory $(pwd)` so paths inside docker/vibenet/compose.yml
# resolve from this repo's root.
#
# Usage:
# just vibe — bring up vibenet against base/base main
# just vibe <branch> — checkout <branch> in ../base first
# just vibe-down — tear down, wipe volumes + chain state
# just vibe-ui — rebuild just the Next.js container
# (preserves chain state + explorer index)
# just vibe-logs [services] — tail logs
# just vibe-ps [services] — container status
#
# First-time: clones ../base/ if missing. Caddy TLS overlay (production)
# auto-enables when /etc/vibenet/tls/origin.crt exists.

_ui_root := justfile_directory()
# base/base sibling. Computed at justfile parse time so all recipes share it.
_base_repo := justfile_directory() / '..' / 'base'

# These two are referenced as ${VIBENET_UI_ROOT} / ${BASE_REPO_ROOT} inside
# docker/vibenet/compose.yml and caddy.yml so the bind-mount + build-context
# paths are absolute regardless of which directory `docker compose` is
# invoked from.
export VIBENET_UI_ROOT := _ui_root
export BASE_REPO_ROOT := _base_repo

# Helper: compose args common to every vibe* recipe.
# We cd into base/base/etc/docker before invoking so that env_file directives
# inside base/base's docker-compose.yml (which point at the bare filename
# "devnet-env") resolve correctly. Paths in our docker/vibenet/compose.yml
# are still resolved relative to that file's own location (base/ui/docker/
# vibenet/), so they work regardless of the cwd.
_compose := '\
--env-file devnet-env \
--env-file ' + _ui_root + '/docker/vibenet/env \
-f docker-compose.yml \
-f ' + _ui_root + '/docker/vibenet/compose.yml'

# Default: list available recipes.
default:
@just --list

# Bring up the full vibenet stack against base/base @ <branch> (default: main).
# Clones ../base as a sibling if missing.
vibe branch="main":
#!/usr/bin/env bash
set -euo pipefail

if [ ! -d {{ _base_repo }} ]; then
echo "[vibe] base/base not found at {{ _base_repo }} — cloning..."
git clone git@github.com:base/base.git {{ _base_repo }}
fi

echo "[vibe] base/base @ {{ branch }}"
git -C {{ _base_repo }} fetch --quiet origin {{ branch }} 2>/dev/null \
|| git -C {{ _base_repo }} fetch --quiet origin
git -C {{ _base_repo }} checkout --quiet {{ branch }}
git -C {{ _base_repo }} pull --ff-only --quiet 2>/dev/null || true

if [ ! -f docker/vibenet/env ]; then
echo "ERROR: docker/vibenet/env missing. Copy from docker/vibenet/env.example." >&2
exit 1
fi

# Skip --build for the next-app when a pre-built image is pinned; otherwise
# we build from this repo's Dockerfile.
build_flag="--build"
if [ -n "${VIBENET_UI_IMAGE:-}" ]; then
build_flag="--pull missing"
fi

export VIBENET_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
export VIBENET_COMMIT="$(git rev-parse --short HEAD)"

caddy_overlay=
if [ -f /etc/vibenet/tls/origin.crt ]; then
caddy_overlay="-f docker/vibenet/caddy.yml"
echo "[vibe] Caddy TLS overlay enabled (/etc/vibenet/tls/origin.crt found)"
fi

# Tear down anything from a previous run so we always start clean.
just vibe-down >/dev/null 2>&1 || true

cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay up -d $build_flag

# Stop vibenet and wipe all data, including named volumes (vibescan SQLite,
# rendered config, shared contracts.json). The chain state in ../base/.devnet
# also gets wiped so the next `just vibe` starts from a fresh genesis.
vibe-down:
#!/usr/bin/env bash
set -euo pipefail
caddy_overlay=
if [ -f /etc/vibenet/tls/origin.crt ]; then
caddy_overlay="-f docker/vibenet/caddy.yml"
fi
cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay \
down --remove-orphans -v 2>/dev/null || true
if [ -d {{ _base_repo }}/.devnet ]; then
docker run --rm -v "$(cd {{ _base_repo }} && pwd)/.devnet:/devnet" \
alpine sh -c 'rm -rf /devnet/*' 2>/dev/null || true
fi

# Rebuild just the Next.js UI container without resetting the chain. Block
# history, explorer index, and deployed contracts all survive.
vibe-ui:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f docker/vibenet/env ]; then
echo "ERROR: docker/vibenet/env missing." >&2
exit 1
fi
export VIBENET_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
export VIBENET_COMMIT="$(git rev-parse --short HEAD)"
caddy_overlay=
if [ -f /etc/vibenet/tls/origin.crt ]; then
caddy_overlay="-f docker/vibenet/caddy.yml"
fi
cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay \
up -d --no-deps --build --force-recreate next-app
cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay \
up -d --no-deps --force-recreate vibenet-config-renderer

# Tail logs from vibenet containers (optionally filter by service names).
vibe-logs *services:
#!/usr/bin/env bash
set -euo pipefail
caddy_overlay=
if [ -f /etc/vibenet/tls/origin.crt ]; then
caddy_overlay="-f docker/vibenet/caddy.yml"
fi
cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay logs -f {{ services }}

# Container status (optionally filter by service names).
vibe-ps *services:
#!/usr/bin/env bash
set -euo pipefail
caddy_overlay=
if [ -f /etc/vibenet/tls/origin.crt ]; then
caddy_overlay="-f docker/vibenet/caddy.yml"
fi
cd {{ _base_repo }}/etc/docker && docker compose {{ _compose }} $caddy_overlay ps {{ services }}

# Run the Next.js app standalone against an already-running devnet (no Docker
# rebuild). Useful for hot-reload UI iteration.
dev:
npm run dev
Loading
Loading