zeekay fbd08c4e1f rewrite(bridge): Next.js → Vite 8 SPA + hanzoai/spa
- Convert app/bridge/ from Next.js 14 app-router to Vite 8 SPA.
- New entry: index.html → src/main.tsx → src/App.tsx (wouter router).
- src/pages/{HomePage,AuthPage,CampaignsPage,CampaignDetailPage,SalonPage,
  SwapPage,TeleporterSwapPage,UtilaSwapPage,TransactionsPage,NotFoundPage}.tsx.
- src/shims/next-{link,image,navigation,dynamic,headers,server,font/google,mdx}
  + sentry-nextjs map Next.js APIs onto wouter + plain DOM so existing
  components compile unchanged. Aliased in vite.config.ts.
- Dockerfile (root + app/bridge): FROM node:22-alpine AS build → vite build →
  FROM ghcr.io/hanzoai/spa COPY dist /public.
- Delete app-router dir, next.config.js, next-env.d.ts, middleware.ts,
  sentry.*.ts. Keep app/explorer/ and docs/ untouched (still Next.js).

Tenant route resolution:
  src/app/api/tenant/route.ts was a 17-line edge handler that called
  lib/tenant.fetchTenant(). fetchTenant() only reads env vars and fetches a
  public IAM /api/get-organization endpoint. No secrets. Moved to client:
  lib/tenant.ts now reads import.meta.env.VITE_* and is called directly from
  main.tsx + TenantProvider. No sidecar needed.

TODO:
  - `pnpm install` in CI to pick up wouter, vite, @vitejs/plugin-react,
    @sentry/browser (added to package.json).
  - Pre-existing viem/teleport tsc errors remain (ignored as before via esbuild).
  - Storybook config still references @storybook/nextjs — rewire to
    @storybook/react-vite separately.
2026-04-19 00:05:10 -07:00
2024-01-08 22:05:19 +01:00
2025-12-24 14:19:52 -08:00
2026-03-27 19:44:20 -07:00
2025-12-24 14:19:52 -08:00
2025-12-24 14:19:52 -08:00
2026-03-27 19:44:20 -07:00
2025-12-31 22:21:30 -08:00
2025-08-03 15:52:32 -05:00

Lux Bridge

Bridge monorepo for Lux Network - a decentralized cross-chain bridge using Multi-Party Computation (MPC) for secure asset transfers.

Prerequisites

  • Node.js v20+
  • pnpm v9.15.0+
  • Go 1.22+ (for MPC tools)
  • Docker (for infrastructure services)

Quick Start

1. Install Dependencies

# Install pnpm if needed
npm install -g pnpm

# Install project dependencies
pnpm install

# Install MPC tools via Go
make install-mpc

2. Start Infrastructure

# Start infrastructure services (Lux ID, KMS, databases, etc.)
make up

This starts:

  • Lux ID (Casdoor) - Port 8000 - Unified authentication
  • KMS (Vault) - Port 8200 - Key management
  • NATS - Port 4223 - Messaging
  • Consul - Port 8501 - Service discovery
  • PostgreSQL - Port 5433 - Bridge database
  • Lux ID DB - Port 5434 - Auth database

3. Start MPC Network

# Start 3-node MPC network
make start-mpc-nodes

This runs MPC nodes on:

  • Node 0: HTTP 6000, gRPC 9090
  • Node 1: HTTP 6001, gRPC 9091
  • Node 2: HTTP 6002, gRPC 9092

4. Start Application Services

In separate terminals:

# Terminal 1: Bridge API Server
cd app/server && pnpm dev

# Terminal 2: Bridge UI
cd app/bridge && pnpm dev

5. Access Services

Architecture

Bridge UI → Bridge Server → MPC Nodes → Blockchain Networks
                               ↓
                    KMS + Lux ID + Consul

Key Features

  • MPC Security: 2-of-3 threshold signatures
  • Multi-Chain: Support for EVM and non-EVM chains
  • Unified Auth: Lux ID (Casdoor) integration
  • Key Management: Secure key storage in KMS
  • Service Discovery: Consul for dynamic configuration

Development

# Run tests
pnpm test

# Check MPC status
lux-mpc-cli status --url http://localhost:6000

# View logs
tail -f logs/mpc-node-0.log

# Stop services
make stop-mpc-nodes  # Stop MPC
make down           # Stop infrastructure

Documentation

Tips

Since "pnpm" is a finger twister, many people alias it to "pn". For example, with bash, put alias pn='pnpm' in .bashrc.

S
Description
▼ Bridge, powered by trustless MPC network and privacy focused Teleport protocol.
Readme BSD-3-Clause
260 MiB
Languages
TypeScript 52.2%
Go 40.9%
Solidity 2.8%
JavaScript 1.8%
Shell 1.4%
Other 0.8%