MCPcopy Index your code
hub / github.com/bogdano/pick-a-park

github.com/bogdano/pick-a-park @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
4,356 symbols 11,786 edges 21 files 11 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Pick A Park!

Quickly pick a US National Park to visit, based on driving distance from your location, and the weather at the park.

A learning exercise in Go programming, this project was inspired by the hours I spent trying to pick a national park for a roadtrip during spring break, while I was studying in the US. In mid-March most of the parks around me were still too cold for a longer camping trip, and so I would spend hours cross-referencing the weather at the parks and trying to pick the closest one that my sleeping bag could handle.

The app uses data from the National Park Service API, the OpenWeatherMap API, and the Mapbox API.

Most of the Go code deals with wrangling the data from the NPS API. Their images are 10MB+ in size, and so one of the primary tasks was to resize and compress them before storing them in my DB, in an efficient way. Other optimizations include storing certain responses in my DB as JSON strings, minimizing the number of queries to the Mapbox API by using the Haversine function to narrow down parks within a certain radius of the coordinates provided by the browser's Geolocation API, and storing certain responses in localstorage.

For templating, I used templ (templ.guide). The type safety and LSP saved me several times during development, and template generation is very quick at Go build time.

I used HTMX (https://htmx.org) to handle state because I am interested in exploring how it feels to use it in real-world projects. Its simplicity is enticing, but I am still trying to narrow down specifically what kinds of usecases it would provide a massive benefit for in terms of reduced complexity (as is the case with this project), and which kinds of usecases it would eventually appear to be a hindrance for. All additional client-side logic was written in pure JS.

I opted to use Pocketbase (https://pocketbase.io) for this project because I love the idea of it and wanted to experience working with it. Considering the final scope, it would have made more sense to use something like Turso or basic SQLite distributed via LiteFS (as of now the app doesn't utilize the auth/email functionalities because I didn't feel it would contribute to the usability of the app).

The app is hosted on fly.io.

PS. There is nothing stopping this project from including National Parks from all nations, other than the gargantuan task of accumulating the data necessary (which does not appear to be consolidated anywhere). According to Wikipedia, there are 3,367 national parks worldwide.

If anybody has a suggestion as to how to make this happen, please let me know!

Core symbols most depended-on inside this repo

get
called by 543
pb_public/mapbox-gl.js
evaluate
called by 223
pb_public/mapbox-gl.js
fire
called by 198
pb_public/mapbox-gl.js
set
called by 189
pb_public/mapbox-gl.js
destroy
called by 171
pb_public/mapbox-gl.js
emplaceBack
called by 159
pb_public/mapbox-gl.js
add
called by 140
pb_public/mapbox-gl.js
t
called by 135
pb_public/mapbox-gl.js

Shape

Method 2,746
Function 961
Class 644
Struct 5

Languages

TypeScript99%
Go1%

Modules by API surface

pb_public/mapbox-gl.js4,071 symbols
pb_public/htmx.min.js188 symbols
pb_public/blaze-slider.min.js32 symbols
pb_public/mapbox-gl-geocoder.min.js23 symbols
api/parks_service.go17 symbols
template/template.go5 symbols
api/mapbox_matrix.go5 symbols
pb_public/preload.js4 symbols
migrations/1721759078_collections_snapshot.go1 symbols
migrations/1721010851_collections_snapshot.go1 symbols
migrations/1718825049_collections_snapshot.go1 symbols
migrations/1718824959_collections_snapshot.go1 symbols

For agents

$ claude mcp add pick-a-park \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact