Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 months ago

A responsive frontend quiz app with light and dark theme toggle

react, react-router, vite, zustand, tailwind-css
Afuh Flynn Tembeng•300
@afuhflynn
A solution to the Frontend Quiz app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

💡 Highlights Comprehensive Feature Set: The app allows users to select quiz subjects, answer multiple-choice questions, receive immediate feedback, and view their final scores. This aligns well with the challenge requirements.​

Accessibility Considerations: Implementing keyboard navigation enhances usability for a broader audience, demonstrating attention to inclusive design.​

Theme Customization: Offering both light and dark themes caters to user preferences and improves the overall user experience.​

Responsive Design: Ensuring the app displays optimally across various devices showcases a solid understanding of responsive web design principles.​

🔄 Areas for Improvement Enhanced Error Handling: While the app notifies users when they attempt to submit without selecting an answer, consider expanding error handling to cover scenarios like network failures or unexpected inputs.​

Performance Optimization: Evaluate the app's load times and responsiveness, especially on mobile devices. Optimizing assets and code can enhance performance.​

User Feedback Mechanisms: Implementing features like progress indicators or hints can provide users with better feedback during the quiz, potentially improving engagement and learning outcomes.​

🚀 Moving Forward State Management: Exploring state management libraries like Redux or Context API can help manage complex state transitions more efficiently.​

Testing: Incorporating testing frameworks such as Jest or React Testing Library can ensure the app's reliability and facilitate future enhancements.​

Continuous Deployment: Setting up CI/CD pipelines can streamline the deployment process, allowing for quicker updates and maintenance.

What challenges did you encounter, and how did you overcome them?

🧠 Challenge 1: Managing Complex State Across Components As your application grew, managing state across multiple components became increasingly complex. Passing props through several layers led to tangled code and made debugging difficult.​ Frontend Mentor

Solution: Implementing a centralized state management system, such as Zustand, can streamline state handling. This approach reduces prop drilling and makes the state more predictable and easier to manage. ​

🎨 Challenge 2: Ensuring Responsive and Accessible Design Creating a user interface that is both responsive and accessible across various devices and browsers posed significant challenges. Inconsistent rendering and layout issues were common, especially when dealing with different screen sizes and input methods.​

Solution: Tailwindcss advance Flexbox and Grid layouts helped in building a responsive design. Incorporating accessibility best practices, such as semantic HTML and ARIA roles, improved the app's usability for all users. Regular testing across devices and browsers ensured consistent performance. ​

⚙️ Challenge 3: Maintaining Performance and Load Times As features were added, the application's performance began to suffer, leading to longer load times and a less responsive interface.​

Solution: Optimizing assets by compressing images and minifying CSS and JavaScript files improved load times. Implementing code-splitting and lazy loading ensured that only necessary code was loaded initially, enhancing performance. ​

🧪 Challenge 4: Lack of Early Testing Initially, the application lacked a robust testing strategy, leading to bugs and regressions that were hard to track.​

Solution: Integrating testing frameworks like Jest and React Testing Library allowed for the creation of unit and integration tests. Writing tests alongside development helped catch issues early and ensured that new features didn't break existing functionality. ​

🧭 Challenge 5: Navigating React's Learning Curve Reacquainting yourself with React's concepts after a hiatus presented a steep learning curve, especially with hooks and functional components.​

Solution: Dedicating time to review React documentation and tutorials helped refresh your understanding. Engaging with community resources and seeking assistance when needed facilitated a smoother re-entry into React development.

What specific areas of your project would you like help with?
  1. State Management If you're currently using React's useState for managing state, consider exploring more scalable solutions like the Zustand. These tools can help manage complex state across multiple components more efficiently, especially as your application grows.​

  2. Performance Optimization To enhance the app's performance, you might look into implementing techniques such as code splitting, lazy loading, and image optimization. These strategies can significantly reduce initial load times and improve the overall user experience. ​

  3. Testing Strategy Incorporating testing frameworks like Jest and React Testing Library can help ensure your app's reliability. Writing unit and integration tests during development can catch bugs early and facilitate smoother future enhancements.​

  4. User Experience Enhancements Consider adding features like progress indicators or hints to provide users with better feedback during the quiz. These enhancements can improve engagement and learning outcomes.​

  5. Accessibility Improvements While you've implemented keyboard navigation, further accessibility improvements could include ensuring proper ARIA roles, focus management, and screen reader support to make the app more inclusive.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Afuh Flynn Tembeng's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.