# basnetsuman4/geomedlink_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/basnetsuman4/geomedlink_frontend
- Repository: https://github.com/basnetsuman4/geomedlink_frontend

## Overview

##### Main Architectural Components

a) Presentation Layer
- Screens (User Interface)
- Components (Reusable UI elements)
- Navigation System

b) Business Logic Layer
- Hooks (Custom logic and API interactions)
- Context (State management)

c) Service Layer
- API Integration
- Helper Functions

##### Component Relationships

a) Navigation Flow:
- Root Stack Navigator
- Bottom Tab Navigator
- Feature-specific Stack Navigators (NewsFeed, Post)

b) Data Flow:
- User Context → Screens
- API Hooks → Screens
- Components → Screens

##### Detailed Component Breakdown

Create sections for each major feature:

a) Authentication
- Login Screen
- User Context
- Password Management

b) Posts System
- Post Creation
- Comments
- Likes
- Reports
- Delete Functionality

c) News System
- News Feed
- News View

d) Events System
- Event Creation
- Event List
- Event Feed

e) User Management
- Profile Management
- Doctor Profiles
- Blood Donor Profiles
- Profile Photo Management

**┌─ Navigation Layer ─────────────────────┐**
- (Root, Bottom, Stack Navigators)       │
- Presentation Layer ───────────────────┤
- (Screens, Components)                  │
- Business Logic Layer ─────────────────┤
- (Hooks, Context)                       │
- Service Layer ──────────────────────┘
- (API Integration, Helpers)             │
- ┘

##### Key Integration Points

Critical integration points:

- User Authentication Flow
- API Integration Points
- State Management Connection Points
- Navigation State Management
- Component Composition

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef navigation fill:#FFE873,stroke:#333
    classDef ui fill:#AED6F1,stroke:#333
    classDef logic fill:#A2D9A2,stroke:#333
    classDef context fill:#D7BDE2,stroke:#333
    classDef api fill:#F5B7B1,stroke:#333
    classDef helper fill:#D5D8DC,stroke:#333

    %% Navigation Layer
    subgraph Navigation
        RootNav["Root Navigator"]
        BottomNav["Bottom Navigator"]
        NewsFeedNav["NewsFeed Navigator"]
        PostNav["Post Navigator"]
    end

    %% Presentation Layer
    subgraph Screens
        Login["Login Screen"]
        PostCreation["Post Creation"]
        PostView["Post View"]
        Comments["Comments"]
        Reports["Reports"]
        Delete["Delete"]
        NewsFeed["News Feed"]
        NewsView["News View"]
        EventCreate["Event Creation"]
        EventList["Event List"]
        EventFeed["Event Feed"]
        Profile["Profile Management"]
        DoctorProfile["Doctor Profiles"]
        DonorProfile["Blood Donor Profiles"]
        ProfilePhoto["Profile Photo"]
        Search["Search Screen"]
    end

    subgraph Components
        Header["Header"]
        Row["Row"]
    end

    %% Business Logic Layer
    subgraph Hooks
        PostAPI["Post API"]
        CommentAPI["Comment API"]
        LikeAPI["Like API"]
        ReportAPI["Report API"]
        DeleteAPI["Delete API"]
        NewsAPI["News API"]
        EventAPI["Event API"]
        UserAPI["User API"]
        DoctorAPI["Doctor API"]
        DonorAPI["Blood Donor API"]
        SearchAPI["Search API"]
        Debounce["Debounce"]
        PasswordAPI["Password API"]
    end

    subgraph Context
        UserContext["User Context"]
        Theme["Theme Configuration"]
    end

    %% Service Layer
    subgraph Helpers
        Loader["Loader"]
    end

    %% Relationships
    RootNav --> BottomNav
    BottomNav --> NewsFeedNav
    BottomNav --> PostNav

    UserContext --> Login
    UserContext --> Profile
    
    PostAPI --> PostCreation
    PostAPI --> PostView
    CommentAPI --> Comments
    ReportAPI --> Reports
    DeleteAPI --> Delete
    
    NewsAPI --> NewsFeed
    NewsAPI --> NewsView
    
    EventAPI --> EventCreate
    EventAPI --> EventList
    EventAPI --> EventFeed
    
    UserAPI --> Profile
    DoctorAPI --> DoctorProfile
    DonorAPI --> DonorProfile
    
    SearchAPI --> Search
    Debounce --> Search
    
    Header --> Screens
    Row --> Screens
    
    Loader --> Screens

    %% Styling
    class RootNav,BottomNav,NewsFeedNav,PostNav navigation
    class Login,PostCreation,PostView,Comments,Reports,Delete,NewsFeed,NewsView,EventCreate,EventList,EventFeed,Profile,DoctorProfile,DonorProfile,ProfilePhoto,Search,Header,Row ui
    class PostAPI,CommentAPI,LikeAPI,ReportAPI,DeleteAPI,NewsAPI,EventAPI,UserAPI,DoctorAPI,DonorAPI,SearchAPI,Debounce,PasswordAPI logic
    class UserContext,Theme context
    class Loader helper

    %% Click Events
    click RootNav "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/navigations/Root/root-stack.tsx"
    click BottomNav "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/navigations/Bottom/bottom-stack.tsx"
    click NewsFeedNav "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/navigations/Stack/NewsFeed/newsFeed-stack.tsx"
    click PostNav "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/navigations/Stack/Post/post-stack.tsx"
    click Login "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Login/login.tsx"
    click UserContext "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/context/userContext.ts"
    click PasswordAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/user/usePasswordApi.tsx"
    click PostCreation "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/uploadPost.tsx"
    click PostView "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/post.tsx"
    click Comments "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/Comment/comment.tsx"
    click Reports "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/report.tsx"
    click Delete "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/delete.tsx"
    click NewsFeed "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/Components/newsFeed.tsx"
    click NewsView "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/News/Component/newsView.tsx"
    click EventCreate "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Event/addEvent.tsx"
    click EventList "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Event/eventList.tsx"
    click EventFeed "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Post/Components/eventFeed.tsx"
    click Profile "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/User/profile.tsx"
    click DoctorProfile "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/User/editDoctor.tsx"
    click DonorProfile "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/User/editDonor.tsx"
    click ProfilePhoto "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/User/changeProfilePhoto.tsx"
    click Search "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/screens/Search/search.tsx"
    click Header "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/components/Header.tsx"
    click Row "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/components/Row.tsx"
    click Theme "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/theme/theme.tsx"
    click Loader "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/helper/loader.tsx"
    click PostAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/post/usePostApi.tsx"
    click CommentAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/post/useCommentApi.tsx"
    click LikeAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/post/useLikeApi.tsx"
    click ReportAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/post/useReportApi.tsx"
    click DeleteAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/post/useDeleteApi.tsx"
    click NewsAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/news/useNewsApi.tsx"
    click EventAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/event/useEventApi.ts"
    click UserAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/user/useUserApi.tsx"
    click DoctorAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/user/useDoctorApi.tsx"
    click DonorAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/user/useBloodDonorApi.ts"
    click SearchAPI "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/search/useSearchApi.ts"
    click Debounce "https://github.com/Basnetsuman4/geomedlink_frontend/blob/main/src/hooks/search/useDebounce.ts"
```
