# iamvijay98/social-media-app-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/iamvijay98/social-media-app-frontend
- Repository: https://github.com/iamvijay98/social-media-app-frontend

## Overview

##### Project type and purpose
- This is a React‐based Single Page Application (SPA) implementing the front end of a social network (“FACE GRAM”).
- Users can sign up / log in, create/read/update/delete posts, follow/unfollow, comment, like, view profiles and receive notifications.

##### File structure
- Top‐level:
- public/ – static HTML, manifest, robots.txt
- src/ – all React source code
– index.js + App.js – entry point and root component with Router
– Components/ – reusable UI widgets (Navigation, LeftSide, MiddleSide, RightSide, Post, Comments, Profile modules, etc.)
– Pages/ – route‐level components (Home, Profile, Notification, FriendsId, Register)
– Data/ – mock or API‐service wrappers (DisplayPostData.js, FollowingData.js)
– assets/ – images and media resources
- No backend code here, but README implies REST/GraphQL APIs for persistence and auth.

##### Relevant README insights
- Tech stack: React, JavaScript, CSS3
- Navigation via React Router
- Responsive design across devices
- Key features: signup/login, profile editing, posting, commenting, liking, following, notifications

a. Main Components
- User’s Browser (React SPA)
- Static File Hosting / CDN (serves index.html, JS, CSS, assets)
- API Layer (Auth Service, Posts Service, Users Service, Notification Service)
- Database(s) or managed backend (where data is stored)
- External Services (e.g., image store or CDN for user uploads, push notifications)

b. Relationships & Interactions
- User → HTTP(S) → Static Hosting (delivers SPA)
- Within SPA:
- App.js + Router decide which Page component to mount
- Page components import and compose UI Components
- UI Components call Data / API wrappers → REST endpoints
- SPA ↔ API Layer: Authentication tokens, CRUD for posts/comments/follows, notifications
- API Layer ↔ Database / Storage

c. Architectural Patterns & Design Principles
- Component-based UI (React) with clear separation of concerns (Navigation, Layout, Widgets)
- Client-side routing (React Router)
- Service abstraction for data access (Data/ folder)
- Responsive layout (CSS modules per component)
- Potential global state (Context or Redux) woven into data service layer

