How kenny-fred/human-computer-interface works
This is a browser-based translation app with per-user translation history, favorites and statistics, plus phrase prediction, voice input, reviews, and administration. The main flow is browser input through the translation API and controller to LibreTranslate; successful results are saved in JSON-backed history. Prediction uses vocabulary derived from that history. The server also implements review, admin, and notification endpoints. Those capabilities are visible in server excerpts, but their detailed persistence and the admin-page wiring are not; those links are therefore omitted.,
Main entry points: translate.js Translation routes · db.js User history and stats · app.js Translation interface · translateController.js Translation controller
Components 15
Browser app
- Translation interface
frontend/js/app.js - Voice input
frontend/js/voiceService.js
Translation API
- Translation routes
backend/routes/translate.js - Translation controller
backend/controllers/translateController.js - Phrase prediction
backend/services/autoCompleteService.js - Translation service
backend/services/libreTranslateService.js
Translation data
- User history and stats
backend/database/db.js - Translation JSON
backend/database/translations.json
Reviews and administration
- Server endpoints
backend/server.js - Admin interface
frontend/admin.html - Review endpoints
backend/server.js - Admin and notifications
backend/server.js
Other components
- App user
- Browser speech API
- LibreTranslate
Connections 16
- App user → Translation interface: uses
- Translation interface → Translation routes: requests predictions
frontend/js/app.js - Translation interface → Translation routes: loads favorites
frontend/js/app.js - Translation interface → Voice input: starts voice input
frontend/js/app.js - Voice input → Browser speech API: uses recognition
frontend/js/voiceService.js - Server endpoints → Translation routes: mounts routes
backend/server.js - Translation routes → Translation controller: dispatches
backend/routes/translate.js - Translation routes → Phrase prediction: requests suggestions
backend/routes/translate.js - Translation routes → User history and stats: checks duplicates
backend/routes/translate.js - Translation controller → Translation service: translates text
backend/controllers/translateController.js - Translation controller → User history and stats: saves and reads
backend/controllers/translateController.js - Translation service → LibreTranslate: sends requests
backend/services/libreTranslateService.js - Phrase prediction → User history and stats: reads vocabulary
backend/services/autoCompleteService.js - User history and stats → Translation JSON: persists data
backend/database/db.js - Server endpoints → User history and stats: reads admin stats
backend/server.js - Admin interface → Admin and notifications: admin workflow