A social network API based on twitter under development using solid design and clean arquitecture principles.
❗ Developed just for academic reasons by a junior developer with little experience, feel free to correct any mistakes I make, I'll be glad to learn from you.
dev: Start server in development mode
start: Start server in production mode
test: Run test suits with jest
build: Compile typescript files to plain javascript files into "dist" folder
migrate: Migrate the database specified by environment variables
🔒: Requires authentication
GET • /api/sessions 🔒 • Get data from the user authenticated
"header": {
"authorization": "<string required> [Bearer JWT token]"
},
Code : 200 OK
"body": {
"id": "<string> [User id]",
"email": "<string> [User email]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
POST • /api/sessions • Create a new session with user data provided (signin)
"body": {
"email": "<string email max=50 required> [User email]",
"password": "<string min=8 max=30 required> [User password]"
}
Code : 201 CREATED
"body": {
"token": "<string> [JWT token]",
"user": {
"id": "<string> [User id]",
"email": "<string> [User email]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
}
DELETE • /api/sessions 🔒 • Revoke the authorization token
"header": {
"authorization": "<string required> [Bearer JWT token]"
},
Code : 200 OK
GET • /api/users • Get a list of all users
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive max=30 optional default=10> [Users per page]",
"slug": "<string optional> [Search term to filter by name or by tag, (starts with \"@\" to filter only by tag)]"
}
Code : 200 OK
"header": {
"x-total-count": "<number> [Total of users]",
"x-total-pages": "<number> [Total of pages]"
}
"body": [
{
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
]
GET • /api/users/:id • Get data from a specific user searching for its id
"params": {
"id": "<string required> [User id]"
}
Code : 200 OK
"body": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
POST • /api/users • Create a new user with the data provided
"body": {
"email": "<string email max=50 required> [User email]",
"name": "<string max=50 required> [User name]",
"tag": "<string alphanum max=30 required> [User tag]",
"password": "<string min=8 max=30 required> [User password]",
"image": "<image/(png|jpg|jpeg) max=1mb optional> [User picture]"
}
Code : 201 CREATED
"body": {
"id": "<string> [User id]",
"email": "<string> [User email]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
PUT • /api/users 🔒 • Update the authorized user
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"email": "<string email max=50 required> [User email]",
"password": "<string min=8 max=30 required> [User password]",
"image": "<image/(png|jpg|jpeg) max=1mb optional> [User picture]"
}
Code : 200 OK
"body": {
"id": "<string> [User id]",
"email": "<string> [User email]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
DELETE • /api/users 🔒 • Delete the authorized user
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
Code : 200 OK
GET • /api/users/trend • Get a list of all users ordered by last followers count
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive max=30 optional default=10> [Users per page]",
"time": "<number integer positive optional max=31536000000(1 year) default=86400000(1 day)> [Time before now to count last followers]"
}
Code : 200 OK
"header": {
"x-total-count": "<number> [Total of users]",
"x-total-pages": "<number> [Total of pages]"
}
"body": [
{
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"followers": "<number> [User followers count]",
"following": "<number> [User following count]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
}
]
GET • /api/follows • Get list of all follows
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive max=30 optional default=10> [Follows per page]",
"follower-id": "<string optional> [User follower id]",
"target-id": "<string optional> [User target id]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Follow id]",
"follower": {
"id": "<string> [User follower id]",
"name": "<string> [User follower name]",
"tag": "<string> [User follower tag]",
"description": "<string> [User follower description]",
"image": "<string> [User follower image url]",
"createdAt": "<Date> [User follower date/time of creation]",
"updatedAt": "<Date> [User follower date/time of last update]"
},
"target": {
"id": "<string> [User target id]",
"name": "<string> [User target name]",
"tag": "<string> [User target tag]",
"description": "<string> [User target description]",
"image": "<string> [User target image url]",
"createdAt": "<Date> [User target date/time of creation]",
"updatedAt": "<Date> [User target date/time of last update]"
},
"createdAt": "<Date> [Follow date/time of creation]",
}
]
GET • /api/follows/:followerId/:targetId • Get data from a specific follow
"params": {
"followerId": "<string required> [User follower id]",
"targetId": "<string required> [User target id]"
},
Code : 200 OK
"body": {
"id": "<string> [Follow id]",
"follower": {
"id": "<string> [User follower id]",
"name": "<string> [User follower name]",
"tag": "<string> [User follower tag]",
"description": "<string> [User follower description]",
"image": "<string> [User follower image url]",
"createdAt": "<Date> [User follower date/time of creation]",
"updatedAt": "<Date> [User follower date/time of last update]"
},
"target": {
"id": "<string> [User target id]",
"name": "<string> [User target name]",
"tag": "<string> [User target tag]",
"description": "<string> [User target description]",
"image": "<string> [User target image url]",
"createdAt": "<Date> [User target date/time of creation]",
"updatedAt": "<Date> [User target date/time of last update]"
},
"createdAt": "<Date> [Follow date/time of creation]",
}
POST • /api/follows 🔒 • Create a new follow between the user authenticated and a target provided
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"targetId": "<string required> [User target id]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Follow id]",
"follower": {
"id": "<string> [User follower id]",
"name": "<string> [User follower name]",
"tag": "<string> [User follower tag]",
"description": "<string> [User follower description]",
"image": "<string> [User follower image url]",
"createdAt": "<Date> [User follower date/time of creation]",
"updatedAt": "<Date> [User follower date/time of last update]"
},
"target": {
"id": "<string> [User target id]",
"name": "<string> [User target name]",
"tag": "<string> [User target tag]",
"description": "<string> [User target description]",
"image": "<string> [User target image url]",
"createdAt": "<Date> [User target date/time of creation]",
"updatedAt": "<Date> [User target date/time of last update]"
},
"createdAt": "<Date> [Follow date/time of creation]",
}
DELETE • /api/follows/:id 🔒 • Delete a follow searching for its id
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Follow id]",
}
Code : 201 CREATED
GET • /api/posts • Get a list of all posts
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive optional max=30 default=10> [Posts per page]",
"author-id": "<string optional> [User author id]",
"slug": "<string optional> [Search term to filter by text]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
]
GET • /api/posts/:id • Get data from a specific post searching for it's id
"params": {
"id": "<string required> [Post id]"
},
Code : 200 OK
"body": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
POST • /api/posts 🔒 • Create a new post with the data provided and author from authentication
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"text": "<string max=256 optional> [Post text]",
"image": "<image/(png|jpg|jpeg) max=1mb optional> [Post image]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"email": "<string> [User email]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
PUT • /api/posts/:id 🔒 • Update a post with the data provided
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Post id]"
}
"body": {
"text": "<string max=256 required> [Post text]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"email": "<string> [User email]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
DELETE • /api/posts/:id 🔒 • Delete a post searching for its id
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Post id]"
},
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
Code : 200 OK
GET • /api/posts/feed 🔒 • Get a list of last posts from following users and the authenticated user
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive optional max=30 default=10> [Posts per page]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
]
GET • /api/posts/trend • Get a list of posts ordered by last likes count
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive optional max=30 default=10> [Posts per page]",
"time": "<number integer positive optional max=31536000000(1 year) default=86400000(1 day)> [Time before now to count last likes]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"likes": "<number> [Post likes count]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
}
]
GET • /api/post-likes • Get list of all post-likes
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive max=30 optional default=10> [Follows per page]",
"user-id": "<string optional> [User id]",
"post-id": "<string optional> [Post id]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Post-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Post-Like date/time of creation]",
}
]
GET • /api/post-likes/:userId/:postId • Get data from a specific post-like
"params": {
"userId": "<string required> [User id]",
"postId": "<string required> [Post id]"
},
Code : 200 OK
"body": {
"id": "<string> [Post-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Post-Like date/time of creation]",
}
POST • /api/post-likes 🔒 • Create a new post-like from the user authenticated to a post provided
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"postId": "<string required> [Post id]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Post-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Post-Like date/time of creation]",
}
DELETE • /api/post-likes/:id 🔒 • Delete a post-like searching for its id
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Post-Like id]",
}
Code : 201 CREATED
GET • /api/comments • Get a list of all comments
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive optional max=30 default=10> [Posts per page]",
"user-id": "<string optional> [User id]",
"post-id": "<string optional> [Post id]",
"slug": "<string optional> [Search term to filter by text]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"likes": "<number> [Comment likes count]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
}
]
GET • /api/comments/:id • Get data from a specific comment searching for it's id
"params": {
"id": "<string required> [Comment id]"
},
Code : 200 OK
"body": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"likes": "<number> [Comment likes count]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
}
POST • /api/comments 🔒 • Create a new comment with the data provided and user from authentication
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"text": "<string max=256 optional> [Comment text]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"likes": "<number> [Comment likes count]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
}
PUT • /api/comments/:id 🔒 • Update a comment with the data provided
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Comment id]"
}
"body": {
"text": "<string max=256 required> [Comment text]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"likes": "<number> [Comment likes count]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
}
DELETE • /api/comments/:id 🔒 • Delete a comment searching for its id
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"params": {
"id": "<string required> [Comment id]"
},
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
Code : 200 OK
GET • /api/comment-likes • Get list of all comment-likes
"query": {
"page": "<number integer positive optional default=1> [Page]",
"per-page": "<number integer positive max=30 optional default=10> [Follows per page]",
"user-id": "<string optional> [User id]",
"comment-id": "<string optional> [Comment id]"
},
Code : 200 OK
"body": [
{
"id": "<string> [Comment-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"comment": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
},
"createdAt": "<Date> [Comment-Like date/time of creation]"
}
]
GET • /api/comment-likes/:userId/:commentId • Get data from a specific comment-like
"params": {
"userId": "<string required> [User id]",
"commentId": "<string required> [Comment id]"
},
Code : 200 OK
"body": {
"id": "<string> [Comment-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"comment": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
},
"createdAt": "<Date> [Comment-Like date/time of creation]"
}
POST • /api/comment-likes 🔒 • Create a new comment-like from the user authenticated to a comment provided
"header": {
"authorization": "<string bearer token required> [Bearer JWT token]"
},
"body": {
"commentId": "<string required> [Comment id]",
}
Code : 201 CREATED
"body": {
"id": "<string> [Comment-Like id]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"comment": {
"id": "<string> [Comment id]",
"text": "<string> [Comment text]",
"user": {
"id": "<string> [User id]",
"name": "<string> [User name]",
"tag": "<string> [User tag]",
"description": "<string> [User description]",
"image": "<string> [User image url]",
"createdAt": "<Date> [User date/time of creation]",
"updatedAt": "<Date> [User date/time of last update]"
},
"post": {
"id": "<string> [Post id]",
"text": "<string> [Post text]",
"image": "<string> [Post image]",
"author": {
"id": "<string> [User author id]",
"name": "<string> [User author name]",
"tag": "<string> [User author tag]",
"description": "<string> [User author description]",
"image": "<string> [User author image url]",
"createdAt": "<Date> [User author date/time of creation]",
"updatedAt": "<Date> [User author date/time of last update]"
},
"createdAt": "<Date> [Post date/time of creation]",
"updatedAt": "<Date> [Post date/time of last update]"
},
"createdAt": "<Date> [Comment date/time of creation]",
"updatedAt": "<Date> [Comment date/time of last update]"
},
"createdAt": "<Date> [Comment-Like date/time of creation]"
}