Blogshog

Blogshog is a full-stack web application that lets you browse, write, and comment on other blogs.

Technologies

React.jsTailwind CSSExpress.jsMongoDBReduxVercel

Timeline

05/2022 - 07/2022

Role

Full Stack

Team

Solo

Status

completed

Overview

A community blogging platform built on the MERN stack. Write, read, and comment — with a clean API, flexible data model, and JWT auth under the hood.

This was my first real full-stack build. The goal was straightforward: a place to write and read blogs. But getting the data model right, wiring auth securely, and designing a scalable API surface turned it into a genuine learning ground.

System Design & Architecture

Blogshog follows a classic client-server architecture using the MERN stack:

Client (React)

  • Component-driven UI for blogs, comments, and profiles
  • Global state management using Redux
  • Handles user interactions and API communication

Backend (Node.js + Express)

  • RESTful API for:
    • Blog CRUD operations
    • Comment management
    • User authentication
  • Middleware-based architecture for request handling and validation

Data Layer (MongoDB)

  • Document-based schema designed for:
    • Blogs (content, author, metadata)
    • Comments (linked to blogs and users)
    • Likes (linked to blogs and users)
    • Users (profiles and authentication data)

Key Engineering Decisions

1. Document-Based Data Modeling

Decision: Use MongoDB with reference-based relationships.

Why:

  • Embedding comments inside blog documents would cause them to grow unbounded
  • Flexibility in handling varying blog content structures
  • Using reference IDs (blogId, userId) keeps documents lean and queries predictable
  • Simpler schema evolution compared to relational databases

2. RESTful API Design

Decision: Structure backend as modular REST endpoints.

Why:

  • Clear separation of concerns
  • Easier to extend with new features (bookmarks etc.)

3. Centralized State Management

Decision: Use Redux for managing authentication and blog state.

Why:

  • Multiple components depend on shared data (user session, blog list, comments)
  • Centralizing it in Redux made updates predictable and debugging straightforward.

4. JWT-Based Authentication

Decision: Use token-based authentication for securing APIs.

Why:

  • Stateless and scalable
  • Works well with REST APIs

Implementation:

  • Issued JWTs on login/signup
  • Protected routes via middleware validation

Challenges

Managing Relational Data in a NoSQL Database

MongoDB does not provide native joins like SQL systems.

Solution:

  • Used reference IDs to link users, blogs, and comments
  • Structured queries to fetch related data efficiently

Designing a Flexible Comment System

Comments must be tied to both users and blog posts.

Solution:

  • Created a schema linking comment → blogId → userId
  • Ensured consistent data retrieval and rendering

Securing User Authentication

Handling user sessions securely is critical in content platforms.

Solution:

  • Implemented JWT-based authentication
  • Protected sensitive routes via middleware

Learnings

This project focused on building data-driven, API-centric systems:

  • Managing global application state effectively
  • Designing schemas for relational data in NoSQL environments
  • REST API structure matters a lot as a codebase grows
  • Auth is easy to get wrong — JWT + middleware is a solid, repeatable pattern