voiceforge-universal / docs /MOBILE_ARCHITECTURE.md
creator-o1
Initial commit: Complete VoiceForge Enterprise Speech AI Platform
d00203b

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) or http://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:

  1. Connect to ws://<host>/api/v1/ws/transcription?client_id=<uuid>
  2. Send Audio Chunks (binary) or JSON commands.
  3. 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

  1. Setup: Ensure Backend is running (docker-compose up).
  2. Run: flutter run
  3. Build: flutter build apk --release