DEV Community

Cover image for HikingPSU: Clear Trail Ratings and an AI Guide for Happy Valley
Zihan Zhao
Zihan Zhao

Posted on

HikingPSU: Clear Trail Ratings and an AI Guide for Happy Valley

What we built

State College has a strong hiking tradition, and great trails start just outside town. But information about them is scattered across club pages, forums, PDFs and word of mouth. On popular apps, a trail is labeled only Easy, Moderate or Hard, with no reason given. Details that matter here are often missing, too, like whether you can get there without a car or whether it's hunting season.

At HackPSU, our team of four built HikingPSU: one place where Penn State hikers can find trails around Happy Valley, see clear ratings, and build a hiking community together.

How it works

  • A map of 52 trails. We imported 40 from OpenStreetMap and entered 12 by hand.
  • A five-level difficulty scale that explains itself. Effort = miles + feet of climb รท 500. Rough terrain bumps a trail up a level. Every rating shows its reasons, so "Level 3" means something.
  • An AI trail planner. Users ask hiking questions, and our AI agent, powered by the Gemini API, answers using our trail data.
  • Check-ins and badges. When you finish a hike near a trailhead, you can check in with GPS and earn badges.

What we used

  • Frontend: React, Vite, Leaflet and Tailwind, hosted on AWS Amplify
  • Backend: FastAPI on Render
  • Data: MongoDB and OpenStreetMap
  • Login: Auth0
  • AI: Gemini API

What broke at 3am

  • The guest limit didn't work. Guests get 5 AI questions a day, but in testing they could keep going. We keyed the limit by IP address and read the IP from the last entry in X-Forwarded-For. Behind our host's proxy, that entry was the proxy's own address, and it changed between requests, so every request looked like a new visitor. We switched to Cloudflare's CF-Connecting-IP header, which holds the real visitor's IP.
  • Trails looked too easy. Many trails we imported from OpenStreetMap are out-and-back, but we rated them on the one-way distance. Once we rated them on the full round trip, the number of Level 1 trails dropped from 28 to 16.
  • Merge conflicts hit main. Four people pushing to one branch at 2am led to conflict markers in committed code. We fixed it and added branch protection with pull-request reviews.
  • The chatbot printed raw asterisks. The AI replied in Markdown, but the chat window showed ** and - as plain text. We added light Markdown rendering.

What's next

We want to grow HikingPSU from Happy Valley to the rest of Pennsylvania. The same OpenStreetMap import works for any region, and every check-in helps verify the trail data. If you're in State College, try it at hikingpsu.com.

Top comments (0)