Skip to content

johnOfGod33/Personal-Blog-API

Repository files navigation

PERSONAL BLOG API

A RESTful API that would power a personal blog.The client interface can be found here

FEATURES

  • User authentication and authorization (sign up and login)

  • Post new article

  • Post comment

  • Get articles (published or draft)

  • Update article

  • Delete article

Docs

check here

TECH

  • Node js
  • Express js
  • Mongoose & mongoDB Atlas
  • Swagger

Database Schema

users collection

{
  username: {
    type: String,
    required: true,
  },
  email: {
    type: String,
    required: true,
  },
  password: {
    type: String,
    required: true,
  },
}

articles collection

{
  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,
    },
  ],
}

About

A RESTful API that would power a personal blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published