# deadok-core/travel architecture

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

- Interactive diagram: https://gitdiagram.com/deadok-core/travel
- Repository: https://github.com/deadok-core/travel

## Overview

TravelBlog is a React travel-community frontend. Visitors browse paginated travel posts and open post details; registered users can create posts and comments, authenticate, and manage profiles. The app routes these experiences through page components, which invoke API modules for server operations. Authentication state is held in Redux and persisted in local storage; a shared Axios client attaches stored tokens. README documents the major user-facing capabilities and endpoints; some component wiring is supported by the SOURCE INDEX rather than excerpts, so uncertain links are omitted.

Main entry points: [`src/App/App.tsx`](https://github.com/deadok-core/travel/blob/main/src/App/App.tsx) (Route shell), [`src/api/posts/posts.ts`](https://github.com/deadok-core/travel/blob/main/src/api/posts/posts.ts) (Posts API), [`src/Components/Pages/Login/Login.tsx`](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Login/Login.tsx) (Login page), [`src/api/auth/auth.ts`](https://github.com/deadok-core/travel/blob/main/src/api/auth/auth.ts) (Auth API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Application and navigation"]
  node_app["Route shell<br/>[App.tsx]"]
  node_header["Site header<br/>[Header.tsx]"]
end

subgraph group_identity["Authentication and identity"]
  node_login["Login page<br/>[Login.tsx]"]
  node_register["Registration page<br/>[Register.tsx]"]
  node_authapi["Auth API<br/>[auth.ts]"]
  node_authstate[("Auth state<br/>[authSlice.tsx]")]
  node_authhook["Auth hooks<br/>[useAuthDispatch.ts]"]
end

subgraph group_travel["Travel posts and discussion"]
  node_postlist["Post list page<br/>[FetchCardList.tsx]"]
  node_cardlist["Post cards<br/>[CardList.tsx]"]
  node_card["Post card<br/>[Card.tsx]"]
  node_postdetail["Post detail<br/>[Post.tsx]"]
  node_comments["Comments<br/>[Comments.tsx]"]
  node_commentform["Add comment<br/>[AddComment.tsx]"]
  node_postform["Create post<br/>[AddNewPost.tsx]"]
  node_postsapi["Posts API<br/>[posts.ts]"]
end

subgraph group_profiles["User profiles"]
  node_profile["Profile page<br/>[Profile.tsx]"]
  node_editprofile["Edit profile<br/>[EditProfile.tsx]"]
  node_fetchuser["User data loader<br/>[FetchUser.tsx]"]
  node_userapi["User API<br/>[user.ts]"]
end

subgraph group_shared["Shared data and interface"]
  node_store[("Redux store<br/>[store.tsx]")]
  node_queryclient["Query client<br/>[queryClient.ts]"]
  node_httpclient["HTTP client<br/>[client.ts]"]
  node_ui["Shared UI"]
end

node_visitor(("Visitor"))
node_api{{"TravelBlog API"}}

node_visitor -->|"opens"| node_app
node_app -->|"routes through"| node_header
node_app -->|"routes to"| node_postlist
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_editprofile
node_app -->|"routes to"| node_postdetail
node_app -->|"routes to"| node_commentform
node_app -->|"routes to"| node_postform
node_app -->|"provides"| node_store
node_login -->|"authenticates"| node_authapi
node_register -->|"registers"| node_authapi
node_authapi -->|"sends requests"| node_httpclient
node_authapi -->|"calls endpoints"| node_api
node_login -->|"updates"| node_authstate
node_register -->|"updates"| node_authstate
node_authhook -->|"selects and dispatches"| node_store
node_postlist -->|"fetches posts"| node_postsapi
node_postlist -->|"renders"| node_cardlist
node_cardlist -->|"renders"| node_card
node_postdetail -->|"fetches detail"| node_postsapi
node_postdetail -->|"renders"| node_comments
node_commentform -->|"submits comment"| node_postsapi
node_postform -->|"creates post"| node_postsapi
node_postsapi -->|"sends requests"| node_httpclient
node_postsapi -->|"calls endpoints"| node_api
node_profile -->|"reads identity"| node_authhook
node_editprofile -->|"updates profile"| node_userapi
node_header -->|"loads user"| node_fetchuser
node_fetchuser -->|"fetches profile"| node_userapi
node_userapi -->|"sends requests"| node_httpclient
node_userapi -->|"calls endpoints"| node_api
node_app -.->|"configures queries"| node_queryclient
node_login -->|"uses controls"| node_ui
node_postform -->|"uses controls"| node_ui
node_commentform -->|"uses controls"| node_ui

click node_app "https://github.com/deadok-core/travel/blob/main/src/App/App.tsx"
click node_header "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Header/Header.tsx"
click node_login "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Login/Login.tsx"
click node_register "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Register/Register.tsx"
click node_authapi "https://github.com/deadok-core/travel/blob/main/src/api/auth/auth.ts"
click node_authstate "https://github.com/deadok-core/travel/blob/main/src/Store/authSlice.tsx"
click node_authhook "https://github.com/deadok-core/travel/blob/main/src/Hooks/useAuthDispatch.ts"
click node_postlist "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/FetchCardList/FetchCardList.tsx"
click node_cardlist "https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/CardList/CardList.tsx"
click node_card "https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/Card/Card.tsx"
click node_postdetail "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Post/Post.tsx"
click node_comments "https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/Comments/Comments.tsx"
click node_commentform "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/AddComment/AddComment.tsx"
click node_postform "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/AddNewPost/AddNewPost.tsx"
click node_postsapi "https://github.com/deadok-core/travel/blob/main/src/api/posts/posts.ts"
click node_profile "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Profile/Profile.tsx"
click node_editprofile "https://github.com/deadok-core/travel/blob/main/src/Components/Pages/EditProfile/EditProfile.tsx"
click node_fetchuser "https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/FetchUser/FetchUser.tsx"
click node_userapi "https://github.com/deadok-core/travel/blob/main/src/api/user/user.ts"
click node_store "https://github.com/deadok-core/travel/blob/main/src/Store/store.tsx"
click node_queryclient "https://github.com/deadok-core/travel/blob/main/src/api/queryClient.ts"
click node_httpclient "https://github.com/deadok-core/travel/blob/main/src/api/client.ts"
click node_ui "https://github.com/deadok-core/travel/tree/main/src/Components/UI"

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_header toneBlue
class node_login,node_register,node_authapi,node_authstate,node_authhook toneAmber
class node_postlist,node_cardlist,node_card,node_postdetail,node_comments,node_commentform,node_postform,node_postsapi,node_api toneMint
class node_profile,node_editprofile,node_fetchuser,node_userapi toneRose
class node_store,node_queryclient,node_httpclient,node_ui,node_visitor toneIndigo
```

## Components

### Application and navigation

- [Route shell](https://github.com/deadok-core/travel/blob/main/src/App/App.tsx): `src/App/App.tsx`
- [Site header](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Header/Header.tsx): `src/Components/Pages/Header/Header.tsx`

### Authentication and identity

- [Login page](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Login/Login.tsx): `src/Components/Pages/Login/Login.tsx`
- [Registration page](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Register/Register.tsx): `src/Components/Pages/Register/Register.tsx`
- [Auth API](https://github.com/deadok-core/travel/blob/main/src/api/auth/auth.ts): `src/api/auth/auth.ts`
- [Auth state](https://github.com/deadok-core/travel/blob/main/src/Store/authSlice.tsx): `src/Store/authSlice.tsx`
- [Auth hooks](https://github.com/deadok-core/travel/blob/main/src/Hooks/useAuthDispatch.ts): `src/Hooks/useAuthDispatch.ts`

### Travel posts and discussion

- [Post list page](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/FetchCardList/FetchCardList.tsx): `src/Components/Pages/FetchCardList/FetchCardList.tsx`
- [Post cards](https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/CardList/CardList.tsx): `src/Components/Widgets/CardList/CardList.tsx`
- [Post card](https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/Card/Card.tsx): `src/Components/Widgets/Card/Card.tsx`
- [Post detail](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Post/Post.tsx): `src/Components/Pages/Post/Post.tsx`
- [Comments](https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/Comments/Comments.tsx): `src/Components/Widgets/Comments/Comments.tsx`
- [Add comment](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/AddComment/AddComment.tsx): `src/Components/Pages/AddComment/AddComment.tsx`
- [Create post](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/AddNewPost/AddNewPost.tsx): `src/Components/Pages/AddNewPost/AddNewPost.tsx`
- [Posts API](https://github.com/deadok-core/travel/blob/main/src/api/posts/posts.ts): `src/api/posts/posts.ts`

### User profiles

- [Profile page](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/Profile/Profile.tsx): `src/Components/Pages/Profile/Profile.tsx`
- [Edit profile](https://github.com/deadok-core/travel/blob/main/src/Components/Pages/EditProfile/EditProfile.tsx): `src/Components/Pages/EditProfile/EditProfile.tsx`
- [User data loader](https://github.com/deadok-core/travel/blob/main/src/Components/Widgets/FetchUser/FetchUser.tsx): `src/Components/Widgets/FetchUser/FetchUser.tsx`
- [User API](https://github.com/deadok-core/travel/blob/main/src/api/user/user.ts): `src/api/user/user.ts`

### Shared data and interface

- [Redux store](https://github.com/deadok-core/travel/blob/main/src/Store/store.tsx): `src/Store/store.tsx`
- [Query client](https://github.com/deadok-core/travel/blob/main/src/api/queryClient.ts): `src/api/queryClient.ts`
- [HTTP client](https://github.com/deadok-core/travel/blob/main/src/api/client.ts): `src/api/client.ts`
- [Shared UI](https://github.com/deadok-core/travel/tree/main/src/Components/UI): `src/Components/UI`

### Other components

- **Visitor**
- **TravelBlog API**

## Connections

- Visitor → Route shell: opens (evidence: `src/App/App.tsx`)
- Route shell → Site header: routes through (evidence: `src/App/App.tsx`)
- Route shell → Post list page: routes to (evidence: `src/App/App.tsx`)
- Route shell → Login page: routes to (evidence: `src/App/App.tsx`)
- Route shell → Registration page: routes to (evidence: `src/App/App.tsx`)
- Route shell → Profile page: routes to (evidence: `src/App/App.tsx`)
- Route shell → Edit profile: routes to (evidence: `src/App/App.tsx`)
- Route shell → Post detail: routes to (evidence: `src/App/App.tsx`)
- Route shell → Add comment: routes to (evidence: `src/App/App.tsx`)
- Route shell → Create post: routes to (evidence: `src/App/App.tsx`)
- Route shell → Redux store: provides (evidence: `src/App/App.tsx`)
- Login page → Auth API: authenticates (evidence: `src/Components/Pages/Login/Login.tsx`)
- Registration page → Auth API: registers (evidence: `src/Components/Pages/Register/Register.tsx`)
- Auth API → HTTP client: sends requests (evidence: `src/api/auth/auth.ts`)
- Auth API → TravelBlog API: calls endpoints (evidence: `README.md`)
- Login page → Auth state: updates (evidence: `src/Components/Pages/Login/Login.tsx`)
- Registration page → Auth state: updates (evidence: `src/Components/Pages/Register/Register.tsx`)
- Auth hooks → Redux store: selects and dispatches (evidence: `src/Hooks/useAuthDispatch.ts`)
- Post list page → Posts API: fetches posts (evidence: `src/Components/Pages/FetchCardList/FetchCardList.tsx`)
- Post list page → Post cards: renders (evidence: `src/Components/Pages/FetchCardList/FetchCardList.tsx`)
- Post cards → Post card: renders (evidence: `src/Components/Widgets/CardList/CardList.tsx`)
- Post detail → Posts API: fetches detail (evidence: `src/Components/Pages/Post/Post.tsx`)
- Post detail → Comments: renders (evidence: `src/Components/Pages/Post/Post.tsx`)
- Add comment → Posts API: submits comment (evidence: `src/Components/Pages/AddComment/AddComment.tsx`)
- Create post → Posts API: creates post (evidence: `src/Components/Pages/AddNewPost/AddNewPost.tsx`)
- Posts API → HTTP client: sends requests (evidence: `src/api/posts/posts.ts`)
- Posts API → TravelBlog API: calls endpoints (evidence: `README.md`)
- Profile page → Auth hooks: reads identity (evidence: `src/Components/Pages/Profile/Profile.tsx`)
- Edit profile → User API: updates profile (evidence: `src/Components/Pages/EditProfile/EditProfile.tsx`)
- Site header → User data loader: loads user (evidence: `src/Components/Pages/Header/Header.tsx`)
- User data loader → User API: fetches profile (evidence: `src/Components/Widgets/FetchUser/FetchUser.tsx`)
- User API → HTTP client: sends requests (evidence: `src/api/user/user.ts`)
- User API → TravelBlog API: calls endpoints (evidence: `README.md`)
- Route shell → Query client: configures queries
- Login page → Shared UI: uses controls (evidence: `src/Components/Pages/Login/Login.tsx`)
- Create post → Shared UI: uses controls (evidence: `src/Components/Pages/AddNewPost/AddNewPost.tsx`)
- Add comment → Shared UI: uses controls (evidence: `src/Components/Pages/AddComment/AddComment.tsx`)
