Skip to Content
ArchitectureWeb applicationOverview
Architecture · Web application

The product people use, bound to one identity.

What it is for

The web application, apps/ui, is everything a person sees: the organisation mapMapThe view of teams, services and their dependencies for the selected part of the organisation. Details appear beside the map., the measured C/A/RC/A/RThree separate scores for a team or service: Complexity, Agility and Recoverability. Each uses current evidence and the customer’s stated scoring rules. (Complexity, Agility and RecoverabilityRecoverabilityThe R in C/A/R: how well a team or service restores acceptable service after a failure. Recovery times and tested alternatives can supply evidence.) figures, findingsFindingA difference in the records that needs a decision. It includes its sources and can describe a slow handoff, disputed fact or missing owner., the GuideGuideThe help pages inside NovusLens. They explain the pages, input formats and tasks in the version you use. They are product instructions, not evidence about the organisation. and the question panel. The user guide explains how to use these pages. This section is the engineering view.

How it runs

It is a Next.jsNext.jsThe web framework used to build and run the NovusLens interface. It provides pages, server code and request handlers. 15 application with ReactReactThe library used to build the interface from reusable pieces called components. 19, started with pnpm start -p <port>. The development driver ops defaults to port 3111. Set NOVUSLENS_GATE_UI_PORT to a free port for an isolated gate run. The Compose ui service publishes 127.0.0.1:${NOVUSLENS_UI_PORT}, default 3111. Pages are server-rendered and use dynamic = "force-dynamic", so none of them is cached across readers.

The application reaches data in two ways:

  • Read modelRead modelThe database tables used by the map, Ask and Find. NovusLens rebuilds these tables from its history of recorded changes., directly. Server code in apps/ui/lib/twin.ts queries PostgresPostgresThe database software that stores the tables read by the NovusLens screens, along with document bodies, access records and protected personnel records. through a pg connection pool. DATABASE_URL sets the address and defaults to a local development database. The data is the read model rebuilt from the log.
  • Reasoning service, through one proxyProxyA service that receives a request and forwards it to another service. The NovusLens web proxy adds the signed-in identity and service token.. The browser calls the web application, which forwards the request to the reasoning service. It calls /api/reasoning/..., which replaces any viewer with the session identity, adds the shared service tokenService tokenA secret value sent with requests between NovusLens services. The receiving service refuses requests with a missing or wrong value. and forwards the call. See session, profile and access.
Page reads go straight to the read model. Anything that needs the reasoning service goes through one proxy, after the viewer is resolved from the session.

A browser request through the session check, the Postgres read path and the reasoning proxy.

Identity

The session is the identity. A signed login cookieCookieA small value a browser keeps and sends back to a website. NovusLens uses a signed cookie to remember the signed-in account. names the viewer, and nothing in a URL or request body can replace it. In the customer profileDeployment profileA setting that selects customer or development behaviour. Customer mode refuses development credentials and uses the signed-in session as the identity. (CONWAY_PROFILE=customer) the ?viewer= parameter is ignored entirely, and a request without a session is refused.

Architectural units

Build guards

The build script runs next build, then two guards. A failure of either fails the build.

GuardWhat it checks
scripts/guard-palette.mjsEvery hex colour in the built CSSCSSCascading Style Sheets: the rules that control a web page's colours, type and layout. must come from the approved colour set in the @theme block of app/globals.css. Pure black and white are not in the ramp, so they fail. Partly transparent versions of an approved colour and fully transparent are allowed.
scripts/guard-register.mjsScans UI source, manuals, Guide sources and partner pack for verdicts or promises. A negation such as “never” or “not” must be on the same or previous line. It also fails on the framework name “Conway+” appearing on a product surface. Exceptions go in scripts/guard-register-allow.txt.

The register guard keeps to the product’s boundary mechanically: NovusLens maps and advises, and issues no verdicts. Judgement about tone stays with human review.

Last updated