Skip to content

A simple and fun React web app that fetches random pieces of advice using the Advice Slip API. Built with React.js and Tailwind CSS, this project highlights API integration, state management, and responsive UI design.

Notifications You must be signed in to change notification settings

geliettech/mystic-cookie

Repository files navigation

Frontend Mentor - Advice generator app solution

This is a solution to the Advice generator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

📋 Table of Contents


Overview

💡 The Challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Generate a new piece of advice by clicking the dice icon

This challenge focuses on working with APIs, creating dynamic user interfaces, and applying responsive design principles.


Screenshots

Desktop View

Mobile View


🔗 Links


⚙️ My Process

🛠️ Built With

  • React.js – For building the interactive UI
  • Tailwind CSS – For fast, responsive, and clean styling
  • Fetch API / Async Await – For retrieving random advice from the Advice Slip API
  • CSS Custom Properties – To manage consistent colors and spacing
  • Mobile-First Workflow – Ensuring responsiveness across devices

🧠 What I Learned

This project helped me deepen my understanding of API integration, state management, and conditional rendering in React. Here’s a key takeaway:

// I learned that funtion mapping is used for arrays of objects.
// When the data is in object format, you can access properties directly.
<p>{data.slip.advice}</p>

🚀 Continued Development

In future projects, I aim to focus on:

  • Enhancing API error handling and loading animations
  • Implementing light/dark mode using Tailwind’s theme toggle
  • Exploring state management libraries like Zustand or Redux for larger apps
  • Writing cleaner, reusable React components

📚 Useful Resources


👩‍💻 Author


💖 Acknowledgments

A big thank you to:

  • The Frontend Mentor team for providing this practical challenge.
  • The YouTube community (particularly React tutorial creators) for insightful guidance on API fetching and React hooks.

About

A simple and fun React web app that fetches random pieces of advice using the Advice Slip API. Built with React.js and Tailwind CSS, this project highlights API integration, state management, and responsive UI design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published