- clone the repo
- cd into kanban-api
- run npm install
- start up mongodb
- create a .env with CONNECTION_STRING="mongodb://localhost:27017" (obviously modify to the port you're using, make sure its in the right folder)
- use yarn start to start the program
- if for whatever reason yarn start is not working, try yarn startdev
- The server will by default run on localhost 9000
To make the frontend interact with the backend, I'd highly reccomend using CORS
The routes can all be found in the routes/index.js file in the repository, but this is a brief summary
path: /tasks
For the different tasks, there are 4 separate routes:
- put (updates the task); arguments: type, assignee, title, description
- delete (deletes the task); arguments: title
- post (creates the task); arguments: type, assignee, title, description
- get (retrieves the task); arguments: none
path : /users
For the different users, there are 2 separate routes:
- get (retrieves the user); arguments: none
- post (creates the user); arguments: firstName, lastName
const userSchema = new Schema({
firstName: { type: String, required: true},
lastName: { type: String, required: true},
})
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},
})