d. Key Technologies / Frameworks
- React (create-react-app conventions)
- React Router for navigation
- CSS modules / scoped CSS for styling
- Fetch/Axios or custom wrapper in Data/ for HTTP calls
- CDN for static asset delivery
- JWT or OAuth for auth tokens (implied)

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef ui fill:#add8e6,stroke:#000,stroke-width:1px
    classDef data fill:#90ee90,stroke:#000,stroke-width:1px
    classDef external fill:#ffa500,stroke:#000,stroke-width:1px

    User["User Browser"]:::external
    publicIndex["public/index.html"]:::external
    publicManifest["public/manifest.json"]:::external
    publicRobots["public/robots.txt"]:::external

    User -->|GET index.html| publicIndex
    publicIndex -->|"loads assets"| publicManifest
    publicIndex --> publicRobots

    StaticHost["Static Hosting/CDN"]:::external
    publicIndex --> StaticHost

    subgraph "React SPA"
        ReactApp["React SPA"]:::ui
        Router["Client-side Routing (React Router)"]:::ui
        subgraph "Pages"
            HomePage["Home Page"]:::ui
            ProfilePage["Profile Page"]:::ui
            NotificationPage["Notification Page"]:::ui
            FriendIdPage["Friend's Profile Page"]:::ui
            LoginPage["Login Page"]:::ui
            SignUpPage["Sign Up Page"]:::ui
        end
        subgraph "UI Components"
            Navigation["Navigation"]:::ui
            LeftSide["Left Navigation Panel"]:::ui
            MiddleSide["Main Content Layout"]:::ui
            RightSide["Right Sidebar"]:::ui
            InputPost["Post Input Widget"]:::ui
            FeedPosts["Feed Post Display"]:::ui
            SinglePost["Single Post Component"]:::ui
            CommentsComp["Comments Component"]:::ui
            InfoProfile["Profile Info Display"]:::ui
            ModelProfile["Profile Edit Modal"]:::ui
            ProfileInput["Profile Input Post"]:::ui
            ProfileMiddle["Profile Layout"]:::ui
            InfoFriends["Friends Profile Info"]:::ui
            UserHomeComp["User Home Feed"]:::ui
        end
        subgraph "Data Services"
            PostData["Post Data Service"]:::data
            FollowData["Following Data Service"]:::data
        end

        ReactApp --> Router
        Router --> HomePage
        Router --> ProfilePage
        Router --> NotificationPage
        Router --> FriendIdPage
        Router --> LoginPage
        Router --> SignUpPage

        HomePage --> Navigation
        HomePage --> LeftSide
        HomePage --> MiddleSide
        HomePage --> RightSide

        MiddleSide --> InputPost
        MiddleSide --> FeedPosts
        FeedPosts --> SinglePost
        SinglePost --> CommentsComp

        ProfilePage --> InfoProfile
        ProfilePage --> ModelProfile
        ProfilePage --> ProfileInput
        ProfilePage --> ProfileMiddle

        FriendIdPage --> InfoFriends

        UserHomeComp --> FeedPosts

        InputPost --> PostData
        FeedPosts --> PostData
        SinglePost --> PostData
        CommentsComp --> PostData
        Navigation --> FollowData

    end

    subgraph "Backend APIs & Storage"
        AuthAPI["Authentication API"]:::external
        PostsAPI["Posts API"]:::external
        UsersAPI["User Service API"]:::external
        NotifyAPI["Notification API"]:::external
        ObjectStorage["Object Storage/CDN"]:::external

        AuthAPI --> DBAuth[("Auth Database")]:::external
        PostsAPI --> DBPosts[("Posts Database")]:::external
        UsersAPI --> DBUsers[("User Database")]:::external
        NotifyAPI --> DBNotify[("Notification Database")]:::external
        PostsAPI --> ObjectStorage
    end

    ReactApp -->|POST/GET /login,/signup| AuthAPI
    ReactApp -->|CRUD posts| PostsAPI
    ReactApp -->|GET profile/:id| UsersAPI
    ReactApp -->|GET notifications| NotifyAPI

    PostData -.->|REST calls| PostsAPI
    FollowData -.->|REST calls| UsersAPI

    class User,StaticHost,AuthAPI,PostsAPI,UsersAPI,NotifyAPI,ObjectStorage,DBAuth,DBPosts,DBUsers,DBNotify external
    class ReactApp,Router,HomePage,ProfilePage,NotificationPage,FriendIdPage,LoginPage,SignUpPage,Navigation,LeftSide,MiddleSide,RightSide,InputPost,FeedPosts,SinglePost,CommentsComp,InfoProfile,ModelProfile,ProfileInput,ProfileMiddle,InfoFriends,UserHomeComp ui
    class PostData,FollowData data

    click ReactApp "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/index.js"
    click ReactApp "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/App.js"
    click Router "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/App.js"
    click Navigation "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Navigation/Nav.js"
    click LeftSide "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/LeftSide/Left.js"
    click MiddleSide "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/MiddleSide/Middle.js"
    click RightSide "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/RightSide/Right.js"
    click InputPost "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Post/InputPost.js"
    click FeedPosts "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Home/Feedposts.js"
    click SinglePost "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Home/Post.js"
    click CommentsComp "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Comments/Comments.js"
    click InfoProfile "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Profile/ProfileComponents/InfoProfile/Info.js"
    click ModelProfile "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Profile/ProfileComponents/ModelProfile/ModelProfile.js"
    click ProfileInput "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Profile/ProfileComponents/ProfileInputPost.js"
    click ProfileMiddle "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/Profile/ProfileMiddle.js"
    click InfoFriends "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/FriendsProfile/FriendsProfileInfo/InfoFriends.js"
    click UserHomeComp "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Components/UserHome/UserHome.js"
    click PostData "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Data/DisplayPostData.js"
    click FollowData "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Data/FollowingData.js"
    click HomePage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/Home/Home.js"
    click ProfilePage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/Profile/Profile.js"
    click NotificationPage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/Notification/Notification.js"
    click FriendIdPage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/FriendsId/FriendsId.js"
    click LoginPage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/RegisterPage/Login.js"
    click SignUpPage "https://github.com/iamvijay98/social-media-app-frontend/blob/main/src/Pages/RegisterPage/SignUp.js"
    click publicIndex "https://github.com/iamvijay98/social-media-app-frontend/blob/main/public/index.html"
    click publicManifest "https://github.com/iamvijay98/social-media-app-frontend/blob/main/public/manifest.json"
    click publicRobots "https://github.com/iamvijay98/social-media-app-frontend/blob/main/public/robots.txt"
    click ObjectStorage "https://github.com/iamvijay98/social-media-app-frontend/tree/main/src/assets/"
```
