Skip to content

The Joke Generator is an Angular SPA that fetches random jokes from the free JokeAPI. Users can select a category (e.g., Programming, Pun, Dark) and click "New Joke" to get a setup. A "What?" button then reveals the punchline for a fun, interactive experience. 🎭

Notifications You must be signed in to change notification settings

20250317-Java-AWS/lianhong-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Joke Generator 🀣

Description

The Joke Generator is an Angular Single Page Application (SPA) that uses the free JokeAPI to fetch and display jokes based on user-selected categories.

On the home page, users can select one or more joke categories such as Programming, Pun, Misc, or Dark. When they click the "New Joke" button, the app fetches a random joke from those selected categories.

The app first displays the setup part of the joke (like a question). A second button, labeled "What?", lets the user reveal the delivery or punchline of the joke.


Concepts

  • βœ… SPA Route Navigation – All interaction happens within a single page. Additional routes like /favorites or /svg can be added later.
  • βœ… Consume a RESTful API – Uses the JokeAPI to fetch real-time jokes based on user-selected categories.
  • βœ… User Interaction – Users can choose joke categories, get a new joke, and reveal the punchline.
  • βœ… Multiple Components – The app includes:
    • HomeComponent: Displays category options and two liner jokes with interaction
    • SingleComponent: Displays category options and one liner jokes with interaction
    • FavoritesComponent: View and manage saved jokes

Features

  • 🟒 Home Page (/)

    • Select multiple joke categories
    • "New Joke" button fetches a random joke
    • Add to Favorite button add the joke to the Favorites.
    • Reset button reset everything.
    • Display the setup first
    • "What/Why?" button reveals the punchline
  • 🟒 One-Liner (/single)

    • Select multiple joke categories from drop-down
    • "New Joke" button fetches a random one part joke from the selected category
    • "New Joke" button reveals the next joke in the selected category.
  • 🟒 Favorites (/favorites)

    • Display all the favorite jokes.
    • "Remove" button the selected joke from the list and remove from display.

Technologies Used

  • Frontend Framework: Angular
  • API: JokeAPI
  • Routing: Angular Router
  • HTTP: Angular HttpClient
  • Styling: CSS / Bootstrap

About

The Joke Generator is an Angular SPA that fetches random jokes from the free JokeAPI. Users can select a category (e.g., Programming, Pun, Dark) and click "New Joke" to get a setup. A "What?" button then reveals the punchline for a fun, interactive experience. 🎭

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published