Git Product home page Git Product logo

kanban-api's Introduction

Run the server locally

  1. clone the repo
  2. cd into kanban-api
  3. run npm install
  4. start up mongodb
  5. create a .env with CONNECTION_STRING="mongodb://localhost:27017" (obviously modify to the port you're using, make sure its in the right folder)
  6. use yarn start to start the program
  7. if for whatever reason yarn start is not working, try yarn startdev
  8. The server will by default run on localhost 9000

To make the frontend interact with the backend, I'd highly reccomend using CORS

ROUTES

The routes can all be found in the routes/index.js file in the repository, but this is a brief summary

TASKS:

path: /tasks

For the different tasks, there are 4 separate routes:

  1. put (updates the task); arguments: type, assignee, title, description
  2. delete (deletes the task); arguments: title
  3. post (creates the task); arguments: type, assignee, title, description
  4. get (retrieves the task); arguments: none

USERS:

path : /users

For the different users, there are 2 separate routes:

  1. get (retrieves the user); arguments: none
  2. post (creates the user); arguments: firstName, lastName

User model:

const userSchema = new Schema({
  firstName: { type: String, required: true},
  lastName: { type: String, required: true},
})

Task model:

const taskSchema = new Schema({
  type: { 
    type: String, 
    enum : ['TO DO', 'IN PROGRESS', 'COMPLETE', 'IN REVIEW'], 
    default: 'TO DO', 
    },
    assignee: { type: String, required: false},
    title: {type: String, required: true},
    description: {type: String, required: false},
    dateDue: {type: Date, required: true},
})

kanban-api's People

Contributors

garrett-freddo 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.