This project involves building a Blogging API called Mosaic Jots API that enables users to create, manage, and retrieve articles. It supports user authentication, blog creation, modification, and retrieval, including functionality like pagination, searching, and sorting.
To view the ERD for this database design, please visit the ERD Diagram for a visual representation of the entity relationships.
-
User Management
- Users have attributes: first name, last name, email, password, and potentially other customizable attributes.
- Registration and login features for users are implemented.
- JWT is utilized for user authentication with token expiration after 1 hour.
-
Blog States
- Blogs can be in "draft" or "published" states.
- Both logged-in and non-logged-in users can access a list of published blogs and read them.
-
Blog Creation & Management
- Logged-in users can create blogs, which start in a "draft" state.
- The blog owner can update a blog to the "published" state, edit blogs in both "draft" and "published" states, and delete them as needed.
-
Blog Access & Interaction
- The blog owner can retrieve a list of their blogs. The endpoint is paginated and filterable by state.
- Blog entries consist of: title, description, tags, author details, timestamp, state, read count, reading time, and body.
-
List of Blogs Endpoint
- This endpoint is accessible to both logged-in and non-logged-in users and is paginated.
- Default page size is set to 20 blogs per page and allows searching by author, title, and tags. It also supports ordering by read count, reading time, and timestamp.
-
Blog Details
- Retrieving a single blog updates its read count and returns author information.
- Reading time of the blog is calculated using a designated algorithm.
-
Testing, Logging, and Visualization
- Comprehensive tests are written for all endpoints.
- Winston is used for logging functions and processes.
- MongoDB is the chosen database for this project.
- Email (required and unique)
- First name and Last name (required)
- Password
- Title (required and unique)
- Description
- Author
- State
- Read count
- Reading time
- Tags
- Body (required)
- Timestamp