Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 2 years ago

REST Countries API (Next.js & Server Actions + TypeScript + Tailwind)

accessibility, next, tailwind-css, typescript, lighthouse
Melvin Aguilar šŸ§‘šŸ»ā€šŸ’»ā€¢61,020
@MelvinAguilar
A solution to the REST Countries API with color theme switcher challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


šŸŽ Features:

  • Next.js Server Actions to fetch data with:
    • Filtering šŸ“‚
    • Pagination ā™»ļø
    • Sorting šŸ”
  • Achieved +95% in Lighthouse score for performance, accessibility, best practices, and SEO. šŸ“Š
  • Resemblance with the original design. šŸŽØ
  • Small animations with Framer motion. šŸŽ¬
  • No errors or warnings using ESLint (Airbnb style guide). āœ”ļø
  • Custom hooks. šŸŽ£
  • Utilized TailwindCSS for responsive styling. šŸŽØ
  • Codebase is well-maintained and formatted using Prettier. šŸ’»

šŸ› ļø Built With:

  • Next.js 14. ⚔
  • TypeScript šŸš€
  • TailwindCSS. šŸŽØ
  • ESLint (Airbnb style guide). šŸ“¦
  • Framer-motion. šŸŽ¬
  • npm - prettier - prettier-plugin-tailwindcss. šŸ’»

šŸ” Clarifications:

  • While the Rest Countries API was an option, it had limitations like lack of pagination and limited filtering capabilities. I opted to utilize Server Actions in Next.js and the data.json provided with the challenge. This allowed seamless integration with MongoDB for efficient data handling.
  • I acknowledge that continuous polling for change requests might consume more data, but it was implemented for experimental purposes.

Any suggestions on how I can enhance this solution or achieve even better performance are welcome!

Thank you. šŸ˜ŠāœŒļø

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 Melvin Aguilar šŸ§‘šŸ»ā€šŸ’»'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

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

Frontend Mentor

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

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