Giter Site home page Giter Site logo

anishkumardiwan / climate_data_managment_system Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 51 KB

You can save climate data, fetch records by area or climate, and calculate climate data deltas. Error handling is in place for various scenarios, and contributions are welcome. Please refer to the provided README for detailed setup and usage instructions.

Home Page: https://climatedatamanagmentsystem-production.up.railway.app/

JavaScript 100.00%
controller expressjs javascript mongodb nodejs rest-api routes

climate_data_managment_system's Introduction

Climate Data Management System

This project is a proof of concept (POC) for managing climate data. It provides endpoints for saving, retrieving, and calculating climate data deltas for different climate conditions and areas. The system uses Node.js and MongoDB for data storage.

Postman Document

This Is the Example of API Call Click Here

Getting Started

Follow the instructions below to set up and run the climate data management system on your local machine.

Prerequisites

Installation

  1. Clone this repository to your local machine:
git clone https://github.com/Anishkumardiwan/climate_data_managment_system;
  1. Navigate to the project directory:
cd climate_data_management_system
  1. Install the project dependencies:
npm install
  1. Start the server. You can usually do this by running:
npm start
  1. Add .env file and Declare the variable:
PORT
MONGODBURL

The server will start and listen on port 5000 or Decleare the process.env.PORT in .env file.

Usage

Saving Climate Data

To save climate data, make a POST request to the /api/climate endpoint with the following payload:

{
  "climate": "hot",
  "area_code": 111,
  "temperature": 25,
  "humidity": 88,
  "chances_of_rain": 40
}

Fetching All Saved Records

To fetch all saved climate records, make a GET request to the /api/climate endpoint.

Fetching Records of a Particular Area

To fetch climate records for a specific area, make a GET request to the /api/climate/:areaCode endpoint, where :areaCode should be replaced with the desired area code.

Fetching Records of a Particular Climate in an Area

To fetch climate records for a specific climate in a particular area, make a GET request to the /api/climate/:areaCode/:climate endpoint, where :areaCode is the area code, and :climate is one of the climate types (hot, humid, rainy, or cold).

Calculating Climate Data Delta

To calculate climate data delta, make a POST request to the /api/climate/delta endpoint with the following payload:

{
  "from_climate": "hot",
  "to_climate": "cold",
  "area_code": 111
}

Response Format

The API returns responses in JSON format with the following structure:

{
  "success": true/false,
  "error": "If success is false, this will be set, else it will be null and its value would be the reason why the saving of data failed",
  "data": {
    // Data or result here
  }
}

Error Handling

Proper error handling is implemented in the endpoints to handle various scenarios, including validation errors and data not found errors.

Contributing

Contributions are welcome! If you'd like to contribute to this project, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

climate_data_managment_system's People

Contributors

anishkumardiwan 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.