How pradeepvrm/lmchat works
This repository implements a browser-based chat application: users submit messages, the Flask backend loads conversation history, requests a streamed completion from an OpenAI-compatible service, saves the reply, and streams it back to the browser. Users can also register or sign in and access conversation-list, history, and deletion endpoints. Authentication is handled by Appwrite, while chat data is stored in PostgreSQL. The tree and sampled code establish these backend routes and the chat client; the README is empty, and the other templates’ contents were not sampled, so their detailed behavior is not shown.
Main entry points: app.py Chat endpoint · app.js Chat client · index.html Chat page · auth.py Authentication
Components 16
Browser interface
- Chat client
static/app.js - Chat page
templates/index.html - Login page
templates/login.html - Registration page
templates/register.html - Sidebar template
templates/sidebar.html
Flask application
- Flask routes
app.py - Chat endpoint
app.py - Conversation API
app.py - Auth routes
app.py
Identity
- Authentication
auth.py - Appwrite
Chat data
- Conversation operations
db_helpers.py - ORM models
database.py - PostgreSQL
Other components
- User
- Chat model service
Connections 18
- User → Chat page: opens
- User → Login page: opens
- User → Registration page: opens
- Chat page → Chat client: loads
- Chat client → Chat endpoint: posts message
- Flask routes → Chat page: renders
- Flask routes → Login page: renders
- Flask routes → Registration page: renders
- Flask routes → Sidebar template: renders
- Chat endpoint → Authentication: creates anonymous session
- Auth routes → Authentication: registers or signs in
- Authentication → Appwrite: calls
- Chat endpoint → Conversation operations: loads and saves messages
- Conversation API → Conversation operations: reads or deletes
- Conversation operations → PostgreSQL: reads and writes
- Chat endpoint → Chat model service: streams completion
- Chat endpoint → Chat client: streams response
- ORM models → PostgreSQL: defines schema