Skip to content

amir-hossein-karimi/todo-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Todo App

This repository contains a full-stack todo application. It is built using React and typescript for the FrontEnd and Node.js and MongoDB for the BackEnd.

LINKS

FrontEnd

The FrontEnd is built using React and typescript. It is located in the front directory.

BackEnd

The BackEnd is built using Node.js and MongoDB. It is located in the back directory.

Installation

To install the application, follow these steps:

Clone the repository:

git clone https://github.com/amir-hossein-karimi/todo-list.git

Install the dependencies for the FrontEnd:
cd front
npm install

Install the dependencies for the BackEnd:

cd back
npm install

Start the FrontEnd:

cd back
npm start

The FrontEnd should now be running at http://localhost:3000.

Start the BackEnd:

cd back
npm start

The BackEnd should now be running at http://localhost:3500.

Usage

BackEnd routes usage

AUTHENTICATION

login: http://localhost:3500/auth/login

{
  "method": "post",
  "body": {
    "username": "username",
    "password": "password"
  }
}

register: http://localhost:3500/auth/register

{
  "method": "post",
  "body": {
    "username": "username",
    "password": "password"
  }
}

refreshToken: http://localhost:3500/auth/refreshToken

{
  "method": "post",
  "body": {
    "refreshToken": "refresh token"
  },
  "headers": {
    "token": "expired token"
  }
}

USER

get all users: http://localhost:3500/user/all

{
  "method": "get"
}

get one user: http://localhost:3500/user/one?id={{_id}}

{
  "method": "get"
}

create a user: http://localhost:3500/user/create

{
  "method": "post",
  "body": {
    "username": "username",
    "password": "password",
    "role": "user | admin | superAdmin | undefined(optional key)"
  }
}

update a user: http://localhost:3500/user/update?id={{_id}}

{
  "method": "put",
  "body": {
    "role": "user | admin | superAdmin | undefined(optional key)",
    "token": "token | undefined(optional key)",
    "refreshToken": "refresh token | undefined(optional key)"
  }
}

delete a user: http://localhost:3500/user/delete?id={{_id}}

{
  "method": "delete"
}

CATEGORIES

get all your categories: http://localhost:3500/category/all

{
  "method": "get",
  "headers": {
    "token": "token"
  }
}

get one category (It must be yours): http://localhost:3500/category/one?id={{_id}}

{
  "method": "get",
  "headers": {
    "token": "token"
  }
}

create a category: http://localhost:3500/category/create

{
  "method": "post",
  "headers": {
    "token": "token"
  },
  "body": {
    "name": "category name"
  }
}

update a category (It must be yours): http://localhost:3500/category/update?id={{_id}}

{
  "method": "put",
  "headers": {
    "token": "token"
  },
  "body": {
    "name": "category name"
  }
}

delete a category (It must be yours): http://localhost:3500/category/delete?id={{_id}}

{
  "method": "delete",
  "headers": {
    "token": "token"
  }
}

TODOS

get all your todos: http://localhost:3500/todos/all

{
  "method": "get",
  "headers": {
    "token": "token"
  }
}

get one todo (It must be yours): http://localhost:3500/todos/one?id={{_id}}

{
    {
  "method": "get",
  "headers": {
    "token": "token"
  },
}
}

create a todo: http://localhost:3500/todos/create

{
  "method": "post",
  "headers": {
    "token": "token"
  },
  "body": {
    "title": "todo title",
    "description": "todo description | undefined(optional key)",
    "categoryId": "category id"
  }
}

update a todo: http://localhost:3500/todos/update?id={{_id}}

{
  "method": "put",
  "headers": {
    "token": "token"
  },
  "body": {
    "title": "todo title | undefined(optional key)",
    "description": "todo description | undefined(optional key)",
    "categoryId": "category id | undefined(optional key)"
  }
}

delete a todo (It must be yours): http://localhost:3500/todos/delete?id={{_id}}

{
  "method": "delete",
  "headers": {
    "token": "token"
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published