Git Product home page Git Product logo

kanzatahreem / the-mealdb Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 4.32 MB

Web app build on an external API called as MealDB, and an Involvement API which is used to record the user interactions including likes, and comments.

Home Page: https://kanzatahreem.github.io/The-MealDB/

License: MIT License

Shell 13.03% HTML 13.92% JavaScript 46.75% CSS 26.29%
api api-documentation asynchronous-programming callback css es6-modules git-conflicts gitflow github-projects group-project

the-mealdb's Introduction

The MealDB - API based webapp

The JavaScript capstone project is build on MealDB, an external API, and an Involvement API which is used to record the user interactions including likes, and comments. The project covers the following mentioned points

  • The main page shows a list or a collection of meals (retrieved from an Β­external API) that you can like.
  • A popup window with more data about an item that you can use to comment on the different meals and also see a list of comments.
  • In the pop-up window you can see the main ingredients, needed for each recipe, a procedure to follow for the preparation of each meal.
  • The popup window consists of two buttons, one that connects to a YouTube video explaining step-by-step of each recipe, and another one that links to official website.
  • The application shows the number of likes and comments for each meals. Β­

Built With

  • HTML & CSS
  • Bootstrap
  • JavaScript (ES6)
  • Webpack
  • Jest Testing Library
  • MealDB API
  • Linters

Live Demo

Live at MealDB

Video Description

View video presentaton

Getting Started

Prerequisites

  • node.js (10.13.0 (LTS))
  • git

Setup

To get a local copy, follow the steps below:

  1. Open your terminal

  2. Navigate to the directory where you want to clone the project.

  3. Clone the project using git clone or directly by running the following command

    git clone [email protected]:KanzaTahreem/The-MealDB.git

  4. Open your editor and follow the steps mentioned below

Install

  • npm install

Usage

  • npm run build
  • npm start

Authors

πŸ‘€ Author

Authors

πŸ‘€ Author

🀝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

πŸ“ License

This project is MIT licensed.

the-mealdb's People

Contributors

kanzatahreem avatar osvaldobc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

osvaldobc

the-mealdb's Issues

Peer-to-Peer Code Review

Hi @OsvaldoBC and @KanzaTahreem,
Your project is looking great. I really enjoyed reviewing it, it shows all the hard work displayed
Congratulations! πŸŽ‰

Highlights

  • The design fits the template. βœ”οΈ
  • Good use of ES6 modules. βœ”οΈ
  • Good use of GitFlow. βœ”οΈ
  • Webpack configuration is good! βœ”οΈ
  • I love the Slider 😁. βœ”οΈ

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

Cheers and Happy coding!πŸ‘πŸ‘πŸ‘

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

[4pt] - Display list of items on the Homepage - Student A

Create the main part of the homepage that keeps the layout from the wireframe:

Screenshot 2021-06-27 at 21 50 23

When the page loads, the webapp retrieves data from the selected API and shows the list of items on screen with the basic data (e.g. title + image).

Prepare also "Comments" and "Reservations" buttons. They should be doing nothing - just being displayed.

This task does not include displaying the number of likes for each item.

This task does not include the counter of the items.

[3pt] - Add reservations counter - Student C

Even if the API gives you the number of reservations you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Reservations pop up.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

[3pt] - Add all items counter on the Homepage - Student A

Even if the API gives you the number of items, you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Homepage.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

[0.5pt] Find external API - group task

Find an API to base the development of the webapp around it. The API should allow you to

  • Get a list of items with a unique item id (or generate the unique id).
  • For a given item, get detailed information about it.
    choose an APIs that doesn't need authentication. if you select an API that requires authentication, you should implement it on your own. Also, if you select an API that provides image resources your webapp will be more visual.

[3pt] - Add comments counter - Student B

Even if the API gives you the number of comments you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Comments pop up.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

[4pt] - Display Reservations pop up with selected item's details - Student C

Create a reservations popup only with the top section (displaying details of the selected item)

Screenshot 2021-06-27 at 22 10 45

When the popup loads, the webapp retrieves data from the selected API and shows details about the selected item.

Add event to button prepared by your teammate that will open your popup. You need to communicate with your team member to make sure that you do not block each other (most likely the easiest solution is to merge the list of items feature to the dev branch before you try to add that event).

JavaScript-Capstone

Hi reviewer! πŸ‘‹

Here's the link of our GitHub group project

We are a team of 2 students, Kanza and Osvaldo, and we followed the steps mentioned below for creating the project:

