# ssi-anik/bd-income-tax-calculator architecture

> Architecture diagram of the GitHub repository ssi-anik/bd-income-tax-calculator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ssi-anik/bd-income-tax-calculator
- Repository: https://github.com/ssi-anik/bd-income-tax-calculator

## Overview

##### Project type and purpose
- This is a single-page, client-side React application bootstrapped with Create React App.
- It is intended to run in the browser as a front-end only project (no backend code in this repo).
- Its primary function is to display company, salary, and user information via a set of React components.

##### File structure
- Top-level files and dirs:
- public/ – static assets (index.html, manifest.json, robots.txt) that get served directly.
- src/ – React source code, including the root index.js and the App component plus subcomponents.
- package.json – lists React, React-DOM and build/deploy scripts.
- .github/workflows/deploy_gh_pages.yml – CI/CD pipeline to build and publish the static site to GitHub Pages.
- No backend directory (e.g., “api” or “server”), so this is purely front-end.
- src/ contains these React components:
- App.js – root container
- TopNav.js – top navigation bar
- LeftSideContent.js / RightSideContent.js – layout columns
- CompanyList.js – list view of companies
- Company.js – individual company details
- SalaryInformation.js – salary detail widget
- UserInformation.js – user profile widget

##### README for additional insights
- It is a standard Create React App README; there is no extra architecture info.
- The build pipeline uses Webpack/Babel under the hood (hidden until you eject).

a. Main components
- User’s Web Browser (Client)
- Static Hosting / CDN (e.g., GitHub Pages)
- React Single-Page Application
– Entry point: index.html → bundle.js
– Root component: App
– Child components: TopNav, LeftSideContent, RightSideContent, CompanyList, Company, SalaryInformation, UserInformation
- Build Tools (locally): Yarn, Webpack/Babel
b. Relationships and interactions
- User ↔ Browser UI (events, clicks)
- Browser → Static Host (HTTP GET for index.html + JS/CSS bundles)
- React App internal data flow:
– App holds state (e.g., list of companies, selected user)
– Props flow downward from App to children
– Child components emit callbacks/events upward to App to update state
c. Architectural patterns and design principles
- Single-Page Application (SPA)
- Unidirectional data flow (Flux-like)
- Component-based decomposition (container vs. presentational)
- Separation of concerns: static vs. dynamic code, UI vs. build config
d. Key technologies and libraries
- React, ReactDOM
- Webpack, Babel (bundling/transpilation)
- Yarn (package manager)
- GitHub Actions + gh-pages (CI/CD)

## Diagram (Mermaid)

```mermaid
graph TB
    %% CI/CD Pipeline
    CI_CD["GitHub Actions CI/CD"]:::ci
    click CI_CD "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/.github/workflows/deploy_gh_pages.yml"

    %% Build Tools
    BuildTools["Local Build Tools<br/>(Yarn, Webpack/Babel)"]:::code

    %% Source Files
    subgraph "Source Files" 
        SF_IndexJS["src/index.js"]:::code
        click SF_IndexJS "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/index.js"
        SF_App["src/App.js"]:::code
        click SF_App "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/App.js"
        SF_TopNav["src/TopNav.js"]:::code
        click SF_TopNav "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/TopNav.js"
        SF_Left["src/LeftSideContent.js"]:::code
        click SF_Left "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/LeftSideContent.js"
        SF_Right["src/RightSideContent.js"]:::code
        click SF_Right "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/RightSideContent.js"
        SF_CompanyList["src/CompanyList.js"]:::code
        click SF_CompanyList "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/CompanyList.js"
        SF_Company["src/Company.js"]:::code
        click SF_Company "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/Company.js"
        SF_Salary["src/SalaryInformation.js"]:::code
        click SF_Salary "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/SalaryInformation.js"
        SF_User["src/UserInformation.js"]:::code
        click SF_User "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/src/UserInformation.js"
        SF_Package["package.json"]:::code
        click SF_Package "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/package.json"
    end

    %% Static Hosting
    subgraph "Static Hosting / CDN" 
        Host_Dir["public/"]:::infra
        click Host_Dir "https://github.com/ssi-anik/bd-income-tax-calculator/tree/master/public/"
        Host_HTML["public/index.html"]:::infra
        click Host_HTML "https://github.com/ssi-anik/bd-income-tax-calculator/blob/master/public/index.html"
    end

    %% Browser
    Browser["User Web Browser"]:::runtime

    %% React Application Runtime
    subgraph "React Application (Runtime)" 
        R_Index["Entry Point<br/>index.js"]:::runtime
        R_App["App"]:::runtime
        R_TopNav["TopNav"]:::runtime
        R_Left["LeftSideContent"]:::runtime
        R_Right["RightSideContent"]:::runtime
        R_CompanyList["CompanyList"]:::runtime
        R_Company["Company"]:::runtime
        R_Salary["SalaryInformation"]:::runtime
        R_User["UserInformation"]:::runtime
    end

    %% Connections
    CI_CD -->|Triggers build & deploy| BuildTools
    BuildTools -->|Bundles source| Host_Dir
    SF_IndexJS --> BuildTools
    SF_App --> BuildTools
    SF_TopNav --> BuildTools
    SF_Left --> BuildTools
    SF_Right --> BuildTools
    SF_CompanyList --> BuildTools
    SF_Company --> BuildTools
    SF_Salary --> BuildTools
    SF_User --> BuildTools
    SF_Package --> BuildTools

    Host_Dir -->|Serves assets| Browser
    Host_HTML -->|Serves HTML| Browser

    Browser -->|Loads bundle| R_Index
    R_Index -->|Renders| R_App

    %% React component hierarchy and data flow
    R_App -->|"props"| R_TopNav
    R_App -->|"props"| R_Left
    R_App -->|"props"| R_Right

    R_Left -->|"props"| R_CompanyList
    R_CompanyList -->|"props"| R_Company
    R_Right -->|"props"| R_Salary
    R_Right -->|"props"| R_User

    R_TopNav -->|"event callbacks"| R_App
    R_CompanyList -->|"select callback"| R_App
    R_Company -->|"detail callback"| R_App
    R_Salary -->|"update callback"| R_App
    R_User -->|"update callback"| R_App

    %% Styles
    classDef infra fill:#fde2e2,stroke:#d80032,stroke-width:1px;
    classDef code fill:#e0f7fa,stroke:#006064,stroke-width:1px;
    classDef runtime fill:#e8f5e9,stroke:#2e7d32,stroke-width:1px;
    classDef ci fill:#fff3e0,stroke:#ef6c00,stroke-width:1px;
```
