Spaces:
Sleeping
Sleeping
VoiceForge Mobile App Architecture
Overview
The VoiceForge Mobile Companion App is built using Flutter to provide a cross-platform (Android/iOS) experience. It connects to the VoiceForge FastAPI backend to provide speech-to-text and text-to-speech capabilities on the go.
Tech Stack
- Framework: Flutter (Dart)
- State Management: flutter_riverpod (Recommended for scalability) or Provider
- Networking: Dio (advanced HTTP client) + web_socket_channel
- Audio: flutter_sound or record (recording), audioplayers (playback)
- Local Storage: shared_preferences (settings), hive (offline cache - optional)
Project Structure
We follow a Clean Architecture inspired feature-first approach:
lib/
βββ core/ # Global core functionality
β βββ config/ # Environment config
β βββ constants/ # UI constants, API endpoints
β βββ theme/ # App theme & styles
β βββ utils/ # Helper functions
β βββ network/ # Dio client, Interceptors
β
βββ features/ # Feature-based modules
β βββ auth/ # Authentication (if re-enabled)
β βββ transcription/ # STT Feature
β β βββ data/ # Repositories, DTOs
β β βββ domain/ # Models, Entities
β β βββ presentation/ # Screens, Widgets, Providers
β βββ synthesis/ # TTS Feature
β βββ history/ # Transcripts List & Details
β
βββ shared/ # Shared widgets & models
β βββ widgets/ # Common UI components
β βββ models/ # Shared data models
β
βββ main.dart # Entry point
API Integration
Base URL
- Development:
http://<your-local-ip>:8000(Physical Device) orhttp://10.0.2.2:8000(Android Emulator) - Production:
https://api.voiceforge.com
Endpoints
| Feature | Method | Endpoint | Description |
|---|---|---|---|
| STT | POST | /api/v1/stt/transcribe |
Upload audio for transcription |
| TTS | POST | /api/v1/tts/synthesize |
Convert text to speech |
| History | GET | /api/v1/transcripts |
List past transcripts |
| Stream | MAX | /api/v1/ws/transcription |
Real-time WebSocket stream |
Real-time Transcription (WebSocket)
Flow:
- Connect to
ws://<host>/api/v1/ws/transcription?client_id=<uuid> - Send Audio Chunks (binary) or JSON commands.
- Receive JSON updates:
{"status": "processing", "partial": "..."}.
Design Guidelines
- Visuals: Match the "Premium Dark Theme" of the web app.
- Colors:
- Primary: HSL(220, 14%, 96%) (Light text) / HSL(222, 47%, 11%) (Background) - Sync with web CSS
- Accents: Vibrant gradients for action buttons.
- Typography: Inter / Roboto.
Development Workflow
- Setup: Ensure Backend is running (
docker-compose up). - Run:
flutter run - Build:
flutter build apk --release