Rest Countries Api using Next, Tailwind and TypeScript

Solution retrospective
I'm most proud of implementing advanced Next.js 15 features like unstable_cache
for API optimization and useOptimistic
for seamless user interactions.
I handled complex state synchronization between URL parameters, search filters, and optimistic updates while maintaining accessibility with React Aria Components
What challenges did you encounter, and how did you overcome them?The biggest challenge was managing theme persistence across server-side rendering and client-side hydration without causing mismatches. I solved this by implementing cookie-based theme detection on the server side and proper client-side synchronization.
What specific areas of your project would you like help with? Areas I'd like help with-
Performance Optimization
- Best practices for reducing unnecessary re-renders
-
State Management
- Better patterns for managing complex state
-
Accessibility
- Ensuring the application meets WCAG standards
- Improving keyboard navigation and screen reader support
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@DarkstarXDD
Looks nice.
Any reason why you are setting up the font files manually? If there is a specific reason for that then it's fine, but otherwise Next.js has a built in workflow for that. You can simply import any google font from
next/font/google
inside yourlayout.tsx
file (or any other file you like) and then use that. When your app is built, Next.js will automatically download that font file and self host it. So you don't have to include the font assets and then reference them with@font-face
in your.css
file. DocsAgain, if you have a reason to not use it then it's totally fine, but I just shared in case you were not aware of that feature.
Marked as helpful - @wendyhamel
Hi there!
- Great match to the design!
- Great research on the error handling and keeping track of your personal challenges.
- Light and dark mode switch out smoothly, without upsetting your eyes
I could not test it thoroughly because the API was not working as it should. But the layout looks good on different screen sizes.
Happy coding!
Marked as helpful - @adam-crowley
Style
Responsive layout/style looks good.
On the CountryDetail component, the flag image aspect-ratio is distorted. This can be fixed by setting height of the img tag to
auto
and removing themax-height
property.Currency the flags rendered are PNG links. The SVG links are visually sharper. The json file has
svg
andpng
links for each countriesflags
property.Animation elements for light/dark mode: Some elements don't have an color animation transition. The animation would look smoother if all the elements transition together.
Function
The persistant light/dark mode on reload is cool.
The filter/dropdown functionality, in combination with country search is really good usability-wise.
State management: I recommend Zustand for global state management. It's easy to get to grips with and it saves complex prop drilling.
Accessibility
Accessibility looks good, but you can run it through this tester if you want to get it perfect. https://wave.webaim.org/
Great job!
Marked as helpful - P@Romeo899
web app looks awesome. Nice!👍
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