How bounsic-a-s/tongi works
Project type and purpose
• Full-stack, cross-platform translation app
• Flutter-based UI (Android, iOS, Web, Linux, macOS, Windows)
• C++ REST API backend for orchestration
• Three Python microservices (STT, TTS, TTT) for specialized translation tasks
File structure
Top-level directories:
• frontend/ – Flutter app organized into core utilities, screens, services, widgets; platform folders for Android, iOS, Web, Linux, macOS, Windows; pubspec.yaml; tests
• backend/ – C++ server: main.cpp entrypoint; controllers (health, data, stt, tts, ttt); services; models; utils; CMakeLists.txt; Dockerfiles; config.json; test scripts
• servers/ – Python Flask microservices: stt_server, tts_server, ttt_server; each with app.py, controllers, services, models, Dockerfile, Jenkinsfile, tests
• scripts (servers/run_*.bat) to launch all or individual services
Extract architecture insights from the README
• Tech stack: Flutter/Dart, C++ (Pistache or similar REST engine), Python/Flask, Docker, CMake, Jenkins
• Features: audio translation, text translation, camera OCR translation, multi-language support, settings
• Backend orchestrates calls to microservices
Main components & interactions
a. Client Layer (Flutter Frontend)
– UI screens call translation endpoints: audio, text, camera
– Uses logic controllers and services for recording, OCR, API calls
b. Backend Layer (C++ REST API)
– Exposes REST endpoints: /health, /data, /stt, /tts, /ttt
– Internally structured as Controllers → Services → Models
– Reads config.json for service URLs, API keys
c. Microservices Layer (Python Flask)
– STT Service: speech-to-text
– TTS Service: text-to-speech (uses Azure voices config)
– TTT Service: text-to-text translation
d. Infrastructure & CI/CD
– Docker containers for backend and each microservice
– Docker-Compose to orchestrate local dev
– Jenkinsfiles for CI pipelines
Data flow relationships
• User interacts with Flutter UI → HTTP(S) request to C++ REST API
• C++ Controller routes request to appropriate Service
• C++ Service issues HTTP call to corresponding Python microservice
• Microservice processes input, returns JSON payload
• C++ Service may post-process, then returns unified response to Flutter
Architectural patterns & principles
• Separation of concerns: UI / orchestration / specialized processing
• Layered C++ backend (Controller-Service-Model)
• Microservices for independently scaling translation tasks
• Containerization for reproducible environments
• Cross-platform client via Flutter
1. Client (Flutter app on multiple platforms)
2. Backend (C++ REST API)
3. Microservices (STT, TTS, TTT)
4. Infrastructure (Docker, Jenkins, Docker-Compose)
• Flutter → C++ API
• C++ API → each Python microservice
• Microservice → C++ API → Flutter
• Client: blue
• Backend: green
• Microservices: orange
• Infra/CI: gray