How mhashir03/ozzy works
Project Type and Purpose
• Ozzy is a cross-platform mobile application focused on overcoming communication challenges for users with speech difficulties. It leverages speech recognition (via OpenAI’s Whisper API) to convert spoken input into text and then provides text-to-speech playback.
• It is designed as an accessibility tool within the assistive technology domain, as highlighted in the README.
File Structure
• The project lives inside the "frontend/HackSLU-2025" directory, indicating that the key mobile application code is in a dedicated “frontend” directory.
• Key directories include:
• app – Contains main application components, configuration files (babel.config.js, tailwind.config.js), context providers (ThemeContext, AppContext), navigation setup (AppNavigator), and screens (HomeScreen, SpeechScreen, SettingsScreen).
• api – Hosts code for interfacing with the speech API (speechApi.ts) so that external services (OpenAI Whisper API) are used.
• components – Houses individual UI components (including feature-specific components for speech such as LanguageSelector).
• assets – Holds fonts and images used by the application.
• lib – Manages library code including constant definitions for languages and other app-specific constants.
• The file tree demonstrates a component-based structure typical for React Native apps, with clear separation between UI, configuration, API connections, context management, and utility hooks.
Components
a. Mobile App Frontend: Mark this as the primary interactive user interface built with React Native and Expo.
• App Container: Core entry point (index.tsx) which loads App.tsx.
• Navigation: Managed by React Navigation (AppNavigator) that routes between screens.
• Screens: Home, Speech, and Settings.
• Components: Both generic and feature-specific components (like LanguageSelector in speech feature).
• Context Providers: Handle theming (ThemeContext) and global app state (AppContext).
• Hooks: Custom hooks (useColorScheme, useThemeColor) used for adaptive theming.
b. API Integration:
• API layer (speechApi.ts) showing outbound HTTP requests to the external API.
c. Audio Handling:
• Modules for audio recording and playback that use Expo AV and Expo Speech libraries.
d. External Dependencies:
• Usage of libraries such as React Navigation, Expo AV, Expo Speech, and Tailwind (for styling).
Relationships and Interactions
• From the Voice Input captured on the Speech Screen to the API module (speechApi.ts) which communicates with the OpenAI Whisper API.
• From the API response, passing processed text back to the component(s) to trigger text-to-speech playback.
• That user interactions on the Home and Settings screens navigate via AppNavigator.
• That context providers (AppContext and ThemeContext) supply state information (such as theming and global settings) to various screens and components.
• That the UI components interact with the API layer indirectly (through hooks or direct API calls) to handle audio recording and playback.
Architectural Patterns and Design Principles
• The design follows a clear separation of concerns, modularizing:
• UI layers (screens, navigation, components)
• State Management (context APIs for global state)
• Service Integration (API layer for speech processing)
• Use of environmental variables (in a .env file) supports external configuration (like API keys), emphasizing best practices in configuration management.
• The use of modern tooling (like Expo for mobile development) illustrates a component and modular-focused architecture that supports rapid development.
• Separation between the main layers (UI, API integration, and service handling), ensuring that all essential parts of the application are represented.