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.
BackEnd routes usage
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"
}
}
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"
}
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"
}
}
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"
}
}