Skip to content

MultiAgency/dashboard

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:
    bun 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

bun install             # Install dependencies
bun run dev:postgres    # Boot docker compose Postgres + start dev (persistent local dev)
# or:
bun run db:migrate && bun run dev   # Use the configured API_DATABASE_URL, or in-memory pglite by default

The API plugin uses PostgreSQL via Drizzle. Without API_DATABASE_URL set, it boots against an in-memory pglite database — fine for quick exploration but state resets on every restart. For persistent local dev, bun run dev:postgres boots PostgreSQL instances via docker-compose.yml (api/auth/projects on 5432/5433/5434) and starts the dev server. Migrations run automatically on startup; bun 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.config.json'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 (updates bos.config.json)
bos publish             # Publish config to the FastKV registry under `account`
bos publish --deploy    # Build/deploy all workspaces, then publish
bun run publish         # Same publish command via root script

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 → publish with bos publish --deploy
  • API Changes: Edit api/src/ → hot reload automatically → publish with bos publish --deploy
  • Runtime Config: Edit bos.config.json → publish with bos publish --deploy (the host is remote — see Architecture)

Before Committing

Always run these commands before committing:

bun test        # Run all tests
bun typecheck   # Type check all packages
bun 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.config.json's extends); this repo owns ui/ and api/ only.

┌─────────────────────────────────────────────────────────┐
│              Host (Remote — not in this repo)           │
│  Hono.js + oRPC + bos.config.json 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 bos.config.json (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 with Zephyr Cloud

Configuration

All runtime configuration lives in bos.config.json. 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 publish --deploy is the release path when you want Zephyr URLs refreshed before publishing the config.

Lint Setup

This project uses Biome for linting and formatting:

# Check linting
bun lint

# Fix auto-fixable issues
bun lint:fix

# Format code
bun 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

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages