How latikamadankar/lexoai-chatbot works
LexoAI is a browser-based conversational chat app backed by an Express API. Users submit prompts, the API requests a reply from OpenRouter and saves the exchange in MongoDB; users can also browse, reopen, and delete saved threads. The React app shares prompt, reply, and thread state through context, while separate chat and sidebar views handle conversation and history. Markdown rendering and code highlighting are visible UI capabilities. The README is empty, so this map relies on the shown source; it does not assume additional product features.
Main entry points: chat.js Chat API · MyContext.jsx Shared context · ChatWindow.jsx Chat window · Sidebar.jsx Thread sidebar
Components 13
Chat interface
- React entry
Frontend/src/main.jsx - App state
Frontend/src/App.jsx - Shared context
Frontend/src/MyContext.jsx - Chat window
Frontend/src/ChatWindow.jsx - Chat renderer
Frontend/src/Chat.jsx - Thread sidebar
Frontend/src/Sidebar.jsx
API and orchestration
- HTTP server
Backend/server.js - Chat API
Backend/routes/chat.js
Thread persistence
- Thread model
Backend/models/Thread.js - MongoDB
External services
- Reply client
Backend/utils/openai.js - OpenRouter
Other components
- User
Connections 15
- User → Chat window: sends prompts
Frontend/src/ChatWindow.jsx - User → Thread sidebar: manages threads
Frontend/src/Sidebar.jsx - React entry → App state: renders
Frontend/src/main.jsx - App state → Shared context: provides state
Frontend/src/App.jsx - Shared context → Chat window: shares state
Frontend/src/ChatWindow.jsx - Shared context → Thread sidebar: shares state
Frontend/src/Sidebar.jsx - Shared context → Chat renderer: shares state
Frontend/src/Chat.jsx - Chat window → Chat renderer: renders
Frontend/src/ChatWindow.jsx - Chat window → Chat API: posts prompts
Frontend/src/ChatWindow.jsx - Thread sidebar → Chat API: loads history
Frontend/src/Sidebar.jsx - HTTP server → Chat API: mounts API
Backend/server.js - HTTP server → MongoDB: connects
Backend/server.js - Chat API → Thread model: reads and writes
Backend/routes/chat.js - Chat API → Reply client: requests reply
Backend/routes/chat.js - Reply client → OpenRouter: requests completion
Backend/utils/openai.js