You want to create a todolist app without bothering too much with a backend code. Here's how TodoKernel can help you! ๐
TodoKernel is an API ready to go allowing you to create todolists. Then all you have to do is to create a sweat little UI that fit your need! ๐
- TodoKernel
- Index ๐
- Installation
- Dependencies ๐งท
- Api methods
- Registration ๐
- Authentification ๐๐ฝโโ๏ธ๐๐ฝโโ๏ธ
- Update user's informations ๐๐ฝโโ๏ธ๐๐ฝโโ๏ธโ๐ฝ
- Get user's informations ๐๐ฝโโ๏ธ๐๐ฝโโ๏ธ
- Send email to recover a password ๐ฉ๐
- Change a forgotten password ๐๐ฝ๐
- Delete current user ๐๐๐ฝโโ๏ธ๐๐ฝโโ๏ธ
- Create a todolist ๐
- Add an item to a todolist โ
- Delete an item from a todolist ๐โ
- Get all your todolists ๐
- Check or uncheck a todolist item โ โ๐
- Get all items of a todolist
- Move a todolist item ๐ โ
- Rename a todolist item โ๐ฝ๐
- Delete a todolist ๐๐
- Rename a todolist โ๐ฝ๐
- Delete a todolist ๐๐
- Delete all current's user todolists ๐๐๐๐๐
Make sure that node and MongoDb are installed on your machine/server ๐
-
The very first step is to install is to fetch the TodoKernel project. To do so, you can:
Clone the project via git, by running the following command:
git clone https://github.com/bricefriha/TodoKernel.git
If you don't have git installed you can still download the project.
-
Next you'll have to install all the required npm packages. Thus, move to the TodoKernel folder an run this command:
npm install
-
Then, to make sure to get access to the project config, rename
config-dist
toconfig
-
Now all you have to do is starting your app
npm start
-
Finally, the most important part: Enjoy! ๐
Request type: POST
route: "/users/register"
body:
{
"firstName": "BriceFriha",
"lastName": "BriceFriha",
"username": "BriceFriha",
"email": "brice.friha@email.com",
"password": "pwd"
}
response:
{
"username": "BriceFriha",
"firstName": "BriceFriha",
"lastName": "BriceFriha",
"email": "brice.friha@email.com",
"todolists": [
],
"token": "<your token>"
}
Request type: POST
route: "/users/authenticate"
body:
{
"username": "BriceFriha",
"password": "pwd"
}
with an email
{
"email": "brice.friha@email.com",
"password": "pwd"
}
response:
{
"username": "BriceFriha",
"firstName": "BriceFriha",
"lastName": "BriceFriha",
"todolists": [
],
"token": "<your token>"
}
โ You must use a bearer token to perform this action
Request type: PUT
route: "/users/register"
body:
{
"username": "JustinC",
"firstName": "Justin",
"lastName": "Case",
"email": "brice.friha@email.com",
"newPassword": "TheNewPassword",
"password": "TheOldPassword"
}
โน If you don't want to modify the password, just don't fill the "newPassword" field
response:
{
"status": "OK",
"result": "Changes saved"
}
โ You must use a bearer token to perform this action
Request type: GET
route: "/users/current"
body:
{
"username": "JustinC",
"firstName": "Justin",
"lastName": "Case",
"password": "pass"
}
Request type: POST
route: "/users/forgot"
Body:
{
"email": "brice.friha@outlook.com"
}
Response:
{
"status": "OK"
}
Request type: PUT
route: "/users/recovery"
Body:
{
"recoveryCode": "[recovery code sent via email]",
"newPassword": "pwd"
}
โน it's worth noting that the user is automatically connected after this action
Response:
{
"username": "BriceFriha",
"email": "brice.friha@outlook.com",
"firstName": "Brice",
"lastName": "Friha",
"todolists": [
{
"items": [
"5ee0eb0dc551c20d74674086"
],
"_id": "5ee0eaf2c551c20d74674085",
"title": "Shopping list",
"user": "5ee0e25556294c2c70ee128b",
"__v": 1
}
],
"token": "<your token>"
}
โ You must use a bearer token to perform this action
Request type: DELETE
route: "/users/current"
response:
{
"status": "OK",
"result": " deleted"
}
โ You must use a bearer token to perform this action
Request type: POST
route: "/todolists/create"
body:
{
"title":"Shopping list"
}
response:
{
"items": [],
"_id": "5ed7f3d335670f2f348c8cbc",
"title": "Shopping list",
"user": "5ecd5cb5048a7231d8ddbb15",
"__v": 0
}
โ You must use a bearer token to perform this action
Request type: POST
route: "/todos/add"
body:
{
"name":"Eggs",
"todolistId": "5ed7f3d335670f2f348c8cbc"
}
response:
{
"_id": "5ed7f43f35670f2f348c8cbd",
"name": "Eggs",
"done": false,
"todolist": "5ed7f3d335670f2f348c8cbc",
"user": "5ecd5cb5048a7231d8ddbb15",
"order": 0,
"__v": 0
}
โ You must use a bearer token to perform this action
Request type: DELETE
route: "/todos/[item id]"
response:
{
"status": "OK",
"result": " deleted"
}
โ You must use a bearer token to perform this action
Request type: GET
route: "/todolists/"
response:
[
{
"items": [
],
"_id": "5ed385135151de45f4b637df",
"title": "Shopping list",
"user": "5ecd5cb5048a7231d8ddbb15",
"order": 0,
"__v": 2
},
{
"items": [
],
"_id": "5ed7f3d335670f2f348c8cbc",
"title": "Shopping list",
"user": "5ecd5cb5048a7231d8ddbb15",
"order": 1,
"__v": 1
}
]
โ You must use a bearer token to perform this action
Request type: PUT
route: "/todos/Check/[item id]"
response:
{
"status": "OK"
}
โ You must use a bearer token to perform this action
Request type: GET
Route: "/todos/get"
Body:
{
"todolistId": "[todolist in which you want to put it]"
}
โ You must use a bearer token to perform this action
Request type: PUT
Route: "/todos/move/[Todolist id]"
Body:
{
"newPosition": "[the new position (order attribut)]",
"todolistId": "[todolist in which you want to put it]"
}
Response:
{
"name": "Fries"
}
โ You must use a bearer token to perform this action
Request type: PUT
Route: "/todos/rename/[Todolist id]"
Body:
{
"name": "Fries"
}
Response:
{
"name": "Fries"
}
โ You must use a bearer token to perform this action
Request type: DELETE
route: "/todolists/[Todolist id]"
response:
{
"status": "OK",
"result": " deleted"
}
โ You must use a bearer token to perform this action
Request type: PUT
Route: "/todolists/rename/[Todolist id]"
Body:
{
"title": "Workout"
}
Response:
{
"items": [
],
"_id": "5ed7f3d335670f2f348c8cbc",
"title": "Workout",
"user": "5ecd5cb5048a7231d8ddbb15",
"__v": 2
}
โ You must use a bearer token to perform this action
Request type: DELETE
route: "/todolists/[Todolist id]"
response:
{
"status": "OK",
"result": " deleted"
}
โ You must use a bearer token to perform this action
Request type: DELETE
route: "/users/cleanup"
response:
{
"status": "OK",
"result": " deleted"
}