# emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend architecture

> Architecture diagram of the GitHub repository emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend
- Repository: https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend

## Overview

This is a React invoice-processing application with sign-in, invoice handling across General Payments, SJO, and ROSPBU, team assignment, and administrative configuration. The principal workflow is to enter a protected invoice app, search or create invoices, and open invoice details for review; administrators also manage users, master data, integrations, and email configuration. The graph reflects routes and calls visible in the excerpts and source index. Several feature pages are unsampled, so their internal behavior and unshown connections are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/App.jsx) (Routes and providers), [`src/services/network.service.js`](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/network.service.js) (API client), [`src/context/AuthContext.jsx`](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/context/AuthContext.jsx) (Auth state), [`src/services/auth.service.js`](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/auth.service.js) (Session service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routes and providers<br/>[App.jsx]"]
  node_layout["App layout<br/>[AppLayout.jsx]"]
end

subgraph group_identity["Identity and session"]
  node_authroute["Access guard<br/>[AuthRoute.jsx]"]
  node_login["Sign-in page<br/>[Login.jsx]"]
  node_authcontext["Auth state<br/>[AuthContext.jsx]"]
  node_authservice["Session service<br/>[auth.service.js]"]
  node_network["API client<br/>[network.service.js]"]
  node_storage[("Browser storage<br/>[storage.service.js]")]
  node_msal["Microsoft sign-in<br/>[msal.service.js]"]
end

subgraph group_invoices["Invoice operations"]
  node_invoice_list["Invoice list<br/>[InvoiceList.jsx]"]
  node_invoice_detail["Invoice details<br/>[InvoiceDetails.jsx]"]
  node_rospbu_create["ROSPBU creation"]
  node_team["Team assignment<br/>[TeamAssignment.jsx]"]
end

subgraph group_admin["Administration"]
  node_users["User management<br/>[Users.jsx]"]
  node_configuration["Master data<br/>[Configuration.jsx]"]
  node_integrations["Integration settings"]
  node_email["Email settings"]
end

node_user(("User"))
node_microsoft(("Microsoft identity"))
node_api(("Application API"))

node_user -->|"uses"| node_app
node_app -->|"routes through"| node_authroute
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_layout
node_app -->|"routes to"| node_invoice_list
node_app -->|"routes to"| node_invoice_detail
node_app -->|"routes to"| node_rospbu_create
node_app -->|"routes to"| node_team
node_app -->|"routes to"| node_users
node_app -->|"routes to"| node_configuration
node_app -->|"routes to"| node_integrations
node_app -->|"routes to"| node_email
node_authroute -->|"checks access"| node_authcontext
node_layout -->|"reads session"| node_authcontext
node_login -->|"signs in"| node_authcontext
node_authcontext -->|"manages session"| node_authservice
node_authcontext -->|"checks session"| node_network
node_authcontext -->|"reads session"| node_storage
node_authcontext -->|"handles redirect"| node_msal
node_authservice -->|"calls auth endpoints"| node_network
node_authservice -->|"stores session"| node_storage
node_authservice -->|"clears tokens"| node_msal
node_msal -->|"authenticates with"| node_microsoft
node_network -->|"reads bearer token"| node_storage
node_network -->|"sends requests"| node_api
node_invoice_list -->|"loads and creates"| node_network
node_invoice_detail -->|"loads and updates"| node_network
node_team -->|"manages assignments"| node_network
node_users -->|"manages users"| node_network
node_configuration -->|"manages data"| node_network
node_email -.->|"uses API"| node_network
node_integrations -.->|"uses API"| node_network

click node_app "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/App.jsx"
click node_layout "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/components/AppLayout.jsx"
click node_authroute "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/components/AuthRoute.jsx"
click node_login "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/Login.jsx"
click node_authcontext "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/context/AuthContext.jsx"
click node_authservice "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/auth.service.js"
click node_network "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/network.service.js"
click node_storage "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/storage.service.js"
click node_msal "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/msal.service.js"
click node_invoice_list "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/InvoiceList.jsx"
click node_invoice_detail "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/InvoiceDetails.jsx"
click node_rospbu_create "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/RospbuInvoiceCreate.jsx"
click node_team "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/TeamAssignment.jsx"
click node_users "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/settings/Users.jsx"
click node_configuration "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/settings/Configuration.jsx"
click node_integrations "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/tree/main/src/pages/settings/integrations"
click node_email "https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/tree/main/src/pages/settings/email"

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_app,node_layout,node_user toneBlue
class node_authroute,node_login,node_authcontext,node_authservice,node_network,node_storage,node_msal toneAmber
class node_invoice_list,node_invoice_detail,node_rospbu_create,node_team,node_api toneMint
class node_users,node_configuration,node_integrations,node_email toneRose
class node_microsoft toneIndigo
```

## Components

### Application shell

- [Routes and providers](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [App layout](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/components/AppLayout.jsx): `src/components/AppLayout.jsx`

### Identity and session

- [Access guard](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/components/AuthRoute.jsx): `src/components/AuthRoute.jsx`
- [Sign-in page](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Auth state](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Session service](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/auth.service.js): `src/services/auth.service.js`
- [API client](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/network.service.js): `src/services/network.service.js`
- [Browser storage](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/storage.service.js): `src/services/storage.service.js`
- [Microsoft sign-in](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/services/msal.service.js): `src/services/msal.service.js`

### Invoice operations

- [Invoice list](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/InvoiceList.jsx): `src/pages/app/InvoiceList.jsx`
- [Invoice details](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/InvoiceDetails.jsx): `src/pages/app/InvoiceDetails.jsx`
- [ROSPBU creation](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/RospbuInvoiceCreate.jsx): `src/pages/app/RospbuInvoiceCreate.jsx`
- [Team assignment](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/app/TeamAssignment.jsx): `src/pages/app/TeamAssignment.jsx`

### Administration

- [User management](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/settings/Users.jsx): `src/pages/settings/Users.jsx`
- [Master data](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/blob/main/src/pages/settings/Configuration.jsx): `src/pages/settings/Configuration.jsx`
- [Integration settings](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/tree/main/src/pages/settings/integrations): `src/pages/settings/integrations`
- [Email settings](https://github.com/emergys-solutions-pvt-ltd/cargill-invoiceprocessing-custom-app-frontend/tree/main/src/pages/settings/email): `src/pages/settings/email`

### Other components

- **User**
- **Microsoft identity**
- **Application API**

## Connections

- User → Routes and providers: uses (evidence: `src/App.jsx`)
- Routes and providers → Access guard: routes through (evidence: `src/App.jsx`)
- Routes and providers → Sign-in page: routes to (evidence: `src/App.jsx`)
- Routes and providers → App layout: routes to (evidence: `src/App.jsx`)
- Routes and providers → Invoice list: routes to (evidence: `src/App.jsx`)
- Routes and providers → Invoice details: routes to (evidence: `src/App.jsx`)
- Routes and providers → ROSPBU creation: routes to (evidence: `src/App.jsx`)
- Routes and providers → Team assignment: routes to (evidence: `src/App.jsx`)
- Routes and providers → User management: routes to (evidence: `src/App.jsx`)
- Routes and providers → Master data: routes to (evidence: `src/App.jsx`)
- Routes and providers → Integration settings: routes to (evidence: `src/App.jsx`)
- Routes and providers → Email settings: routes to (evidence: `src/App.jsx`)
- Access guard → Auth state: checks access (evidence: `src/App.jsx`)
- App layout → Auth state: reads session (evidence: `src/components/AppLayout.jsx`)
- Sign-in page → Auth state: signs in (evidence: `src/pages/Login.jsx`)
- Auth state → Session service: manages session (evidence: `src/context/AuthContext.jsx`)
- Auth state → API client: checks session (evidence: `src/context/AuthContext.jsx`)
- Auth state → Browser storage: reads session (evidence: `src/context/AuthContext.jsx`)
- Auth state → Microsoft sign-in: handles redirect (evidence: `src/context/AuthContext.jsx`)
- Session service → API client: calls auth endpoints (evidence: `src/services/auth.service.js`)
- Session service → Browser storage: stores session (evidence: `src/services/auth.service.js`)
- Session service → Microsoft sign-in: clears tokens (evidence: `src/services/auth.service.js`)
- Microsoft sign-in → Microsoft identity: authenticates with (evidence: `src/services/msal.service.js`)
- API client → Browser storage: reads bearer token (evidence: `src/services/network.service.js`)
- API client → Application API: sends requests (evidence: `src/services/network.service.js`)
- Invoice list → API client: loads and creates (evidence: `src/pages/app/InvoiceList.jsx`)
- Invoice details → API client: loads and updates (evidence: `src/pages/app/InvoiceDetails.jsx`)
- Team assignment → API client: manages assignments (evidence: `src/pages/app/TeamAssignment.jsx`)
- User management → API client: manages users (evidence: `src/pages/settings/Users.jsx`)
- Master data → API client: manages data (evidence: `src/pages/settings/Configuration.jsx`)
- Email settings → API client: uses API (evidence: `src/pages/settings/email/EmailRegistrationTab.jsx`)
- Integration settings → API client: uses API
