ajmeese7 / where-temperature

Find a location that is currently in your desired temperature range.

Home Page:https://where-temperature.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⛈️Where Temperature⛈️

JavaScript License Stars Forks Leave a Star!

Find a location that is currently in your desired temperature range.

Project Preview

Developing

You can replicate the PostgreSQL table structure by running the following query on your local Postgres server:

CREATE TABLE data (
    id SERIAL PRIMARY KEY,
    weather_data text,
    date TIMESTAMP default CURRENT_TIMESTAMP
);

To start up the Express server, run npm run devstart. This will start it with Nodemon, so the server will automatically restart whenever you make changes to important files. You can view it at localhost:5000.

To start a local Postgres server, run psql postgresql://[user[:password]@][netloc][:port][/dbname], filling in your server's information where appropriate.

You should create a .env file with the following values assigned:

  • DATABASE_URL
  • OPEN_WEATHER_MAP_API_KEY
    • This project uses the Current Weather API from Open Weather Map to get the weather data.
    • You can sign up for a free API key here.

NOTE: The project is coded to retrieve new data if the Postgres data is older than five minutes. However, the server's time zone may differ from yours, so it may unnecessarily retrieve new data, or it may not gather new data when it should. I am currently unaware of an easy solution to this, without gathering new data on automatic intervals, so suggestions are welcome.

About

Find a location that is currently in your desired temperature range.

https://where-temperature.herokuapp.com/

License:MIT License


Languages

Language:JavaScript 73.3%Language:EJS 15.7%Language:CSS 10.8%Language:Procfile 0.2%