Giter Club home page Giter Club logo

icp-virtual-garden-manager's Introduction

Internet Computer garden manager application 🌺πŸͺ»πŸŒΌπŸŒ·

TypeScript Smart Contract 101 Challenge

Do you often find yourself asking, β€œWhy did my once-thriving plant suddenly turn into a sad pile of leaves?” If so, you’re not alone! Many of us have been there β€” overwatering, underwatering, or simply forgetting to check on our leafy companions. But don’t worry, Plant Manager is here to save the day (and your plants)! 🌱🌷 It's your personal plant assistant, designed to help you keep your plants healthy and happy.

Features

  • Add a New Plant 🌻: Got a new plant? Add it to your garden and keep track of its needs.
  • Retrieve Plants 🌱: See all your green friends in one place.
  • Update Plant Details ✨: Changed the plant’s name or want to add extra notes? No problem.
  • Delete a Plant πŸͺ΄: Time to say goodbye? Remove plants from your collection when needed.
  • Check Plants Needing Watering 🌧️: Find out which plants are giving you the sad eye and need a drink.
  • Water a Specific Plant πŸ’¦: Update the watering status for your plants and keep them hydrated!

Installation

  1. Clone the repository.
  2. Install dependencies using npm install.
  3. Run the project using dfx start --host 127.0.0.1:8000 --clean --background then dfx deploy.

Usage

Once the project is running, you can make HTTP requests to the exposed endpoints to interact with your garden.

  • POST /plants: Add a new plant to your garden.

    • Request Body:
      {
        "name": "Rose",
        "species": "Rosa",
        "waterFrequencyDays": 7,
        "notes": "Needs a lot of sunlight."
      }
    • Example Request:
      curl -X POST http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants -H "Content-Type: application/json" -d '{"name": "Rose", "species": "Rosa","waterFrequencyDays": 7, "notes": "Needs a lot of sunlight."}'
  • GET /plants: Retrieve a list of all plants in your garden.

    • Example Request:
      curl -X GET http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants
  • GET /plants/:id: Retrieve details of a specific plant by ID.

    • Example Request:
      curl -X GET http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants/{plantId}
  • PUT /plants/:id: Update details of a specific plant by ID.

    • Request Body:
      {
        "name": "Rose πŸ₯€"
      }
    • Example Request:
      curl -X PUT http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants/{plantId} -H "Content-Type: application/json" -d '{"name": "Rose πŸ₯€"}'
  • DELETE /plants/:id: Delete a specific plant from your garden by ID.

    • Example Request:
      curl -X DELETE http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants/{plantId}
  • GET /plants/need-watering: Check which plants need watering.

    • Example Request:
      curl -X GET http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants/need-watering
  • PUT /plants/:id/water: Update the last watered date for a specific plant by ID.

    • Example Request:
      curl -X PUT http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/plants/{plantId}/water

icp-virtual-garden-manager's People

Contributors

ofrankowska avatar

Watchers

 avatar

Forkers

coolestnick

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.