# tondi11/loginauth-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/tondi11/loginauth-frontend
- Repository: https://github.com/tondi11/loginauth-frontend

## Overview

This is a React account-management frontend. A user enters through routed login or registration; authentication state and API calls support email verification, password recovery, protected dashboard access, profile editing, and account settings, including session and two-factor controls. The API client handles bearer tokens and refresh retries. Shared components provide loading placeholders and inline or toast feedback. Several feature files were not excerpted, so their presence and routing are supported by the source index or App.js, but their internal behavior is not detailed here.

Main entry points: [`src/App.js`](https://github.com/tondi11/loginauth-frontend/blob/main/src/App.js) (Route application), [`src/contexts/AuthContext.js`](https://github.com/tondi11/loginauth-frontend/blob/main/src/contexts/AuthContext.js) (Auth state), [`src/services/api.js`](https://github.com/tondi11/loginauth-frontend/blob/main/src/services/api.js) (API client), [`src/components/Settings.jsx`](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Settings.jsx) (Account settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App routing"]
  node_app["Route application<br/>[App.js]"]
  node_authgate["Protected route<br/>[ProtectedRoute.js]"]
  node_protectedpage["Protected page<br/>[ProtectedPage.js]"]
end

subgraph group_identity["Authentication"]
  node_login["Login<br/>[Login.js]"]
  node_register["Registration<br/>[Register.js]"]
  node_google["Google login<br/>[GoogleLogin.js]"]
  node_verify["Email verification<br/>[VerifyEmail.js]"]
  node_forgot["Forgot password<br/>[ForgotPassword.js]"]
  node_reset["Reset password<br/>[ResetPassword.js]"]
  node_auth["Auth state<br/>[AuthContext.js]"]
end

subgraph group_account["Account workspace"]
  node_dashboard["Dashboard<br/>[Dashboard.js]"]
  node_profile["Profile editor<br/>[Profile.jsx]"]
  node_settings["Account settings<br/>[Settings.jsx]"]
end

subgraph group_shared["Shared UI and API"]
  node_api["API client<br/>[api.js]"]
  node_useragent["User-agent parser<br/>[UserAgent.js]"]
  node_skeletons["Loading placeholders"]
  node_messages["Inline messages<br/>[InlineMessages.jsx]"]
  node_toast["Toast notifications<br/>[toast.js]"]
end

node_user(("User"))
node_backend["Application backend"]

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_verify
node_app -->|"routes to"| node_forgot
node_app -->|"routes to"| node_reset
node_app -->|"guards routes"| node_authgate
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_settings
node_authgate -->|"checks auth"| node_auth
node_authgate -->|"renders"| node_protectedpage
node_login -->|"uses auth"| node_auth
node_login -->|"renders"| node_google
node_register -->|"registers via"| node_auth
node_google -->|"calls"| node_api
node_auth -->|"calls"| node_api
node_auth -->|"notifies with"| node_toast
node_api -->|"sends requests"| node_backend
node_api -->|"notifies with"| node_toast
node_dashboard -->|"uses auth"| node_auth
node_dashboard -->|"calls"| node_api
node_dashboard -->|"formats agent"| node_useragent
node_profile -->|"uses auth"| node_auth
node_profile -->|"calls"| node_api
node_profile -->|"renders"| node_skeletons
node_profile -->|"renders"| node_messages
node_settings -->|"uses auth"| node_auth
node_settings -->|"calls"| node_api
node_settings -->|"renders"| node_skeletons
node_settings -->|"renders"| node_messages
node_settings -->|"notifies with"| node_toast

click node_app "https://github.com/tondi11/loginauth-frontend/blob/main/src/App.js"
click node_authgate "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ProtectedRoute.js"
click node_protectedpage "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ProtectedPage.js"
click node_login "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Login.js"
click node_register "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Register.js"
click node_google "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/GoogleLogin.js"
click node_verify "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/VerifyEmail.js"
click node_forgot "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ForgotPassword.js"
click node_reset "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ResetPassword.js"
click node_auth "https://github.com/tondi11/loginauth-frontend/blob/main/src/contexts/AuthContext.js"
click node_dashboard "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Dashboard.js"
click node_profile "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Profile.jsx"
click node_settings "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Settings.jsx"
click node_api "https://github.com/tondi11/loginauth-frontend/blob/main/src/services/api.js"
click node_useragent "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/UserAgent.js"
click node_skeletons "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/SkeletonLoaders.jsx"
click node_messages "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/InlineMessages.jsx"
click node_toast "https://github.com/tondi11/loginauth-frontend/blob/main/src/components/toast.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_app,node_authgate,node_protectedpage,node_user toneBlue
class node_login,node_register,node_google,node_verify,node_forgot,node_reset,node_auth toneAmber
class node_dashboard,node_profile,node_settings toneMint
class node_api,node_useragent,node_skeletons,node_messages,node_toast toneRose
class node_backend toneIndigo
```

## Components

### App routing

- [Route application](https://github.com/tondi11/loginauth-frontend/blob/main/src/App.js): `src/App.js`
- [Protected route](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ProtectedRoute.js): `src/components/ProtectedRoute.js`
- [Protected page](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ProtectedPage.js): `src/components/ProtectedPage.js`

### Authentication

- [Login](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Login.js): `src/components/Login.js`
- [Registration](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Register.js): `src/components/Register.js`
- [Google login](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/GoogleLogin.js): `src/components/GoogleLogin.js`
- [Email verification](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/VerifyEmail.js): `src/components/VerifyEmail.js`
- [Forgot password](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ForgotPassword.js): `src/components/ForgotPassword.js`
- [Reset password](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/ResetPassword.js): `src/components/ResetPassword.js`
- [Auth state](https://github.com/tondi11/loginauth-frontend/blob/main/src/contexts/AuthContext.js): `src/contexts/AuthContext.js`

### Account workspace

- [Dashboard](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Dashboard.js): `src/components/Dashboard.js`
- [Profile editor](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Profile.jsx): `src/components/Profile.jsx`
- [Account settings](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/Settings.jsx): `src/components/Settings.jsx`

### Shared UI and API

- [API client](https://github.com/tondi11/loginauth-frontend/blob/main/src/services/api.js): `src/services/api.js`
- [User-agent parser](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/UserAgent.js): `src/components/UserAgent.js`
- [Loading placeholders](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/SkeletonLoaders.jsx): `src/components/SkeletonLoaders.jsx`
- [Inline messages](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/InlineMessages.jsx): `src/components/InlineMessages.jsx`
- [Toast notifications](https://github.com/tondi11/loginauth-frontend/blob/main/src/components/toast.js): `src/components/toast.js`

### Other components

- **User**
- **Application backend**

## Connections

- User → Route application: uses
- Route application → Auth state: provides auth (evidence: `src/App.js`)
- Route application → Login: routes to (evidence: `src/App.js`)
- Route application → Registration: routes to (evidence: `src/App.js`)
- Route application → Email verification: routes to (evidence: `src/App.js`)
- Route application → Forgot password: routes to (evidence: `src/App.js`)
- Route application → Reset password: routes to (evidence: `src/App.js`)
- Route application → Protected route: guards routes (evidence: `src/App.js`)
- Route application → Dashboard: routes to (evidence: `src/App.js`)
- Route application → Profile editor: routes to (evidence: `src/App.js`)
- Route application → Account settings: routes to (evidence: `src/App.js`)
- Protected route → Auth state: checks auth (evidence: `src/components/ProtectedRoute.js`)
- Protected route → Protected page: renders (evidence: `src/App.js`)
- Login → Auth state: uses auth (evidence: `src/components/Login.js`)
- Login → Google login: renders (evidence: `src/components/Login.js`)
- Registration → Auth state: registers via (evidence: `src/components/Register.js`)
- Google login → API client: calls (evidence: `src/components/GoogleLogin.js`)
- Auth state → API client: calls (evidence: `src/contexts/AuthContext.js`)
- Auth state → Toast notifications: notifies with (evidence: `src/contexts/AuthContext.js`)
- API client → Application backend: sends requests (evidence: `src/services/api.js`)
- API client → Toast notifications: notifies with (evidence: `src/services/api.js`)
- Dashboard → Auth state: uses auth (evidence: `src/components/Dashboard.js`)
- Dashboard → API client: calls (evidence: `src/components/Dashboard.js`)
- Dashboard → User-agent parser: formats agent (evidence: `src/components/Dashboard.js`)
- Profile editor → Auth state: uses auth (evidence: `src/components/Profile.jsx`)
- Profile editor → API client: calls (evidence: `src/components/Profile.jsx`)
- Profile editor → Loading placeholders: renders (evidence: `src/components/Profile.jsx`)
- Profile editor → Inline messages: renders (evidence: `src/components/Profile.jsx`)
- Account settings → Auth state: uses auth (evidence: `src/components/Settings.jsx`)
- Account settings → API client: calls (evidence: `src/components/Settings.jsx`)
- Account settings → Loading placeholders: renders (evidence: `src/components/Settings.jsx`)
- Account settings → Inline messages: renders (evidence: `src/components/Settings.jsx`)
- Account settings → Toast notifications: notifies with (evidence: `src/components/Settings.jsx`)
