GeoBorders


I've just completed a front-end coding challenge from @frontendmentor! ๐.You can see my solution here: https://www.frontendmentor.io/solutions/geoborders-41vKW7Z3Vi. Any suggestions on how I can improve are welcome!
Completing this challenge was no small feat. While the challenge was not complex it helped refresh my frontend skills while still allowing me to interact with real-world APIs which needless to say had a complex data structure. Enough with the intro ๐What does GeoBorders bring along?
Tech Stack
Frontend
Next.js
Typescript
TailwindCSS
Shadcn
Lucide React
Millify
Maps
GoogleMaps
OpenStreetMaps
APIs
Testing
Postman - API Testing
Lighthouse - Accessibility testing
Features
View countries - Users can view a list of all countries in a scrollable screen
Search - Users can search countries by their name
Filter - Users can filter the list of all countries by their region
Maps Integrations - Users can see where each country is located in the globe
GoogleMaps
OpenStreetMaps
Leaflet.js
Take-home
Achievement
I was most excited by the chances to consume a real-life API. Fetching data - with a complex structure and rendering to the user, allowed me to exercise my skills in DOM Manipulation, conditional rendering and array manipulation.
Challenges
I had an issue with theme switching. Theme switching being a client-side concept threw me into the rabbit hole of hydration. The system (on the server side) could not understand what window === undefined
meant. The solution for this was to restrict theme change unless and until mounting is successful. In the attempt to incorporate maps, I did realize that the location Marker
in React Leaflet https://react-leaflet.js.org/docs/ was not showing. A search on this pointed out that it is a common problem in Next.js. Trying to customize the marker only proved more stubborn as I quickly realized that I had set SSR (Browser-Only feature) to true - Had to disable this.
Subscribe to my newsletter
Read articles from Stephen Mwangi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Stephen Mwangi
Stephen Mwangi
I'm a software engineer with a passion for building clean, scalable, and user-first solutions. I care deeply about code quality, performance, and turning complex ideas into intuitive digital experiences.