How malinuuus/chuck-norris-jokes-app works
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: App.tsx App routes · jokes.service.ts Jokes service · app.module.ts Nest app · jokes.controller.ts Jokes controller
Components 23
Client app
- App routes
client/src/App.tsx - Login page
client/src/pages/Login/index.tsx - Register page
client/src/pages/Register/index.tsx - Auth form
client/src/components/AuthForm/index.tsx - Decoration
client/src/components/Decoration.tsx - Logo
client/src/components/Logo.tsx - Main layout
client/src/components/Main/index.tsx - Random joke
client/src/pages/RandomJoke/index.tsx - My jokes
client/src/pages/MyJokes/index.tsx - Add joke
client/src/pages/AddJoke/index.tsx - API client
client/src/services/apiService.ts - Joke storage
client/src/utils/localStorage.ts - Browser storage
Server API
- Nest app
server/src/app.module.ts - Jokes controller
server/src/jokes/jokes.controller.ts - Categories controller
server/src/categories/categories.controller.ts
Joke integration
- Jokes service
server/src/jokes/jokes.service.ts - Categories service
server/src/categories/categories.service.ts - Joke filters
server/src/jokes/dto/get-joke-filter.dto.ts - Joke response
server/src/jokes/dto/joke.dto.ts - Joke model
server/src/jokes/joke.model.ts
Other components
- User
- Chuck Norris API
Connections 31
- User → App routes: opens
- App routes → Login page: routes to
client/src/App.tsx - App routes → Register page: routes to
client/src/App.tsx - App routes → Main layout: wraps pages
client/src/App.tsx - App routes → Random joke: routes to
client/src/App.tsx - App routes → My jokes: routes to
client/src/App.tsx - App routes → Add joke: routes to
client/src/App.tsx - Login page → Auth form: renders
client/src/pages/Login/index.tsx - Register page → Auth form: renders
client/src/pages/Register/index.tsx - Auth form → Decoration: renders
client/src/components/AuthForm/index.tsx - Auth form → Logo: renders
client/src/components/AuthForm/index.tsx - Main layout → Logo: renders
client/src/components/Main/index.tsx - Random joke → API client: fetches jokes
client/src/pages/RandomJoke/index.tsx - Random joke → Joke storage: saves joke
client/src/pages/RandomJoke/index.tsx - My jokes → Joke storage: reads and removes
client/src/pages/MyJokes/index.tsx - Add joke → Joke storage: saves joke
client/src/pages/AddJoke/index.tsx - Joke storage → Browser storage: reads and writes
client/src/utils/localStorage.ts - API client → Nest app: HTTP requests
client/src/services/apiService.ts - Nest app → Jokes controller: registers
server/src/app.module.ts - Nest app → Categories controller: registers
server/src/app.module.ts - Nest app → Jokes service: provides
server/src/app.module.ts - Nest app → Categories service: provides
server/src/app.module.ts - Jokes controller → Jokes service: delegates to
server/src/jokes/jokes.controller.ts - Jokes controller → Joke filters: accepts
server/src/jokes/jokes.controller.ts - Jokes controller → Joke response: returns
server/src/jokes/jokes.controller.ts - Jokes service → Joke filters: uses
server/src/jokes/jokes.service.ts - Jokes service → Joke response: builds
server/src/jokes/jokes.service.ts - Jokes service → Joke model: types response data
server/src/jokes/jokes.service.ts - Jokes service → Chuck Norris API: requests random joke
server/src/jokes/jokes.service.ts - Categories controller → Categories service: delegates to
server/src/categories/categories.controller.ts - Categories service → Chuck Norris API: requests categories
server/src/categories/categories.service.ts