Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
98d5512
Push latest changes
KausarShangareeva Sep 25, 2025
127b346
Push latest changes
KausarShangareeva Sep 25, 2025
5489944
Push latest changes
KausarShangareeva Sep 25, 2025
1de6ca8
Push latest changes
KausarShangareeva Sep 26, 2025
ae9d5aa
Push latest changes
KausarShangareeva Sep 26, 2025
9a7a894
Push latest changes
KausarShangareeva Sep 26, 2025
e9e46bb
Push latest changes
KausarShangareeva Sep 26, 2025
784c5e8
Push latest changes
KausarShangareeva Sep 27, 2025
8dbd8b0
Push latest changes
KausarShangareeva Oct 2, 2025
b05a547
Push latest changes
KausarShangareeva Oct 2, 2025
4eb8b44
Push latest changes
KausarShangareeva Oct 2, 2025
3d98665
Push latest changes
KausarShangareeva Oct 10, 2025
08a61e3
Push latest changes
KausarShangareeva Oct 10, 2025
72c0918
Push latest changes
KausarShangareeva Oct 10, 2025
a7fca00
chore: push latest changes
KausarShangareeva Oct 10, 2025
1d070a1
chore: push latest changes
KausarShangareeva Oct 10, 2025
7405025
chore: push latest changes
KausarShangareeva Oct 10, 2025
36be877
chore: push latest changes
KausarShangareeva Oct 10, 2025
dd969f1
Revise README for Favorite Dessert project
KausarShangareeva Nov 14, 2025
c6d878e
Simplify README introduction text
KausarShangareeva Nov 14, 2025
f337b9a
Add
KausarShangareeva Nov 14, 2025
f870dac
Update README with screenshot and features section
KausarShangareeva Nov 14, 2025
4ae8edd
Add screenshot to README
KausarShangareeva Nov 14, 2025
bee3ff5
Update project files and README
KausarShangareeva Nov 16, 2025
bd8e466
Deleted not used img
KausarShangareeva Nov 16, 2025
12f0a9d
Deleted not needed js
KausarShangareeva Nov 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 115 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,115 @@
# js-project-recipe-library
# 🍰 Favorite Dessert

**Favorite Dessert** is a fun and interactive dessert recipe app built during Technigo’s Advanced JavaScript & TypeScript course. You can explore, filter, sort, and save your favorite desserts while practicing real API integration, dynamic DOM rendering, and responsive design.

The project is live on [Netlify](https://favorate-dessert.netlify.app/).

---

## πŸ”— Demo

Check it out here: [Favorite Dessert on Netlify](https://favorate-dessert.netlify.app/)

---

## πŸ“Έ Screenshot

![Favorite Dessert Screenshot](website-screenshot/Screenshot.png)

---

## πŸš€ Features

- πŸ” **Search desserts** by name
- 🍽️ **Cuisine filter**: British, Chinese, Indian, or All
- πŸ”„ **Sorting options**:
- Descending ⬇️ / Ascending ⬆️
- Less popular ⭐ / More popular ⭐⭐⭐
- Random 🎲
- ❀️ **Like your favorite desserts** and view them in the **Favorites** section
- πŸ“± Fully **responsive design** β€” works on desktop, tablet, and mobile

---

## 🧰 Tech Stack / What I Built With

- **HTML / CSS / SASS** for structure, layout, and styling
- **CSS Grid** for responsive card layout
- **CSS animations** for loading spinner and transitions
- **Vanilla JavaScript**:
- `map()`, `filter()`, `sort()` for array logic
- `async/await` for API calls
- `fetch()` API for real recipe data
- `localStorage` for caching API responses
- DOM manipulation using `innerHTML` and `classList`
- Event handling with `addEventListener()`
- **Lucide Icons** for interactive UI elements

---

## 🧠 How It Works

1. On page load, the app fetches 15 random dessert recipes from the Spoonacular API.
2. API responses are cached in **localStorage** to minimize requests and respect quota limits.
3. If the API fails or the daily quota is exceeded, the app falls back to **local demo data**.
4. Desserts are dynamically rendered with **images, cooking time, ingredients, and popularity**.
5. Users can **filter by cuisine** or **sort recipes** by popularity, cooking time, or randomly.
6. **Favorites system**: click the heart icon to like/unlike desserts; favorites persist in localStorage.
7. The layout is fully **responsive**, adapting from mobile to large desktop screens.

---

## πŸ“‚ File Structure

```
πŸ“‚ css/ # Stylesheets
πŸ“‚ img/ # Dessert images
πŸ“‚ js/ # JavaScript logic
πŸ“‚ sass/ # SASS files
β”‚
β”œβ”€β”€ πŸ“ abstracts/ # Variables, mixins, functions
β”œβ”€β”€ πŸ“ base/ # Base styles (reset, typography)
β”œβ”€β”€ πŸ“ cards/ # Card styles for desserts
β”œβ”€β”€ πŸ“ components/ # Reusable UI components
β”œβ”€β”€ πŸ“ layout/ # Layout and grid styles
└── πŸ“ page/ # Page-specific styles
```

---

## πŸ“„ Project Requirements

- Display recipes dynamically from API or demo data βœ…
- Filter by at least one property (cuisine) βœ…
- Sort by at least one property (popularity or cooking time) βœ…
- Random recipe button βœ…
- Empty state when no results match the filter
- Fully responsive layout (320px β†’ 1600px+) βœ…

---

## πŸ“ What I Learned

- How to fetch and handle data from a real API with async/await
- Implementing fallback strategies when API fails or quota is exceeded
- Caching API responses in localStorage
- Creating dynamic, data-driven UI with `.map().join("")`
- Filtering, sorting, and updating the DOM efficiently
- Implementing a favorites system that persists across page refreshes
- Responsive design using CSS Grid and media queries
- Building a friendly UX with loading states and empty states

---

## πŸ”œ Next Steps

- Add detailed recipe view / modal
- Implement dietary restriction filters
- Enable recipe sharing or rating system
- Improve accessibility further

---

## πŸ“„ License

This project is free to use for educational purposes.
Loading