How goswami2021vaibhav/yt-mern-blog works
This is a MERN blogging application: the React client provides public blog discovery and search, sign-in and profile management, and authenticated blog/comment plus admin category/user workflows. The Express API handles authentication and domain operations, persisting users, blogs, categories, comments, and likes in MongoDB; blog and profile images use Cloudinary. Client-to-API request details are not shown in the excerpts or README, so those links are omitted. Dashed edges indicate framework dispatch inferred from route registration where handler wiring was not excerpted.
Main entry points: App.jsx Page router · index.js Express API · Blog.route.js Blog routes · Blog.controller.js Blog operations
Components 33
React client
- Client entry
client/src/main.jsx - Page router
client/src/App.jsx - Sign-in and signup
client/src/pages/SignIn.jsx - Blog discovery
client/src/pages/Index.jsx - Search results
client/src/pages/SearchResult.jsx - Blog management
client/src/pages/Blog/AddBlog.jsx - Blog reading
client/src/pages/SingleBlogDetails.jsx - Category management
client/src/pages/Category/AddCategory.jsx - Profile
client/src/pages/Profile.jsx - Comment moderation
client/src/pages/Comments.jsx
API and access
- Express API
api/index.js - Auth routes
api/routes/Auth.route.js - Authentication
api/controllers/Auth.controller.js - JWT authentication
api/middleware/authenticate.js - Blog routes
api/routes/Blog.route.js - Category routes
api/routes/Category.route.js - Comment routes
api/routes/Comment.route.js - Like routes
api/routes/Bloglike.route.js - User routes
api/routes/User.route.js - Image upload
api/config/multer.js
Content domains
- Blog operations
api/controllers/Blog.controller.js - Category operations
api/controllers/Category.controller.js - Comment operations
api/controllers/Comment.controller.js - Blog likes
api/controllers/BlogLike.controller.js - User operations
api/controllers/User.controller.js
Persistence and media
- Blog records
api/models/blog.model.js - Category records
api/models/category.model.js - Comment records
api/models/comment.model.js - Like records
api/models/bloglike.model.js - User records
api/models/user.model.js
Other components
- Browser user
- MongoDB
- Cloudinary media
Connections 36
- Browser user → Client entry: uses
- Client entry → Page router: renders
client/src/main.jsx - Page router → Sign-in and signup: routes to
client/src/App.jsx - Page router → Blog discovery: routes to
client/src/App.jsx - Page router → Search results: routes to
client/src/App.jsx - Page router → Blog management: routes to
client/src/App.jsx - Page router → Blog reading: routes to
client/src/App.jsx - Page router → Category management: routes to
client/src/App.jsx - Page router → Profile: routes to
client/src/App.jsx - Page router → Comment moderation: routes to
client/src/App.jsx - Express API → Auth routes: mounts
api/index.js - Express API → Blog routes: mounts
api/index.js - Express API → Category routes: mounts
api/index.js - Express API → Comment routes: mounts
api/index.js - Express API → Like routes: mounts
api/index.js - Express API → User routes: mounts
api/index.js - Auth routes → Authentication: dispatches
api/routes/Auth.route.js - Auth routes → JWT authentication: uses
api/routes/Auth.route.js - Blog routes → Blog operations: dispatches
api/routes/Blog.route.js - Blog routes → JWT authentication: uses
api/routes/Blog.route.js - Category routes → Category operations: dispatches
api/routes/Category.route.js - Comment routes → Comment operations: dispatches
api/routes/Comment.route.js - Like routes → Blog likes: dispatches
api/routes/Bloglike.route.js - User routes → User operations: dispatches
api/routes/User.route.js - Authentication → User records: reads/writes
api/controllers/Auth.controller.js - Blog operations → Blog records: reads/writes
api/controllers/Blog.controller.js - Blog operations → Category records: reads
api/controllers/Blog.controller.js - Blog operations → Cloudinary media: uploads media
api/controllers/Blog.controller.js - User operations → User records: reads/writes
api/controllers/User.controller.js - User operations → Cloudinary media: uploads media
api/controllers/User.controller.js - Comment operations → Comment records: reads/writes
api/controllers/Comment.controller.js - Category operations → Category records: reads/writes
api/controllers/Category.controller.js - Blog likes → Like records: reads/writes
api/controllers/BlogLike.controller.js - Blog routes → Image upload: configures upload
api/routes/Blog.route.js - User routes → Image upload: configures upload
api/routes/User.route.js - Express API → MongoDB: connects
api/index.js