Skip to content

Latest commit

 

History

History
109 lines (87 loc) · 3.31 KB

README.md

File metadata and controls

109 lines (87 loc) · 3.31 KB

BlogEngine

MicrosoftSQLServer Swagger JWT

Restful Blog API with jwt authentication.

Features

Users can :

  • Create and Follow blogs.
  • Add posts to their blogs.
  • Like and Comment to posts.
  • Add tags to their posts.
  • Change profile picture
  • Change username

Admins can :

  • Suspend/Unsuspend users.

Controllers

Auth

Method Route
POST /api/auth/signup
POST /api/auth/signin
POST /api/auth/signout
POST /api/auth/refreshToken

Users

Method Route
GET ​/api​/user
POST /api​/user​/change-profile-photo
POST ​/api​/user​/change-username
DELETE ​/api​/user​/remove-profile-photo
GET ​/api​/user​/users-list

Admins

Method Route
GET ​/api​/adminontroller​/suspend-user​/{username}
GET ​/api​/adminontroller​/unsuspend-user​/{username}

Blogs

Method Route Description
GET /api/blogs/ Get all blogs
GET /api/blogs/{id} Get blog by id
POST /api/blogs Create new blog
PUT /api/blogs/{id} Update blog
DELETE /api/blogs/{id} Delete blog
GET /api/blogs/{id}/followers Get blog by id
POST /api/blogs/{id}/follow Follow blog
POST /api/blogs/{id}/unfollow Unfollow blog
GET /api/blogs/followed-blogs Get followed blogs

Posts

Method Route Description
GET /api/posts Get all posts certain Blog
GET /api/posts/{postId} Get post by id
POST /api/posts Add new post
PUT /api/posts/{postId} Update post
DELETE /api/posts/{postId} Delete post
POST /api/posts/{postId}/like Like a post
POST /api/posts/{postId}/unlike Remove like of a post
GET /api/posts/{postId}/likes Get all likes by postId

Comments

Method Route Description
GET /api/comments Get all comments of a certain Post
POST /api/comments Add new comment
PUT /api/comments/{commentId} Update a commment
DELETE /api/comments/{commentId} Delete a comment
POST /api/comments/{commentId}/like Like a comment
POST /api/comments/{commentId}/unlike Remove like of a commment

Tags

Method Route Description
GET /api/tags Get all tags
POST /api/tags Add new tag

Testing

You can either register and login or use any of the two seeded users :

to gain jwt access.


You can use with `curl` , postman or head to `https://localhost:7086/swagger/index.html`
Have fun! 😃

License

Licence