Create an empty repository for your group project.

  • Follow the steps described in curriculum-tools-copy-projects.
  • Open the GitHub project (Kanban board) in your team repo.
  • Make sure that in the card titles you can see: Student A and Student B
  • Make sure that each card starts with [Xpt] - that number indicates the number of points that shows how complex the task is. 1 point = 1 hour of work.
  • Decide who in your team is the Student A and Student B.
  • Each of the team members should assign themselves to the correct cards. Decide who will be the assignee for the cards marked as group tasks. All cards on your Kanban board should have assignees.

Peer to peer code review - October 21

Hi @OsvaldoBC and @KanzaTahreem ,
Your project is looking great! The effort you have put onto it really shows. Below you will find some feedback and recommendation from our Morning session team 😸

Highlights

  • Great design! βœ”οΈ
  • Clean and easy-to-read code. βœ”οΈ
  • Good use of ES6 modules. βœ”οΈ
  • The slider on the homepage is a great addition. βœ”οΈ

Recommendations

const getMeals = async () => {
const response = await fetch('https://www.themealdb.com/api/json/v1/1/filter.php?c=Seafood', {
method: 'GET',
});

  • The GET method is the default for fetch, so you don't need to specify it in this case πŸ™‚ . More info here.

const showPopup = async (idMeal) => {
popUpSection.innerHTML = '<div class="backdrop"></div>';
const commentsList = await getComments(idMeal);
getMealDetail(idMeal).then((meal) => {
const string = `
<div class="popup-wrapper">
<div class="popup">
<i class="fa-solid fa-xmark close"></i>
<div class="popup-details">
<img src=${meal.meals[0].strMealThumb} alt="Thumbnail" class="popup-img">
<h3 class="game-title">${meal.meals[0].strMeal}</h3>
<div class="meal-links">
<button> <a href="${meal.meals[0].strSource}"> Source</a></button>
<button> <a href="${meal.meals[0].strYoutube}"> Youtube</a></button>
</div>
<div class="popup-desc">
<p><b> Main Ingredients </b></p>
<ul>
<li>${meal.meals[0].strIngredient1}: ${meal.meals[0].strMeasure1}</li>
<li>${meal.meals[0].strIngredient2}: ${meal.meals[0].strMeasure2}</li>
<li>${meal.meals[0].strIngredient3}: ${meal.meals[0].strMeasure3}</li>
<li>${meal.meals[0].strIngredient4}: ${meal.meals[0].strMeasure4}</li>
<li>${meal.meals[0].strIngredient5}: ${meal.meals[0].strMeasure5}</li>
</ul>
<p><b>Procedure to Follow</b></p>
<p>${meal.meals[0].strInstructions}</p>
<div class="tags"> <b>Tags:</b> ${(meal.meals[0].strTags || '').split(',').map((el) => `<code class='tag'>${el}</code>`)}</div>
</div>
</div>
<h3 class="counter">Comments(<b class="total-comments">0</b>)</h3>
<div class='meal-comments'>
${commentsList ? commentsList.map((comment) => `
<div class="comment d-flex justify-content-between align-items-center mb-3">
<div class="d-flex justify-content-between align-items-center p-1">
<div class="username"><b>${comment.username}:</b></div>
<div class="message">${comment.comment}</div>
</div>
<div class="date">${comment.creation_date}</div>
</div>
`).join('') : ''}
</div>
<h3>Add a new Comment</h3>
<form class="post-comments">
<input type="text" name="username" class="user-name" placeholder="Your name" required>
<textarea class="user-comment" name="comment" placeholder="Your insights" required></textarea>
<button type="submit" class="submit-btn">Submit</button>
</form>
</div>
</div>`;
const stringElement = parser.parseFromString(string, 'text/html').body.firstChild;
popUpSection.append(stringElement);
const closeBtn = stringElement.querySelector('.close');
closeBtn.addEventListener('click', (e) => {
e.preventDefault();
popUpSection.classList.add('hidden');
});

  • The popup looks great and works as intended, but since you are already using Bootstrap in your project, I would kindly encourage you to check this framework's solution that makes the job a lot easier πŸ’» . More info can be found here

[4pt] -Display Comments pop up with selected item's details - Student B

Create a comments popup only with the top section (displaying details of the selected item)

Screenshot 2021-06-27 at 22 10 45

When the popup loads, the webapp retrieves data from the selected API and shows details about the selected item.

Add event to button prepared by your teammate that will open your popup. You need to communicate with your team member to make sure that you do not block each other (most likely the easiest solution is to merge the list of items feature to the dev branch before you try to add that event).

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.