Giter VIP home page Giter VIP logo

tasklist's Introduction

Tasklist

Node.js express todo-list app. Portfolio project.

index-screen

Features

  • Adding, deleting and editing task
  • Setting date and time for a task
  • Setting project for a task
  • Adding, deleting and editing project
  • Setting name and color of a project
  • Login and signup

Video demo soon

Data design

All data stored in postgreSQL database.

DB diagram

API

Tasks

GET /tasks

Request example

GET "https://srgprp-tasklist.herokuapp.com/tasks"

Response example

200 OK
[
  {
    "id": 154,
    "description": "Add new task",
    "is_completed": false,
    "time_of_creation": "2022-03-03T18:34:43.534Z",
    "date": null,
    "time": null,
    "folder_name": null,
    "folder_id": null
  },
  {
    "id": 153,
    "description": "Set date and time",
    "is_completed": false,
    "time_of_creation": "2022-03-03T18:34:43.531Z",
    "date": "2022-03-03",
    "time": "18:00:00+01:00",
    "folder_name": "Casual",
    "folder_id": 23
  },
  {
    "id": 152,
    "description": "Create new project",
    "is_completed": false,
    "time_of_creation": "2022-03-03T18:34:43.526Z",
    "date": null,
    "time": null,
    "folder_name": null,
    "folder_id": null
  }
]
POST /tasks

Request example

POST "https://srgprp-tasklist.herokuapp.com/tasks"
{
    "description": "Cook pasta",
    "date": "2022-08-17",
    "time": "16:00",
    "folder_id": 1
}

Response example

200 OK
{
    "messageToUser": "New task has been created"
}
PUT /tasks/:id

Request example

PUT "https://srgprp-tasklist.herokuapp.com/tasks/110"
{
    "description": "To the dentist",
    "date": "2022-02-11",
    "time": "14:00",
    "folder_id": 1
}

Response example

200 OK
{
    "messageToUser": "Task has been successfully updated!"
}
DELETE /tasks

Request example

DELETE "https://srgprp-tasklist.herokuapp.com/tasks/120"

Response example

200 OK
{
    "messageToUser": "Task has been successfully deleted!"
}

Colors

GET/colors

Request example

GET "https://srgprp-tasklist.herokuapp.com/colors"

Response example

200 OK
[
  {
    "id": 1,
    "name": "Orange",
    "value": "#FF9749"
  },
  {
    "id": 2,
    "name": "Blue",
    "value": "#3D77F6"
  },
  {
    "id": 3,
    "name": "Green",
    "value": "#169446"
  },
  {
    "id": 4,
    "name": "Berry Red",
    "value": "#BC245D"
  }
]

Folders

GET /folders

Request example

GET "https://srgprp-tasklist.herokuapp.com/folders"

Response example

200 OK
[
  {
    "id": 231,
    "name": "Classic Music",
    "color_id": 1
  },
  {
    "id": 8,
    "name": "Piano",
    "color_id": 2
  }
]
POST /folders

Request example

POST "https://srgprp-tasklist.herokuapp.com/folders"
{
    "folderName": "Writing",
    "colorId": "1"
}

Response example

200 OK
{
  "folderId": 283
}
PUT /folders/:id

Request example

PUT "https://srgprp-tasklist.herokuapp.com/folders/240"
{
    "folderName": "Writing a book",
    "colorId": "283"
}

Response example

200 OK
{
    "messageToUser": "Project has been updated"
}
DELETE /folders/:id

Request example

DELETE "https://srgprp-tasklist.herokuapp.com/folders/283"

Response example

200 OK
{
    "messageToUser": "Folder has been deleted"
}

Authentication

POST /auth/register

Request example

POST "https://srgprp-tasklist.herokuapp.com/auth/register"
{
    "username": "JoanOfArc",
    "password": "JoanTheFighter17@#"
}

Response example

200 OK
{
  "isAuthenticated": true
}
POST /auth/login

Request example

POST "https://srgprp-tasklist.herokuapp.com/auth/login"
{
    "username": "JoanOfArc",
    "password": "JoanTheFighter17@#"
}

Response example

200 OK
{
  "isAuthenticated": true
}
GET /auth/logout

Request example

GET "https://srgprp-tasklist.herokuapp.com/auth/logout"

Response example

200 OK
{
  "isAuthenticated": false
}
GET /auth/check-auth

Request example

GET "https://srgprp-tasklist.herokuapp.com/auth/check-auth"

Response example

200 OK
{
  "isAuthenticated": false
}

Users

POST /users

Request example

POST "https://srgprp-tasklist.herokuapp.com/users"
{
    "username": "bob"
}

Response example

200 OK
{
  "isUsernameExists": false
}

Security

Usernames instead of emails

The app utilizes usernames instead of emails for authentication so that user is able to proceed with the app without worrying about possible misuse of their personal information.

Hashing passwords

The app doesn't store passwords in their original form. Each password goes through hashing with bcrypt.js before entering database.

Strong passwords

Library zxcvbn by dropbox checks passwords on signup page. It discourages people to use common passwords and accepts only those that are at least moderate strength.

Sessions over tokens

The app uses session-cookies to remember users and grant them access to their own collection of projects and tasks. The token-based authentication methods were also considered but they seem less secure, more bulky and shine best in server-to-server interaction.

Express-session module was used to implement sessions.

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.