Skip to content

Repository files navigation

Peaks

Peaks is a Meta Display Glasses web app that overlays nearby visible peaks, churches, towers, and tall landmarks relative to the user's position, heading, and altitude.

Structure

  • public/ - static frontend for the glasses.
  • functions/api/nearby-peaks.js - Cloudflare Pages Function used by the frontend.
  • GET /api/nearby-peaks?lat={lat}&lng={lng}&alt={alt} - returns visible skyline objects.

Local Development

npm install
npm run dev

Then open the local URL printed by Wrangler. The app also has a Demo button that uses the test coordinates near Tanvald.

Cloudflare Pages Git Setup

Use Cloudflare Pages Git integration so every push to main deploys automatically.

  1. Push this repository to GitHub.
  2. In Cloudflare Dashboard, open Workers & Pages.
  3. Select Create application.
  4. Select Pages.
  5. Select Connect to Git.
  6. Pick the GitHub repository for Peaks.
  7. Configure build settings:
    • Framework preset: None
    • Production branch: main
    • Build command: leave empty, or use exit 0
    • Build output directory: public
    • Root directory: leave empty if this repository root contains public/ and functions/
  8. Select Save and Deploy.

Cloudflare Pages will also deploy functions/api/nearby-peaks.js because the functions/ directory is at the repository root.

Backend Notes

No private API keys are required.

The backend calls:

  • OpenStreetMap Overpass for peaks, churches, towers, and height-tagged buildings.
  • OpenTopoData SRTM30m for terrain elevation samples.

Because OpenTopoData's public endpoint is rate-limited, the function batches elevation requests with a small delay. For heavier use, replace ELEVATION_URL in functions/api/nearby-peaks.js with a hosted elevation service, Cloudflare Worker, or cached DEM tile pipeline.

Deployment Check

npm run check

This verifies that the Cloudflare Pages Function compiles.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages