GithubHelp home page GithubHelp logo

avi-meshulam / weather-app-ts Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 21.83 MB

A client-server web application with TypeScript and Node.js

TypeScript 86.65% HTML 7.68% CSS 5.67%
weather map node typescript html css ajax client-server leaflet openweathermap

weather-app-ts's Introduction

weather-app

A client-server web application with TypeScript and Node.js

weather-app

Tools & Libraries

Features

Responsive design - The display is adjusted to fit screen

Caching:

Server side:

  • Static files (html, css, js, json, images)
  • Weather data (upon request, with a predetermined expiration time)

Client side:

  • Cities data (names, coordinates, countries etc.)
  • Weather data (upon request, with a predetermined expiration time)

Installation & Run:

  1. Open command prompt in 'weather-app-avi' folder
  2. Type 'npm install' to install all the required packages for the application
  3. Type 'npm start' to start the server
  4. Open a browser at http://localhost:8080

Routes:

Route Description
/ Root - Weather data is not displayed and map is scaled to fit the world
/weather?city={city},{country} City's weather - Displays the weather of the selected city and zooms the map on that city

User Interface

Selecting a city:

Option 1: Select a city from the dropdown list above the weather panel

Option 2: Click on a city marker on the map

Upon selecting a city, the map is zoomed on that city and the city's weather is displayed in the weather panel

weather-app-ts's People

weather-app-ts's Issues

Review

Avi

Sanity check: OK

Code inspection: OK

  • See typo

Project Structure: Good

  • Prefer using class over id selector for css styles

Readability (Complexity Magic numbers, function / line length): OK

  • What are *.map files?
  • filterJSON - please explain
  • Why simulating clicks with dispatchEvent? Make a generic function instead.
  • Some long functions (over 20 lines)
  • Suggestion - see simple projects of as inspiration for simplicity

Naming (files, functions, variables): Good

  • Some functions are not very clear (see filterJSON )
  • main.ts - Do not name simple map object with cache extension, if not functioning as actual cache (cities, markers)

Efficiency: OK

  • Why dealing with Optionrequests?
  • Caching on client is client responsibility (which can be done using storage object). Cookies determined by server - should be for authentication / server session management (As a last resort)

Documentation (Readme, inline):

  • Great Readme. thumb’s up :)
  • Server files - require more comments

Error handling: OK

  • Some error occur once on browser (couldn’t reconstruct)

Unexpected request handling: OK

Cleanup (remove unneeded conde, comments etc.): OK

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.