Skip to content

About

A web-accessible, fully-editable project dashboard backed by Neon (Postgres), driven by a web UI and a CLI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mission Control

A web-accessible, fully-editable project dashboard backed by Neon (Postgres). Both the web UI and a CLI write to the same database, so AI agents have a centralized, integrated place to track project state.

Stack: Next.js 16 (App Router) · Neon serverless + Drizzle ORM · BetterAuth (Google OAuth, locked to you@example.com) · Vercel.

Local setup

  1. cp .env.example .env.local and fill it in (see below).
  2. npm install
  3. npm run db:migrate — apply migrations to Neon (run as the owner role).
  4. npm run dev — open http://localhost:3030 and sign in with Google as you@example.com.

Useful: npm run db:studio (Drizzle Studio), npm run db:generate (regenerate migration SQL after a schema change).

The three database roles

Role Env var Where Access
owner DATABASE_URL local / CI only everything — migrations + seed
app DATABASE_URL in Vercel Vercel env only read/write all tables incl. auth
agent AGENT_DATABASE_URL local CLI / agents projects + tasks + runs + events; no auth tables

Create the scoped agent role once (psql as owner):

CREATE ROLE mc_agent LOGIN PASSWORD '…';
GRANT USAGE ON SCHEMA public TO mc_agent;
GRANT SELECT, INSERT, UPDATE, DELETE ON projects, tasks TO mc_agent;
-- Mission Control: runs/events are append-only / update-only — no DELETE. events.seq is a
-- GENERATED-AS-IDENTITY column, so table INSERT suffices (no sequence grant needed).
GRANT SELECT, INSERT, UPDATE ON runs, events TO mc_agent;
REVOKE ALL ON users, sessions, accounts, verification FROM mc_agent;

Migration 0023_reapply_agent_grants_dual_name applies the schema USAGE + projects/tasks (full) + runs/events (no DELETE) grants automatically — but only if the mc_agent (or legacy cc_agent) role already exists (a pg_roles-guarded DO block). Create the role BEFORE running migrations on a fresh DB, or re-run the GRANTs above once after. (The early 0001/0002/0004 grant migrations guard only the legacy cc_agent name, so on a rebuilt DB they no-op for mc_agent — which is why 0023 exists.)

After any future migration that adds an agent-facing table, re-run the GRANT (or set ALTER DEFAULT PRIVILEGES FOR ROLE <owner> IN SCHEMA public GRANT SELECT,INSERT,UPDATE,DELETE ON TABLES TO mc_agent;).

CLI (for agents)

Requires the scoped AGENT_DATABASE_URL. It does not silently fall back to DATABASE_URL (which may be the owner role) — with only DATABASE_URL set, mc refuses to run (exit 4) unless you opt in with MC_ALLOW_DATABASE_URL_FALLBACK=1 (not recommended). See cli/README.md.

npm run cli -- project list --json
npm run cli -- task add my-project "Wire up billing"

Beyond the project/task catalog, the CLI also drives Mission Control — agent runs, the activity-event log, and the cost rollup — plus self-dispatch (task next/task claim) and self-sourcing (task import-issues):

npm run cli -- run list --active --json          # what's running right now
npm run cli -- task next --json                  # next claimable task (FIFO)
npm run cli -- spend --group-by agent --json     # cost rollup, by agent

The full command catalog (every flag, with readonly tags) is in cli/README.md and at runtime via mc spec --json.

Security model

  • Sign-in is Google OAuth, restricted to you@example.com, enforced both at user-creation (databaseHooks.user.create.before, fail-closed) and per-request (requireAllowedUser() in every server action and the dashboard page). Middleware is only a redirect convenience, not the security boundary.
  • Threat model for AGENT_DATABASE_URL: anyone holding it can read/write all project and task data and bypasses the email allowlist for the write path. It cannot read sessions or accounts (auth tables are revoked). Treat it as a sensitive credential; never set it in Vercel.

Deploying to Vercel

  • Set in Vercel (Production): DATABASE_URL (the app role, not owner), BETTER_AUTH_SECRET, BETTER_AUTH_URL + NEXT_PUBLIC_BETTER_AUTH_URL (prod origin), GOOGLE_CLIENT_ID/SECRET, ALLOWED_EMAIL. Do not set AGENT_DATABASE_URL or the owner string there.
  • Add the production callback to Google Cloud authorized redirect URIs: https://<prod-domain>/api/auth/callback/google.
  • Node is pinned to 22.x via engines in package.json.
  • For future schema changes: run npm run db:migrate (owner, local/CI) and re-grant the agent role before promoting code that depends on the new schema.

About

A web-accessible, fully-editable project dashboard backed by Neon (Postgres), driven by a web UI and a CLI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages