CLASSROOM PRESENTATION — MVP 1.0

ThreadBuddy: Chat that remembers your path.

Read the short walkthrough for your instructor, then open the technical details if asked.

Present in 10 steps

01 · The idea

A ChatGPT-like application

ThreadBuddy is a simple AI chat application built for the class assignment. It supports multiple users and AI providers.

02 · Create an account

Separate private conversations

Each learner signs up with a username and password. Chats belong to that account, not to other users.

03 · Ask a question

Use Claude or Gemini

Write a message. The application sends the current chat context to a selected AI model through its API.

04 · Resume later

Saved conversation history

Messages remain available after signing out. Select an old chat to continue from where you stopped.

05 · Jump to a prompt

The distinctive feature 🧭

The right sidebar lists earlier user questions. Click one to jump straight to that spot, without scrolling forever.

06 · Keep what matters

Pin a memory

Save a useful message as memory. These pins can help future AI replies remember what the user explicitly chose.

07 · Share a passage

Choose a section to email

Pick starting and ending prompts. The app prepares a mail draft; the user reviews and sends it in their email client.

08 · Export a conversation

Own your chat history

Download the entire conversation as a readable Markdown file. Export memories and chats together in JSON.

09 · Summarize

Important points in one place

Summarize a thread, save the result, copy it, email it or download it. If no API key exists, a clearly labelled demo summary is available.

10 · Admin and costs

Secure API configuration

An administrator manages keys, models and usage allowances. The app works in labelled demo mode before a paid key is connected.

Technical documentation

These sections describe the implemented MVP, not proposed future features.

1. Architecture and hosting

Single Bun/JavaScript Railway Function with server-side API routes and static HTML, CSS and JavaScript assets. JSON data is kept on a persistent Railway volume. It is intentionally a small demonstration, not a production SaaS architecture.

2. Multi-user authentication

Users register with unique usernames and scrypt password hashes. Login creates a random server-side session with an HttpOnly cookie. Every chat, summary, memory and export endpoint checks account ownership. There is no email verification or password reset by email in the MVP.

3. AI compatibility

Claude uses Anthropic's Messages API; Gemini uses Google's generateContent API; OpenRouter uses an OpenAI-compatible chat-completions interface. A common application function adapts requests and extracts the text response, preserving message history when changing providers.

4. Memory and context

Each user has private stored chats, messages, saved summaries and explicitly pinned memories. For an AI response, the app sends recent chat messages plus the saved summary and selected pinned facts. It does not transmit the entire chat history each time. A vector database and automatic semantic retrieval are deferred.

5. Prompt jump navigation

The frontend builds a list of user prompts from stored messages. Each prompt corresponds to a message DOM element; pressing it scrolls to that exact location. This is navigation, not AI regeneration or branching from an old prompt.

6. Share and export

Selected passages are constructed between two user messages, then copied or passed to a mailto link that opens the user's email client; messages are not automatically emailed. Full-chat Markdown and per-user memory JSON are generated by authenticated server endpoints. Direct Google Drive integration is deferred to avoid OAuth complexity.

7. Summarization

When AI is configured and limits permit, a short summarization request generates main topics, decisions, open questions and next steps; the summary is saved in the conversation. Without a provider, a clearly labelled basic demo summary reflects the last user prompts, not an invented AI answer.

8. Security and privacy

AI keys are AES-256-GCM encrypted at rest using a server key. Passwords use scrypt hashes. Sessions use HttpOnly, SameSite cookies; same-origin checks protect mutations. User data is owner-scoped. Browser rendering uses text content to avoid injecting chat HTML. This is demonstration-grade security; public commercial deployment needs further review.

9. Quotas and known limitations

Admin-set daily call limits apply per user and globally. When live AI is unavailable, the interface displays a demo response rather than pretending it came from an AI model. Current state is a single JSON file, not PostgreSQL. Chat history is limited to 200 messages per thread, and memory pins are limited for the MVP. There is no web search, attachments, streaming responses, direct email sending or Drive OAuth.

10. API endpoints

Public: /api/health, /api/me. Authentication: /api/auth/register, /api/auth/login and /api/auth/logout. Chats: /api/chats, /api/chats/new, /api/chats/:id, /message, /summary, /rename, /delete, /export. Memory: /api/memory/pin, /delete, /export. Admin: /api/admin/login, /config, /save, /models, /remove-key and /password.

11. Future upgrade list

Managed PostgreSQL, email verification, robust billing safeguards, OAuth-based Google Drive export, editable summaries, threaded branching from prompt jump points, semantic memory retrieval, and side-by-side multi-model comparisons. These are deliberately excluded from the homework MVP.