Skip to content

tonym128/peakylight

Repository files navigation

PeakyLight

About

This is a serverless web application to fetch and show you astronomical daylight vs topographical daylight at any place on earth. In short, it shows you how much less sun you will get than your weather forecast for your area predicts.

It shows sunrise and sunset differences on any day of the year, using the topographical layout of the surrounding land. You can get a monthly report and export a video for every day of the year to view the differences.

How to Use

  1. Open index.html or peakylight.html in your web browser.

How to Run

This project consists of static HTML files. To view them, you can open the .html files directly in your browser. However, for a more realistic development and testing environment, it's recommended to use a local web server.

You can view the website at https://tonym128.github.io/peakylight/ which would be the same as hosting this yourself.

Using a local static server (serve)

This project is static and is best served with a small static server during development. We recommend the Node.js serve package:

  1. Install serve globally (or as a dev dependency):
npm install -g serve
  1. Run the server from the project root:
serve

serve will print a URL to open in your browser (commonly http://localhost:3000). It handles correct MIME types and caching headers which makes it a better development experience than opening files directly.

You can run serve on a specific port (for example 8000) like this:

serve -l 8000

If you don't want to install serve globally, you can run it with npx:

npx serve -l 8000

How to Dev

  1. Clone the repository.
  2. Install dependencies: npm install
  3. Make changes to the code.

How to Test

  1. Run the tests: npx playwright test

Data Sources

The PeakyLight application utilizes several external data sources and libraries to provide its functionality:

  • Mapping & Geocoding:

    • LeafletJS: An open-source JavaScript library for mobile-friendly interactive maps.
    • OpenTopoMap: Provides topographic map tiles.
    • Nominatim: Provides geocoding services from OpenStreetMap data.
  • 3D Visualization & Sun Position:

    • Three.js: A cross-browser JavaScript library and API used to create and display animated 3D computer graphics in a web browser.
    • SunCalc: A tiny JavaScript library for calculating sun position, sunlight phases (times for sunrise, sunset, dusk, etc.), and lunar position and phases.
  • Elevation Data:

    • Amazon Web Services (AWS) Terrain Tiles: Provides elevation data for rendering the 3D terrain.
  • PDF Generation:

    • jsPDF & jsPDF-AutoTable: Libraries used to generate and export reports as PDF documents.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

About

Web page to show Astronomical daylight vs topographical daylight at any place on earth.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors