Skip to content

feat: add Deno launcher, root tasks, and README - #7

Merged
g-eoj merged 3 commits into
mainfrom
feat/launcher-and-readme
Feb 25, 2026
Merged

feat: add Deno launcher, root tasks, and README#7
g-eoj merged 3 commits into
mainfrom
feat/launcher-and-readme

Conversation

@g-eoj

@g-eoj g-eoj commented Feb 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • launcher.ts — orchestrates the Python backend and Fresh frontend: starts both processes, streams their logs, and handles graceful shutdown on Ctrl+C or unexpected exit
  • deno.json — root-level tasks (deno task start, dev:web, build:web)
  • README.md — user-facing quick-start guide: feature list, architecture diagram, vLLM setup instructions (>= 0.13, no reasoning parser, Hermes tool-call parser required), env vars, and port config

Test plan

  • deno task start launches both services and streams [frontend] / [backend] logs
  • Ctrl+C sends SIGTERM to both processes and exits cleanly
  • README renders correctly on GitHub (Mermaid diagram, tables)
  • vLLM requirements and start command are accurate

🤖 Generated with Claude Code

Adds the orchestration layer and user-facing docs:
- launcher.ts: starts the Python backend and Fresh frontend, streams their output, handles graceful shutdown
- deno.json: root tasks (start, dev:web, build:web)
- README.md: quick-start guide with vLLM requirements, architecture diagram, and feature list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Feb 25, 2026

Copy link
Copy Markdown

Greptile Summary

Added orchestration layer for Librarian: a Deno-based launcher that manages the Python backend and Fresh frontend as child processes with log streaming and graceful shutdown on SIGINT/SIGTERM.

  • launcher.ts validates required env vars from env.schema.json, starts both services with port config from librarian.config.json, streams prefixed logs, and handles cleanup
  • Root deno.json provides start, dev:web, and build:web tasks
  • README documents the full setup flow including vLLM requirements (>= 0.13, Hermes tool-call parser, no reasoning parser)

Confidence Score: 4/5

  • Safe to merge with minor documentation inaccuracy and style improvement opportunity
  • Core orchestration logic is solid with proper error handling, port checking, and shutdown management. The README claim about opening the browser is inaccurate, and the stream reader should handle errors to avoid potential unhandled rejections. These are both minor issues that don't affect core functionality.
  • Pay attention to README.md:79 (documentation fix) and consider the launcher.ts:143 error handling suggestion

Important Files Changed

Filename Overview
launcher.ts Orchestrates backend and frontend startup with proper shutdown handling; minor issue with unhandled promise in stream reader
README.md Comprehensive documentation with vLLM setup instructions, architecture diagram, and quick-start guide
deno.json Root-level Deno tasks for start, dev, and build commands

Sequence Diagram

sequenceDiagram
    participant User
    participant Launcher as launcher.ts
    participant Env as env.schema.json
    participant Config as librarian.config.json
    participant Frontend as Frontend (Vite)
    participant Backend as Backend (uvicorn)

    User->>Launcher: deno task start
    Launcher->>Env: loadEnvSchema()
    Env-->>Launcher: required env vars
    Launcher->>Launcher: validateEnv()
    
    Launcher->>Config: loadConfig()
    Config-->>Launcher: ports (or defaults)
    
    Launcher->>Launcher: Check frontend port
    Launcher->>Frontend: startFrontend(8080, 8001)
    Frontend-->>Launcher: stdout/stderr streams
    Launcher->>Launcher: streamOutput("frontend")
    Launcher->>Launcher: waitForPort(8080)
    
    Launcher->>Launcher: Check backend port
    Launcher->>Backend: startBackend(8001)
    Backend-->>Launcher: stdout/stderr streams
    Launcher->>Launcher: streamOutput("backend")
    Launcher->>Backend: Poll /openapi.json
    Backend-->>Launcher: Health check OK
    
    User->>Launcher: Ctrl+C (SIGINT)
    Launcher->>Frontend: SIGTERM
    Launcher->>Backend: SIGTERM
    Launcher->>Launcher: Wait 5s or force SIGKILL
    Launcher->>User: Exit
Loading

Last reviewed commit: 45e7a09

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment thread launcher.ts
Comment on lines +143 to +156
function streamOutput(name: string, stream: ReadableStream<Uint8Array>) {
const reader = stream.getReader();
const decoder = new TextDecoder();

(async () => {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n").filter((l) => l.trim())) {
console.log(`[${name}] ${line}`);
}
}
})();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unhandled promise rejection if reader errors

Suggested change
function streamOutput(name: string, stream: ReadableStream<Uint8Array>) {
const reader = stream.getReader();
const decoder = new TextDecoder();
(async () => {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n").filter((l) => l.trim())) {
console.log(`[${name}] ${line}`);
}
}
})();
function streamOutput(name: string, stream: ReadableStream<Uint8Array>) {
const reader = stream.getReader();
const decoder = new TextDecoder();
(async () => {
try {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n").filter((l) => l.trim())) {
console.log(`[${name}] ${line}`);
}
}
} catch (error) {
// Reader errors are non-fatal (process may have exited)
}
})();
}

Comment thread README.md Outdated
deno task start
```

Librarian starts the backend and frontend, then opens your browser.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

launcher doesn't open browser — line 79 in launcher.ts only logs "Press Ctrl+C to stop"

g-eoj and others added 2 commits February 24, 2026 16:17
- README: fix incorrect claim that launcher opens the browser
- launcher: wrap streamOutput reader loop in try/catch to handle non-fatal reader errors when a process exits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove manual uv sync step (uv run handles it automatically) and
consolidate to a two-line clone-and-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@g-eoj
g-eoj merged commit 84f21fb into main Feb 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant