This is a minimal chat app for for kids (age 8+) with a Node/Express backend and a static frontend. The server can call GitHub-hosted models via a configurable API endpoint; if you don't configure the endpoint, the server returns a mock response so you can try the UI locally.
Disclaimer: This app is purely for learning purpose and not recomended for production use.
- Install dependencies
cd "D:\Projects\Caskia"
npm install- Create a
.envfile from the example and add your token
copy .env.example .env
# Edit .env and set GITHUB_API_TOKEN (do NOT commit this file)
notepad .env- Run the server
npm start
# then open http://localhost:3000 in your browser- Store your GitHub personal access token in
.envasGITHUB_API_TOKEN. - Optionally set
GITHUB_API_URLandGITHUB_MODELif you have a specific GitHub models endpoint. If those are not set, the server uses a mock reply so the UI remains usable. - Conversations are kept in-memory per anonymous session (cookie-based). They are not persisted to disk.
- Frontend (
public/): a simple single-page chat UI (index.html,app.js,styles.css). The UI sends user messages to the server atPOST /api/chatand renders replies. Text formatting supported by the UI:**bold**→ rendered as bold text.- Numbered lists like
1. A 2. Bor newline-separated lists are converted to proper<ol>/<ul>elements for readability.
- Backend (
server.js): an Express server that accepts chat messages, keeps an in-memory conversation per anonymous cookie session, and forwards the conversation (with a kid-friendly system prompt) to the configured AI endpoint. - Model adapter: the backend calls the URL in
GITHUB_API_URLwith a JSON body{ model, messages }andAuthorization: Bearer <token>. IfGITHUB_API_URLorGITHUB_API_TOKENis missing, the server returns a safe mock reply so you can test the UI without a configured model.
server.js— Express server and model adapterpublic/index.html,public/app.js,public/styles.css— frontendpublic/assets/caskia.png— logo (place your logo here)public/assets/bg.png— background image used with 50% opacity.env.example— environment variables template
"You are CaskIA, a friendly chat assistant for kids aged 8-14. Use simple language, short sentences, a cheerful tone, avoid adult topics, and ask clarifying questions when helpful. If a user asks about something unsafe, respond with a gentle refusal and suggest a safe alternative."
- If you see
GitHub API error 404: 404 page not foundin server logs, theGITHUB_API_URLis likely incorrect (wrong host or path) or the request shape doesn't match the endpoint. Check the URL and model id in your.env. - The server logs non-OK responses from the API (status and response body) to help diagnose issues.
- To test the API manually in PowerShell (replace placeholders):
$body = '{ "model":"<GITHUB_MODEL>", "messages":[{"role":"system","content":"You are CaskIA."},{"role":"user","content":"Hello"}] }'
Invoke-RestMethod -Uri '<GITHUB_API_URL>' -Method Post -Headers @{ Authorization = 'Bearer <GITHUB_API_TOKEN>'; 'Content-Type' = 'application/json'; Accept = 'application/vnd.github+json' } -Body $body | ConvertTo-Json- Never commit
.envto source control. Add it to.gitignoreif you plan to commit.

