How seungboan/try-on-hanbok works
The project “Try On Hanbok” is a Flutter-based, cross-platform application that provides a virtual fitting experience for Hanbok (traditional Korean dress) using AI services. It comprises clearly separated frontend and backend components, with the frontend implemented in Flutter (targeting mobile, web, desktop) and the backend handled via Supabase services integrated under the supabase_services folder.
Main Components
• Frontend Application (Client):
• Backend Services:
• The supabase_services directory indicates the backend integration layer. This module includes Supabase configuration, services, and models for handling image storage, AI model invocation for virtual fittings, and user authentication.
• Relevant files like supabase_service.dart, inference_service.dart, and the configuration for environment variables denote its key role in interfacing with Supabase and possibly Edge Functions.
• External Services:
• Supabase is the third-party service providing database, storage, and authentication.
• AI processing for the virtual fitting function is implied through integration services in the supabase_services module.
Analyzing the Relationships and Interactions
• The Flutter frontend interacts with the Supabase backend through defined service interfaces (API calls, state management via hanbok_state.dart, etc.).
• Users trigger operations like image upload or design selection via the UI (lib/pages and lib/widgets) which, in result, communicate with the backend for processing (using the supabase_services functions).
• Data flows bidirectionally: user inputs (images, design selections) flow from the UI to the backend, and the processed results (virtual fitting images, status updates) are returned to the UI.
• The use of custom lint rules indicates adherence to specific naming and coding standards, which is part of the overall architectural discipline.
Architectural Patterns & Design Principles
• Clear Separation of Concerns: The project separates the UI layer (Flutter under lib/) from backend interactions (supabase_services).
• Modular Design: Distinct modules for client-side widgets, pages, constants, and backend services ensure maintainability and scalability.
• Cross-Platform Development: The project’s folder structure (android, ios, web, linux, macos, windows) emphasizes the cross-platform build nature of Flutter.
Relevant Technologies, Frameworks, and Libraries
• Flutter (UI toolkit for cross-platform development)
• Supabase (for backend services including user authentication, database management, storage, and possibly AI model invocation via Edge Functions)
• Dart (as the primary programming language, alongside specific toolchains for linting and analysis like analysis_options.yaml)
• Platform-specific build configurations (Gradle, Xcode, CMake for desktop platforms)
Elements
• Clear labels for each component:
• Supabase Backend Integration component and its sub-services (inference service, image storage, environment & configuration service).
• API calls from the Flutter app to the backend services.
• Visual Differentiation: