# shivampandyajani/fyprojecte architecture

> Architecture diagram of the GitHub repository shivampandyajani/fyprojecte, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivampandyajani/fyprojecte
- Repository: https://github.com/shivampandyajani/fyprojecte

## Overview

1. This repository is a workforce analytics application with two main user-facing roles: employees and managers. The product surface is split into a React frontend and a Python backend that appears to provide analytics, performance, compensation, attrition, and ML-driven insights.

2. The frontend is a single-page application in `frontend/src`. The route/page structure is role-oriented: `LoginPage`, `EmployeeProfilePage`, `LeaderboardPage`, employee `MyPerformancePage`, and several manager pages such as `Overview`, `Workforce`, `Performance`, `Attrition`, `Compensation`, `Directory`, and `MLInsights`.

3. The frontend’s visual structure is built around reusable dashboard scaffolding. `DashboardLayout` and `Sidebar` define the main shell/navigation, while `src/components/ui` contains a large set of shared UI primitives that indicate a component-library approach rather than page-specific custom markup.

4. Frontend state and service boundaries are centralized. `contexts/AuthContext.js` manages authentication/user context for the app, and `src/lib/api.js` is the main integration point to the backend API. That separation suggests pages do not talk directly to the backend; they go through a shared API layer.

5. Styling and build tooling are frontend-centric and modern React-based. The app uses `package.json`, `craco.config.js`, `tailwind.config.js`, and PostCSS, indicating a Tailwind-powered React build. The presence of a `plugins/health-check` folder suggests build/runtime health endpoints or checks are wired into the frontend toolchain.

6. The backend is a Python service rooted at `backend/server.py`. Its role is to expose data and analytics endpoints consumed by the frontend. Because the repo also includes `backend/requirements*.txt`, the backend is a self-contained Python runtime with its own dependency set.

7. `backend/ml_models.py` is the main analytics/ML boundary. It likely encapsulates model loading, scoring, and other predictive logic used by manager-facing views such as attrition and ML insights. This file is the clearest indicator that predictions are computed server-side rather than in the browser.

8. The backend’s data source is local and file-based. `backend/data/IBMDataset.csv` is the only visible data asset, so the system likely reads from this dataset for analytics and model operations instead of using a database service. No separate DB, queue, or external analytics platform is evident in the tree.

9. The data flow is therefore straightforward: user action in a role-specific frontend page -> API call through `src/lib/api.js` -> Python backend endpoint in `server.py` -> dataset/ML logic in `ml_models.py` -> JSON response back to the UI for charts, tables, and dashboard metrics.

10. There is a separate documentation/report-generation workflow under `Documentation`. Scripts like `extract.py` and `generate_report.py` appear to transform project documentation into report artifacts, supported by multiple source documents. This is a side pipeline, not part of the app’s runtime architecture.

11. Testing and validation are lightweight and mostly backend-oriented. `backend_test.py` and the `tests/` directory indicate automated checks, while `test_reports/` stores generated iteration results. There is no obvious dedicated frontend test suite in the tree.

12. Overall, the architecture is a classic two-tier analytics app: React presentation layer with role-based dashboards, and a Python service layer that owns analytics/model execution over a local CSV dataset. The main diagram boundaries should be drawn around the frontend SPA, the backend API/ML layer, and the documentation/testing support workflows.

Main entry points: [`frontend/src/lib/api.js`](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/lib/api.js) (API Client), [`frontend/src/App.js`](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/App.js) (React App), [`backend/server.py`](https://github.com/shivampandyajani/fyprojecte/blob/main/backend/server.py) (Python API), [`frontend/src/components/DashboardLayout.js`](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/components/DashboardLayout.js) (Dashboard Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend SPA"]
  node_frontend_app["React App<br/>SPA shell<br/>[App.js]"]
  node_dashboard_shell["Dashboard Shell<br/>layout<br/>[DashboardLayout.js]"]
  node_sidebar_nav["Sidebar<br/>navigation<br/>[Sidebar.js]"]
  node_auth_context(("Auth Context<br/>state<br/>[AuthContext.js]"))
  node_api_client["API Client<br/>service layer<br/>[api.js]"]
  node_login_page["Login<br/>auth page<br/>[LoginPage.js]"]
  node_employee_pages["Employee Views<br/>role pages"]
  node_leaderboard_page["Leaderboard<br/>employee page<br/>[LeaderboardPage.js]"]
  node_manager_overview["Manager Overview<br/>manager page<br/>[OverviewPage.js]"]
  node_manager_ops["Manager Ops<br/>manager pages<br/>[WorkforcePage.js]"]
  node_ui_library["UI Library<br/>components"]
  node_frontend_tooling["Frontend Tooling<br/>build/runtime<br/>[package.json]"]
end

subgraph group_backend["Backend Service"]
  node_backend_api["Python API<br/>web service<br/>[server.py]"]
  node_ml_models["ML Models<br/>analytics engine<br/>[ml_models.py]"]
  node_csv_dataset[("CSV Dataset<br/>data source<br/>[IBMDataset.csv]")]
  node_backend_tests["Backend Tests<br/>validation<br/>[backend_test.py]"]
end

subgraph group_support["Support Workflows"]
  node_doc_pipeline["Doc Pipeline<br/>report workflow<br/>[extract.py]"]
  node_reports["Reports<br/>artifacts<br/>[iteration_1.json]"]
end

node_frontend_app -->|"uses"| node_dashboard_shell
node_frontend_app -->|"wraps"| node_auth_context
node_frontend_app -->|"calls"| node_api_client
node_dashboard_shell -->|"contains"| node_sidebar_nav
node_dashboard_shell -->|"composes"| node_ui_library
node_login_page -->|"uses"| node_auth_context
node_employee_pages -->|"fetches"| node_api_client
node_leaderboard_page -->|"fetches"| node_api_client
node_manager_overview -->|"fetches"| node_api_client
node_manager_ops -->|"fetches"| node_api_client
node_frontend_tooling -->|"builds"| node_frontend_app
node_api_client -->|"requests"| node_backend_api
node_backend_api -->|"delegates"| node_ml_models
node_backend_api -->|"reads"| node_csv_dataset
node_ml_models -->|"trains/queries"| node_csv_dataset
node_backend_tests -.->|"validates"| node_backend_api
node_doc_pipeline -->|"produces"| node_reports

click node_frontend_app "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/App.js"
click node_dashboard_shell "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/components/DashboardLayout.js"
click node_sidebar_nav "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/components/Sidebar.js"
click node_auth_context "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/contexts/AuthContext.js"
click node_api_client "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/lib/api.js"
click node_login_page "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/LoginPage.js"
click node_employee_pages "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/EmployeeProfilePage.js"
click node_leaderboard_page "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/LeaderboardPage.js"
click node_manager_overview "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/manager/OverviewPage.js"
click node_manager_ops "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/manager/WorkforcePage.js"
click node_ui_library "https://github.com/shivampandyajani/fyprojecte/tree/main/frontend/src/components/ui"
click node_frontend_tooling "https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/package.json"
click node_backend_api "https://github.com/shivampandyajani/fyprojecte/blob/main/backend/server.py"
click node_ml_models "https://github.com/shivampandyajani/fyprojecte/blob/main/backend/ml_models.py"
click node_csv_dataset "https://github.com/shivampandyajani/fyprojecte/blob/main/backend/data/IBMDataset.csv"
click node_backend_tests "https://github.com/shivampandyajani/fyprojecte/blob/main/backend_test.py"
click node_doc_pipeline "https://github.com/shivampandyajani/fyprojecte/blob/main/Documentation/extract.py"
click node_reports "https://github.com/shivampandyajani/fyprojecte/blob/main/test_reports/iteration_1.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_app,node_dashboard_shell,node_sidebar_nav,node_auth_context,node_api_client,node_login_page,node_employee_pages,node_leaderboard_page,node_manager_overview,node_manager_ops,node_ui_library,node_frontend_tooling toneBlue
class node_backend_api,node_ml_models,node_csv_dataset,node_backend_tests toneAmber
class node_doc_pipeline,node_reports toneMint
```

## Components

### Frontend SPA

React single-page app for employee and manager dashboards.

- [React App](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/App.js): SPA shell · Frontend entrypoint and routing for the workforce analytics app. · `frontend/src/App.js`
- [Dashboard Shell](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/components/DashboardLayout.js): layout · Shared dashboard layout and navigation scaffold. · `frontend/src/components/DashboardLayout.js`
- [Sidebar](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/components/Sidebar.js): navigation · Primary in-app navigation for role-based dashboards. · `frontend/src/components/Sidebar.js`
- [Auth Context](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/contexts/AuthContext.js): state · Central auth and user session context. · `frontend/src/contexts/AuthContext.js`
- [API Client](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/lib/api.js): service layer · Shared frontend integration point for backend calls. · `frontend/src/lib/api.js`
- [Login](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/LoginPage.js): auth page · User sign-in surface. · `frontend/src/pages/LoginPage.js`
- [Employee Views](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/EmployeeProfilePage.js): role pages · Employee-facing profile and performance views. · `frontend/src/pages/EmployeeProfilePage.js`
- [Leaderboard](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/LeaderboardPage.js): employee page · Ranking and comparison view for employees. · `frontend/src/pages/LeaderboardPage.js`
- [Manager Overview](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/manager/OverviewPage.js): manager page · Executive summary dashboard for managers. · `frontend/src/pages/manager/OverviewPage.js`
- [Manager Ops](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/src/pages/manager/WorkforcePage.js): manager pages · Workforce, performance, directory, compensation, attrition, and ML insight views. · `frontend/src/pages/manager/WorkforcePage.js`
- [UI Library](https://github.com/shivampandyajani/fyprojecte/tree/main/frontend/src/components/ui): components · Reusable shared UI primitives used across pages. · `frontend/src/components/ui`
- [Frontend Tooling](https://github.com/shivampandyajani/fyprojecte/blob/main/frontend/package.json): build/runtime · React build, Tailwind, CRACO, and health-check plugin wiring. · `frontend/package.json`

### Backend Service

Python analytics API and ML layer over local dataset.

- [Python API](https://github.com/shivampandyajani/fyprojecte/blob/main/backend/server.py): web service · Backend server exposing analytics endpoints. · `backend/server.py`
- [ML Models](https://github.com/shivampandyajani/fyprojecte/blob/main/backend/ml_models.py): analytics engine · Server-side model scoring and predictive analytics boundary. · `backend/ml_models.py`
- [CSV Dataset](https://github.com/shivampandyajani/fyprojecte/blob/main/backend/data/IBMDataset.csv): data source · Local dataset used for analytics and model inputs. · `backend/data/IBMDataset.csv`
- [Backend Tests](https://github.com/shivampandyajani/fyprojecte/blob/main/backend_test.py): validation · Automated backend checks. · `backend_test.py`

### Support Workflows

Documentation generation and test/report artifacts.

- [Doc Pipeline](https://github.com/shivampandyajani/fyprojecte/blob/main/Documentation/extract.py): report workflow · Documentation extraction and report generation scripts. · `Documentation/extract.py`
- [Reports](https://github.com/shivampandyajani/fyprojecte/blob/main/test_reports/iteration_1.json): artifacts · Generated report outputs and iteration results. · `test_reports/iteration_1.json`

## Connections

- React App → Dashboard Shell: uses · The app is built around the shared dashboard layout.
- React App → Auth Context: wraps · Authentication state is centralized for the app.
- React App → API Client: calls · Pages fetch data through the shared API layer.
- Dashboard Shell → Sidebar: contains · The main shell includes sidebar navigation.
- Dashboard Shell → UI Library: composes · Layout and pages rely on reusable UI primitives.
- Login → Auth Context: uses · Login flow updates auth state.
- Employee Views → API Client: fetches · Employee views consume backend data through the API client.
- Leaderboard → API Client: fetches · Leaderboard data comes from backend endpoints.
- Manager Overview → API Client: fetches · Overview cards and metrics are backend-driven.
- Manager Ops → API Client: fetches · Operational manager views consume analytics endpoints.
- Frontend Tooling → React App: builds · Frontend build tooling packages the SPA.
- API Client → Python API: requests · Frontend integration layer talks to the Python service.
- Python API → ML Models: delegates · API routes hand off analytics and predictions to model logic.
- Python API → CSV Dataset: reads · Backend loads data from the local CSV source.
- ML Models → CSV Dataset: trains/queries · Model logic depends on the dataset for scoring and analytics.
- Backend Tests → Python API: validates · Tests cover backend service behavior.
- Doc Pipeline → Reports: produces · Documentation scripts generate report artifacts.
