# ravnus-inc/knowme-frontend architecture

> Architecture diagram of the GitHub repository ravnus-inc/knowme-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ravnus-inc/knowme-frontend
- Repository: https://github.com/ravnus-inc/knowme-frontend

## Overview

##### Project type and purpose
- This is a full-stack mobile front-end application built in Flutter, using GetX for state management.
- It’s the client app of “Know Me,” a career management platform that records user activities, interacts with AI analysis, and fetches/postings (jobs, internships, contests) from remote services.

##### File structure
- Top-level:
- android/ – native Android project
- assets/ – images, svgs, fonts for the UI
- lib/ – all Dart code
– core/ – constants (API URLs), utilities (e.g., storage), theme
– shared/ – reusable API client, shared widgets, shared repositories
– features/ – each feature follows a folder-per-feature pattern (activity, ai_analysis, membership, posts, recommendation, search, home, splash)
– routes/ – app routing definitions
- test/ – unit and widget tests
- Pattern: Presentation (views), State (GetX controllers), Domain (services & repositories), Data (ApiClient), Models in each layer, following a variant of MVVM or layered architecture with the Repository pattern.

##### README insights
- Confirms use of Flutter, GetX, REST-style APIs.
- Outlines features: login/signup (with OAuth), activity tracking, post recommendation, AI analysis.

