# mlitvaj/react-starter architecture

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

- Interactive diagram: https://gitdiagram.com/mlitvaj/react-starter
- Repository: https://github.com/mlitvaj/react-starter

## Overview

React Starter is a browser-based reading-list application with built-in token authentication. Users enter through authentication or, when signed in, the dashboard; they can discover books, manage reading and finished lists, view book details, and access profile functions. The API layer provides typed, schema-validated endpoint operations, while authentication state is persisted and restored across reloads. The graph covers documented features and source-indexed modules; unsampled route implementations are represented by their existing feature directories, and only evidenced relationships are connected.

Main entry points: [`src/app/App.tsx`](https://github.com/mlitvaj/react-starter/blob/main/src/app/App.tsx) (Route Selection), [`src/common/auth/index.ts`](https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/index.ts) (Auth Operations), [`src/app/Root.tsx`](https://github.com/mlitvaj/react-starter/blob/main/src/app/Root.tsx) (Root Providers), [`src/features/auth`](https://github.com/mlitvaj/react-starter/tree/main/src/features/auth) (Auth Screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["App Shell"]
  node_entry["Application Entry<br/>[index.tsx]"]
  node_root["Root Providers<br/>[Root.tsx]"]
  node_app["Route Selection<br/>[App.tsx]"]
  node_i18n["Translations<br/>[index.ts]"]
end

subgraph group_identity["Authentication"]
  node_authui["Auth Screens"]
  node_guards["Route Guards"]
  node_authlogic["Auth Operations<br/>[index.ts]"]
  node_authstate[("Persisted Auth State<br/>[state.ts]")]
  node_restore["Session Restoration"]
end

subgraph group_books["Bookshelf"]
  node_dashboard["Dashboard"]
  node_shelf["Bookshelf Features"]
  node_profile["Profile Features"]
end

subgraph group_services["API and State"]
  node_queries["Query Operations<br/>[queries.ts]"]
  node_endpoints["API Endpoints<br/>[endpoints.ts]"]
  node_client["Fetch Client<br/>[client.ts]"]
  node_queryprovider["Query Provider<br/>[Query.tsx]"]
end

node_reader(("Reader"))
node_api{{"Backend API"}}

node_reader -->|"uses"| node_entry
node_entry -->|"renders"| node_root
node_root -->|"renders"| node_app
node_root -->|"wraps with"| node_queryprovider
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"protects route"| node_guards
node_dashboard -.->|"includes"| node_shelf
node_dashboard -.->|"includes"| node_profile
node_authui -.->|"uses"| node_authlogic
node_authlogic -->|"calls"| node_endpoints
node_authlogic -->|"updates"| node_authstate
node_restore -->|"relogs in"| node_authlogic
node_authstate -->|"persists token"| node_reader
node_shelf -.->|"uses"| node_queries
node_queries -->|"calls"| node_endpoints
node_endpoints -->|"calls"| node_client
node_client -.->|"requests"| node_api
node_authui -.->|"uses auth services"| node_api
node_profile -.->|"uses profile services"| node_api
node_reader -.->|"selects language"| node_i18n

click node_entry "https://github.com/mlitvaj/react-starter/blob/main/src/index.tsx"
click node_root "https://github.com/mlitvaj/react-starter/blob/main/src/app/Root.tsx"
click node_app "https://github.com/mlitvaj/react-starter/blob/main/src/app/App.tsx"
click node_authui "https://github.com/mlitvaj/react-starter/tree/main/src/features/auth"
click node_guards "https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/RequireIsLoggedIn.tsx"
click node_authlogic "https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/index.ts"
click node_authstate "https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/state.ts"
click node_restore "https://github.com/mlitvaj/react-starter/blob/main/src/app/PersistAuthGate.tsx"
click node_dashboard "https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard"
click node_shelf "https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard/features/bookshelf"
click node_profile "https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard/features/profile"
click node_queries "https://github.com/mlitvaj/react-starter/blob/main/src/api/queries.ts"
click node_endpoints "https://github.com/mlitvaj/react-starter/blob/main/src/api/endpoints.ts"
click node_client "https://github.com/mlitvaj/react-starter/blob/main/src/api/client.ts"
click node_queryprovider "https://github.com/mlitvaj/react-starter/blob/main/src/app/providers/Query.tsx"
click node_i18n "https://github.com/mlitvaj/react-starter/blob/main/src/i18n/index.ts"

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_entry,node_root,node_app,node_i18n toneBlue
class node_authui,node_guards,node_authlogic,node_authstate,node_restore toneAmber
class node_dashboard,node_shelf,node_profile,node_api toneMint
class node_queries,node_endpoints,node_client,node_queryprovider toneRose
class node_reader toneIndigo
```

## Components

### App Shell

- [Application Entry](https://github.com/mlitvaj/react-starter/blob/main/src/index.tsx): `src/index.tsx`
- [Root Providers](https://github.com/mlitvaj/react-starter/blob/main/src/app/Root.tsx): `src/app/Root.tsx`
- [Route Selection](https://github.com/mlitvaj/react-starter/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Translations](https://github.com/mlitvaj/react-starter/blob/main/src/i18n/index.ts): `src/i18n/index.ts`

### Authentication

- [Auth Screens](https://github.com/mlitvaj/react-starter/tree/main/src/features/auth): `src/features/auth`
- [Route Guards](https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/RequireIsLoggedIn.tsx): `src/common/auth/RequireIsLoggedIn.tsx`
- [Auth Operations](https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/index.ts): `src/common/auth/index.ts`
- [Persisted Auth State](https://github.com/mlitvaj/react-starter/blob/main/src/common/auth/state.ts): `src/common/auth/state.ts`
- [Session Restoration](https://github.com/mlitvaj/react-starter/blob/main/src/app/PersistAuthGate.tsx): `src/app/PersistAuthGate.tsx`

### Bookshelf

- [Dashboard](https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard): `src/features/dashboard`
- [Bookshelf Features](https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard/features/bookshelf): `src/features/dashboard/features/bookshelf`
- [Profile Features](https://github.com/mlitvaj/react-starter/tree/main/src/features/dashboard/features/profile): `src/features/dashboard/features/profile`

### API and State

- [Query Operations](https://github.com/mlitvaj/react-starter/blob/main/src/api/queries.ts): `src/api/queries.ts`
- [API Endpoints](https://github.com/mlitvaj/react-starter/blob/main/src/api/endpoints.ts): `src/api/endpoints.ts`
- [Fetch Client](https://github.com/mlitvaj/react-starter/blob/main/src/api/client.ts): `src/api/client.ts`
- [Query Provider](https://github.com/mlitvaj/react-starter/blob/main/src/app/providers/Query.tsx): `src/app/providers/Query.tsx`

### Other components

- **Reader**
- **Backend API**

## Connections

- Reader → Application Entry: uses
- Application Entry → Root Providers: renders (evidence: `src/index.tsx`)
- Root Providers → Route Selection: renders (evidence: `src/app/Root.tsx`)
- Root Providers → Query Provider: wraps with (evidence: `src/app/Root.tsx`)
- Route Selection → Auth Screens: routes to (evidence: `src/app/App.tsx`)
- Route Selection → Dashboard: routes to (evidence: `src/app/App.tsx`)
- Route Selection → Route Guards: protects route (evidence: `src/app/App.tsx`)
- Dashboard → Bookshelf Features: includes
- Dashboard → Profile Features: includes
- Auth Screens → Auth Operations: uses
- Auth Operations → API Endpoints: calls (evidence: `src/common/auth/index.ts`)
- Auth Operations → Persisted Auth State: updates (evidence: `src/common/auth/index.ts`)
- Session Restoration → Auth Operations: relogs in (evidence: `src/app/PersistAuthGate.tsx`)
- Persisted Auth State → Reader: persists token
- Bookshelf Features → Query Operations: uses
- Query Operations → API Endpoints: calls (evidence: `src/api/queries.ts`)
- API Endpoints → Fetch Client: calls (evidence: `src/api/endpoints.ts`)
- Fetch Client → Backend API: requests
- Auth Screens → Backend API: uses auth services
- Profile Features → Backend API: uses profile services
- Reader → Translations: selects language
