How ardacagankeser/test-app works
Project Type and Purpose
• This is a cross-platform Flutter application (“Test App”) for creating, taking, and managing tests/quizzes.
• It targets Android, iOS, macOS, Windows, Linux, and Web, with plans to integrate a Supabase backend for authentication and data persistence.
File Structure Analysis
• Top-level “android”, “ios”, “macos”, “windows”, “linux”, “web” – platform-specific boilerplate and native embedding of the Flutter engine.
• Core Flutter code lives under “lib/”:
• main.dart – app entry point and route setup
• data/ – sample data until backend is integrated
• models/ – domain objects (MedicalTest, TestQuestion)
• screens/ – UI pages (Welcome, Auth, Create Test, Take Test)
• widgets/ – reusable UI components (TestCard)
• theme_notifier.dart – state management for theming
• “test/” – widget tests.
• Configuration: pubspec.yaml, analysis_options.yaml, platform build scripts (Gradle, Xcode project files, CMakeLists).
README Insights
• Upcoming: UI/UX updates, Supabase integration (authentication, database), containerization (Docker).
a. Main Components
1. Presentation Layer (Flutter UI)
– Screens: Welcome, Auth, Create Test, Take Test
– Widgets: TestCard, form fields, navigation
2. State Management / Business Logic
– theme_notifier.dart (ChangeNotifier or Provider)
– Controllers/Providers (to be introduced for Supabase calls)
3. Data Layer
– Models (MedicalTest, TestQuestion)
– Repositories / Services (DataProvider → sample or SupabaseClient)
4. Backend Services (Supabase)
– Auth (Sign-up, Sign-in)
– Database (Postgres/PostgREST)
– Real-time (optional for live test updates)
5. Platform/Engine Layer
– Flutter Engine & Platform Channels (if any custom plugins are used)
6. External Integrations
– Dockerized backend (future)
– Third-party packages (e.g., supabase_flutter, provider)
b. Relationships & Interactions
• UI screens invoke business logic via Providers/Controllers.
• Controllers call DataProvider/Repository methods.
• DataProviders switch between SampleData (local) and SupabaseClient (remote).
• SupabaseClient communicates over HTTPS with Supabase Auth and Database endpoints.
• Responses are mapped into Models, then fed back to UI.
• ThemeNotifier broadcasts UI theme changes to all widgets.
• Platform code (Android, iOS, etc.) simply embeds Flutter; minimal direct interaction unless custom native plugins are added.
c. Architectural Patterns & Principles
• Layered Architecture: Presentation → Business Logic → Data Access → External Services
• Dependency Inversion: UI depends on abstractions (repositories), not concrete data providers
• State Management via ChangeNotifier/Provider (or consider Riverpod/Bloc in future)
• Separation of Concerns: Widgets vs. Screens vs. Services vs. Models
d. Key Technologies & Frameworks
• Flutter SDK & Dart
• Provider (state management)
• Supabase Dart/Flutter SDK
• Platform build tools: Gradle (Android), Xcode (iOS/macOS), CMake (Linux/Windows), web bundling