The backend for the micro-learning app micronomicon.
Usage:
There are many available tags. User subscribes to new tags and gets a micron to read/watch on those topics. A Micron is a random resource on the given topics.
method | endpoint | does |
---|---|---|
POST | /register | Register a user |
POST | /login | Log a user in |
POST | /logout | Logs the user out |
GET | /users/me | Get the user |
GET | /users/me/tags | Get the user's tags |
POST | /users/me/tags | Add new tags to the user tags |
DELETE | /users/me/tags | Delete tags from the user tags |
GET | /users/me/microns | Get a micron for the user |
GET | /tags | Get all the available tags |
Expand
Method : POST
Body
{
"email": "jane@doe.com",
"username": "jane",
"name": "Jane Doe",
"password": "abc-12345"
}
Response
{
"message": "Created the user"
}
Expand
Method : POST
Body
{
"username" : "jane",
"password" : "abc-12345"
}
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o"
}
Expand
Method : POST
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Response
{
"message": "Successfully logged out"
}
Expand
Method : GET
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Response
{
"username": "jane",
"name": "Jane Doe",
"email": "jane@hello.com",
"tags": {
"tags": [
{
"name": "c"
},
{
"name": "react"
},
{
"name": "python"
}
],
"size": 3
}
}
Expand
Method : GET
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Response
{
"tags": [
{
"name": "c"
},
{
"name": "react"
},
{
"name": "python"
}
],
"size": 3
}
Expand
Method : POST
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Body
{
"ids": ["c", "angular", "react"]
}
Response
{
"message": "Successfully added the tags"
}
Expand
Method : DELETE
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Body
{
"ids": ["c", "angular", "react"]
}
Response
{
"message": "Successfully removed the tags"
}
Expand
Method : GET
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Response
{
"tags": [
{
"name": "c"
},
{
"name": "react"
},
{
"name": "groovy"
}
]
}
Expand
Method : GET
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTY1NzE2MjIsImlhdCI6MTU5NjU2NDQyMiwidXNlcm5hbWUiOiJvd2FyeSJ9.CS7osQC8bQihpG7nQKWqUvGQysiB9Y0lkV7tdXSoS-o
Response
{
"URL": "https://learnxinyminutes.com/docs/python/",
"Title": "Python"
}
To run all the test, issue the following command:
docker-compose -f docker-compose-test.yml up