A RESTful API that would power a personal blog.The client interface can be found here
-
User authentication and authorization (sign up and login)
-
Post new article
-
Post comment
-
Get articles (published or draft)
-
Update article
-
Delete article
check here
- Node js
- Express js
- Mongoose & mongoDB Atlas
- Swagger
{
username: {
type: String,
required: true,
},
email: {
type: String,
required: true,
},
password: {
type: String,
required: true,
},
}
{
title: {
type: String,
required: true,
},
author: {
type: SchemaTypes.ObjectId,
ref: "User",
required: true,
},
creationDate: {
type: Date,
default: () => Date.now(),
},
updateDate: Date,
description: {
type: String,
required: true,
},
published: {
type: Boolean,
default: false,
},
imageUrl: { type: String, default: "" },
content: {
type: String,
required: true,
},
like: {
type: Number,
default: 0,
},
unlike: {
type: Number,
default: 0,
},
tags: [String],
Comments: [
{
username: String,
email: String,
comment: String,
},
],
}