# romanonyshko/car-selling-test-proj architecture

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

- Interactive diagram: https://gitdiagram.com/romanonyshko/car-selling-test-proj
- Repository: https://github.com/romanonyshko/car-selling-test-proj

## Overview

Auto Lincoln is a browser-based auto-parts catalogue admin panel. Users sign in, enter the protected application, and can view dashboard data, browse the catalogue section, or open support chat. The sampled code shows the router, session checks, dashboard query path, and chat state/socket layers. The README documents direct REST and WebSocket connections to the NestJS API; catalogue and several other sections are currently placeholders. Some UI and API internals were not sampled, so only documented or indexed relationships are shown.

Main entry points: [`src/app/router/routes.tsx`](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/app/router/routes.tsx) (Protected routes), [`src/pages/dashboard/DashboardPage.tsx`](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/dashboard/DashboardPage.tsx) (Dashboard page), [`src/features/support/hooks/useSupportChat.ts`](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/hooks/useSupportChat.ts) (Chat controller), [`src/lib/apiClient.ts`](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/lib/apiClient.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["Application entry<br/>[App.tsx]"]
  node_routes["Protected routes<br/>[routes.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
  node_navigation["Sidebar navigation<br/>[Sidebar.tsx]"]
  node_catalogue["Parts catalogue<br/>[CataloguePage.tsx]"]
  node_api_client["HTTP client<br/>[apiClient.ts]"]
end

subgraph group_auth["Authentication"]
  node_login["Login form<br/>[LoginForm.tsx]"]
  node_login_hook["Login mutations<br/>[useLogin.ts]"]
  node_auth_api["Session API<br/>[authApi.ts]"]
  node_auth_queries["Session query<br/>[authQueries.ts]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_page["Dashboard page<br/>[DashboardPage.tsx]"]
  node_dashboard_query["Dashboard query<br/>[useDashboard.ts]"]
  node_dashboard_api["Dashboard API<br/>[dashboardApi.ts]"]
  node_dashboard_widgets["Dashboard widgets"]
end

subgraph group_support["Support chat"]
  node_support_page["Support page<br/>[SupportPage.tsx]"]
  node_support_chat["Chat interface<br/>[SupportChat.tsx]"]
  node_chat_hook["Chat controller<br/>[useSupportChat.ts]"]
  node_chat_reducer["Chat state<br/>[chatReducer.ts]"]
  node_chat_socket["Chat socket<br/>[chatSocket.ts]"]
end

node_user(("Panel user"))
node_api["NestJS API"]

node_user -->|"opens"| node_app
node_app -->|"provides router"| node_routes
node_routes -->|"renders protected layout"| node_layout
node_routes -->|"checks session"| node_auth_queries
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_dashboard_page
node_routes -->|"routes to"| node_catalogue
node_routes -->|"routes to"| node_support_page
node_layout -->|"renders"| node_navigation
node_login -->|"submits through"| node_login_hook
node_login_hook -->|"calls login"| node_auth_api
node_auth_queries -->|"fetches current user"| node_auth_api
node_auth_api -->|"requests session"| node_api_client
node_dashboard_page -->|"loads data"| node_dashboard_query
node_dashboard_page -->|"renders"| node_dashboard_widgets
node_dashboard_query -->|"fetches"| node_dashboard_api
node_dashboard_api -->|"requests data"| node_api_client
node_support_page -->|"renders"| node_support_chat
node_support_chat -.->|"uses controller"| node_chat_hook
node_chat_hook -->|"updates state"| node_chat_reducer
node_chat_hook -->|"uses socket"| node_chat_socket
node_chat_socket -->|"connects by WebSocket"| node_api
node_api_client -->|"sends REST requests"| node_api

click node_app "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/app/App.tsx"
click node_routes "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/app/router/routes.tsx"
click node_layout "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/components/layout/AppLayout.tsx"
click node_navigation "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/components/layout/Sidebar.tsx"
click node_catalogue "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/catalogue/CataloguePage.tsx"
click node_login "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/ui/LoginForm.tsx"
click node_login_hook "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/hooks/useLogin.ts"
click node_auth_api "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/api/authApi.ts"
click node_auth_queries "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/api/authQueries.ts"
click node_dashboard_page "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/dashboard/DashboardPage.tsx"
click node_dashboard_query "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/dashboard/hooks/useDashboard.ts"
click node_dashboard_api "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/dashboard/api/dashboardApi.ts"
click node_dashboard_widgets "https://github.com/romanonyshko/car-selling-test-proj/tree/main/src/features/dashboard/ui"
click node_support_page "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/support/SupportPage.tsx"
click node_support_chat "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/ui/SupportChat.tsx"
click node_chat_hook "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/hooks/useSupportChat.ts"
click node_chat_reducer "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/model/chatReducer.ts"
click node_chat_socket "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/api/chatSocket.ts"
click node_api_client "https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/lib/apiClient.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_app,node_routes,node_layout,node_navigation,node_catalogue,node_api_client,node_user toneBlue
class node_login,node_login_hook,node_auth_api,node_auth_queries toneAmber
class node_dashboard_page,node_dashboard_query,node_dashboard_api,node_dashboard_widgets,node_api toneMint
class node_support_page,node_support_chat,node_chat_hook,node_chat_reducer,node_chat_socket toneRose
```

## Components

### App shell

- [Application entry](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Protected routes](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/app/router/routes.tsx): `src/app/router/routes.tsx`
- [App layout](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`
- [Sidebar navigation](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`
- [Parts catalogue](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/catalogue/CataloguePage.tsx): `src/pages/catalogue/CataloguePage.tsx`
- [HTTP client](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/lib/apiClient.ts): `src/lib/apiClient.ts`

### Authentication

- [Login form](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/ui/LoginForm.tsx): `src/features/auth/ui/LoginForm.tsx`
- [Login mutations](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/hooks/useLogin.ts): `src/features/auth/hooks/useLogin.ts`
- [Session API](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/api/authApi.ts): `src/features/auth/api/authApi.ts`
- [Session query](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/auth/api/authQueries.ts): `src/features/auth/api/authQueries.ts`

### Dashboard

- [Dashboard page](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/dashboard/DashboardPage.tsx): `src/pages/dashboard/DashboardPage.tsx`
- [Dashboard query](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/dashboard/hooks/useDashboard.ts): `src/features/dashboard/hooks/useDashboard.ts`
- [Dashboard API](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/dashboard/api/dashboardApi.ts): `src/features/dashboard/api/dashboardApi.ts`
- [Dashboard widgets](https://github.com/romanonyshko/car-selling-test-proj/tree/main/src/features/dashboard/ui): `src/features/dashboard/ui`

### Support chat

- [Support page](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/pages/support/SupportPage.tsx): `src/pages/support/SupportPage.tsx`
- [Chat interface](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/ui/SupportChat.tsx): `src/features/support/ui/SupportChat.tsx`
- [Chat controller](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/hooks/useSupportChat.ts): `src/features/support/hooks/useSupportChat.ts`
- [Chat state](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/model/chatReducer.ts): `src/features/support/model/chatReducer.ts`
- [Chat socket](https://github.com/romanonyshko/car-selling-test-proj/blob/main/src/features/support/api/chatSocket.ts): `src/features/support/api/chatSocket.ts`

### Other components

- **Panel user**
- **NestJS API**

## Connections

- Panel user → Application entry: opens (evidence: `README.md`)
- Application entry → Protected routes: provides router (evidence: `src/app/App.tsx`)
- Protected routes → App layout: renders protected layout (evidence: `src/app/router/routes.tsx`)
- Protected routes → Session query: checks session (evidence: `src/app/router/routes.tsx`)
- Protected routes → Login form: routes to (evidence: `src/app/router/routes.tsx`)
- Protected routes → Dashboard page: routes to (evidence: `src/app/router/routes.tsx`)
- Protected routes → Parts catalogue: routes to (evidence: `src/app/router/routes.tsx`)
- Protected routes → Support page: routes to (evidence: `src/app/router/routes.tsx`)
- App layout → Sidebar navigation: renders (evidence: `src/components/layout/AppLayout.tsx`)
- Login form → Login mutations: submits through (evidence: `src/features/auth/ui/LoginForm.tsx`)
- Login mutations → Session API: calls login (evidence: `src/features/auth/hooks/useLogin.ts`)
- Session query → Session API: fetches current user (evidence: `src/features/auth/api/authQueries.ts`)
- Session API → HTTP client: requests session (evidence: `src/features/auth/api/authApi.ts`)
- Dashboard page → Dashboard query: loads data (evidence: `src/pages/dashboard/DashboardPage.tsx`)
- Dashboard page → Dashboard widgets: renders (evidence: `src/pages/dashboard/DashboardPage.tsx`)
- Dashboard query → Dashboard API: fetches (evidence: `src/features/dashboard/hooks/useDashboard.ts`)
- Dashboard API → HTTP client: requests data (evidence: `src/features/dashboard/api/dashboardApi.ts`)
- Support page → Chat interface: renders (evidence: `src/pages/support/SupportPage.tsx`)
- Chat interface → Chat controller: uses controller
- Chat controller → Chat state: updates state (evidence: `src/features/support/hooks/useSupportChat.ts`)
- Chat controller → Chat socket: uses socket (evidence: `src/features/support/hooks/useSupportChat.ts`)
- Chat socket → NestJS API: connects by WebSocket (evidence: `README.md`)
- HTTP client → NestJS API: sends REST requests (evidence: `README.md`)
