Giter Site home page Giter Site logo

mustafatufan / weather Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 499 KB

:partly_sunny: Weather

Home Page: https://tufan.ee

License: MIT License

Java 84.48% HTML 15.52%
spring-boot springboot postgresql javascript jpa api sax sax-parser java java-8

weather's Introduction

Weather

โ›… Weather is an interview project.

Introduction

There is an XML weather API accessible at http://www.ilmateenistus.ee/ilma_andmed/xml/forecast.php?lang=eng

Build a Spring-Boot application consisting of at least two Maven modules.

Module 1 - background process:

This module has to contain a scheduled method (with the @Scheduled annotation) that will consume the weather API and save the results in a PostgreSQL database.

You can ignore any wind/sea data in the API result as this is not important to this task.

The scheduled method should run every 30 minutes.

The module should set up the database schema by itself on startup if one does not exist already. Assume that the application will have superuser access to a PostgreSQL database with the following properties:

Address: localhost:5432
Database: weather
Username: weather
Password: weather

Module 2 - web:

This module should serve a simple web page.

The web page should show the user the latest weather forecast (read from the database).

The user should be able to easily look up current weather for their location, by entering the name of the location in a search bar.

Optionally, you can create a third module that would contain code and/or settings common to both applications, so that the two previously mentioned modules can re-use some of the same code.

No limitations are set on the front-end framework, so use whatever framework you want and design the page however you see fit.

The application has to use Maven as the build environment and should be easy to compile and run.

After building the application, please send us the source code for evaluation (or host it in a git repository). Also include a readme file with instructions on how to compile and run the application.

Applications

screenshot

Applications

weather-web / WebApplication.java

  • localhost:8080 serves home page
  • localhost:8080/api/forecast serves forecast JSON
  • web.properties holds Thymeleaf settings

weather-scheduler / SchedulerApplication.java

  • ForecastTask.java is triggered by Cron and insert prod. forecast from this url.
  • scheduler.properties holds Cron & XML URL

weather-repository / TestApplication.java

  • ForecastRepositoryTest.java inserts mock data
  • repository.properties holds DataSource & JPA settings

Settings

Database

The application need a superuser access to a PostgreSQL database with the following properties:

Address: localhost:5432
Database: weather
Username: weather
Password: weather

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.