LocalLens

Source layout

Where the code lives, and what each file is responsible for.

The whole app lives under src/. No nested modules, no shared package. Everything is imported by relative path, so you can read the call graph straight off the top of each file.

src/domain.ts     shared types and AppError
src/files.ts      local + browser file adapters
src/rag.ts        chunking and grounded prompt
src/qvac.ts       QVAC integration
src/store.ts      JSON persistence
src/locallens.ts  application workflow
src/cli.ts        no-UI interface
src/server.ts     optional HTTP interface
src/ui/           optional browser UI (index.html, app.js, styles.css)

Dependency direction

The import graph is one-way. Top to bottom, each row imports only from rows above it.

FileImports from src/
domain.ts
rag.tsdomain
qvac.tsdomain
store.tsdomain
files.tsdomain
locallens.tsdomain, files, rag, qvac, store
cli.tsdomain, locallens
server.tsdomain, locallens
ui/(talks to server.ts over HTTP only)

domain.ts is the foundation. Every other file imports it; it imports nothing back. locallens.ts is the apex. Every other file is below it; it pulls them all together.

Two-line summary

cli and server both consume LocalLensApp from locallens.ts. LocalLensApp consumes files, rag, qvac, and store. All four of those consume only domain.

Next

The next page in the build path — Implementation walkthrough — visits each file in build order and shows the minimum code each one needs.

If you only want a quick reference for "what should X own?", the Code structure page has the full table.

On this page