Skip to content

[Feature] Implement Blog Categories and Tags System for Content Organization and Discovery #14

Description

@adityajha-iitj

Overview:
Implement a foundational categorization and tagging system for blog posts that allows users to organize content and improve discoverability. This will add essential content management capabilities to transform the basic blog into a more organized and user-friendly platform.

Current Problems:

  • No way to categorize blog posts (all posts are mixed together)
  • No tagging system for content organization
  • No filtering capabilities to find specific content
  • No content structure or organization
  • Difficult for users to discover relevant posts
  • No way to track popular topics or categories

Proposed Solution:

  1. Create Category System:

Category Model:

public class Category {
    private String id;
    private String name;
    private String description;
    private int blogCount;
    private String createdAt; 
    private boolean isActive;    // for soft deletion
}
  1. Create Tag System:

Tag Model:

public class Tag {
    private String name;       
    private int usageCount; 
    private String createdAt;  
    private boolean isActive;    // for soft deletion
}
  1. Enhance Blog Model:

Updated Blog Model:

public class Blog {
    // Existing fields...
    private String categoryId;       
    private List<String> tags;       
    private String createdAt;  
    private String updatedAt; 
}
  1. New Endpoints:

Categories:

POST /categories/create          // Create category
GET /categories/all             // Get all categories
GET /categories/{categoryId}    // Get specific category
PUT /categories/{categoryId}    // Update category
DELETE /categories/{categoryId} // Delete category

Tags:

GET /tags/all                
POST /tags/create
DELETE /tags/{tagName}  

Enhanced Blogs:

GET /blogs/category/{categoryId} // Get blogs by category
GET /blogs/tag/{tagName}        // Get blogs by tag
PUT /blogs/{blogId}/category    // Update blog category
PUT /blogs/{blogId}/tags        // Update blog tags 

Requirements:

  • Create Category and Tag models with proper relationships
  • Implement basic CRUD operations for categories and tags
  • Add category and tag fields to existing Blog model
  • Create filtering endpoints for blogs by category and tags

Acceptance Criteria:

  • Users can create and manage tags and categories
  • Blogs can be assigned to categories and tagged
  • Blogs can be filtered by category and individual tags
  • Category and tag usage counts are accurately maintained
  • Proper error handling and validation for all operations
  • Existing blog functionality remains unchanged
  • Category and tag data is properly stored in Firestore

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions