How yorkeccak/bio works
Project type and purpose
• This is a full-stack web application built with Next.js 15 (App Router) that serves as a biomedical research assistant.
• The frontend delivers a chat interface and data-driven views; the “backend” consists of Next.js API routes that orchestrate calls to external services (Valyu API, OpenAI/Vercel AI SDK, Daytona code execution sandboxes, Ollama local models, Supabase for auth/storage, webhooks for polar integration, etc.).
File structure
• Top level:
• package.json, pnpm-lock.json, tsconfig.json, next.config.ts, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs
• docs/ for design notes, public/ for static assets
• src/app/ contains React Server Components and API route folders (chat, checkout, collections, customer-portal, env-status, ollama-status, rate-limit, uploads, usage, webhooks, auth).
• src/components/ holds UI components (ChatInterface, BottomBar, modals, charts, shadcn/ui wrappers).
• src/lib/ provides shared utilities (citation, env validation, hooks, LLM context, rate-limit, polar events, stores).
• src/utils/supabase/ has client and server Supabase helpers for auth or persistence.
• src/types/ and root-level config files define typing, linting, and build pipelines.
README for additional insights
• Architecture callout at bottom:
• Frontend: Next.js 15 App Router, Tailwind CSS, shadcn/ui
• AI: OpenAI GPT-4 (with function calling) + optional Ollama local models
• Data: Valyu API (clinical trials, drug labels, PubMed)
• Code Execution: Daytona sandboxes (Python)
• Visualizations: Recharts
• Real-time streaming via Vercel AI SDK
• Security: sandboxing, HIPAA-compliant, HTTPS, API key management
Detail
• Context/state providers (React Context) as sub-components of the frontend.
• Important middleware (middleware.ts for auth/rate-limit) and route interceptors.