This project is a comprehensive blogging system consisting of three main parts: a RESTful API, a client-side application, and a content management system (CMS) for administrators. It allows admins to create, read, update, and delete blog posts, submit comments, and manage blog content efficiently.
The Blog API is the backbone of the entire system, responsible for handling data related to users, posts, and comments. It is built using MongoDB as the database and Express.js as the server framework. The API employs the following key features:
There are three primary data models within the API - user, post, and comment. The comment model is linked to the post model through a reference to the post's unique identifier. This relationship allows comments to be associated with specific posts.
Input data is validated using the express-validator library to ensure data integrity and security.
Users that are logged in will receive a JWT token, allowing to maintain persistent access. Notably, only the Content Management System (CMS) allows users to login; client-side users cannot log in.
For protected routes, JWT token received with request cookies are verified to determine if user has access.
The API supports various endpoints for performing CRUD (Create, Read, Update, Delete) operations on posts and comments, including the ability to get, submit, update, and delete posts individually, and retrieve all posts. Users can also create, retrieve, and delete comments.
AI generated humor:
Q: Tell me a joke about backend authorization
A: Why did the backend authorization system go to therapy?
Because it had too many issues with trust and kept denying access to its feelings!

