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.
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.
- Source Code: github.com/geliettech/mystic-cookie
- Live Demo: Mystic Cookie
- 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
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>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
- React Official Documentation – For understanding React hooks, components, and lifecycle concepts
- Tailwind CSS Docs – Helped me build responsive layouts quickly
- Frontend Mentor Discord – Great place to get feedback and connect with other developers
- Portfolio: Ogechi Uhegbu
- Frontend Mentor: @geliettech
- GitHub: @geliettech
- Twitter: @geliettech
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.