Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 24 days ago

Responsive shop app with database and animations

animation, mongodb, next, react
P
radkr•60
@radkr
A solution to the Product list with cart 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?

Proud of

With my solution I went a bit further and created a

  • Next.js site deployed on Vercel that is
  • dinamically adjusts to the browser's default font size and is
  • reponsive but still
  • stick to the Frontend Mentor's design when the default font size is 16px.

I improved the user experience by adding

  • animation to the modal and the add to cart button plus
  • smooth transitions upon hover.

I want to make this project a bit more closer to a real world scenario by

  • fetching the product list from a database and the product pictures from a blob store so products can be added or removed without needing to rebuild the application while
  • preserving server-side rendering as a step towards SEO so the shop's products can be find easier while browsing the internet so
  • my application connects to MongoDb Atlas and Vercel Blob Store by an async react server component
  • as well as applies incremental static regeneration on the page with invalidation timeout of 60s.

While implementing unit and integration tests, I successfully tackled several challenges

  • particularly in handling asynchronous server components in both test types, and
  • in effectively mocking the React Context API.

Would do differently next time:

  • Think ahead of animations at the beginning of the project.
  • I would like to dive into the testing best practices to be more effective.
What challenges did you encounter, and how did you overcome them?

Testing async react server components is challenging because the React Testing Library does not yet support them. I read several articles and discussions about workarounds and finally came up with my solution that worked well for me this time.

I am not sure that I found the best way to animate the app.

I found it surprisingly hard to implement the increment and decrement buttons with an animated hover state. The normal and the hover states are complements of each other in the sense that where one of them white, the other is transparent. After all, I solved the problem by replacing an SVG image with its complementary one on hover. I am wondering if there is a better way to achieve the same effect.

What specific areas of your project would you like help with?

I found it surprisingly hard to implement the increment and decrement buttons with an animated hover state. The normal and the hover states are complements of each other in the sense that where one of them is white, the other is transparent. After all, I solved the problem by replacing an SVG image with its complementary one on hover. I am wondering if there is a better way to achieve the same effect.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on radkr'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.