Code Monkey home page Code Monkey logo

chunknorrisjoke's Introduction

The application objective is to fetch 10 Random Chuck Norris jokes. These jokes can be fetched from the following API http://api.icndb.com/jokes/random/10

Description

When jokes are fetched they need to be displayed in a list. In this list we can mark certain jokes as favorite. The favorite jokes will appear in a favorites list with a max of 10 unique items.

There should be an option to remove jokes from the favorite list as well.

On refresh the favorites lists should be stored so next time when application visited, favorites should be present.

In addition, we can also turn a timer on/off via a button (every 5 seconds). This will add one random joke to the favorites list http://api.icndb.com/jokes/random/1 until the list has 10 items.

ِApplication Hierarchy:

The application consists of three tiers:

1. Frontend (FE):

It has one page in ASP.NET MVC that displays the jokes list along with the favorites. It has JavaScript library called jokes.js which exposes the functions that can be performed on a Joke such as fetchSavedJokes, fetchJokes and fireJokesTimer. Such functions are encapsulated into a joke class called JokeHandler, so you need to instantiate it to get access to them.

In addition, there is the view MVC page which references the jokes.js class functions.

2. Middleware (MW):

It is the layer that responsible for parsing the jokes from the FE layer to the backend (BE) layer. This layer can be developed using many tools and technologies such as .NET, NodeJs, or PHP. This application uses .NET Entity Framework to communicate with the data container (here is SQL Server). Here, we use Restful API services to handle jokes.

3. Backend (BE):

It is the data layer where favorite jokes are placed and stored. It can be replaced by any other data containers such as memory storage, web storage or even flat files. We have here one table called Joke which stores Joke Id, value and category. Database structure and table creation script can be found here as well.

Technical Design Highlights

As a simple application, it uses a multiselect.js library which can be found here.

ِApplication Screenshots:

  1. Fetch Jokes

- Fetch Jokes.

  1. Load Stored Favorite Jokes at Startup

- Stored Favorite Jokes.

  1. Get Random Jokes

- Get Random Jokes.

  1. Done Getting Random Jokes

- Done Random Jokes.

chunknorrisjoke's People

Contributors

diaakhateeb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.