GithubHelp home page GithubHelp logo

weather-api's Introduction

weather-api

This project is created as per the requirements of the assignment provided by publicissapient. The purpose of this project is to consume the OpenWeatherMap api .

Design Principles :

This api has been developed using SOLID design principles. More info about SOLID design principles can be found on https://en.wikipedia.org/wiki/SOLID

Requirements:

The assignment

โ€ข Develop, test and deploy a micro service to show the output of a city's next 3 days high and low temperatures. If rain is predicted in next 3 days or temperature goes above 40 degree celsius then mention 'Carry umbrella' or 'Use sunscreen lotion' respectively, in the output, for that day.

Tech Stack

  • Since I am java programmer and I've been using spring framework from past 10 years . The choice was quite obvious to use Spring Boot . Other than spring boot , maven , junit, docker , swagger, tomcat were used.

Installation

This project is java-based. So It requires Jdk 11 (or later) and Maven 3.6.3 (or later) to run.

$ cd weather-api
$ mvn package
$ java -jar target/weather-api-1.0.0.jar 

Another way to run this api is to use docker (latest image is already pushed to docker hub)

$ docker run -p 8080:8080 rantidev7/weather-api:latest

Or if there is need to build new image then it can also be build and pushed to docker hub via

$ cd weather-api
$ mvn jib:build

And then run

$ docker run -p 8080:8080 rantidev7/weather-api:latest

Running tests

After changes you can run tests using Maven command:

$ cd weather-api
$ mvn test

Rest API

As required, this API has 1 endpoint :

  1. /v1/weather/{city}

Testing API

  1. API can be tested using Postman/Soap Ui
  2. Swagger is also included in api , I would suggest to use swagger then there is no need to perform extra work.

Things included in current version :

  1. JavaDocs are aslo included, to generate javadocs use

    $cd weather-api
    $ mvn javadoc:javadoc
    

    Then go to the folder /target/site/apidocs

  2. Google's code convention is being forced via the checkstyle.xml.

  3. Swagger is included and automatic updation of swagger specification is done.

Things to be included in future version :

  1. CI/CD should also be implemented for this api.
  2. If we want to move to microservioces architecture then probably we can look for Netflix OSS (apigateway , service descovery , cloud config etc.)
  3. Current version doen't support maven/spring profiles , which needs to be implemented.

weather-api's People

Watchers

James Cloos avatar Rantidev Singh avatar

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.