How bbrunossf/presentationagent works
Project type and purpose
• This is a full‑stack web application built with Remix (React on the frontend, Node.js on the backend) that provides an interactive UI for sending commands to an AI agent and visualizing the results (text, charts, canvas). A secondary Python microservice (“agent”) handles transcription (via Whisper) and command execution.
File structure
• Top‑level:
• package.json, tsconfig.json, remix.config.js, vite.config.ts → Node/Remix app config
• app/ → Remix source
• public/ → static assets
• .gitignore, Dockerfile, docker‑compose.yml → container setup
• app/routes/ holds your HTTP endpoints (api.run-agent.ts, api.transcribe.ts) and the main UI route (_index.tsx).
• app/components/ contains React UI: Canvas, Sidebar, Header, Input/Output.
• app/services/remoteAgent.ts wraps HTTP calls to your backend API.
• app/store/useCommandStore.ts is your client‑side state store (e.g., Zustand).
• app/data/routes.json stores generated route history.
• app/utils/ generate/write functions create new Remix routes dynamically.
• app/backend/ is a Python agent microservice (Docker‑ized) with main.py and whisper_handler.py.
README for additional insights
• The goal is live demo of commands→agent→UI refresh.
• It calls for real‑time re‑rendering (Remix revalidation), canvas/panel for results, an API to modify/save routes, and server‑side change detection.
a. Main components
• User Interface (React/Remix loader/actions)
• Remix Server (Node.js runtime hosting routes & APIs)
• AI Agent Microservice (Python + Whisper)
• Data Store (routes.json file, dynamic route files)
• External AI/Whisper library
b. Relationships & interactions
1. User enters a command in VoiceInput/CommandInput → React state/store
2. remoteAgent service invokes POST /api.run-agent or /api.transcribe on Remix server
3. Remix route handler forwards request to the Python agent via HTTP (Docker Compose network)
4. Python agent processes (transcription or action) → returns JSON result
5. Remix handler returns response → React updates OutputDisplay/Canvas/WorkloadChart
6. If route generation is involved: utils.generateRoute → writeRouteToFile updates file system → Remix triggers revalidation → new dynamic route appears
c. Architectural patterns & design principles
• Separation of concerns: UI vs. API vs. agent service
• Event‑driven flow: user action triggers network calls → stream results
• Dynamic code generation: server writes new route modules
• Revalidation (Remix incremental re‑render) for real‑time updates
d. Relevant technologies/frameworks
• Frontend: React + TypeScript, Tailwind CSS, Zustand (store), Canvas/Chart libs
• Backend: Remix (Node.js), Express‑style routes, file‑watch/revalidate
• Agent: Python 3, Whisper, Flask or pure HTTP server
• Orchestration: Docker Compose
• Persistence: JSON file (routes.json) + generated .tsx files
Detailed capture of essential elements
• Network calls (HTTP), file operations, and revalidation triggers.
• How dynamic route generation flows from front → server util → write to disk → Remix dev server picks up changes.
• Don’t simply list files—represent their runtime roles (UI, API, service, data store).