Skip to content
MultiAgencyPublic

About

customizable admin pages for Sputnik DAOs

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

multiagency.ai

The dashboard for multiagency.ai — an on-chain agency: a DAO-shaped entity sourcing contributors, budgeting treasury to projects, and billing against those budgets.

Maintained by MultiAgency. Built on everything.dev.

A Module Federation site composed at runtime, using the every-plugin architecture and the everything-dev api & cli, with NEAR Protocol integration.

Built with Tanstack Start, Hono.js, oRPC, better-auth, and rsbuild.

Application

The app is split into four auth-gated sections plus public pages:

  • Public (/) — Landing, projects directory, apply forms, contact, docs, treasury, team, work
  • /platform — Super admin only (user.role === "admin"). App owner dashboard for creating and managing all organizations. Init the agency org here on first deploy.
  • /admin — Agency admin & owner (Better Auth org role admin or owner). Manage agency settings (/admin/settings), members (/admin/members), and projects (/admin/projects/:slug).
  • /dashboard — Agency members, admins, and owners (org role member, admin, or owner).
  • /client — Any authenticated user. Client portal for organizations with metadata type: "client".

API routes are gated server-side with Better Auth organization roles:

  • Read-only (list projects, contributors, budgets, etc.): admin, owner, member
  • Write & financial (create/delete, budget transfers, billing): admin, owner
  • Platform (org creation, global listing): user.role === "admin" super admin only

On-chain treasury operations (proposals, token balances, FT holdings) integrate with Sputnik DAO contracts when the org's metadata includes a daoAccountId. Non-DAO orgs treat the org account as self-owned.

First-time setup

Deploy the app, then make yourself a super admin to set up the initial agency.

  1. Sign in with your NEAR wallet at the deployed URL.
  2. Open the auth database and set your user role to admin:
    pnpm bos db studio auth
    In the Drizzle Studio UI, navigate to the user table and set the role column to admin for your user row.
  3. Visit /platform and create your agency organization (type: "agency") with an optional daoAccountId if you have a Sputnik DAO.
  4. Invite agency admins and members from /admin/members.

Quick Start

pnpm install             # Install dependencies
pnpm run dev             # Start dev; creates .env on first run

The API plugin uses PostgreSQL via Drizzle. Without API_DATABASE_URL set, bos dev uses a persistent per-workspace pglite data directory under .bos/db, so local state survives restarts. Set API_DATABASE_URL, AUTH_DATABASE_URL, PROJECTS_DATABASE_URL and BUILDERS_DATABASE_URL in .env to use your own Postgres instead. Migrations run automatically on startup; pnpm run db:migrate applies them manually against the configured database.

To inspect databases locally:

bos db studio api       # API database (agency schema)
bos db studio auth      # Auth database (users, sessions, organizations)
bos db studio projects  # Projects plugin database
bos db studio <plugin>  # Any registered plugin database

This serves the UI and API locally and mounts them on a remote host (loaded via bos.app.ts's extends). See AGENTS.md for the full port table. UI defaults to http://localhost:3003 (rsbuild auto-bumps if occupied — check the dev server output).

CLI Commands

everything-dev is the canonical runtime package and CLI. bos is a command alias for the same tool. See the framework skills at .opencode/skills/everything-dev/ — dev-workflow/SKILL.md for the dev cycle and publish-sync/SKILL.md for deployment, sync, and upgrade flows.

Development

everything-dev dev --host remote   # Remote host, local UI + API (typical)
everything-dev dev --ui remote     # Isolate API work
everything-dev dev --api remote    # Isolate UI work
           |/ --proxy              # Use a proxy
everything-dev dev                 # Full local, client shell by default

# `bos` is an alias for the same commands
bos dev --ssr                      # Opt into local SSR

Production

everything-dev start --no-interactive   # All remotes, production URLs

Build & Publish

bos build               # Build all packages
bos publish             # Publish config only to the FastKV registry under `account`
bos deploy              # Build, upload bundles to the CDN, publish config, redeploy the runtime
bos deploy --env staging  # The same for staging (CI runs this on push to `staging`)

Staging CI deploys with a project-scoped Railway token, which can redeploy the dashboard service but cannot change its image. After a bos upgrade moves to a new release, switch the staging service's source to the new image by hand once the staging deploy has published: Railway → staging → dashboard → Settings → Source → ghcr.io/nearbuilders/everything-dev:v<release>.

Project Management

bos info                    # Show configuration
bos status                  # Check remote health
bos clean                   # Clean build artifacts

Development Workflow

Making Changes

  • UI Changes: Edit ui/src/ → hot reload automatically → ship with bos deploy
  • API Changes: Edit api/src/ → hot reload automatically → ship with bos deploy
  • Runtime Config: Edit bos.app.ts → deploy with bos deploy (the host is remote — see Architecture)

Before Committing

Always run these commands before committing:

pnpm test        # Run all tests
pnpm typecheck   # Type check all packages
pnpm lint        # Run linting (see lint setup below)

Git Workflow

See CONTRIBUTING.md for detailed contribution guidelines including:

  • Branch naming conventions
  • Semantic commit format
  • Pull request process

Documentation

Architecture

Module Federation monorepo with runtime-loaded configuration. The host is remote (loaded via bos.app.ts's extends); this repo owns ui/ and api/ only.

┌─────────────────────────────────────────────────────────┐
│              Host (Remote — not in this repo)           │
│  Hono.js + oRPC + bos.app.ts loader                │
│  ┌──────────────────┐      ┌──────────────────┐         │
│  │ Module Federation│      │ every-plugin     │         │
│  │ Runtime          │      │ Runtime          │         │
│  └────────┬─────────┘      └────────┬─────────┘         │
│           ↓                         ↓                   │
│  Loads UI Runtime          Loads API Plugins            │
└───────────┬─────────────────────────┬───────────────────┘
            ↓                         ↓
┌───────────────────────┐ ┌───────────────────────┐
│    ui/ (Runtime)      │ │   api/ (Plugin)       │
│  React + TanStack     │ │  oRPC + Effect        │
│  ui/src/app.ts        │ │  remoteEntry.js       │
└───────────────────────┘ └───────────────────────┘

Key Features:

  • ✅ Runtime Configuration - All URLs from the published config (no rebuild needed)
  • ✅ Independent Deployment - UI and API deploy separately
  • ✅ Type Safety - End-to-end with oRPC contracts
  • ✅ UI Runtime Boundary - everything-dev/ui/client and /server own router/runtime glue
  • ✅ CDN-Ready - Module Federation bundles served from the everything.dev CDN

Configuration

All runtime configuration lives in bos.app.ts. The agency surface lives in api/, which proxies the upstream projects plugin via pluginsClient.projects(proxyCtx(orgAccountId)) for project CRUD (list/get/create/update). See AGENTS.md for the plugin model and proxy-as-org rule.

bos deploy is the release path: it uploads the bundles, publishes the config to FastKV and redeploys the runtime image.

Lint Setup

This project uses Biome for linting and formatting:

# Check linting
pnpm lint

# Fix auto-fixable issues
pnpm lint:fix

# Format code
pnpm format

Biome is configured in biome.json at the project root. Generated files (like routeTree.gen.ts) are automatically excluded.

Tech Stack

Frontend:

  • React 19 + TanStack Router (file-based) + TanStack Query
  • Tailwind CSS v4 + shadcn/ui components
  • Module Federation for microfrontend architecture

Backend:

  • Hono.js server + oRPC (type-safe RPC + OpenAPI)
  • every-plugin architecture for modular APIs
  • Effect-TS for service composition

Database & Auth:

  • PostgreSQL + Drizzle ORM (pglite in-memory by default; node-postgres when API_DATABASE_URL is set)
  • Better-Auth with NEAR Protocol support

Related Projects

License

MIT

About

customizable admin pages for Sputnik DAOs

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages