Neptune AI Chatbot

Tylon Sohnle

A framework-free chat app with streamed Ollama replies, saved conversation context and cancellable requests.

The Express backend separates routing, controllers, middleware and inference, so the parts that validate a request are not tangled with the parts that talk to the model. Replies stream to the browser through the Fetch API and a streamed reader, decoded with TextDecoder and rendered as they arrive rather than waiting for the full response.

An AbortController ties cancellation and timeouts to each request, and a heartbeat polls a health endpoint so the interface can show when the backend is unavailable instead of failing silently. The API is rate-limited per IP with proxy-aware client detection, validated input and an environment-configured CORS allowlist, and it logs requests with timing and user-agent data. The front end deploys on GitHub Pages and the API on Render.