Skip to content

Features

Kasun Akalanka edited this page Apr 21, 2026 · 2 revisions

✨ Features

A breakdown of every major capability across all three subprojects.


β†’ Navigation: Home Β· Architecture Β· API Reference


Client β€” Chat UI

πŸ’¬ Real-time WebSocket chat

Messages stream instantly over Direct Line's WebSocket connection. The client connects to the streamUrl returned by the server on conversation start β€” no polling, no delay.

πŸ“ Markdown rendering

Bot responses are passed through a Markdown utility layer before display. This means Copilot Studio can return structured answers with headings, bullet lists, code blocks, links, and bold/italic text β€” all rendered beautifully in the chat bubble.

πŸ’Ύ Persistent session storage

Three keys are written to sessionStorage so a page refresh doesn't lose context:

Key Contents
opotin_chat_messages Full chat history array
opotin_conversation Conversation metadata (ID, token, streamUrl)
opotin_watermark Direct Line watermark for deduplication

πŸ” Message deduplication

The Direct Line watermark is persisted so that reconnecting after a refresh doesn't re-deliver messages the user has already seen. Only activities newer than the last watermark are processed.

πŸ—‘οΈ Clear conversation control

A built-in control wipes all three sessionStorage keys and starts a fresh conversation β€” useful when testing or when a student wants a clean start.


Server β€” Proxy + API

πŸ”’ Secure Direct Line proxy

DIRECT_LINE_SECRET never reaches the browser. The server exchanges it for a short-lived token and returns only the token and streamUrl to the client. See Architecture β†’ Security Model for the full flow.

πŸ—„οΈ SQLite persistence

Every conversationId is automatically stored in data/database.db the moment a conversation starts. The database file is created on first run β€” no setup needed.

⭐ Feedback API

Students can rate any conversation from 1–5 stars via POST /feedback/:conversationId. Ratings are stored alongside the conversation record and exposed to the admin dashboard.

πŸ›‘οΈ Admin endpoint protection

All analytics endpoints require an X-Admin-Token header matching the ADMIN_TOKEN value in server/.env. Requests without a valid token receive a 401 response.


Admin Dashboard

πŸ“Š Feedback analytics

The Overview tab shows:

  • Average rating across all conversations
  • Distribution bars β€” visual breakdown of how many 1β˜… through 5β˜… ratings were given
  • Donut chart β€” proportional view of the rating spread
  • Summary cards β€” total conversations rated, total feedback entries

πŸ—‚οΈ Conversation insights

The Conversations tab lists every rated conversation with sorting controls by date and rating. Each entry expands to show the full conversation details via ConversationCard.

πŸ”‘ Token-based authentication

Login submits the admin token, which is tested immediately against the backend. On success, the token is persisted to sessionStorage under opotin_admin_token so the admin stays logged in across tab refreshes.

πŸ”„ Data refresh

The navbar includes a refresh button that re-fetches both /feedback and /conversations in parallel β€” no need to reload the page.


Developer Experience

πŸ“¦ One-command startup

npm run dev   # starts client + server + admin concurrently

The root package.json uses concurrently to orchestrate all three Vite/Node processes in a single terminal session.

πŸ”§ Independent subproject scripts

Each subproject can also be run on its own:

cd client && npm run dev    # Chat UI only
cd server && npm start      # API only
cd admin  && npm run dev    # Dashboard only

β†’ Next: πŸ”Œ API Reference Β· πŸš€ Setup & Configuration

⬑ OPOTIN Wiki


🌐 Live πŸ’¬ Chatbot πŸ“Š Admin Dashboard


πŸ“– Pages

🏠 Home πŸ—οΈ Architecture ✨ Features πŸ”Œ API Reference πŸš€ Setup & Config πŸ› οΈ Tech Stack 🌍 Deployment πŸ‘₯ Team 🩺 Troubleshooting


πŸ“ Subprojects

client/ Β· Chat UI Β· :5173 server/ Β· Proxy + API Β· :3000 admin/ Β· Dashboard Β· :5174


TAMK Student Guide

Clone this wiki locally