# iabhinavrajput/stock-careers architecture

> Architecture diagram of the GitHub repository iabhinavrajput/stock-careers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iabhinavrajput/stock-careers
- Repository: https://github.com/iabhinavrajput/stock-careers

## Overview

##### Project type and purpose
- This is a cross-platform Flutter mobile (and desktop/web) client application called “stock_careers.”
- It implements a layered, client-side architecture using the BLoC pattern to manage state, fetch data (courses, blogs, e-books, user/auth flows) from remote APIs, and render UI screens.

##### File structure
- Top-level platform folders (android/, ios/, web/, linux/, macos/, windows/) contain Flutter embedding and build files. They are the host shells but not part of the app’s core logic.
- lib/ is the single Dart codebase, subdivided into:
- blocs/ – business-logic components (auth, blog, course, ebook, theme) implementing the BLoC/Cubit pattern.
- data/ – models (DTOs) and services (HTTP clients) for remote API calls, plus secure storage (token) utilities.
- presentation/ – UI layer with screens and reusable widgets.
- routes/ – centralized route definitions and generator.
- utils/ – constants (endpoints, themes), helpers (validators, snackbar), secure storage wrapper.
- main.dart wires everything together (BlocProviders, MaterialApp, theme, route generator).

##### Extract insights from README
- The README is boilerplate; no architecture docs are provided. We infer a cleanly layered, client-only app that relies on external RESTful backend services.

##### Detail without overcomplication
- Platform folders are shown only to indicate multi-platform support, not as active business-logic layers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Platform Embedding
    subgraph "Platform Embedding"
        style PlatformShells stroke:#000,fill:none
        PlatformShells["Android / iOS / Web / Linux / macOS / Windows Shells"] 
    end

    %% Application Entry
    Main["main.dart"]:::presentation
    click Main "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/main.dart"

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        ScreensWidgets["Screens & Widgets"]:::presentation
        click ScreensWidgets "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/presentation"
        StaticContent["StaticContentScreen"]:::presentation
        click StaticContent "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/presentation/StaticContent/static_content_screen.dart"
        Routing["Routing Module"]:::presentation
        click Routing "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/routes"
        Utils["UI Helpers & Constants"]:::presentation
        click Utils "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/presentation/widgets"
    end

    %% BLoC Layer
    subgraph "BLoC Layer"
        direction TB
        AuthBlocs["AuthBloc / SignupBloc / ForgotPasswordBloc / UserBloc"]:::bloc
        click AuthBlocs "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/blocs/auth"
        BlogBlocs["BlogBloc / BlogDetailBloc"]:::bloc
        click BlogBlocs "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/blocs/blog"
        CourseBlocs["CourseBloc / CourseDetailBloc"]:::bloc
        click CourseBlocs "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/blocs/course"
        EbookBlocs["EbookBloc / EbookDetailBloc"]:::bloc
        click EbookBlocs "https://github.com/iabhinavrajput/stock-careers/tree/main/lib/blocs/ebook"
        ThemeCubit["ThemeCubit"]:::bloc
        click ThemeCubit "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/blocs/theme/theme_cubit.dart"
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        subgraph Services
            direction TB
            AuthService["AuthService"]:::data
            click AuthService "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/services/auth_service.dart"
            BlogService["BlogService"]:::data
            click BlogService "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/services/blog_service.dart"
            CourseService["CourseService"]:::data
            click CourseService "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/services/course_service.dart"
            EbookService["EbookService"]:::data
            click EbookService "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/services/ebook_service.dart"
            UserService["UserService"]:::data
            click UserService "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/services/user_service.dart"
        end
        subgraph Models
            direction TB
            BlogModel["BlogModel"]:::data
            click BlogModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/blog_model.dart"
            CourseModel["CourseModel"]:::data
            click CourseModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/course_model.dart"
            CourseDetailModel["CourseDetailModel"]:::data
            click CourseDetailModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/course_detail_model.dart"
            EbookModel["EbookModel"]:::data
            click EbookModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/ebook_model.dart"
            UserModel["UserModel"]:::data
            click UserModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/user_model.dart"
            LoginResponseModel["LoginResponseModel"]:::data
            click LoginResponseModel "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/data/models/login_response_model.dart"
        end
        SecureStorage["SecureStorage"]:::storage
        click SecureStorage "https://github.com/iabhinavrajput/stock-careers/blob/main/lib/utils/secure_storage.dart"
    end

    %% External API
    ExternalAPI["External RESTful API"]:::external

    %% Interactions
    PlatformShells -->|Launches| Main
    Main -->|"renders"| ScreensWidgets
    ScreensWidgets -->|"dispatch Events"| AuthBlocs
    ScreensWidgets -->|"dispatch Events"| BlogBlocs
    ScreensWidgets -->|"dispatch Events"| CourseBlocs
    ScreensWidgets -->|"dispatch Events"| EbookBlocs
    ScreensWidgets -->|"dispatch Events"| ThemeCubit

    AuthBlocs -->|"calls"| AuthService
    BlogBlocs -->|"calls"| BlogService
    CourseBlocs -->|"calls"| CourseService
    EbookBlocs -->|"calls"| EbookService
    AuthBlocs -->|"calls"| UserService

    AuthService -->|"HTTP"| ExternalAPI
    BlogService -->|"HTTP"| ExternalAPI
    CourseService -->|"HTTP"| ExternalAPI
    EbookService -->|"HTTP"| ExternalAPI
    UserService -->|"HTTP"| ExternalAPI

    ExternalAPI -->|"JSON"| AuthService
    ExternalAPI -->|"JSON"| BlogService
    ExternalAPI -->|"JSON"| CourseService
    ExternalAPI -->|"JSON"| EbookService
    ExternalAPI -->|"JSON"| UserService

    AuthService -->|"parses to Models"| UserModel
    BlogService -->|"parses to Models"| BlogModel
    CourseService -->|"parses to Models"| CourseModel
    CourseService -->|"parses to Models"| CourseDetailModel
    EbookService -->|"parses to Models"| EbookModel
    AuthService -->|"parses to Models"| LoginResponseModel

    AuthService -->|"token read/write"| SecureStorage

    AuthService -->|"returns"| AuthBlocs
    BlogService -->|"returns"| BlogBlocs
    CourseService -->|"returns"| CourseBlocs
    EbookService -->|"returns"| EbookBlocs
    UserService -->|"returns"| AuthBlocs

    AuthBlocs -->|"emit States"| ScreensWidgets
    BlogBlocs -->|"emit States"| ScreensWidgets
    CourseBlocs -->|"emit States"| ScreensWidgets
    EbookBlocs -->|"emit States"| ScreensWidgets
    ThemeCubit -->|"emit State"| ScreensWidgets

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#000;
    classDef bloc fill:#D0F0C0,stroke:#000;
    classDef data fill:#FFF4D0,stroke:#000;
    classDef storage fill:#D3D3D3,stroke:#000;
    classDef external fill:#E8E8E8,stroke:#000;
    classDef platform stroke:#000,fill:none;
```
