How abhishekwarkade2007-bit/ai-assistant works
This is a browser-based assistant for chat, web search, and opening pages as context. Users submit a chat prompt, search query, or URL; the browser sends requests to local Express routes or Netlify Functions, then displays results and makes search/page context available to chat. Chat can use OpenAI or Gemini, while search fetches DuckDuckGo HTML and page browsing fetches the supplied URL. The local server and Netlify functions are parallel backends. Source excerpts show their request handling; deployment routing is documented in the README.
Main entry points: app.js Chat and tools · _shared.js Function helpers · server.js Local chat route · search.js Function search
Components 15
Browser interface
- Assistant UI
public/index.html - Chat and tools
public/app.js
Local backend
- Express host
server.js - Local chat route
server.js - Local search route
server.js - Local browse route
server.js
Netlify backend
- Function chat
netlify/functions/chat.js - Function search
netlify/functions/search.js - Function browse
netlify/functions/browse.js - Function helpers
netlify/functions/_shared.js
External services
- OpenAI API
- Gemini API
- DuckDuckGo
- Web pages
Other components
- Assistant user
Connections 20
- Assistant user → Assistant UI: uses
README.md - Assistant UI → Chat and tools: loads
public/app.js - Chat and tools → Local chat route: posts chat
public/app.js - Chat and tools → Local search route: posts query
public/app.js - Chat and tools → Local browse route: posts URL
public/app.js - Chat and tools → Function chat: posts chat
public/app.js - Chat and tools → Function search: posts query
public/app.js - Chat and tools → Function browse: posts URL
public/app.js - Express host → Assistant UI: serves
server.js - Local chat route → OpenAI API: requests completion
server.js - Local chat route → Gemini API: requests completion
server.js - Local search route → DuckDuckGo: fetches results
server.js - Local browse route → Web pages: fetches page
server.js - Function chat → Function helpers: calls helpers
netlify/functions/chat.js - Function search → Function helpers: calls helpers
netlify/functions/search.js - Function browse → Function helpers: calls helpers
netlify/functions/browse.js - Function helpers → OpenAI API: requests completion
netlify/functions/_shared.js - Function helpers → Gemini API: requests completion
netlify/functions/_shared.js - Function search → DuckDuckGo: fetches results
netlify/functions/search.js - Function browse → Web pages: fetches page
netlify/functions/browse.js