Giter Club home page Giter Club logo

dewpoint.7bit.org's Introduction

Dew Point Forecast

Build Status

This is a small web application that provides the dew point for forecast for a selected location. The dew point is the temperature at which dew forms as air is cooled. Knowing the dewpoint is good for determining how humid a day will feel.

Screen shot of dewpoint forecast for Brisbane, Australia on 1 Nov 2021

Building

This application is built with Rust using the Rocket web framework. It also makes use of the IP2Location DB for mapping IPs to countries. The database is available from https://lite.ip2location.com/database/db1-ip-country and should be placed in the root of the project.

Configuration

There is a sample config file in Rocket.toml.sample, copy this to Rocket.toml and add the two keys. For the OpenWeather API key you will need to create an account at https://openweathermap.org/.

Configuration can also be done via environment variables, which is handy for prod deployment. See the Rocket documentation for details.

Build

cargo build

The binary will be in target/debug/dewpoint.

Production Build

Add --release to the build command:

cargo build --release

The binary will be in target/release/dewpoint.

Run

cargo run

Tips

Fast auto-rebuilding server:

watchexec -w src -w templates -s SIGINT -r 'mold -run cargo run'

Note:

  • watchexec watches the file-system and runs a command when changes are detected
  • mold is a fast linker for Linux.

Licence

This project is dual licenced under either of:

at your option.

dewpoint.7bit.org's People

Contributors

dependabot[bot] avatar wezm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dewpoint.7bit.org's Issues

Improve "glanceability" of forecast page

When viewing the forecast page it's not super obvious which days are more humid than others. There needs to be a way to glean this information at a glace, without having to read and compare the individual temperature vales.

Ability to select temperature unit

Currently the temperature unit is tied to the country. It's likely that some people will want to view the temperature in the alternate unit. Perhaps the default unit is used unless a cookie says otherwise? Or bake into into the link accept /c or /f` to request a specific unit.

Geolocation

  • Implement the location selector on the home page.
  • Provide a country select box to narrow the search and pre-select it with the geoip country.

Mobile

Add the mobile meta tag to set initial zoom.

Allow linking to a locations page

E.g. https://dewpoint.7bit.org/au/-50.123/150.456/placename

The last component with place name would probably not actually do anything. Perhaps if does not match the canonical label for that location then 301 redirect to the right one to prevent proliferation of variants. It would probably need to be transliterated to ascii and slugified too:

  • La Pinçonnière → la-pinconniere

It's possible that this can be pulled from the geocoding result as there is an ascii field in it.

One issue to consider is how to stop bots crawling the whole world through those links?

  • robots.txt blocking them
  • Possibly some varnish config too
  • Maybe require a cookie?

Publish releases

Once things settle down start tagging releases and deploy those to the website instead of main.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.