Skip to content

provide insights about the occurrence of hurricanes based on historical data

Notifications You must be signed in to change notification settings

khallad2/hurricane-analyser

Repository files navigation

Nest Logo

Hurricane-analyser | Nest.js + Typescript

Description

This program provides insights about the occurrence of hurricanes based on historical data.

using Poisson distribution formula to calculate the probability of hurricane occurrence in a given month in the future. https://en.wikipedia.org/wiki/Poisson_distribution

This backend contains two Rest API endpoints:

  • /api/hurricanes/all
  • /api/hurricanes/expect/:month

The program is using the following file as the data source: https://people.sc.fsu.edu/~jburkardt/data/csv/hurricanes.csv

Assumption:

  • user only need to provide a short-month name to get the probability of a hurricane.
  • user Authentication and authorization and security aspects are handled using (Middleware & JWT) etc..
  • Selected Probability formula: Used Poisson Distribution Formula and used the provided Average in the data source

Environment Prerequisites

  • Node.js >= 20.10.0
  • npm >= 10.2.3
  • Typescript >= 5.0.0
  • in root directory change the name of the file .env.example => to .env

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

If I have more time I would do the following:

  • Enhance performance by optimizing parseData
  • Enhance interfaces
  • Transform Request/Response using Interceptors or Middlewares
  • Create centralised Exceptions handling using Filters
  • Implement 95% + testing code coverage
  • Add all constant strings to constants.ts for better errorMessages organizing
  • Create .env.dev & .env.stage

I hope we can talk about it soon!

About

provide insights about the occurrence of hurricanes based on historical data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published