Blog App with Comments

A blog app teaches relationships and nested UI.

Features

Backend routes

GET /api/posts
POST /api/posts
GET /api/posts/:id
PATCH /api/posts/:id
DELETE /api/posts/:id
GET /api/posts/:id/comments
POST /api/posts/:id/comments
DELETE /api/comments/:id

Schema approach

Posts reference author:

authorId: ObjectId

Comments reference post and author:

postId: ObjectId
authorId: ObjectId

Comments are separate because they can grow and need pagination.

UI states

Handle:

What this project proves