1. Mobile App (Flutter Engine)
- Presentation Layer
- UI Screens & Widgets (lib/features/*/views, shared/widgets)
- State Management
- GetX Controllers (lib/features/*/controllers, core/utils/storage_utils for local persistence)
- Domain Layer
- Services (lib/features/*/services, shared/services/api_client.dart)
- Repositories (lib/features/*/repositories, shared/repositories/*)
- Data Layer
- ApiClient (core/utils + shared/services/api_client.dart)
- Local Storage (secure token storage via storage_utils)
2. External Systems
- Authentication & User Profile API
- Posts API (jobs, contests, internships)
- AI Analysis API (analysis & summary)
- Third-party OAuth Providers (Google, Naver)

1. UI → Controller: user taps/clicks
2. Controller → Service/Repository: business logic invocation
3. Repository → ApiClient: HTTP request (with tokens from Local Storage)
4. ApiClient → External API: network call
5. External API → ApiClient → Repository → Controller → UI: data flow back
6. Controller ↔ Local Storage: read/write tokens, cached data

c. Architectural patterns & principles:
- Layered architecture (Presentation → Domain → Data)
- Repository pattern abstracts data sources
- GetX for reactive state management & dependency injection
- Single ApiClient for HTTP concerns (timeouts, headers)
- Feature modularization for scalability

d. Relevant technologies:
- Flutter framework & Dart language
- GetX package (routing, state, DI)
- RESTful APIs over HTTP(S)
- OAuth 2.0 (Google, Naver)
- Local storage (shared_preferences / secure storage via storage_utils)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Mobile App Structure
    subgraph "Mobile App (Flutter Engine)"
        %% Presentation Layer
        subgraph "Presentation Layer"
            Main["Mobile App Entry Point"]:::frontend
            Routes["Routing Definitions"]:::frontend
            BaseScaffold["Base Scaffold Widget"]:::frontend
            subgraph "Feature Views"
                ActivityViews["Activity Views"]:::frontend
                AIAnalysisViews["AI Analysis Views"]:::frontend
                MembershipViews["Membership Views"]:::frontend
                PostsViews["Posts Views"]:::frontend
                RecommendationViews["Recommendation Views"]:::frontend
                SearchViews["Search Views"]:::frontend
                HomeViews["Home Views"]:::frontend
                SplashScreen["Splash Screen"]:::frontend
            end
        end

        %% State Management
        subgraph "State Management (GetX Controllers)"
            ActivityController["ActivityController"]:::controller
            AIAnalysisController["AIAnalysisController"]:::controller
            AIResultController["AIAnalysisResultController"]:::controller
            PreviousResultController["PreviousResultController"]:::controller
            MembershipControllers["Membership Controllers"]:::controller
            PostController["PostController"]:::controller
            PostDetailController["PostDetailController"]:::controller
            FilterController["FilterController"]:::controller
            RecommendationController["RecommendationController"]:::controller
            SearchController["SearchController"]:::controller
            SearchResultController["SearchResultController"]:::controller
            HomeController["HomeController"]:::controller
        end

        %% Domain Layer
        subgraph "Domain Layer (Services & Repositories)"
            ApiConstants["API Constants"]:::domain
            ActivityService["ActivityService"]:::domain
            ActivityRepository["ActivityRepository"]:::domain
            AIAnalysisService["AIAnalysisService"]:::domain
            AuthRepository["AuthRepository"]:::domain
            PostService["Posts Services"]:::domain
            PostRepository["PostRepository"]:::domain
            RecommendationRepository["RecommendationRepository"]:::domain
            SavedRepository["SavedRepository"]:::domain
            SearchService["Search Services"]:::domain
            NotificationRepository["NotificationRepository"]:::domain
        end

        %% Data Layer
        subgraph "Data Layer"
            ApiClient["ApiClient"]:::data
            StorageUtils["Storage Utility"]:::data
        end
    end

    %% External Systems
    subgraph "External Systems"
        AuthAPI["Authentication & User Profile API"]:::external
        PostsAPI["Posts API"]:::external
        AIAPI["AI Analysis API"]:::external
        OAuthProviders["OAuth Providers"]:::external
    end

    %% Interactions
    Main -->|initializes| Routes
    Routes -->|renders| ActivityViews
    Routes -->|renders| AIAnalysisViews
    Routes -->|renders| MembershipViews
    Routes -->|renders| PostsViews
    Routes -->|renders| RecommendationViews
    Routes -->|renders| SearchViews
    Routes -->|renders| HomeViews
    Routes -->|renders| SplashScreen

    ActivityViews -->|user action| ActivityController
    AIAnalysisViews -->|user action| AIAnalysisController
    MembershipViews -->|user action| MembershipControllers
    PostsViews -->|user action| PostController
    PostsViews -->|detail action| PostDetailController
    PostsViews -->|filter action| FilterController
    RecommendationViews -->|user action| RecommendationController
    SearchViews -->|user action| SearchController
    SearchViews -->|result action| SearchResultController
    HomeViews -->|user action| HomeController

    ActivityController -->|calls| ActivityService
    AIAnalysisController -->|calls| AIAnalysisService
    AIResultController -->|calls| AIAnalysisService
    PreviousResultController -->|calls| AIAnalysisService
    MembershipControllers -->|uses| AuthRepository
    PostController -->|uses| PostService
    PostDetailController -->|uses| PostRepository
    FilterController -->|uses| PostService
    RecommendationController -->|uses| RecommendationRepository
    RecommendationController -->|uses| SavedRepository
    SearchController -->|uses| SearchService
    SearchResultController -->|uses| SearchService
    HomeController -->|uses| NotificationRepository

    ActivityService -->|stores/fetches| ActivityRepository
    AIAnalysisService -->|requests| ApiClient
    AuthRepository -->|requests| ApiClient
    PostService -->|requests| ApiClient
    PostRepository -->|requests| ApiClient
    RecommendationRepository -->|requests| ApiClient
    SavedRepository -->|requests| ApiClient
    SearchService -->|requests| ApiClient
    NotificationRepository -->|requests| ApiClient
    ApiConstants -->|configures| ApiClient

    ActivityRepository -->|uses| StorageUtils
    AuthRepository -->|uses| StorageUtils
    ApiClient -->|reads/writes| StorageUtils

    ApiClient -->|HTTP call| AuthAPI
    ApiClient -->|HTTP call| PostsAPI
    ApiClient -->|HTTP call| AIAPI
    MembershipViews -->|OAuth flow| OAuthProviders
    OAuthProviders -->|callback| AuthAPI

    %% Click Events
    click Main "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/main.dart"
    click Routes "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/routes/routes.dart"
    click ApiConstants "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/core/constants/api_constants.dart"
    click StorageUtils "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/core/utils/storage_utils.dart"
    click ApiClient "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/shared/services/api_client.dart"
    click BaseScaffold "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/shared/widgets/base_scaffold.dart"
    click ActivityController "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/activity/controllers/activity_controller.dart"
    click ActivityService "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/activity/services/activity_service.dart"
    click ActivityRepository "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/activity/repositories/activity_repository.dart"
    click ActivityViews "https://github.com/ravnus-inc/knowme-frontend/tree/main/lib/features/activity/views/"
    click AIAnalysisController "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/ai_analysis/controllers/ai_analysis_controller.dart"
    click AIResultController "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/ai_analysis/controllers/ai_analysis_result_controller.dart"
    click PreviousResultController "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/ai_analysis/controllers/previous_result_controller.dart"
    click AIAnalysisService "https://github.com/ravnus-inc/knowme-frontend/blob/main/lib/features/ai_analysis/services/ai_analysis_service.dart"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:1px
    classDef controller fill:#C8E6C9,stroke:#1B5E20,stroke-width:1px
    classDef domain fill:#FFF9C4,stroke:#F57F17,stroke-width:1px
    classDef data fill:#FFCDD2,stroke:#B71C1C,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#616161,stroke-width:1px
```
