Hurricane-analyser | Nest.js + Typescript
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
- 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
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- 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