Giter Club home page Giter Club logo

hinge_health_interactive_tree's Introduction

Description

  • I build a service that manages and manipulates trees.
  • with the piece of codeI'll be ready to demonstrate
  • Good design decisions.
  • Ability to consider edge cases.
  • Documentation

Development Environment

  • make sure you have the right version install in your system.
  • ruby 3.0.0p0
  • Rails 6.1.7.6
  • If you do not have same version available in your system, then download the correct version from here. Link
  • Or You can use the following command to install the required version.
rbenv install -l
rbenv install 3.0.0
rbenv local 3.0.0
ruby -v     #by this time it should display ruby 3.0.0p0
echo "gem: --no-document" > ~/.gemrc
gem install bundler
gem env home
gem install rails -v 6.1.7.4
rbenv rehash
rails -v #by this time it should display Rails 6.1.7.6

How to run this project

git clone [email protected]:Indrajitnaiya09/hinge_health_interactive_tree.git
  • open new terminal and navigate to the correct directory
  1. Recommended way: Run using Docker (Docker should be installed in your system.)
docker-compose up
  1. Running on local system(Optional)
  • ENV variable need to set in:
    • DB_NAME
    • DB_USERNAME
    • DB_PASSWORD
bundle install
rails db:create
rails db:migrate
rails s -p 3000 

Using postman do GET / POST http://localhost:3000/api/tree

body:
{
    "parent": null,
    "label": "Root"
}

will be able to validate Task 1:

  • The data structure that represents the animals example.
  • Will cause a node to be added to the end of a list of children, a new unique id should be assigned by the service.
  • The response should be simple Task 2:
  • Implement the route, and ensure that a GET /interactive_nodes request returns the updated tree.

Implementation summary:

  • POST with body parameters
{
    "parent": null,
    "label": "some_name"
}

consider as valid params, and insert as root node.

  • If one node is present as root node, then it'll insert as 2nd position/index.
  • default operation(search and insert) will perform only in a 0th index.
  • Introduced root_index as an optional params. So, if user pass any root_index value, then will check that index is present or not. If present, then operation(search and insert) will perform on that index.

Example of CURL Calls can be found in curl.txt

hinge_health_interactive_tree's People

Contributors

indrajitnaiya09 avatar

Watchers

James Cloos avatar  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.