How david6604/bhashasetu works
BhashaSetu is a multilingual translation application: users submit text or audio through a web interface or API, the gateway coordinates translation and account features, and a Python service detects languages and translates text. The README also documents authentication, history, caching, resilience controls, rate limiting, and OpenAPI; WebSocket rooms and broadcasts are visible in the gateway excerpt. Voice-service internals and several gateway integrations are not fully sampled, so those links are limited to documented capabilities and visible calls.
Main entry points: index.js HTTP gateway · main.py Translation API · TranslatePage.tsx Translation UI · App.tsx Web application
Components 21
Web client
- Web application
frontend/src/App.tsx - Translation UI
frontend/src/pages/TranslatePage.tsx - Translation state
frontend/src/store/index.ts - Translation API client
frontend/src/api/translate.ts
API gateway
- HTTP gateway
server/index.js - Voice upload route
server/index.js - Redis cache
server/cache.js - Gateway controls
- Gateway circuit breaker
server/circuit.js - API documentation
server/openapi.js
Translation services
- Translation API
python_service/main.py - Language detection
python_service/main.py - NLLB engine
python_service/translation_engine.py - Voice translation
python_service/voice.py
Accounts and history
- JWT authentication
server/auth.js - Translation history
server/index.js - Translation records
prisma/schema.prisma
Realtime
- WebSocket rooms and broadcasts
server/index.js - Room manager
server/roomManager.js - Broadcast subscriptions
server/broadcastManager.js
Other components
- Translator
Connections 21
- Translator → Web application: uses
- Web application → Translation UI: routes to
- Translation UI → Translation state: reads and updates
- Translation UI → Translation API client: requests translation
- Translation API client → HTTP gateway: sends request
- HTTP gateway → Translation API: forwards translation
- Translation API → Language detection: detects language
- Translation API → NLLB engine: translates text
- Voice upload route → Voice translation: forwards audio
- HTTP gateway → JWT authentication: mounts auth routes
- HTTP gateway → Translation history: serves history
- Translation history → Translation records: reads records
- HTTP gateway → Translation records: stores translations
- HTTP gateway → Redis cache: caches
- HTTP gateway → Gateway controls: rate limits
- HTTP gateway → Gateway circuit breaker: uses breaker
- HTTP gateway → API documentation: mounts docs
- HTTP gateway → WebSocket rooms and broadcasts: handles connections
- WebSocket rooms and broadcasts → Room manager: manages rooms
- WebSocket rooms and broadcasts → Broadcast subscriptions: manages subscriptions
- WebSocket rooms and broadcasts → Translation API: requests detection and translation