Git Product home page Git Product logo

task-manager---prototal's Introduction

Project Title

Build Status Coverage Version

A CRUD app per the requirements outlined in Prototal's stage II interview document.

Installation

I have pushed the binaries as part of the recent commit to allow for simple running. If for some reason this doesn't work, one may need to use 'mvn clean install' as shown in the Maven installation instructions.

First clone this repository to a directory of your choosing. Then choose your preferred installation method.

Docker

Ensure you are in the project's root directory and:

First run:

    docker-compose build

Then:

    docker-compose up

This should make the project run, and you can begin pinging the endpoints at the bottom of this article.

If you run into issues, ensure that the Docker desktop client is running.

If that again does not work, try running manually (below).

Manual / Maven

# Clone this repository
git clone https://github.com/yourusername/yourprojectname.git

# Navigate to the project directory
cd x

# Install dependencies
mvn clean install

# Run the program.
Use a popular code editor like Intellij IDEA or Eclipse, and run the TaskManagerApplication.java file.

CRUD

You can run CRUD operations by pinging the endpoints at localhost:8080.

For example:

http://localhost:8080/tasks/getAll

(This will initially return empty since the database isn't initially populated.)

Q&A

Potential issues can arise from having the application.properties set to the wrong location.

Ensure it points to spring.data.mongodb.uri=${SPRING_DATA_MONGODB_URI}.

Endpoints

We have several endpoints which can be pinged in the formats below:

ROOT: @RequestMapping("/tasks")

This is the root of the URL, meaning that our API is based around it. Requests will be in the format:

http://localhost:8080/tasks/(request)

@PostMapping("createTask")

Path: http://localhost:8080/tasks/createTask

Body example:

{
    "title": "A totally amazing task.",
    "description": "Read a book.",
    "subTasks": [
        {
            "title": "Read a chapter.",
            "description": "Read that super boring chapter."
        },
        {
            "title": "Read page of book.",
            "description": "This is so fun.",
            "subTasks": [
                {
                    "title": "Read line 12",
                    "description": "This is getting specific.",
                    "subTasks": [
                        {
                            "title": "Read the first letter of line 12.",
                            "description": "..."
                        }
                    ]
                }
            ]
        }
    ]
}

@GetMapping("getById/{id}")

Path example: http://localhost:8080/tasks/getById/id

@PutMapping("/update/{id}")

Path example: http://localhost:8080/tasks/update/id

@DeleteMapping("deleteTask/{id}")

http://localhost:8080/tasks/deleteTask/id

Also:

@GetMapping("getAll")

Path example: http://localhost:8080/tasks/getAll

This is a utility method for easily retrieving entries to the db. The reason this is included is because it can be otherwise quite difficult to get the _ids since it is sent to automatic _id generation.

task-manager---prototal's People

Contributors

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