Shows the current sunset and sunrise times for the selected location.
Visit https://day-light.netlify.com/ to view the app.
The changing length of days and nights depends on the location and season of the year. It would be nice to know how many hours of daylight we have at a certain location.
The user enters the city or country name in the search field and receives the current sunset and sunrise times for that location
- GeoNames
- To discover the latitude and longitude of the location
- To get a sunrise & sunset times from long/lat.
- Bulma CSS framework.
- I'll use Webpack to bundle modules.
- I will submit commit when a feature is added, or a task is accomplished.
- I'll test the website manually, and I'll use Jest framework to write a unit tests.
- I will use wireframe.cc to design a layout.
- It will be deployed on Netlify
You must have Node.js installed before running this project locally. Also, you have to sign up for GeoNames free account, to use their web API.
- Open a terminal and clone the project.
git clone https://github.com/mariusjagminas/Daylight.git
- Navigate into Daylight directory.
cd Daylight
- Install all dependencies.
npm install
-
Create .env file in the project's root directory.
-
Create the USER variable in the .env file. The variable value must be your GeoNames username.
USER=your_user_name_on_GeoNames
- Start webpack development server
npm start
The browser should open automatically. If not, open your browser and visit http://localhost:8080/ to view the application.
Open a terminal and run.
npm run build
You will find the files in the dist. folder
This app uses Jest for a unit testing. To run tests, open a terminal and type:
npm test
or
npm run watch
to run tests in a watch mode.
Thanks to klemenjarc for the feature suggestion. The feature has been implemented in the project. In addition, I've created a basic API endpoint for anyone who wants to use it: same-length-of-the-day-api