Giter Club home page Giter Club logo

weatherapi's Introduction

WeatherAPI

Weather API Example using Blazor

Original request was:

Create an authenticated web application using Angular or other frameworks to display the weather output from the REST API at metaweather. Where Authorised Users can access the weather forcast for Belfast.The page needs to display the next 5 days of weather, including date, weather state, and image to represent the weather state.

Plan of action:

  • My most familiar framework is Blazor and C# which extends ASP.Net. I'm sure it wouldn't take long to get my head around Angular or React but speed was of the essence here.
  • Investigated how the REST API functions, what it returns and is any API Key required
  • Build the initial solution in ASP.NET Core 3.1 (5 is current)
  • Add testing Project to the Solution and design initial tests, e.g. "Can Construct"
  • Create required Razor Components and remove the inital ones added when solution is spun up
  • Design a login scenario which doesn't require database (e.g. cookies or fakebackend model)
  • Add models to represent data returned in API Response
  • Test to ensure criteria are met.

Findings:

  • Although initially I created the solution with Interfaces and Services for separation of concerns I found they were no longer required. This made the testing tricky as everything was inbuilt with little risk of failures being introduced.
  • Creating a login had to be simplistic, usually I would use a database backend (SQL) to hold the login information. This would also require encrypt, decrypt too with an individual password Salt. The login is tested but the username and password are both "1" (both hard coded in the code)
  • Unit tests project was left in place with a test in place to test an unused helper class, just to prove the concept.

weatherapi's People

Contributors

spacefrog29 avatar

Watchers

 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.