AUNUXNEXUS / DOCUMENTATION

Operational clarity
by design.

Implementation notes for the Nexus access layer: identity, policy, one-time delivery, and source retirement in one auditable flow.

VERSION 0.1APP ROUTER + WORKERSLAST REVIEW / 2026-09
01 / SYSTEM OVERVIEW

A small surface
with clear boundaries.

Nexus separates the operator experience from the access engine. The web application handles navigation and identity. The Worker owns policy decisions, source writes, quota enforcement, and audit events.

01Next.js / VercelApp Router, Google sign-in, server-side proxy routes, and the operator console.
02Hono / WorkersSigned internal requests, direct API-key access, policy checks, and source operations.
03D1 + KVD1 keeps the durable record. KV provides the edge-visible quota mirror.
02 / REQUEST LIFECYCLE

Discover.
Issue. Retire.

01

Authenticate the operator

Google OAuth establishes the identity in NextAuth. The server-side proxy signs the request before forwarding it to the Worker.

identity → signature
02

Resolve policy

The Worker loads the user record, checks the daily ceiling, and accepts only a valid channel path.

user + quota → allow
03

Consume the source

The first available line is read. A GitHub content SHA acts as the compare-and-swap token for the update or final delete.

sha → PUT / DELETE
04

Write the receipt

The response contains a receipt and delivery metadata. D1 records the event; the source item cannot be replayed by the next request.

event → audit trail
03 / ACCESS PLANS

Policy follows
the operator.

FREE

Primary source

Free users remain on the primary Worker/source and its standard daily quota.

PREMIUM + LEGACY

Discord server access

Join through the configurable Discord server invite, then request either plan with the team. An admin assigns the plan by the signed-in user's email.

SOURCE REGISTRY

Health metadata only

Registered Cloudflare Workers are grouped by plan and probed for online, offline, or unknown status with timestamps. The registry never aggregates queue lines or credential records.

04 / API SURFACE

Small enough
to reason about.

METHODPATHPURPOSE
GET/v1/meRead the operator plan, Discord invite, and quota
GET/v1/categoriesDiscover available workspace channels
POST/v1/dispenseIssue one item and retire its source line
GET/v1/keysList the operator's scoped API keys
POST/v1/keysMint a key; plaintext is returned once
GET/v1/admin/statsView aggregate operational statistics
GET/v1/admin/sourcesList and health-check plan-specific Workers
POST/v1/admin/users/planAssign Free, Premium, or Legacy by email
DIRECT REQUESTHTTPS ONLY
curl -X POST https://worker.example/v1/dispense \
  -H "Authorization: Bearer aunu_sec_..." \
  -H "Content-Type: application/json" \
  -d '{"category":"workspace"}'
05 / SECURITY NOTES

Default deny.
Useful evidence.

KEY MATERIAL

Plaintext appears once

Generated API keys are hashed before storage. The console returns the full value only at creation time.

CONCURRENCY

Stale writes fail closed

GitHub PUT and DELETE operations include the previously read SHA. A 409 causes a fresh read instead of an overwrite.

ADMIN ACCESS

Authorization lives server-side

Admin email allowlisting is enforced in the Worker. The command page is an interface, not the security boundary.

DATA HANDLING

Use controlled fixtures

The included environment is configured for non-production workspace data. Never put live passwords, payment cards, or session tokens in a fixture repository.

NEXT STEP

See the control plane
in action.

Open the console