Skip to content

Latest commit

Β 

History

History
147 lines (116 loc) Β· 6.44 KB

File metadata and controls

147 lines (116 loc) Β· 6.44 KB

Try πŸ€

A Flutter application designed to assist in preparing for English speaking tests (TOEFL) using the OpenAI GPT API.

This repository focuses on the front-end implementation. For the Spring Boot server and AI prompt engineering, please refer to the back-end repository.

πŸ“ Project Structure

lib/
β”œβ”€β”€ main.dart                      # The entry point of the application
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ repository/                # Handles data management and interaction with data sources
β”‚   β”‚   β”œβ”€β”€ task1_repository.dart    
β”‚   β”‚   β”œβ”€β”€ task2_repository.dart   
β”‚   β”‚   β”œβ”€β”€ task3_repository.dart    
β”‚   β”‚   β”œβ”€β”€ task4_repository.dart     
β”‚   β”‚   β”œβ”€β”€ news_repository.dart     
β”‚   β”‚   └── home_repository.dart    
β”‚   β”œβ”€β”€ model/                     # Defines the data structures
β”‚   β”‚   β”œβ”€β”€ task1_model.dart      
β”‚   β”‚   β”œβ”€β”€ task2_model.dart         
β”‚   β”‚   β”œβ”€β”€ task3_model.dart       
β”‚   β”‚   β”œβ”€β”€ task4_model.dart         
β”‚   β”‚   β”œβ”€β”€ news_model.dart        
β”‚   β”‚   └── report_model.dart       
β”‚   └── view/                      # Contains the UI components
β”‚       β”œβ”€β”€ base_view.dart           
β”‚       β”œβ”€β”€ auth/                  # Contains authentication views and view models
β”‚       β”‚   β”œβ”€β”€ login_view.dart           
β”‚       β”‚   └── login_view_model.dart 
β”‚       β”œβ”€β”€ home/
β”‚       β”‚   β”œβ”€β”€ home_view.dart          
β”‚       β”‚   β”œβ”€β”€ home_view_model.dart    
β”‚       β”‚   β”œβ”€β”€ rotation_3d.dart        
β”‚       β”‚   └── learning_history_view.dart 
β”‚       β”œβ”€β”€ test/
β”‚       β”‚   β”œβ”€β”€ common/            # Shared widgets for test and news
β”‚       β”‚   β”‚   β”œβ”€β”€ microphone_test_widget.dart    
β”‚       β”‚   β”‚   β”œβ”€β”€ reading_material_widget.dart  
β”‚       β”‚   β”‚   β”œβ”€β”€ loading_view.dart            
β”‚       β”‚   β”‚   β”œβ”€β”€ feedback_view.dart           
β”‚       β”‚   β”‚   β”œβ”€β”€ question_widget.dart       
β”‚       β”‚   β”‚   └── listening_material_widget.dart 
β”‚       β”‚   β”œβ”€β”€ test_view.dart        
β”‚       β”‚   β”œβ”€β”€ task1/
β”‚       β”‚   β”‚   β”œβ”€β”€ task1_view.dart          
β”‚       β”‚   β”‚   └── task1_view_model.dart 
β”‚       β”‚   β”œβ”€β”€ task2/
β”‚       β”‚   β”‚   β”œβ”€β”€ task2_view.dart        
β”‚       β”‚   β”‚   └── task2_view_model.dart    
β”‚       β”‚   β”œβ”€β”€ task3/
β”‚       β”‚   β”‚   β”œβ”€β”€ task3_view.dart        
β”‚       β”‚   β”‚   └── task3_view_model.dart   
β”‚       β”‚   β”œβ”€β”€ task4/
β”‚       β”‚   β”‚   β”œβ”€β”€ task4_view.dart         
β”‚       β”‚   β”‚   └── task4_view_model.dart    
β”‚       β”œβ”€β”€ news/
β”‚       β”‚   β”œβ”€β”€ news_view.dart            
β”‚       β”‚   β”œβ”€β”€ news_view_model.dart      
β”‚       β”‚   β”œβ”€β”€ drop_cap_text.dart      
β”‚       β”‚   β”œβ”€β”€ news_detail_view.dart     
β”‚       β”‚   └── news_learning_view.dart  

πŸš€ Build and Run Instructions

Prerequisites

Installation and Execution

  1. Clone the repository:
git clone <repository-url>
cd try_app
  1. Install dependencies:
flutter pub get
  1. Set up the .env file:

Create a .env file in the project root with the following content:

BASE_URL=your_server_cloud_url
DEEPGRAM_API_KEY=your_deepgram_api_key

You can get your API key from Deepgram.

  1. Run the app:
flutter run

πŸ§ͺ Running Tests

To execute the test suite, use the following command:

flutter test

πŸ“Š Asset Information

πŸ› οΈ Referenced Open Source Projects

Key Dependencies

  • provider: State management library to manage application state.
  • http: HTTP client for making API requests.
  • flutter_dotenv: Manage environment variables in a .env file.
  • dynamic_color: Provides dynamic theming capabilities.
  • intl: Supports internationalization and localization, particularly for date and number formatting.
  • fluid_bottom_nav_bar: Customizable bottom navigation bar.
  • diff_match_patch: Library for text diffing, useful for comparing text differences.
  • permission_handler: Handles permissions, such as microphone access.
  • sound_stream: Used for audio streaming, particularly for capturing microphone input for Deepgram STT.
  • web_socket_channel: Provides WebSocket support, used for real-time communication with Deepgram API.
  • rxdart: A reactive programming library for managing asynchronous data streams.
  • audioplayers: Used for audio playback within the app.

Development Dependencies

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.