Hugo Fund Formation Platform14 Jun, 02:54 CET

Hugo — Fund-Side Letter Platform

Single-worker worker architecture for fund setup, investor work, document workflows, exports, and AI-assisted clause operations.

Hugo is one Cloudflare Worker that serves:

Current route surface

Top-level registrars (src/routes/register-routes.tsx)
  • /api/feedback and /addin/word-feedback — feedback draft + template feedback endpoints
  • /api/events — review analytics ingestion
  • /addin/word-api/* — allowlisted Word API bridge and related add-in callbacks
  • /api/users — identity and session switch helpers
  • /admin — admin-only utility endpoints
  • /api — fund/investor/clause/chat/search endpoints
  • /api/chat — tool-aware chat surface
  • /auth/addin-complete — Word taskpane session handoff
  • page-routes — all HTML pages below
Page route groups (src/routes/page-routes.tsx)
  • core: fund, sponsor, and closing pages
  • investor: global investor directory and fund-scoped investor/commitment views
  • intelligence: recommender and network graph
  • library: clause library, grouping, MFN exclusions, pro-forma builder
  • configuration: setup/closings/settings, template settings, clause text variables
  • task: fund tasks, LP tasks, comments, activity
  • mfn: MFN and ISL screens
  • upload: side letter upload, parse status, review/merge
  • export: export orchestration and preview/download routes

Runtime and middleware shape

Worker entrypoint

src/index.tsx exports one app with three entry handlers:

  • fetch (HTTP)
  • queue (parse queue consumer)
  • scheduled (hourly maintenance sweep)

There is no separate API worker or queue worker process in this repo.

Auth and request setup
  • Auth: fail-closed CF Access gate when REQUIRE_CF_ACCESS is true, with app-level identity fallback for dev/review modes.
  • Fund context: resolves :fundSlug to c.var.fundId/c.var.fundStatus.
  • Closed-fund policy: applied to /funds/:fundSlug and /api/funds/:fundSlug routes.
  • Review gate: optional password gate via review.hugo.nordiclawfirm.com.

Runtime bindings

BindingRole
DB (D1)Application state and workflow tables
FEEDBACK_DB (D1)feedback draft store + rate limits
DOCUMENTS (R2)raw uploads and generated export artifacts
PARSE_QUEUE (Queue)async doc parse jobs + DLQ
AI_GATEWAY_ID / AI env varsCloudflare AI Gateway + Heimdall provider calls
CHAT_* env varsoptional clause-chat endpoint controls

Background execution

  • Queue: async document parsing and classification runs off request path.
  • DLQ: permanent parse failures are recorded through a dead-letter consumer.
  • Scheduled sweep: repairs stuck parse jobs, cleans orphaned managed R2 objects, and retires old exports/preview artifacts.
  • Database handling: request handlers use retry-wrapped D1 proxies on c.var.db and c.var.feedbackDb.

Primary product surfaces

For implementation follow docs/developer-map.md; for live bindings, use docs/architecture-log.md and README.md together.
Ctrl+K to open · ↑↓ navigate · Enter go · Esc close
Copied