# praduman1916/insyd-poc-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/praduman1916/insyd-poc-frontend
- Repository: https://github.com/praduman1916/insyd-poc-frontend

## Overview

##### Project type and purpose
- This is a frontend‐only Proof of Concept (POC) built with Next.js (App Router), Tailwind CSS, and Axios.
- Its sole purpose is to let users submit and view notifications in real time, leveraging a separate backend (hosted on Railway) via REST endpoints.

##### File structure
- Top level: project configuration files (next.config.mjs, jsconfig.json, Tailwind and PostCSS configs), package.json, README.
- public/: static assets.
- src/app/: Next.js App Router layer containing global styles (globals.css), layout (layout.js), page entrypoint (page.js), and a client‐side service module (api/notificationService.js) that wraps calls to the external API.
- src/components/: React UI building blocks—NotificationForm.jsx and NotificationList.jsx.
- src/utils/: reusable utilities, specifically axiosInstance.js (preconfigured Axios client).

##### README for additional insights
- Core features: adding notifications, infinite scroll, real‐time updates.
- API endpoints: POST and GET on `/api/v1/notifications` served by the backend.
- Deployment: Frontend auto‐deployed on Vercel; backend on Railway.

- Next.js App Router (layout.js, page.js)
- NotificationForm.jsx (POST → /notifications)
- NotificationList.jsx (GET → /notifications, infinite scroll)
- axiosInstance.js (base URL, interceptors)
- notificationService.js (wrapper methods: `createNotification()`, `fetchNotifications()`)
- External Backend API endpoints `/api/v1/notifications`
- Database persistence layer

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Hosting
    Browser["User Browser"]:::external
    CDN["Static Assets (CDN)"]:::external

    %% Next.js App Container
    subgraph "Next.js App on Vercel"
        direction TB
        subgraph "Presentation Layer"
            direction TB
            Styles["globals.css"]:::frontend
            Layout["layout.js"]:::frontend
            Page["page.js"]:::frontend
            NF["NotificationForm.jsx"]:::frontend
            NL["NotificationList.jsx"]:::frontend
        end
        subgraph "Service Layer"
            direction TB
            AX["axiosInstance.js"]:::service
            NS["notificationService.js"]:::service
        end
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        API["Backend API (/api/v1/notifications)"]:::external
        DB["Database"]:::external
    end

    %% Project Configuration
    subgraph "Project Configuration"
        direction TB
        NextConfig["next.config.mjs"]:::config
        JSConfig["jsconfig.json"]:::config
        TWConfig["tailwind.config.js"]:::config
        PCConfig["postcss.config.mjs"]:::config
    end

    %% Data Flows
    Browser -->|"HTTP Request"| Layout
    Layout --> Page
    Page --> NF
    Page --> NL
    NF -->|"POST /api/v1/notifications"| NS
    NL -->|"GET /api/v1/notifications"| NS
    NS --> AX
    AX -->|"REST Calls"| API
    API -->|"CRUD Operations"| DB
    DB -->|"Response JSON"| API
    API -->|"JSON Response"| AX
    Layout --> CDN

    %% Click Events
    click Layout "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/app/layout.js"
    click Page "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/app/page.js"
    click Styles "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/app/globals.css"
    click NF "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/components/NotificationForm.jsx"
    click NL "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/components/NotificationList.jsx"
    click NS "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/app/api/notificationService.js"
    click AX "https://github.com/praduman1916/insyd-poc-frontend/blob/main/src/utils/axiosInstance.js"
    click CDN "https://github.com/praduman1916/insyd-poc-frontend/tree/main/public/"
    click NextConfig "https://github.com/praduman1916/insyd-poc-frontend/blob/main/next.config.mjs"
    click JSConfig "https://github.com/praduman1916/insyd-poc-frontend/blob/main/jsconfig.json"
    click TWConfig "https://github.com/praduman1916/insyd-poc-frontend/blob/main/tailwind.config.js"
    click PCConfig "https://github.com/praduman1916/insyd-poc-frontend/blob/main/postcss.config.mjs"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef service fill:#DFFFD0,stroke:#028A0F,color:#028A0F;
    classDef external fill:#FFE8D0,stroke:#D97706,color:#D97706;
    classDef config fill:#F0F0F0,stroke:#777,stroke-dasharray: 2 2,color:#333;
```
