UCS & A*
Implementation of UCS and A* algorithm for finding the shortest route between 2 points in a map
April 2023 — April 2023
Summary
Rudimentary path finding site to find the shortest route between two points using UCS and A* algorithm
Developer Diaries
Beware of SSR
The library that I used for the map was react-leaflet
that for some reason needed information regarding the browser window. But because NextJS uses SSR by default, using the library out-of-the-box would lead to runtime error. As such, there were a (in retrospect trivial, but I had to spend a bit looking into it initially) work-around that had to be done to ensure the part of the app containing the library is only rendered on the client. This workaround can be seen in the index.tsx
. I think that's only because I was using the pages router instead of the newer app router. If I were using the app router I think I'd only need to mark the whole app with use client
.
The Epicness of DaisyUI
A friend told me about daisyUI a while before this project and I decided to use it here in order to try it out. I can definitely say that it is the GOAT because it made me able to make a decent-looking site with decent-looking component, kind of like bootstrap. Unlike bootstrap however, it's a breeze to customize the components provided by daisyUI.