# lele97/pagatu-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/lele97/pagatu-frontend
- Repository: https://github.com/lele97/pagatu-frontend

## Overview

PagaTu is a React SPA for teams sharing coffee-buying turns. A signed-in member opens Home to review groups, payments, statistics and awards, then enters a group to view its turn and record, skip or share a payment; invitation handling and account flows are separate branches. The README documents the route shell and two-layer HTTP client, but source excerpts are incomplete, so unshown component-to-service links are omitted rather than inferred.

Main entry points: [`app/main.jsx`](https://github.com/lele97/pagatu-frontend/blob/main/app/main.jsx) (Router), [`app/components/group/group.jsx`](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/group.jsx) (Group page), [`app/routes/root.jsx`](https://github.com/lele97/pagatu-frontend/blob/main/app/routes/root.jsx) (App root), [`app/components/buttons/Oauth2LoginButton.jsx`](https://github.com/lele97/pagatu-frontend/blob/main/app/components/buttons/Oauth2LoginButton.jsx) (OAuth login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_router["Router<br/>[main.jsx]"]
  node_root["App root<br/>[root.jsx]"]
  node_footer["Footer<br/>[footer.jsx]"]
  node_error["Error page<br/>[error-page.jsx]"]
  node_settings["Settings state"]
  node_groupcontext["Group navigation state<br/>[GroupContext.jsx]"]
end

subgraph group_accounts["Accounts"]
  node_authlanding["Welcome and auth<br/>[AuthLanding.jsx]"]
  node_login["OAuth login"]
  node_oauthicons["Provider icons<br/>[OAuthIcons.jsx]"]
  node_signup["Registration<br/>[signup-form.jsx]"]
  node_datepicker["Birth date picker"]
  node_authguard["Auth guard<br/>[RequireAuth.jsx]"]
  node_oauthconfig["OAuth config<br/>[oauth.js]"]
end

subgraph group_coffee["Groups and coffee"]
  node_home["Home dashboard<br/>[home.jsx]"]
  node_groupview["Group page<br/>[group.jsx]"]
  node_grouphook["Group page state<br/>[useGroupPage.js]"]
  node_groupheader["Group header<br/>[groupHeader.jsx]"]
  node_paymentmodal["Register payment"]
  node_paymentactions["Payment actions<br/>[paymentActions.jsx]"]
  node_paymentcards["Payment cards<br/>[paymentCards.jsx]"]
  node_invitation["Invitation response<br/>[invitation.jsx]"]
end

subgraph group_network["HTTP client"]
  node_service["Endpoint methods<br/>[apiService.js]"]
  node_api["HTTP requests and cache<br/>[api.js]"]
end

node_member(("Member"))
node_gateway{{"Spring gateway"}}
node_oauthproviders{{"OAuth providers"}}

node_member -->|"opens app"| node_router
node_router -->|"routes through"| node_root
node_root -->|"provides state"| node_settings
node_root -->|"provides state"| node_groupcontext
node_root -->|"renders"| node_footer
node_router -->|"routes to"| node_authlanding
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_groupview
node_router -->|"routes to"| node_invitation
node_router -->|"routes errors to"| node_error
node_router -->|"guards pages with"| node_authguard
node_authlanding -.->|"offers login"| node_login
node_authlanding -.->|"offers registration"| node_signup
node_signup -->|"renders"| node_datepicker
node_login -->|"renders icons"| node_oauthicons
node_login -->|"uses provider config"| node_oauthconfig
node_login -.->|"starts sign-in"| node_oauthproviders
node_home -->|"requests dashboard data"| node_service
node_groupview -->|"uses page state"| node_grouphook
node_groupview -->|"renders"| node_groupheader
node_groupview -->|"renders"| node_paymentmodal
node_groupview -->|"renders"| node_paymentactions
node_groupview -->|"renders"| node_paymentcards
node_grouphook -.->|"requests group data"| node_service
node_invitation -->|"accepts or rejects"| node_service
node_service -->|"calls request layer"| node_api
node_api -->|"sends REST and JWT"| node_gateway

click node_router "https://github.com/lele97/pagatu-frontend/blob/main/app/main.jsx"
click node_root "https://github.com/lele97/pagatu-frontend/blob/main/app/routes/root.jsx"
click node_footer "https://github.com/lele97/pagatu-frontend/blob/main/app/components/footer/footer.jsx"
click node_error "https://github.com/lele97/pagatu-frontend/blob/main/app/components/error/error-page.jsx"
click node_authlanding "https://github.com/lele97/pagatu-frontend/blob/main/app/components/auth/AuthLanding.jsx"
click node_login "https://github.com/lele97/pagatu-frontend/blob/main/app/components/buttons/Oauth2LoginButton.jsx"
click node_oauthicons "https://github.com/lele97/pagatu-frontend/blob/main/app/components/buttons/OAuthIcons.jsx"
click node_signup "https://github.com/lele97/pagatu-frontend/blob/main/app/components/signup/signup-form.jsx"
click node_datepicker "https://github.com/lele97/pagatu-frontend/blob/main/app/components/signup/modal/datePickerModal.jsx"
click node_authguard "https://github.com/lele97/pagatu-frontend/blob/main/app/components/auth/RequireAuth.jsx"
click node_oauthconfig "https://github.com/lele97/pagatu-frontend/blob/main/app/config/oauth.js"
click node_home "https://github.com/lele97/pagatu-frontend/blob/main/app/components/home/home.jsx"
click node_groupview "https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/group.jsx"
click node_grouphook "https://github.com/lele97/pagatu-frontend/blob/main/app/hooks/useGroupPage.js"
click node_groupheader "https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/groupHeader.jsx"
click node_paymentmodal "https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/modals/RegisterPaymentModal.jsx"
click node_paymentactions "https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/paymentActions.jsx"
click node_paymentcards "https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/paymentCards.jsx"
click node_invitation "https://github.com/lele97/pagatu-frontend/blob/main/app/components/invitation/invitation.jsx"
click node_settings "https://github.com/lele97/pagatu-frontend/blob/main/app/context/SettingsContext.jsx"
click node_groupcontext "https://github.com/lele97/pagatu-frontend/blob/main/app/context/GroupContext.jsx"
click node_service "https://github.com/lele97/pagatu-frontend/blob/main/app/utils/apiService.js"
click node_api "https://github.com/lele97/pagatu-frontend/blob/main/app/utils/api.js"

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_router,node_root,node_footer,node_error,node_settings,node_groupcontext toneBlue
class node_authlanding,node_login,node_oauthicons,node_signup,node_datepicker,node_authguard,node_oauthconfig toneAmber
class node_home,node_groupview,node_grouphook,node_groupheader,node_paymentmodal,node_paymentactions,node_paymentcards,node_invitation toneMint
class node_service,node_api toneRose
class node_member,node_gateway,node_oauthproviders toneIndigo
```

## Components

### App shell

- [Router](https://github.com/lele97/pagatu-frontend/blob/main/app/main.jsx): `app/main.jsx`
- [App root](https://github.com/lele97/pagatu-frontend/blob/main/app/routes/root.jsx): `app/routes/root.jsx`
- [Footer](https://github.com/lele97/pagatu-frontend/blob/main/app/components/footer/footer.jsx): `app/components/footer/footer.jsx`
- [Error page](https://github.com/lele97/pagatu-frontend/blob/main/app/components/error/error-page.jsx): `app/components/error/error-page.jsx`
- [Settings state](https://github.com/lele97/pagatu-frontend/blob/main/app/context/SettingsContext.jsx): `app/context/SettingsContext.jsx`
- [Group navigation state](https://github.com/lele97/pagatu-frontend/blob/main/app/context/GroupContext.jsx): `app/context/GroupContext.jsx`

### Accounts

- [Welcome and auth](https://github.com/lele97/pagatu-frontend/blob/main/app/components/auth/AuthLanding.jsx): `app/components/auth/AuthLanding.jsx`
- [OAuth login](https://github.com/lele97/pagatu-frontend/blob/main/app/components/buttons/Oauth2LoginButton.jsx): `app/components/buttons/Oauth2LoginButton.jsx`
- [Provider icons](https://github.com/lele97/pagatu-frontend/blob/main/app/components/buttons/OAuthIcons.jsx): `app/components/buttons/OAuthIcons.jsx`
- [Registration](https://github.com/lele97/pagatu-frontend/blob/main/app/components/signup/signup-form.jsx): `app/components/signup/signup-form.jsx`
- [Birth date picker](https://github.com/lele97/pagatu-frontend/blob/main/app/components/signup/modal/datePickerModal.jsx): `app/components/signup/modal/datePickerModal.jsx`
- [Auth guard](https://github.com/lele97/pagatu-frontend/blob/main/app/components/auth/RequireAuth.jsx): `app/components/auth/RequireAuth.jsx`
- [OAuth config](https://github.com/lele97/pagatu-frontend/blob/main/app/config/oauth.js): `app/config/oauth.js`

### Groups and coffee

- [Home dashboard](https://github.com/lele97/pagatu-frontend/blob/main/app/components/home/home.jsx): `app/components/home/home.jsx`
- [Group page](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/group.jsx): `app/components/group/group.jsx`
- [Group page state](https://github.com/lele97/pagatu-frontend/blob/main/app/hooks/useGroupPage.js): `app/hooks/useGroupPage.js`
- [Group header](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/groupHeader.jsx): `app/components/group/groupHeader.jsx`
- [Register payment](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/modals/RegisterPaymentModal.jsx): `app/components/group/modals/RegisterPaymentModal.jsx`
- [Payment actions](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/paymentActions.jsx): `app/components/group/paymentActions.jsx`
- [Payment cards](https://github.com/lele97/pagatu-frontend/blob/main/app/components/group/paymentCards.jsx): `app/components/group/paymentCards.jsx`
- [Invitation response](https://github.com/lele97/pagatu-frontend/blob/main/app/components/invitation/invitation.jsx): `app/components/invitation/invitation.jsx`

### HTTP client

- [Endpoint methods](https://github.com/lele97/pagatu-frontend/blob/main/app/utils/apiService.js): `app/utils/apiService.js`
- [HTTP requests and cache](https://github.com/lele97/pagatu-frontend/blob/main/app/utils/api.js): `app/utils/api.js`

### Other components

- **Member**
- **Spring gateway**
- **OAuth providers**

## Connections

- Member → Router: opens app (evidence: `README.md`)
- Router → App root: routes through (evidence: `app/main.jsx`)
- App root → Settings state: provides state (evidence: `app/routes/root.jsx`)
- App root → Group navigation state: provides state (evidence: `app/routes/root.jsx`)
- App root → Footer: renders (evidence: `app/routes/root.jsx`)
- Router → Welcome and auth: routes to (evidence: `app/main.jsx`)
- Router → Home dashboard: routes to (evidence: `app/main.jsx`)
- Router → Group page: routes to (evidence: `app/main.jsx`)
- Router → Invitation response: routes to (evidence: `README.md`)
- Router → Error page: routes errors to (evidence: `app/main.jsx`)
- Router → Auth guard: guards pages with (evidence: `app/main.jsx`)
- Welcome and auth → OAuth login: offers login
- Welcome and auth → Registration: offers registration
- Registration → Birth date picker: renders (evidence: `app/components/signup/signup-form.jsx`)
- OAuth login → Provider icons: renders icons (evidence: `app/components/buttons/Oauth2LoginButton.jsx`)
- OAuth login → OAuth config: uses provider config (evidence: `app/components/buttons/Oauth2LoginButton.jsx`)
- OAuth login → OAuth providers: starts sign-in
- Home dashboard → Endpoint methods: requests dashboard data (evidence: `README.md`)
- Group page → Group page state: uses page state (evidence: `README.md`)
- Group page → Group header: renders (evidence: `app/components/group/group.jsx`)
- Group page → Register payment: renders (evidence: `app/components/group/group.jsx`)
- Group page → Payment actions: renders (evidence: `app/components/group/group.jsx`)
- Group page → Payment cards: renders (evidence: `app/components/group/group.jsx`)
- Group page state → Endpoint methods: requests group data
- Invitation response → Endpoint methods: accepts or rejects (evidence: `app/components/invitation/invitation.jsx`)
- Endpoint methods → HTTP requests and cache: calls request layer (evidence: `README.md`)
- HTTP requests and cache → Spring gateway: sends REST and JWT (evidence: `README.md`)
