# malinuuus/chuck-norris-jokes-app architecture

> Architecture diagram of the GitHub repository malinuuus/chuck-norris-jokes-app, 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/malinuuus/chuck-norris-jokes-app
- Repository: https://github.com/malinuuus/chuck-norris-jokes-app

## Overview

This is a React client and NestJS server for browsing Chuck Norris jokes. Users can view a random joke, filter by category and impersonate Chuck Norris; they can save jokes to browser storage and view or add saved jokes. Login and registration are client-side navigation forms, not server-backed authentication. The README documents how to run the two apps but does not describe product behavior; server-to-external-API behavior is visible in the sampled services.

Main entry points: [`client/src/App.tsx`](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/App.tsx) (App routes), [`server/src/jokes/jokes.service.ts`](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.service.ts) (Jokes service), [`server/src/app.module.ts`](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/app.module.ts) (Nest app), [`server/src/jokes/jokes.controller.ts`](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.controller.ts) (Jokes controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client app"]
  node_app["App routes<br/>[App.tsx]"]
  node_login["Login page<br/>[index.tsx]"]
  node_register["Register page<br/>[index.tsx]"]
  node_authform["Auth form<br/>[index.tsx]"]
  node_decoration["Decoration<br/>[Decoration.tsx]"]
  node_logo["Logo<br/>[Logo.tsx]"]
  node_main["Main layout<br/>[index.tsx]"]
  node_random["Random joke<br/>[index.tsx]"]
  node_myjokes["My jokes<br/>[index.tsx]"]
  node_addjoke["Add joke<br/>[index.tsx]"]
  node_apiclient["API client<br/>[apiService.ts]"]
  node_localstorage["Joke storage<br/>[localStorage.ts]"]
  node_browserstore[("Browser storage")]
end

subgraph group_server["Server API"]
  node_nest["Nest app<br/>[app.module.ts]"]
  node_jokescontroller["Jokes controller"]
  node_categoriescontroller["Categories controller"]
end

subgraph group_jokes["Joke integration"]
  node_jokesservice["Jokes service<br/>[jokes.service.ts]"]
  node_categoriesservice["Categories service"]
  node_filterdto["Joke filters"]
  node_jokedto["Joke response<br/>[joke.dto.ts]"]
  node_jokemodel["Joke model<br/>[joke.model.ts]"]
end

node_user(("User"))
node_chuckapi["Chuck Norris API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"wraps pages"| node_main
node_app -->|"routes to"| node_random
node_app -->|"routes to"| node_myjokes
node_app -->|"routes to"| node_addjoke
node_login -->|"renders"| node_authform
node_register -->|"renders"| node_authform
node_authform -->|"renders"| node_decoration
node_authform -->|"renders"| node_logo
node_main -->|"renders"| node_logo
node_random -->|"fetches jokes"| node_apiclient
node_random -->|"saves joke"| node_localstorage
node_myjokes -->|"reads and removes"| node_localstorage
node_addjoke -->|"saves joke"| node_localstorage
node_localstorage -->|"reads and writes"| node_browserstore
node_apiclient -->|"HTTP requests"| node_nest
node_nest -->|"registers"| node_jokescontroller
node_nest -->|"registers"| node_categoriescontroller
node_nest -->|"provides"| node_jokesservice
node_nest -->|"provides"| node_categoriesservice
node_jokescontroller -->|"delegates to"| node_jokesservice
node_jokescontroller -->|"accepts"| node_filterdto
node_jokescontroller -->|"returns"| node_jokedto
node_jokesservice -->|"uses"| node_filterdto
node_jokesservice -->|"builds"| node_jokedto
node_jokesservice -->|"types response data"| node_jokemodel
node_jokesservice -->|"requests random joke"| node_chuckapi
node_categoriescontroller -->|"delegates to"| node_categoriesservice
node_categoriesservice -->|"requests categories"| node_chuckapi

click node_app "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/App.tsx"
click node_login "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/Login/index.tsx"
click node_register "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/Register/index.tsx"
click node_authform "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/AuthForm/index.tsx"
click node_decoration "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Decoration.tsx"
click node_logo "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Logo.tsx"
click node_main "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Main/index.tsx"
click node_random "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/RandomJoke/index.tsx"
click node_myjokes "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/MyJokes/index.tsx"
click node_addjoke "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/AddJoke/index.tsx"
click node_apiclient "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/services/apiService.ts"
click node_localstorage "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/utils/localStorage.ts"
click node_nest "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/app.module.ts"
click node_jokescontroller "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.controller.ts"
click node_categoriescontroller "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/categories/categories.controller.ts"
click node_jokesservice "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.service.ts"
click node_categoriesservice "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/categories/categories.service.ts"
click node_filterdto "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/dto/get-joke-filter.dto.ts"
click node_jokedto "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/dto/joke.dto.ts"
click node_jokemodel "https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/joke.model.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_login,node_register,node_authform,node_decoration,node_logo,node_main,node_random,node_myjokes,node_addjoke,node_apiclient,node_localstorage,node_browserstore,node_user toneBlue
class node_nest,node_jokescontroller,node_categoriescontroller toneAmber
class node_jokesservice,node_categoriesservice,node_filterdto,node_jokedto,node_jokemodel,node_chuckapi toneMint
```

## Components

### Client app

- [App routes](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Login page](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/Login/index.tsx): `client/src/pages/Login/index.tsx`
- [Register page](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/Register/index.tsx): `client/src/pages/Register/index.tsx`
- [Auth form](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/AuthForm/index.tsx): `client/src/components/AuthForm/index.tsx`
- [Decoration](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Decoration.tsx): `client/src/components/Decoration.tsx`
- [Logo](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Logo.tsx): `client/src/components/Logo.tsx`
- [Main layout](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/components/Main/index.tsx): `client/src/components/Main/index.tsx`
- [Random joke](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/RandomJoke/index.tsx): `client/src/pages/RandomJoke/index.tsx`
- [My jokes](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/MyJokes/index.tsx): `client/src/pages/MyJokes/index.tsx`
- [Add joke](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/pages/AddJoke/index.tsx): `client/src/pages/AddJoke/index.tsx`
- [API client](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/services/apiService.ts): `client/src/services/apiService.ts`
- [Joke storage](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/client/src/utils/localStorage.ts): `client/src/utils/localStorage.ts`
- **Browser storage**

### Server API

- [Nest app](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/app.module.ts): `server/src/app.module.ts`
- [Jokes controller](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.controller.ts): `server/src/jokes/jokes.controller.ts`
- [Categories controller](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/categories/categories.controller.ts): `server/src/categories/categories.controller.ts`

### Joke integration

- [Jokes service](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/jokes.service.ts): `server/src/jokes/jokes.service.ts`
- [Categories service](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/categories/categories.service.ts): `server/src/categories/categories.service.ts`
- [Joke filters](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/dto/get-joke-filter.dto.ts): `server/src/jokes/dto/get-joke-filter.dto.ts`
- [Joke response](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/dto/joke.dto.ts): `server/src/jokes/dto/joke.dto.ts`
- [Joke model](https://github.com/malinuuus/chuck-norris-jokes-app/blob/main/server/src/jokes/joke.model.ts): `server/src/jokes/joke.model.ts`

### Other components

- **User**
- **Chuck Norris API**

## Connections

- User → App routes: opens
- App routes → Login page: routes to (evidence: `client/src/App.tsx`)
- App routes → Register page: routes to (evidence: `client/src/App.tsx`)
- App routes → Main layout: wraps pages (evidence: `client/src/App.tsx`)
- App routes → Random joke: routes to (evidence: `client/src/App.tsx`)
- App routes → My jokes: routes to (evidence: `client/src/App.tsx`)
- App routes → Add joke: routes to (evidence: `client/src/App.tsx`)
- Login page → Auth form: renders (evidence: `client/src/pages/Login/index.tsx`)
- Register page → Auth form: renders (evidence: `client/src/pages/Register/index.tsx`)
- Auth form → Decoration: renders (evidence: `client/src/components/AuthForm/index.tsx`)
- Auth form → Logo: renders (evidence: `client/src/components/AuthForm/index.tsx`)
- Main layout → Logo: renders (evidence: `client/src/components/Main/index.tsx`)
- Random joke → API client: fetches jokes (evidence: `client/src/pages/RandomJoke/index.tsx`)
- Random joke → Joke storage: saves joke (evidence: `client/src/pages/RandomJoke/index.tsx`)
- My jokes → Joke storage: reads and removes (evidence: `client/src/pages/MyJokes/index.tsx`)
- Add joke → Joke storage: saves joke (evidence: `client/src/pages/AddJoke/index.tsx`)
- Joke storage → Browser storage: reads and writes (evidence: `client/src/utils/localStorage.ts`)
- API client → Nest app: HTTP requests (evidence: `client/src/services/apiService.ts`)
- Nest app → Jokes controller: registers (evidence: `server/src/app.module.ts`)
- Nest app → Categories controller: registers (evidence: `server/src/app.module.ts`)
- Nest app → Jokes service: provides (evidence: `server/src/app.module.ts`)
- Nest app → Categories service: provides (evidence: `server/src/app.module.ts`)
- Jokes controller → Jokes service: delegates to (evidence: `server/src/jokes/jokes.controller.ts`)
- Jokes controller → Joke filters: accepts (evidence: `server/src/jokes/jokes.controller.ts`)
- Jokes controller → Joke response: returns (evidence: `server/src/jokes/jokes.controller.ts`)
- Jokes service → Joke filters: uses (evidence: `server/src/jokes/jokes.service.ts`)
- Jokes service → Joke response: builds (evidence: `server/src/jokes/jokes.service.ts`)
- Jokes service → Joke model: types response data (evidence: `server/src/jokes/jokes.service.ts`)
- Jokes service → Chuck Norris API: requests random joke (evidence: `server/src/jokes/jokes.service.ts`)
- Categories controller → Categories service: delegates to (evidence: `server/src/categories/categories.controller.ts`)
- Categories service → Chuck Norris API: requests categories (evidence: `server/src/categories/categories.service.ts`)
